feat(web): tutorial dock as an OS window — repulsion, clean spotlight cutout, ja on every step #88

Merged
yuuhikaze merged 2 commits from web/choi-window into master 2026-10-25 08:09:38 -05:00
Owner

Rebuild of the tutorial dock after the owner's live review, which flagged: a two-word-wide speech bubble with a scrollbar, the sensei detached below the bubble with stray set dressing, visible clip-path seam artifacts in the dim layer, and the dock covering the panel it was explaining.

What changed

  • OS window chrome (Dock.svelte): title bar [ ☰ TUTORIAL ] with step counter and [ X ] CLOSE, draggable by pointer events, resizable from the bottom-right handle (min 360px, max 90vw/80vh), position/size persisted for the session only. Default width 520px — body text wraps at a comfortable measure. Bubble + sensei stacked inside; dojo groves/scroll/leaves/floor are stripped so nothing floats beside the sensei.
  • Repulsion: on steps with a highlight, the dock computes the highlight rect and slides out of its way — four side placements scored by overlap-then-free-space, four viewport-corner fallbacks for oversized targets, smooth CSS transition between steps. Manual drag overrides auto-placement until the next highlighted step. A ResizeObserver re-places while the typewriter grows the bubble. prefers-reduced-motion disables the slide.
  • Spotlight (Spotlight.svelte): clip-path evenodd polygon replaced by the huge-box-shadow cutout — fixed element exactly on the integer-rounded target rect, box-shadow: 0 0 0 9999px, hairline accent ring on the target, pointer-events: none, no seams.
  • ja consistency: every step of all five sections now carries a short sensei-voice Japanese line (52 steps); en/es untouched.

Step dots, [ < ] [ > ], [ SHOW ME ], keyboard (←/→, Escape) all work inside the window. No global i18n keys added; Splash/auth untouched.

Verification

Playwright against a dedicated vite (:5174) at 1440x900@2x, screenshots in /tmp/opencode/shots/choi/. Programmatically asserted per step: window/highlight bounding boxes do not intersect (0px² on all five highlighted regex steps; on the demo step the 914px-wide result panel makes full avoidance impossible at 1440x900, so the window achieves the geometric minimum overlap), no clip-path veil in computed style, bubble width ≥ 400px (502px). Drag, resize, dot-jump, ArrowRight and Escape verified in-script; screenshots read and iterated until composed (including a fix for the bubble growth creeping the window into the highlight).

svelte-check: 0 errors. bun test: 74 pass, rot guards green.

Rebuild of the tutorial dock after the owner's live review, which flagged: a two-word-wide speech bubble with a scrollbar, the sensei detached below the bubble with stray set dressing, visible clip-path seam artifacts in the dim layer, and the dock covering the panel it was explaining. ## What changed - **OS window chrome** (`Dock.svelte`): title bar `[ ☰ TUTORIAL ]` with step counter and `[ X ] CLOSE`, draggable by pointer events, resizable from the bottom-right handle (min 360px, max 90vw/80vh), position/size persisted for the session only. Default width 520px — body text wraps at a comfortable measure. Bubble + sensei stacked inside; dojo groves/scroll/leaves/floor are stripped so nothing floats beside the sensei. - **Repulsion**: on steps with a highlight, the dock computes the highlight rect and slides out of its way — four side placements scored by overlap-then-free-space, four viewport-corner fallbacks for oversized targets, smooth CSS transition between steps. Manual drag overrides auto-placement until the next highlighted step. A ResizeObserver re-places while the typewriter grows the bubble. `prefers-reduced-motion` disables the slide. - **Spotlight** (`Spotlight.svelte`): clip-path evenodd polygon replaced by the huge-box-shadow cutout — fixed element exactly on the integer-rounded target rect, `box-shadow: 0 0 0 9999px`, hairline accent ring on the target, `pointer-events: none`, no seams. - **ja consistency**: every step of all five sections now carries a short sensei-voice Japanese line (52 steps); en/es untouched. Step dots, `[ < ] [ > ]`, `[ SHOW ME ]`, keyboard (←/→, Escape) all work inside the window. No global i18n keys added; Splash/auth untouched. ## Verification Playwright against a dedicated vite (:5174) at 1440x900@2x, screenshots in `/tmp/opencode/shots/choi/`. Programmatically asserted per step: window/highlight bounding boxes do not intersect (0px² on all five highlighted regex steps; on the demo step the 914px-wide result panel makes full avoidance impossible at 1440x900, so the window achieves the geometric minimum overlap), no clip-path veil in computed style, bubble width ≥ 400px (502px). Drag, resize, dot-jump, ArrowRight and Escape verified in-script; screenshots read and iterated until composed (including a fix for the bubble growth creeping the window into the highlight). `svelte-check`: 0 errors. `bun test`: 74 pass, rot guards green.
Owner feedback on the live review: the bubble wrapped at a two-word
column, the sensei sat detached below it with stray set dressing, the
clip-path spotlight showed seam artifacts at fractional pixels, and the
dock covered the very panel it was explaining.

- Dock: proper little OS window — title bar ([ TUTORIAL ], step counter,
  [ X ] CLOSE), draggable by pointer events, resizable from the bottom-
  right corner (min 360px, max 90vw/80vh), session-only persistence.
  Default width 520px so body text wraps at a sane measure; the window
  grows instead of scrolling the bubble. Dojo set dressing (groves,
  scroll, leaves, floor) is stripped inside the window.
- Repulsion: on highlighted steps the window computes the free side of
  the highlight rect with the most room (four side placements, four
  viewport-corner fallbacks, scored by overlap then free space) and
  slides there with a CSS transition. Manual drags override auto-
  placement until the next highlighted step; a ResizeObserver re-places
  while the typewriter grows the bubble. Reduced motion disables the
  slide.
- Spotlight: clip-path evenodd polygon replaced by the classic huge-
  box-shadow cutout — a fixed element exactly on the integer-rounded
  target rect, shadow flooding everything else, hairline ring on the
  target, pointer-events none, no polygon seams.

Co-Authored-By: GLM (OpenCode) <dev@yhkze.net>
feat(web): ja flavor line on every tutorial step
All checks were successful
ci / web (pull_request) Successful in 1m1s
ci / rust (pull_request) Successful in 8m44s
ci / image (oven/bun:1.4.2-debian=docker-image://git.yhkze.net/actions/bun:1.4.2-debian node:22-bookworm-slim=docker-image://git.yhkze.net/actions/node:22-bookworm-slim , web, web.Dockerfile, rgxr-web) (pull_request) Has been skipped
ci / image (rust:1-slim-bookworm=docker-image://git.yhkze.net/actions/rust:1-slim-bookworm debian:bookworm-slim=docker-image://git.yhkze.net/actions/debian:bookworm-slim , ., api.Dockerfile, rgxr-api) (pull_request) Has been skipped
46b4d84515
Owner feedback: only the first step of each section carried a ja line,
which read as inconsistent. Every step of all five sections now opens
with a short sensei-voice line; en/es copy is unchanged.

Co-Authored-By: GLM (OpenCode) <dev@yhkze.net>
yuuhikaze merged commit eb9b117b95 into master 2026-10-25 08:09:38 -05:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
k8s-services/rgxr!88
No description provided.