Skip to content

Build one preview of the new TOC move visuals for design-system rulings #502

Closed as not planned

Description

@HMarzban

Part of #499. Read the parent first. No product code. Can start at once.

Summary

The design system is locked (design-system.md:9-25) (read from code). Four Decisions in the TOC move set change how the TOC looks:

  • D2. Remove the drag level picker and its chips.
  • D7. Add an inside highlight on the target row.
  • D8. Indent the drop line to the depth where the section lands.
  • D15. Fade the drag card on release, flash the landed rows, and show an Undo toast.

This issue builds one standalone HTML preview in Notes/previews/, with the real tokens. The maintainer then rules on all four Decisions in one comment. #504, #506 and #508 wait for that ruling. This issue writes no product code, so it can run beside #500.

Maintainer rulings that bind this issue

The full text is on #499. Each line below is a one-line summary.

  • R1. A level change by d shifts every sub-heading of the dragged heading by the same d. The squash mock shows each sub-heading shifted by d before the H6 cap.
  • R2. A level change can make following deeper headings fall inside the moved heading ("capture"). The Undo toast mock shows a capture result.
  • R3. The Title (the first H1) row has no drag grip, and nothing drops above it. Every mock draws the Title row with no grip.
  • R4. A sub-heading that would pass H6 stays at H6 ("squash"). The Undo toast mock shows a squash result.
  • R5. A drop on a heading puts the set inside it, with full micro-interactions. The D7 mocks are the inside highlight and the auto-expand frame.
  • R6. A set is one heading plus its whole subtree. The drag card keeps its +N badge and deck.

Depends on / Blocks

Current behaviour

All lines are read from code at 85295b8cf2fc8f78efd5a3eaa4ecc05af413c2b2, not measured, unless a line says otherwise.

Design-system lock.

  • The change protocol says: "If a task seems to need a new token, species, size, radius, shadow, ink step or house-language rule, stop and ask the maintainer" (design-system.md:13-15).
  • A catalog-row update inside an approved task is the only routine edit (:18-20).
  • globals.scss is a locked file (:21-22).
  • A preview uses "the real tokens from apps/webapp/src/styles/globals.scss, not copied hex values" (AGENTS.md:150).

Title row and Pad title row.

  • The TOC lists every top-level heading with text, the first H1 included (useToc.ts:72-87).
  • buildNestedToc puts every deeper heading inside the heading before it (utils.ts:7-22). So the Title is a root li.toc__item. The H2 rows sit in its ul.toc__children (TocItemBody.tsx:176-192).
  • A separate sticky li.toc__header comes first in the list (TocDesktop.tsx:83-87, :106-107). Its row is .toc__header-row, and it shows the Pad title (TocHeader.tsx:66-79).
  • Pad title is DocumentMetadata.title. It is "Not Title", and the two are not kept in sync (CONTEXT.md:7-8).
  • So "the Title row" in this issue is the first root li.toc__item > .toc__row, not .toc__header-row. Today that row has a grip. The "above the Title" gap is the gap between the two rows. Step 0 confirms this in the running app.
  • Edge case (read from code): an empty Title is skipped (!node.textContent, useToc.ts:78). Then H2 rows become root siblings of .toc__header.

D2: level picker.

D7: inside highlight. No inside state exists today.

D8: drop line.

  • The drop line is 2px base-content with a 10px base-content dot at its start (_tocDrag.scss:240-261).
  • The portal takes left and width from the target row's rect (TocDesktop.tsx:166-172, DropIndicatorPortal.tsx:9-25). So the line starts at the target row's left edge and does not show the landing depth.
  • Catalog row "deck + drop indicator" (design-system.md:415).
  • The visual nest step comes from vendor apps/webapp/node_modules/daisyui/components/menu.css (5.7.32): li ul { margin-inline-start: 1rem }. The TOC sets the nest padding to 0 (_tableOfContents.scss:27-29). So the step is about 16px (secondary / inferred; Step 0 measures it).

D15: settle feedback.

  • The overlay has dropAnimation={null}, so the card vanishes on release (TocDesktop.tsx:135).
  • Motion tokens: --motion-overlay-out 80ms, --motion-flash-hold 2200ms, --motion-ease-enter ease-out, --motion-ease-exit ease-in (_entry.scss:4-12). The JS mirror has MOTION_OVERLAY_OUT_MS but no flash-hold value (motion.ts:1-18).
  • The JS mirror of the flash hold is MESSAGE_HIGHLIGHT_MS = 2200 in chatroom code (messageJumpTiming.ts:1-2).
  • The design-system Motion row (design-system.md:206) and apps/webapp/CLAUDE.md:172 do not list --motion-flash-hold. This is doc drift.
  • The house flash is the msg-card-flash keyframes: primary 24% and 20% peaks, start and end at transparent (globals.scss:742-781).
  • Under reduced motion, the house flash is a static primary 16% fill (:814-834).
  • .msg_card also runs a ::before accent. A left bar on a TOC row is the reverted chat-open accent bar (commit 9c535100c), so the TOC must never port it.
  • State language row 281 limits the flash to "deep-link jump" (design-system.md:281).
  • The toast already takes actionLabel and onAction (ToastNotification.tsx:6-11, :39-73). Its surface is .surface-inverse-raised (globals.scss:541-555).
  • The toast frame is Tailwind utilities: max-w-md gap-3 rounded-box px-4 py-3 shadow-xl, and duration-200 ease-out for the enter (ToastNotification.tsx:43-49). The preview has no Tailwind, so Step 1 maps them to theme.css tokens.

Target behaviour

  • One file, Notes/previews/toc-move-visuals.html, opens in a browser with no server and no network. Git ignores Notes/ (.gitignore:166, read from code).
  • It has one mock per variant: today, the recommended answer, and each alternative named in Decisions. The maintainer can only pick an alternative that the preview shows.
  • It shows every mock in light (docsplus), dark (docsplus-dark) and dark high contrast (docsplus-dark-hc), at a 1440×900 viewport.
  • Every hand-written mock rule in preview.src.html takes its color, radius, shadow and duration from a token read from source. No such rule holds a literal hex or rgb value.
  • Compiled product CSS keeps its own literals as written, such as the drag card's 0 8px 24px shadow and the 160ms caret turn.
  • The one duration with no token is the toast's Tailwind duration-200. build.ts reads it from ToastNotification.tsx:48 (Step 1).
  • Each mock has a caption. The caption names the existing recipe and motion token it reuses, and the catalog row it would change.
  • The preview adds no new token, species, size, radius, shadow or ink step. It defines no new keyframes; it reuses msg-card-flash from source.
  • This issue gets one comment with the screenshots, the path and the mock list. Then the maintainer posts one ruling comment.

Micro-interactions

This issue owns no runtime timeline. It draws frames from the spec timeline on #499 as static or replayable mocks:

Spec step Mock Tokens shown
3. Move (drop line) D8 today and indented none (instant, no tween)
4. Inside highlight D7 recommended, offset and fill-only variants none (instant)
5. Auto-expand of a folded target D7 auto-expand frame the fold caret's existing 160ms var(--motion-ease-enter) turn (a literal, not a token); children appear at once
9 and 10. Release D15 card fade --motion-overlay-out 80ms, --motion-ease-exit (ease-in), opacity only
14. Flash D15 flash, and the reduced-motion tint --motion-flash-hold 2200ms, --motion-ease-enter; static primary 16% under reduced motion
16. Toast D15 Undo toast the toast's existing enter: opacity and translate-y-2, --preview-toast-enter (200ms), var(--ease-out), read from ToastNotification.tsx:48-49

The 500ms hover delay before auto-expand is behaviour, not a visual. #508 owns it (its §Spring-open), and this preview does not draw it.

The preview needs three controls. They are preview tools, not product UI, so label them as such.

  1. Replay. It plays the 80ms fade, the 2200ms flash and the auto-expand frame again.
  2. Simulate reduced motion. It forces the static 16% tint branch. Also honour the real prefers-reduced-motion media query.
  3. Slow ×10 (optional). It slows only the 80ms fade, so the eye can see it. Label it "inspection only, not product timing".

The flash must play on idle, menu-focus and menu-active rows. The keyframes end at transparent, so on the row itself they would wipe those fills. The mock runs them on a row ::after overlay (inset: 0, border-radius: inherit, pointer-events: none). That proves the fills survive. Never use ::before.

Under reduced motion, the static tint holds for --motion-flash-hold and then clears by timer. Never clear it on animationend, which does not fire for a static tint.

Implementation steps

Work on main. Read AGENTS.md, apps/webapp/CLAUDE.md and .cursor/docs/design-system.md (§Change protocol, §State language, §Table of contents, §Motion row) first. Do the steps in this order. Inside the repo, write files only under Notes/previews/. The baseline and sabotage files go to $TMPDIR.

Before Step 0, save a baseline of the tracked trees. Later, the Verification section compares against it:

git status --porcelain -- apps/webapp .cursor docs > "${TMPDIR:-/tmp}/toc-preview-status-before.txt"

Step 0. Measure the live TOC rows

This step writes no file. It gates the geometry in Steps 2 and 4.

  1. From the repo root, start the local stack with make dev-local (Makefile:212-219). Read the WEBAPP port from its output; Next moves to the next free port when 3000 is busy (dev-local-preflight.ts:317-319) (read from code). Below, <port> is that WEBAPP port. Never run a production build while this dev server runs (AGENTS.md:110).

  2. Open http://localhost:<port>/editor?localPersistence=true&docName=toc-preview-measure in a visible tab at 1440×900. The playground sets window._createDocumentFromStructure (EditorPlayground.tsx:78-91).

  3. Seed the outline from Step 2 in the DevTools console. It must return true:

    const p = (t) => ({ type: 'paragraph', content: t })
    const h = (level, title, ...kids) => ({ type: 'heading', level, title, contents: [p(`${title} notes.`), ...kids] })
    window._createDocumentFromStructure({ sections: [{ title: 'Project brief', contents: [
      p('A short project brief.'),
      h(2, 'Plan', h(3, 'Goals'), h(3, 'Risks'), h(3, 'Timeline')),
      h(2, 'Budget', h(3, 'Costs')),
      h(2, 'Team', h(3, 'Roles'), h(3, 'Hiring')),
      h(2, 'Notes', h(3, 'Research', h(5, 'Sources'))),
      h(2, 'Appendix', h(3, 'Detail A', h(4, 'Detail B', h(5, 'Detail C'))))
    ] }] })
  4. Confirm the Title row. Check that document.querySelector('.toc__list > li.toc__item').dataset.id equals the data-toc-id of the first h1 in the editor. Check that the H2 rows sit in that item's ul.toc__children. Record the class of the Title row.

  5. Measure the title start of each depth. Read getBoundingClientRect().left of .toc__row-link on the Title, Plan (H2), Goals (H3), Detail B (H4) and Detail C (H5). Record the nest step in px.

  6. Measure today's card place. Run setTimeout(() => console.log(document.querySelector('.toc-drag-card').getBoundingClientRect(), document.querySelector('.toc__item.is-dragging > .toc__row').getBoundingClientRect()), 3000). Then drag Budget with a real mouse and hold it still.

  7. Stop the stack with Ctrl+C. Put the numbers in the Step 8 comment, tagged "measured".

The playground TOC is 256px wide, not 320px (EditorPlayground.tsx:123). Left offsets inside the column do not depend on its width (secondary / inferred).

Step 4 may find H2 rows as root siblings of .toc__header. Then the D8 line for an H2 starts at the root row's title start, with no nest step. Say so in the Step 8 comment.

Step 1. Generate the CSS from source

AGENTS.md:150 asks for real tokens, not copied hex. The approved preview Notes/previews/373-toc-depth.html copied values by hand ("Theme values copied from…"). Do not repeat that.

  1. Write Notes/previews/toc-move-visuals/build.ts, a short Bun script. It takes two flags:
    • --globals <path>, default apps/webapp/src/styles/globals.scss.
    • --out <path>, default Notes/previews/toc-move-visuals.html.
  2. The script finds each block by pattern, not by line number, so a scratch copy or a later main still works. From the --globals file it takes:
    • The three theme blocks, today at globals.scss:11-177. Match @plugin 'daisyui/theme' blocks whose name is docsplus, docsplus-dark or docsplus-dark-hc. Turn each into [data-theme='x'] { color-scheme: y; … }. Drop default and prefersdark. Keep every custom property as written.
    • The :root, [data-theme] block, today at :365-451. It holds --color-docsy, --pad-well, --focus-ring-soft and --shadow-overlay.
    • The HC --pad-well override, today at :529-531. Without it the HC menu-active fill is wrong, because it mixes on --pad-well.
    • .surface-inverse and .surface-inverse-raised, today at :533-555.
    • The six $msg-flash-* variables and @keyframes msg-card-flash, today at :742-781. Compile that slice with sass.compileString. Do not resolve #{$…} by hand.
  3. Compile two product SCSS files with sass 1.105.1. It is a root devDependency (package.json:120) and lives only in root node_modules.
    • apps/webapp/src/styles/components/_tableOfContents.scss. It @uses _tocDrag.scss, so one compile gives both. Measured on the pinned files: it compiles to 13943 chars, keeps .toc-drag-level.active, and drops every // comment.
    • apps/webapp/src/styles/_daisyui.scss, for the menu-active pair.
    • Never paste raw SCSS into a <style>. A // comment there makes CSS drop the next declaration or rule.
  4. Inline vendor apps/webapp/node_modules/daisyui/components/menu.css (5.7.32) as written, with its @layer wrappers. It paints --menu-active-bg/fg, and it holds the row padding, the row radius and the nest rail. The compiled TOC CSS is unlayered, so it wins over the vendor layer, as in the app (secondary / inferred).
  5. Read these tokens from apps/webapp/node_modules/tailwindcss/theme.css (4.3.3) and emit them into :root. Today they sit at the line numbers shown:
    • --spacing (325), --container-md (337), --text-sm and --text-sm--line-height (349-350).
    • --font-weight-medium and --font-weight-semibold (378-379), --shadow-xl (411), --ease-out (435).
    • Use only the apps/webapp/node_modules copies. The bun store also holds [email protected] and [email protected], and root node_modules holds neither package.
  6. Emit apps/webapp/node_modules/tailwindcss/preflight.css first, so lists, links and buttons lose their browser styles, as in the app. Then emit the blocks in source order: theme blocks, then :root, [data-theme], then the HC override, then the surfaces. The HC override and :root, [data-theme] have equal specificity, so the HC --pad-well is right only when it comes later.
  7. Read the number from duration-200 in ToastNotification.tsx with a regex. Emit it as --preview-toast-enter on :root. It is a preview-local name, not a product token.
  8. Then emit theme.css tokens, vendor menu.css, the compiled _daisyui.scss, the compiled TOC CSS and the flash keyframes.
  9. Print the source commit (git rev-parse HEAD) in an HTML comment at the top of the output. If git status --porcelain lists a source file, add a warning line to that comment.
  10. Keep the hand-written mock in Notes/previews/toc-move-visuals/preview.src.html. The script injects the generated CSS into it. Mock rules use only var(--…) names.
  11. Copy borders as compiled. In HC (--border: 2px, globals.scss:173), only the vendor nest rail (width: var(--border)) gets thicker. Do not swap the literal 1px or 2px borders in the TOC CSS.

Step 2. Build the TOC row scaffold

  • Use the product ancestors, so the compiled rules match: aside.tiptap__toc.m_desktop > ul.toc__list.menu, as in EditorPlayground.tsx:123. Add is-dragging to the ul for drag frames. Set font-family: var(--font-sans) on the body and background: var(--pad-well) on each aside, as the playground does.

  • Use the row markup from TocRow.tsx:43-67 and TocItemBody.tsx:116-192.

  • Map the Tailwind utilities in that markup to --spacing. For example, min-h-8 is min-height: calc(var(--spacing) * 8), and size-5 is a calc(var(--spacing) * 5) square. gap-1 and shrink-0 follow the same way.

  • Notes/previews/373-toc-depth.html is an approved TOC row scaffold, if it exists on your machine. Take only markup and geometry from it, never its copied values.

  • .m_desktop hides each grip until row hover. For a static grip frame, put one row in its own aside with no m_desktop. Then only that grip shows, with its product recipe.

  • Use the hallway seed outline from Run the TOC move hallway test before drop inside ships #509 Step 3 as row text. The levels are:

    H1 Project brief                 (Title)
      H2 Plan                        (folded)
        H3 Goals
        H3 Risks
        H3 Timeline
      H2 Budget
        H3 Costs
      H2 Team
        H3 Roles
        H3 Hiring
      H2 Notes
        H3 Research
          H5 Sources
      H2 Appendix
        H3 Detail A
          H4 Detail B
            H5 Detail C
    
  • Draw the sticky li.toc__header first, with the Pad title "Brief pad" (mock text). Then draw the Title "Project brief" as the first root li.toc__item. Nest every H2 in its ul.toc__children.

  • Draw the Title row with no grip in every mock (R3). No mock draws a drop line in the gap between the Pad title row and the Title row.

  • Add a theme switch (Light, Dark, Dark HC) that sets data-theme on <html>. Do not show all three themes on one page. The menu-active fill needs the theme's own --pad-well.

Step 3. Mock D2 (level picker)

One mock per variant, each on a dragged "Budget" (H2). Budget has one sub-heading, Costs, so every card shows the +1 badge and a deck with data-count='1' (R6).

  1. Today. The card with TocLevelPicker: chips H1 to H5, original H2, active H3.
  2. Recommended. The card with no picker. Draw both card placements:
  3. Alternative. The picker kept, limited to 1..hi with reachable chips only. Example: source H2 below an H2 row, so hi = 3, chips H1 to H3.
  4. Grip hover. The grip-hover preview picker today (TocItemBody.tsx:134), beside the grip with no picker.
  5. Level badge. Rows during a drag with the H{level} badge, beside rows without it.

Caption: catalog rows design-system.md:416 (removed under D2) and :417 (the badge stays; the chip-ink clause goes).

Step 4. Mock D8 (drop line)

  1. Today. The full-width line at the target row's left edge.
  2. Recommended. The line indented to the landing depth, at three depths. They are an H2 under the Title, an H3 under "Team" and an H4 under "Detail A".
    • The line starts at the landing parent's title-start x plus one nest step. For an H2 the parent is the Title row (read from code; Step 0 confirms it).
    • Use the nest step that Step 0 measured. Never use level × 24.
    • The right end stays where today's line ends. That is an implementer default (secondary / inferred), so state it in the caption.
    • Keep the 2px line, the 10px dot and the radius as compiled. No tween.
  3. Add a frame with a skip level: Research (H3) then Sources (H5). Two levels share one depth there; that is accepted.

Caption: catalog row design-system.md:415.

Step 5. Mock D7 (inside highlight)

  1. Recommended. The class is-drop-inside: background-color: color-mix(in oklch, var(--color-primary) 15%, transparent) plus outline: var(--focus-ring-soft); outline-offset: -2px. No drop line shows at the same time.
  2. Alternative, house offset. The same fill and outline with outline-offset: 1px, as design-system.md:205 says today.
  3. Alternative, fill only. The same fill, with no outline.

Show each variant on four rows: an idle row, a menu-focus row, a menu-active (chat-open) row, and the Title row. The Title row's whole row is an inside zone, with no grip.

Set the fill as a background-color declaration, as the product rule would. It replaces the row's own fill; it does not layer on it. So on a menu-active row the mock compares 15% on the column background with 14% on --pad-well (secondary / inferred; the mock decides).

  1. Auto-expand frame. Two frames on the folded "Plan" row, with the recommended highlight.
    • Frame 1: Plan folded, with the inside highlight.
    • Frame 2: Plan open. The caret turns with the existing transform 160ms var(--motion-ease-enter), and Goals, Risks and Timeline appear at once. Replay plays it.
    • Caption: auto-expand reuses the existing fold motion and adds no visual, so it needs no design-system ruling.

Caption: context-menu-active recipe (design-system.md:278), --focus-ring-soft and its offset rule (:205), catalog rows :401 and :282.

Step 6. Mock D15 (settle feedback)

  1. Card fade. The card goes from opacity: 0.8 to 0 over --motion-overlay-out with --motion-ease-exit. Opacity only; keep the start transform.
  2. Flash. msg-card-flash var(--motion-flash-hold) var(--motion-ease-enter) on a row ::after overlay.
    • Show it on idle, menu-focus and menu-active rows.
    • Show the capture case: the moved row "Roles" and the captured row "Hiring" flash together.
  3. Reduced motion. A static color-mix(in oklch, var(--color-primary) 16%, transparent) on the same ::after, held for 2200ms by timer.
  4. Undo toast. Copy the existing frame from ToastNotification.tsx:43-49, mapped to the Step 1 tokens:
    • max-w-md is max-width: var(--container-md). gap-3 and py-3 are calc(var(--spacing) * 3), and px-4 is calc(var(--spacing) * 4).
    • rounded-box is border-radius: var(--radius-box). shadow-xl is box-shadow: var(--shadow-xl).
    • The enter is transition: opacity var(--preview-toast-enter) var(--ease-out), transform var(--preview-toast-enter) var(--ease-out). translate-y-2 is calc(var(--spacing) * 2).
    • text-sm is font-size: var(--text-sm) with line-height: var(--text-sm--line-height). font-medium and font-semibold are the two --font-weight-* tokens.
    • The surface is the class surface-inverse-raised. Use the neutral variant (no status bar). The action ink is var(--inverse-action-ink).
  5. Draw two toasts, each with "Undo":
    • Capture (a menu Promote on Roles): “Roles” is now Heading 2, was Heading 3. “Hiring” moved inside it.
    • Roles goes from H3 to H2 in place, so it becomes a sibling after Team. Hiring (H3) follows it, so it falls inside Roles (R2).
    • Squash (a drop inside Detail C): Moved “Budget” into “Detail C”, as its first sub-heading. Now Heading 6. 1 sub-heading flattens to Heading 6 and loses its nesting.
    • The squash math: Detail C is H5, so Budget lands at H6, and d = +4. Costs shifts by the same d, from H3 to H7 (R1). The cap holds it at H6 (R4). The result is Detail C{H6 Budget, H6 Costs}.
    • The squash line has no cascade part. Show where a moved section landed after a TOC move #506's cascade part names only sub-headings shifted by exactly d. Costs shifted by 3, not 4, so it counts as squashed only.
    • Show where a moved section landed after a TOC move #506 owns describeMoveResult and its phrase table (its Step 6). Both lines above are copied from that table, with curly quotes. If that table changes, copy the new text.
  6. Alternative "none". The landed rows with no fade, no flash and no toast.

Caption: --motion-overlay-out, --motion-flash-hold, msg-card-flash, State language row design-system.md:281, overlay card row :414, the toast catalog row (:576-586).

Step 7. Check the preview in a browser

  • Use Claude in Chrome (mcp__claude-in-chrome__* tools). To open a file:// page, it needs "Allow access to file URLs" turned on, on the extension's page in chrome://extensions. Ask the maintainer to turn it on.
  • Open the file in a visible tab at 1440×900. Read document.visibilityState and confirm visible before you judge any motion; a hidden tab runs no animation frames.
  • Check every mock in Light, Dark and Dark HC.
  • Turn on the OS reduced-motion setting once. Confirm the flash mock shows the static tint with no pulse. Then turn it off.
  • Take one screenshot per mock section per theme. Scroll each section into view first, because a screenshot holds the viewport only.
  • Save them as Notes/previews/screenshots/toc-move-visuals-<theme>-<section>.png, for example toc-move-visuals-dark-hc-d7.png.

Step 8. Ask for the ruling

Post one comment on this issue. Notes/ is local and ignored by git, so public readers see only the screenshots.

  • Attach the Step 7 screenshots. gh issue comment cannot upload images, so drag the PNG files into the comment box in the GitHub web editor.
  • List the preview path, the source commit, and how to rebuild (bun Notes/previews/toc-move-visuals/build.ts).
  • List the Step 0 numbers, tagged "measured": the Title row class, each depth's title start, the nest step and the card place.
  • List the mocks, one line per mock, with the recipe and token it reuses.
  • Add the proposed row-to-child table below.
  • Ask for one ruling comment headed ## Maintainer ruling, <date>. It has ### Design-system additions approved (each row marked locked) and ### Not approved (mock only).
  • Ask the ruling to record D7 and D15 (3) as deliberate exceptions under AGENTS.md:151, if they are kept.

Proposed row-to-child table (the ruling confirms or changes it):

Decision Child Rows it edits after the ruling
D2 #504 design-system.md:416 removed; :417 loses the level-option clause. It keeps the badge and grip ink. Heading :407 and file line :409 drop the picker.
D8 #504 design-system.md:415
D7 #508 design-system.md:401 (TOC rows, drag states); :282 (State language, drag); :205 (the inset offset for the drop-inside outline, if the -2px offset is ruled)
D15 #506 design-system.md:281 widens to "post-move landing"; :414 gains the release fade; :206 and apps/webapp/CLAUDE.md:172 list --motion-flash-hold

Out of scope

Decisions

Owner: the maintainer. The recommended answer comes first. All four are design-system rulings.

  1. D2. Drop the drag level picker, its chips and the grip-hover preview picker? DS. Recommended: drop all three. tocDragModifier pins the card's x to 0.
    • Reason: Edward asks for less freedom, and none of Google Docs, Word or Notion sets a level by a sideways drag (secondary / inferred).
    • Alternative: keep the picker, limited to 1..hi, with reachable chips only. Then record it as a peer exception (AGENTS.md:151).
    • Sub-question, card placement: recommended (a), keep translate(-12px, -36px). Reason: it is today's place, and the card does not cover the rows near the pointer (secondary / inferred).
    • Alternative (b): reset the offset to 0, so the card covers the source row. Then Set the drag level from the row above and indent the drop line #504 changes _tocDrag.scss:86-89.
    • Sub-question, level badge: recommended keep the drag-only H{level} badge. With no picker, it is the only text cue of each row's level. Alternative: remove it with the picker.
  2. D7. How does the inside highlight look? DS. Recommended: is-drop-inside with the context-menu-active fill (primary 15%) plus outline: var(--focus-ring-soft); outline-offset: -2px. It is instant, and the drop line hides.
    • Reason: it reuses the "target of an action" fill. The inset outline differs from the outside keyboard ring. It also shows a change on a chat-open row, and it does not rely on colour alone (SC 1.4.1).
    • Design-system change: the -2px offset breaks the usage rule at design-system.md:205 ("outline-offset: 1px"). If it is ruled, Drop a section onto a TOC heading to put it inside #508 edits :205.
    • Alternative: the same outline at the house outline-offset: 1px. It needs no :205 change, but it looks like the keyboard focus ring.
    • Alternative: fill only. It may show no change on a chat-open row.
    • Peers: Notion highlights a sidebar page when you drop a page into it. Primary source: Notion help, "Nest pages by dragging one into another. You'll see the selected page highlight blue." That is pages, not headings.
    • Google Docs and Word do not drop a heading inside a heading, so they have no inside highlight (secondary / inferred). If kept, record it as a deliberate exception under AGENTS.md:151.
    • Auto-expand reuses the existing fold motion. It needs no ruling.
    • Note: design-system.md:258 lists ring-as-shadow as a deliberate exception, and :1317 lists it as off-system debt. The recommendation uses the outline token, so it avoids that conflict.
  3. D8. Indent the drop line to the landing depth? DS. Recommended: yes. Start it at the landing parent's title-start x plus one measured nest step. Keep the 2px line and the 10px dot. No tween.
    • Reason: today the line starts at the target row's left edge, so it does not show where the section lands. With no picker, the indent is the only depth cue.
    • Alternative: keep today's full-width line.
  4. D15. What settle feedback shows after a release? DS (doctrine change and new motion on the drag card). Recommended, in three parts:
    • (1) The card fades out over 80ms (--motion-overlay-out, ease-in) on every release.
    • (2) The moved row and every captured row flash with msg-card-flash on a ::after overlay over --motion-flash-hold. Under reduced motion they get a static 16% tint for the same hold.
    • (3) The existing toast with an "Undo" action shows when anything is captured or squashed.
    • Reason: capture and squash change rows the user did not drag, and the live preview was cut. The house already has the flash and toast recipes. This widens State language row 281 from "deep-link jump" to "post-move landing".
    • Peers for (3): no Google Docs, Word or Notion help page shows an Undo toast after a heading move (secondary / inferred). The Notion sidebar page has no undo sentence (measured: fetched 2026-10-15).
    • So (3) is a deliberate exception under AGENTS.md:151, if kept. Non-peer support: Apple HIG, Drag and drop, "Prefer letting people undo a drag-and-drop operation."
    • That quote was read from the page's JSON data, because the rendered page came back empty.
    • Alternative: no fade, no flash and no toast; scroll and the live region only.

Acceptance criteria

  • Step 0 numbers exist: the Title row class, each depth's title start, the nest step and today's card place, each tagged "measured".
  • Notes/previews/toc-move-visuals.html exists and opens with no server and no network.
  • It shows today, the recommended answer and each alternative for D2, D7, D8 and D15, as listed in Steps 3 to 6.
  • Every mock draws the Pad title row first, then the Title row with no grip. No drop line shows in the gap between them.
  • Every D2 card mock shows the +1 badge and a deck with data-count='1'.
  • The D7 mocks include the -2px outline, the 1px outline, fill only, and the two-frame auto-expand on folded "Plan".
  • Every mock renders in Light, Dark and Dark HC at 1440×900, checked in a visible tab (document.visibilityState === 'visible').
  • The CSS is generated by build.ts from the sources in Step 1. preview.src.html holds no literal hex or rgb( value.
  • Each mock caption names the recipe, the motion token and the catalog row it touches. No mock adds a token, species, size, radius, shadow, ink step or keyframes.
  • The flash mock shows that idle, menu-focus and menu-active fills survive the flash (the ::after overlay).
  • The reduced-motion switch shows the static 16% tint, and it clears after 2200ms.
  • With the OS reduced-motion setting on, the flash mock shows the static tint with no pulse.
  • No mock draws a row ::before accent, a data-level type ladder or a scroll-spy wash.
  • The comment on this issue carries the screenshots, the path, the source commit, the Step 0 numbers and the mock list.
  • The maintainer has posted a ruling on D2, D7, D8 and D15, with approved rows marked locked.
  • The ruling names, for each approved visual, which child edits which catalog row. It records any kept peer exception.

Verification

This issue adds no code and no test (AGENTS.md §Test Policy, :102-110). Run these checks from the repo root:

# Rebuild the preview from source.
bun Notes/previews/toc-move-visuals/build.ts

# No new change in these trees since the baseline. Must print nothing.
git status --porcelain -- apps/webapp .cursor docs | diff "${TMPDIR:-/tmp}/toc-preview-status-before.txt" -

# No hand-typed colour in the mock source. Must print nothing.
grep -nE '#[0-9a-fA-F]{3,8}\b|rgba?\(' Notes/previews/toc-move-visuals/preview.src.html

Sabotage check for the token step. It proves the preview reads the real --color-primary, not a copy. Run:

SCRATCH="$(mktemp -d)"
bun -e 'const f = await Bun.file("apps/webapp/src/styles/globals.scss").text(); await Bun.write(process.argv[1], f.replace(/--color-primary: [^;]+;/, "--color-primary: red;"))' "$SCRATCH/globals.scss"
bun Notes/previews/toc-move-visuals/build.ts --globals "$SCRATCH/globals.scss" --out "$SCRATCH/sabotage.html"
grep -c -- '--color-primary: red;' "$SCRATCH/sabotage.html"   # must print 1

Open $SCRATCH/sabotage.html in Light and confirm the primary fills turn red. The real preview stays unchanged, because --out points to the scratch folder.

Browser check: open the file at 1440×900 in a visible tab. Switch through the three themes, press Replay, and turn on Simulate reduced motion.

Docs to update

None in the repo. After the ruling, each child edits its own catalog rows and docs, as the row-to-child table says.

Read first


Generated by Claude Code

Activity

  1. added
    Toc
    on Oct 16, 2026
  2. added this to the v2.3.0 milestone on Oct 19, 2026
  3. HMarzban commented on Nov 3, 2026

    @HMarzban
    CollaboratorAuthor

    Status, 2026-11-03. No preview is built yet: Notes/previews/toc-move-visuals.html does not exist. This issue has no dependency, so it can start now.

    Left:

    • Build the preview (Steps 0 to 7) and post the screenshots comment.
    • Maintainer: rule D2, D7, D8 and D15, and mark approved rows locked.
  4. HMarzban commented on Nov 4, 2026

    @HMarzban
    CollaboratorAuthor

    Preview built, 2026-11-04. Ready for the D2, D7, D8 and D15 ruling.

    • Page: Notes/previews/toc-move-visuals.html (local, ignored by git). Source commit 91aeeaa8a.
    • Rebuild: bun Notes/previews/toc-move-visuals/build.ts. Every colour, radius, shadow and duration comes from globals.scss, _entry.scss, _daisyui.scss, _tableOfContents.scss, daisyUI menu.css (5.7.50) and the Tailwind theme tokens. A sabotage build (--color-primary: red) turned the primary fills red, so the page really reads the tokens.
    • Screenshots (Light, Dark, Dark HC; 1440×900, headless Chromium) are in Notes/previews/toc-move-visuals/: -geometry, -d2, -d8, -d7, -d15 and -d15-reduced-motion for each theme. gh cannot attach images, so the maintainer adds them here. Reduced motion is emulated in the browser, not set in the OS.

    Geometry

    • Title starts, from the column edge: Title 54px, H2 70px, H3 86px, H4 102px, H5 118px. The nest step is 16px. These were measured in the preview from the compiled product CSS, not in the live app. The live Step 0 is still owed before Set the drag level from the row above and indent the drop line #504 uses them.
    • The card sits at translate(-12px, -36px) from the source row, plus 24px on x per level step (read from code, DEFAULT_SNAP_CONFIG.stepSize).

    Recommendations

    • D2: drop the level picker, its chips and the grip-hover picker. Keep placement (a), with the -36px offset and x pinned, and keep the level badge. None of Google Docs, Word or Notion sets a level with a sideways drag.
    • D8: indent the drop line to the title start of the landing depth. Today's line starts at the target row's edge at every depth.
    • D7: the context-menu-active fill plus outline: var(--focus-ring-soft) at a -2px offset. Fill only barely changes the chat-open row. In Dark and Dark HC the 15% fill on a menu-focus row is darker than base-300, so the target looks less marked than the scroll-spy row. The 1px offset looks like the keyboard focus ring.
    • D15: all three parts: the card fade, the msg-card-flash row flash, and the Undo toast. They need no new token.

    Rows each ruling edits

    Decision Child Rows it edits after the ruling
    D2 #504 design-system.md:416 removed; :417 loses the level-option clause and keeps the badge and grip ink; heading :407 and file line :409 drop the picker
    D8 #504 design-system.md:415
    D7 #508 design-system.md:401, :282, and :205 if the -2px offset is ruled
    D15 #506 design-system.md:281 widens to "post-move landing"; :414 gains the release fade; :206 and apps/webapp/CLAUDE.md §Motion System list --motion-flash-hold

    Notes

    • Versions moved since the issue was written: sass 1.107.1 (issue: 1.105.1), daisyUI 5.7.50 (issue: 5.7.32).
    • The page also needed the _entry.scss motion :root, which the issue's Step 1 list misses. Without it, the flash and the fade run at 0s.

    Ruling asked

    One comment headed ## Maintainer ruling, <date>, with ### Design-system additions approved (each row marked locked) and ### Not approved (mock only). If D7 and D15 part 3 are kept, record them as deliberate exceptions under the peer rule in AGENTS.md §Workflow And Review Expectations.

  5. HMarzban commented on Nov 4, 2026

    @HMarzban
    CollaboratorAuthor

    Maintainer ruling, 2026-11-04

    • D2: yes. Remove the sideways level offset, the level picker and its chips. The drop slot decides the depth.

    D7, D8 and D15 are still open.

  6. HMarzban commented on Nov 5, 2026

    @HMarzban
    CollaboratorAuthor

    Closed by maintainer ruling 2026-11-05: the current TOC drag is the version we keep. It shipped in dd287cb and f571c08..e9d01ff (see #499). Reopen this if the need comes back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    DesktopTocUI

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions