revdeck 0.4.3 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/daemon.js CHANGED
@@ -1258,7 +1258,7 @@ async function writeFileAtomic(file, data, mode = 384, dirMode = 448) {
1258
1258
  init_redact();
1259
1259
 
1260
1260
  // src/version.ts
1261
- var VERSION = "0.4.3";
1261
+ var VERSION = "0.4.4";
1262
1262
  var PROTOCOL_VERSION = 1;
1263
1263
 
1264
1264
  // src/daemon/main.ts
@@ -2616,6 +2616,21 @@ var EMPTY_DRAFT = (threadId) => ({
2616
2616
  updatedAt: (/* @__PURE__ */ new Date(0)).toISOString()
2617
2617
  });
2618
2618
  var APPROVAL_TTL_MS = 10 * 60 * 1e3;
2619
+ var LEVEL_MARKERS = {
2620
+ blocker: "\u{1F7E5} **blocker**",
2621
+ major: "\u{1F7E7} **major**",
2622
+ minor: "\u{1F7E8} **minor**",
2623
+ question: "\u{1F7E6} **question**"
2624
+ };
2625
+ function markedFindingBody(finding, body) {
2626
+ const marker = LEVEL_MARKERS[finding.level];
2627
+ if (body.trimStart().startsWith(marker)) return body;
2628
+ return finding.file && finding.line === null ? `${marker} \`${finding.file}\`
2629
+
2630
+ ${body}` : `${marker}
2631
+
2632
+ ${body}`;
2633
+ }
2619
2634
  var ReviewService = class {
2620
2635
  events = new EventEmitter();
2621
2636
  store;
@@ -3153,17 +3168,17 @@ ${errors.join("\n")}`));
3153
3168
  warnings.push(tr(`\u0437\u0430\u043C\u0435\u0447\u0430\u043D\u0438\u0435 ${finding.id} \u0443\u0436\u0435 \u043E\u043F\u0443\u0431\u043B\u0438\u043A\u043E\u0432\u0430\u043D\u043E`, `finding ${finding.id} is already published`));
3154
3169
  continue;
3155
3170
  }
3156
- const body2 = normalizeMediaLinks(finding.comment.trim(), review.info.ref.platform, review.info.ref.host, review.info.projectId);
3171
+ const rawBody = normalizeMediaLinks(finding.comment.trim(), review.info.ref.platform, review.info.ref.host, review.info.projectId);
3172
+ const body2 = markedFindingBody(finding, rawBody);
3157
3173
  const check2 = sanitizeBody(body2, review.info.ref.platform, { host: review.info.ref.host });
3158
3174
  if (!check2.ok) {
3159
3175
  warnings.push(tr(`\u0437\u0430\u043C\u0435\u0447\u0430\u043D\u0438\u0435 ${finding.id}: ${check2.reason}`, `finding ${finding.id}: ${check2.reason}`));
3160
3176
  continue;
3161
3177
  }
3162
- const finalBody = finding.file && finding.line === null ? `\`${finding.file}\`: ${body2}` : body2;
3163
3178
  items.push({
3164
3179
  kind,
3165
3180
  id: finding.id,
3166
- body: finalBody,
3181
+ body: body2,
3167
3182
  file: finding.file,
3168
3183
  line: finding.line,
3169
3184
  ...finding.line === null ? {} : { side: "new" }