1
0
Fork 0
polaris-task-force/tests
Z8MB1E 297c39c3e2 fix(npc-dialogue): open the markup menu at the pointer, above the panel
Right-clicking a line in the dialogue editor put the markup menu off to one side
of the panel and stretched the panel as it overflowed, which is not what a
context menu should do.

The menu was rendered inline with position: fixed. The edit dialog's content
carries a transform for its open animation, and a transformed ancestor becomes
the containing block for fixed positioning, so the pointer's viewport coordinates
landed at those coordinates inside the dialog. It is portalled to the body now,
which detaches it from that ancestor, and still positioned at the pointer.

Three things had to follow from the portal:

- The admin stacks its dialog at 1300 and its own overlays up to 9999, so the
  menu is placed at 10000 rather than underneath the panel.
- Payload styles every button with a light surface, which painted pale blocks
  over the dark menu; item buttons are explicitly transparent now.
- A Radix modal sets pointer-events: none on the body while open, and a body
  portal inherits it, leaving the menu visible but unclickable. It carries
  pointer-events-auto.

Placement is a pure clampMenuPosition: the point is pulled inside the viewport so
a right-click near an edge cannot open a menu the author cannot reach. The menu
also closes on resize and on any scroll, so it never detaches from the box.

Verified in the running editor: the menu's rect starts exactly at the click point
(750, 308), its parent is the body, pointer-events is auto, the dialog reports no
overflow, and clicking the first item wrapped the caret with **. 4 unit tests
cover the clamp; 227 npc-dialogue tests pass.
2026-12-01 15:02:16 -05:00
..
audit test(audit): support exact route filtering in the mobile audit 2026-10-13 10:38:45 -04:00
e2e feat(intelligence): add attendance-gated feature unlocks to mission pages 2026-11-21 02:30:48 -05:00
fixtures Revert "feat(minigames): make Bomperator own-seat movement server-authoritative" 2026-10-21 20:25:38 -04:00
helpers test(vitest): isolate:false shared forks with per-pid template clones + memoized payload boot 2026-10-21 12:54:30 -04:00
int fix(npc-dialogue): open the markup menu at the pointer, above the panel 2026-12-01 15:02:16 -05:00
push-schema.ts test(int-suite): auto-accept drizzle push prompts in tests/push-schema.ts 2026-10-21 10:03:33 -04:00
seed-baseline.ts feat(test): run tests against a dedicated truncated database 2026-09-22 17:58:17 -04:00
test-db.ts test(vitest): honor KEEP_TEST_DBS=0 as force-drop escape hatch 2026-10-21 13:04:15 -04:00
vitest-global.ts test(vitest): parallel forks with per-worker database clones 2026-10-21 10:41:57 -04:00
vitest-marker.ts test(vitest): parallel forks with per-worker database clones 2026-10-21 10:41:57 -04:00
vitest-reporter.ts test(vitest): isolate:false shared forks with per-pid template clones + memoized payload boot 2026-10-21 12:54:30 -04:00
vitest-teardown.ts test(vitest): honor KEEP_TEST_DBS=0 as force-drop escape hatch 2026-10-21 13:04:15 -04:00
vitest-worker-setup.ts test(vitest): isolate:false shared forks with per-pid template clones + memoized payload boot 2026-10-21 12:54:30 -04:00