ktg-plugin-marketplace/plugins/voyage/tests
Kjell Tore Guttormsen a7a6a53686 feat(voyage): add three annotation creation gestures + form modal — v4.2 Step 9 [skip-docs]
Three creation gestures + shared form modal for the v4.2 annotation
playground (per critical decisions #2-#4 + research-06):

Gesture 1 — text-anchored adder-popup:
  - mouseup-debounce 200ms (settles selection)
  - 300ms grace before hide (Hypothes.is friction-mitigation)
  - floating .voyage-adder-popup positioned at selection-bound corner
  - click -> opens form modal with derived heading-path + line + snippet

Gesture 2 — paragraph-anchored hover-icon:
  - 24px pencil SVG injected per <p>/<li> after each render
  - opacity 0 default, opacity 1 on hover/focus-visible
  - click -> opens form modal with no snippet

Gesture 3 — page-level note:
  - .voyage-page-note-btn injected in viewport
  - click -> opens form modal with target=page

Form modal (shared):
  - role="dialog" aria-modal="true" + aria-labelledby
  - 400px right-anchored on backdrop (per critical decision #3)
  - 4 intent buttons (Fiks / Endre / Spørsmål / Block) as aria-pressed group
  - <textarea> required for comment
  - ESC + backdrop-click + Avbryt close
  - Lagre persists via saveModalAsAnnotation

Anchor-ID generation (per critical decision #2 + risk-assessor H7):
  - sequential ANN-NNNN per project+file scope
  - persisted in localStorage under voyage_ann_<project>__<file>.drafts

Test coverage: tests/playground/voyage-playground.test.mjs +3 cases —
aria-modal, ANN-, 300ms grace.

Verify: node --test tests/playground/voyage-playground.test.mjs ->
16 pass / 0 fail.
Full npm test: 590 pass / 0 fail / 2 skipped (Docker).

Refs plan.md Step 9 + critical decisions #2/#3/#4 + research-06.
2026-05-09 15:22:52 +02:00
..
commands feat(voyage)!: marketplace handoff — rename plugins/ultraplan-local to plugins/voyage [skip-docs] 2026-05-05 15:37:52 +02:00
fixtures test(voyage): add annotation roundtrip + rollback + source_annotations integration — v4.2 Step 7 2026-05-09 15:13:27 +02:00
helpers feat(voyage)!: marketplace handoff — rename plugins/ultraplan-local to plugins/voyage [skip-docs] 2026-05-05 15:37:52 +02:00
hooks fix(voyage): permanently block cloud metadata endpoints in OTLP validator (CWE-918) 2026-05-09 10:23:51 +02:00
integration test(voyage): add annotation roundtrip + rollback + source_annotations integration — v4.2 Step 7 2026-05-09 15:13:27 +02:00
lib test(voyage): add annotation roundtrip + rollback + source_annotations integration — v4.2 Step 7 2026-05-09 15:13:27 +02:00
parsers feat(voyage): add annotation-digest.mjs with canonical SHA-256 — v4.2 Step 4 2026-05-09 12:53:36 +02:00
playground feat(voyage): add three annotation creation gestures + form modal — v4.2 Step 9 [skip-docs] 2026-05-09 15:22:52 +02:00
scripts feat(voyage): vendor markdown-it/highlight.js + playground render-pipeline + scripts/render-artifact.mjs CLI — v4.2 Step 8 [skip-docs] 2026-05-09 15:20:17 +02:00
synthetic test(voyage): extend plan-determinism.test.mjs — SC #10 forward-compat block 2026-05-09 10:00:08 +02:00
validators test(voyage): pin forward-compat for revision/source_annotations/annotation_digest/revision_reason — v4.2 Step 2 2026-05-09 12:50:22 +02:00