fix(ui): English labels where Voyage shows Norwegian to every user

Operator decision 56 (2026-10-17): the product shows English.

- Annotation HTML: the intent buttons, sidebar badges and the copied
  prompt read Fix / Change / Question. The stored keys stay
  fiks / endre / spørsmål, so annotations saved earlier still load.
- /trekreview project-memory approval: "Add the line" / "Not now".
- README, CLAUDE.md, docs/architecture.md, package.json and plugin.json
  describe what the product shows; README's hollow-answer line and the
  "anslag" in the profile section are English; a Norwegian code comment
  in profile-validator.mjs translated.

The Norwegian hollow-answer list in approval-log.mjs and trekbrief.md
stays: it matches what a user types. Both new tests failed on the code
before the change. Suite 2606 (2604/0/2).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kjell Tore Guttormsen 2026-10-17 01:00:34 +02:00
commit af5de3fcb8
Signed by: ktg
SSH key fingerprint: SHA256:JakMjO6FTBBzN0Bhfj9saOoEjaFxlSdYuZQQpM/lF9Q
10 changed files with 48 additions and 26 deletions

View file

@ -15,7 +15,7 @@
// • render() is deterministic — two runs produce byte-identical output.
// • Default output path is <input-basename>.html next to the input.
// • The v5.0.3 affordances are wired into the HTML: pencil-toggle, form
// popover with three intent buttons (Fiks/Endre/Spørsmål), annotations
// popover with three intent buttons (Fix/Change/Question), annotations
// sidebar, Copy Prompt button, Clear all, localStorage persistence.
import { test } from 'node:test';
@ -146,7 +146,7 @@ test('parseArgs handles --out, positional input, and --help', () => {
test('buildHtml wires the v5.0.3 operator-driven annotation affordances', () => {
// Pin every UX-critical affordance modelled on the reference annotation surface:
// - Pencil-toggle button (annotation mode on/off)
// - Form popover with three intent buttons (Fiks/Endre/Spørsmål)
// - Form popover with three intent buttons (Fix/Change/Question)
// - Annotations sidebar (Your annotations + Clear all + Copy Prompt)
// - Selection capture (window.getSelection())
// - Section context auto-detection (findSection)
@ -157,9 +157,9 @@ test('buildHtml wires the v5.0.3 operator-driven annotation affordances', () =>
assert.ok(html.includes('ann-toggle'), 'must have the pencil-toggle button');
assert.ok(html.includes('Annotation mode: ON'), 'must label the toggle state');
// Form + intents (the three CSS classes for selected state)
assert.ok(html.includes('data-intent="fiks"'), 'must have Fiks intent button');
assert.ok(html.includes('data-intent="endre"'), 'must have Endre intent button');
assert.ok(html.includes('data-intent="spørsmål"'), 'must have Spørsmål intent button');
assert.ok(html.includes('data-intent="fiks"'), 'must have the Fix intent button');
assert.ok(html.includes('data-intent="endre"'), 'must have the Change intent button');
assert.ok(html.includes('data-intent="spørsmål"'), 'must have the Question intent button');
// Form popover
assert.ok(html.includes('ann-form'), 'must have the form popover');
assert.ok(html.includes('ann-form-comment'), 'must have a comment textarea');
@ -179,6 +179,19 @@ test('buildHtml wires the v5.0.3 operator-driven annotation affordances', () =>
assert.ok(anchors >= 5, 'must emit data-anchor-id on enough elements (got ' + anchors + ')');
});
test('buildHtml shows the intents in English and keeps the stored intent keys (operator decision 56)', () => {
const html = buildHtml('/abs/path/brief.md', SAMPLE);
// What the reader sees: button text, sidebar badge labels, the copied prompt.
assert.ok(html.includes('data-intent="fiks"') && html.includes('>Fix</button>'), 'Fix button over the fiks key');
assert.ok(html.includes('data-intent="endre"') && html.includes('>Change</button>'), 'Change button over the endre key');
assert.ok(html.includes('data-intent="spørsmål"') && html.includes('>Question</button>'), 'Question button over the spørsmål key');
assert.ok(html.includes("fiks: 'Fix', endre: 'Change', 'spørsmål': 'Question'"), 'sidebar and prompt labels are English');
assert.ok(html.includes('**Fix**') && html.includes('**Change**') && html.includes('**Question**'), 'the copied prompt names the English intents');
for (const word of ['>Fiks<', '>Endre<', '>Spørsmål<', "'Fiks'", "'Endre'", "'Spørsmål'", '**Fiks**', '**Endre**', '**Spørsmål**']) {
assert.ok(!html.includes(word), `no Norwegian label left: ${word}`);
}
});
test('renderMarkdown produces headings, lists, code, table, blockquote with anchors', () => {
const html = renderMarkdown(`# H1
## H2