Repository navigation
Description
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
+Nbadge and deck.
Depends on / Blocks
- Depends on: nothing. It can start at once.
- Blocks: Set the drag level from the row above and indent the drop line #504 (D2, D8), Show where a moved section landed after a TOC move #506 (D15) and Drop a section onto a TOC heading to put it inside #508 (D7). None of them may change a TOC visual until the ruling comment exists.
- Runs beside: Move a TOC section with its sub-headings and keep the Title fixed #500. That child adds no visual.
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.scssis 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). buildNestedTocputs every deeper heading inside the heading before it (utils.ts:7-22). So the Title is a rootli.toc__item. The H2 rows sit in itsul.toc__children(TocItemBody.tsx:176-192).- A separate sticky
li.toc__headercomes 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.
- The drag card renders
TocLevelPickerabove the card inside.toc-drag-wrapper(TocDesktop.tsx:132-164). - The picker shows H chips within ±3 of the source level (
TocLevelPicker.tsx:5-45). - Grip hover shows a second, preview picker (
TocItemBody.tsx:134). - The chip and picker recipes are in
_tocDrag.scss:91-159. .toc-drag-wrapperhas a statictransform: translate(-12px, -36px)(_tocDrag.scss:86-89). So the card sits 36px above the source row today.- Both pickers also get the class
toc__level-picker(tocClasses.ts:25,TocLevelPicker.tsx:31). - That class is
position: absolute; bottom: calc(100% + 4px)(_tocDrag.scss:60-65). So the picker is out of flow. Removing it moves the card 0px (read from code, not measured). - During a drag, every row shows a
.toc__level-badgepill withH{level}(_tableOfContents.scss:46-48,_tocDrag.scss:67-84). - Catalog rows: "level picker + chips" (
design-system.md:416). "Level badge (drag-only)" (:417) mixes three things: the badge, the level-option chip ink, and the grip ink.
D7: inside highlight. No inside state exists today.
- The nearest recipe is
context-menu-active, primary 15% mixed on transparent, with!important(_tableOfContents.scss:90-92; State languagedesign-system.md:278). - The chat-open
menu-activefill is primary 14% mixed on the opaque--pad-well(_daisyui.scss:14-20). So the two fills may look the same on a chat-open row (secondary / inferred; the preview shows it). - That file only sets
--menu-active-bgand--menu-active-fg. The vendor daisyUImenu.csspaints them. It also holds the row padding, the row radius and the nest rail (read from installed[email protected], local file, no permalink). - Scroll-spy
menu-focusis solidbase-300(_tableOfContents.scss:180-183). - The soft ring token is
--focus-ring-soft:2px solidprimary 45% (globals.scss:410). - Its usage rule is "consume via
outline: var(--focus-ring-soft); outline-offset: 1px" (design-system.md:205). The TOC focus ring follows it (_tableOfContents.scss:246-252). - During a drag, row hover, focus and active fills are forced to
transparent !important(_tableOfContents.scss:50-58). The product rule for D7 must beat it. That is Drop a section onto a TOC heading to put it inside #508's work, not this preview's. - Fold motion exists today. The fold caret turns with
transform 160ms var(--motion-ease-enter, ease-out)(_tableOfContents.scss:146-169). The 160ms is a literal, not a motion token. - A folded row hides its children with
display: none, so they appear at once on open (_tableOfContents.scss:95-97).
D8: drop line.
- The drop line is 2px
base-contentwith a 10pxbase-contentdot at its start (_tocDrag.scss:240-261). - The portal takes
leftandwidthfrom 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-out80ms,--motion-flash-hold2200ms,--motion-ease-enterease-out,--motion-ease-exitease-in (_entry.scss:4-12). The JS mirror hasMOTION_OVERLAY_OUT_MSbut no flash-hold value (motion.ts:1-18). - The JS mirror of the flash hold is
MESSAGE_HIGHLIGHT_MS = 2200in chatroom code (messageJumpTiming.ts:1-2). - The design-system Motion row (
design-system.md:206) andapps/webapp/CLAUDE.md:172do not list--motion-flash-hold. This is doc drift. - The house flash is the
msg-card-flashkeyframes: primary 24% and 20% peaks, start and end attransparent(globals.scss:742-781). - Under reduced motion, the house flash is a static primary 16% fill (
:814-834). .msg_cardalso runs a::beforeaccent. A left bar on a TOC row is the reverted chat-open accent bar (commit9c535100c), 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
actionLabelandonAction(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, andduration-200 ease-outfor the enter (ToastNotification.tsx:43-49). The preview has no Tailwind, so Step 1 maps them totheme.csstokens.
Target behaviour
- One file,
Notes/previews/toc-move-visuals.html, opens in a browser with no server and no network. Git ignoresNotes/(.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.htmltakes 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 24pxshadow and the 160ms caret turn. - The one duration with no token is the toast's Tailwind
duration-200.build.tsreads it fromToastNotification.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-flashfrom 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.
- Replay. It plays the 80ms fade, the 2200ms flash and the auto-expand frame again.
- Simulate reduced motion. It forces the static 16% tint branch. Also honour the real
prefers-reduced-motionmedia query. - 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.
-
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). -
Open
http://localhost:<port>/editor?localPersistence=true&docName=toc-preview-measurein a visible tab at 1440×900. The playground setswindow._createDocumentFromStructure(EditorPlayground.tsx:78-91). -
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')))) ] }] })
-
Confirm the Title row. Check that
document.querySelector('.toc__list > li.toc__item').dataset.idequals thedata-toc-idof the firsth1in the editor. Check that the H2 rows sit in that item'sul.toc__children. Record the class of the Title row. -
Measure the title start of each depth. Read
getBoundingClientRect().leftof.toc__row-linkon the Title, Plan (H2), Goals (H3), Detail B (H4) and Detail C (H5). Record the nest step in px.- Measure
.toc__row-link, not.toc__link. Thea.toc__row-linkwraps thespan.toc__link(TocRow.tsx:55-64; read from code). Rebuild the TOC drop hit test so folded rows and gaps land right #503titleXand Set the drag level from the row above and indent the drop line #504 both read.toc__row-link, so one element gives the title-start x for all three issues.
- Measure
-
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. -
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.
- Write
Notes/previews/toc-move-visuals/build.ts, a short Bun script. It takes two flags:--globals <path>, defaultapps/webapp/src/styles/globals.scss.--out <path>, defaultNotes/previews/toc-move-visuals.html.
- The script finds each block by pattern, not by line number, so a scratch copy or a later
mainstill works. From the--globalsfile it takes:- The three theme blocks, today at
globals.scss:11-177. Match@plugin 'daisyui/theme'blocks whosenameisdocsplus,docsplus-darkordocsplus-dark-hc. Turn each into[data-theme='x'] { color-scheme: y; … }. Dropdefaultandprefersdark. Keep every custom property as written. - The
:root, [data-theme]block, today at:365-451. It holds--color-docsy,--pad-well,--focus-ring-softand--shadow-overlay. - The HC
--pad-welloverride, today at:529-531. Without it the HCmenu-activefill is wrong, because it mixes on--pad-well. .surface-inverseand.surface-inverse-raised, today at:533-555.- The six
$msg-flash-*variables and@keyframes msg-card-flash, today at:742-781. Compile that slice withsass.compileString. Do not resolve#{$…}by hand.
- The three theme blocks, today at
- Compile two product SCSS files with
sass1.105.1. It is a root devDependency (package.json:120) and lives only in rootnode_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 themenu-activepair.- Never paste raw SCSS into a
<style>. A//comment there makes CSS drop the next declaration or rule.
- Inline vendor
apps/webapp/node_modules/daisyui/components/menu.css(5.7.32) as written, with its@layerwrappers. 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). - 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-smand--text-sm--line-height(349-350).--font-weight-mediumand--font-weight-semibold(378-379),--shadow-xl(411),--ease-out(435).- Use only the
apps/webapp/node_modulescopies. The bun store also holds[email protected]and[email protected], and rootnode_modulesholds neither package.
- Emit
apps/webapp/node_modules/tailwindcss/preflight.cssfirst, 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-wellis right only when it comes later. - Read the number from
duration-200inToastNotification.tsxwith a regex. Emit it as--preview-toast-enteron:root. It is a preview-local name, not a product token. - Then emit
theme.csstokens, vendormenu.css, the compiled_daisyui.scss, the compiled TOC CSS and the flash keyframes. - Print the source commit (
git rev-parse HEAD) in an HTML comment at the top of the output. Ifgit status --porcelainlists a source file, add a warning line to that comment. - 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 onlyvar(--…)names. - 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 inEditorPlayground.tsx:123. Addis-draggingto theulfor drag frames. Setfont-family: var(--font-sans)on the body andbackground: var(--pad-well)on eachaside, as the playground does. -
Use the row markup from
TocRow.tsx:43-67andTocItemBody.tsx:116-192. -
Map the Tailwind utilities in that markup to
--spacing. For example,min-h-8ismin-height: calc(var(--spacing) * 8), andsize-5is acalc(var(--spacing) * 5)square.gap-1andshrink-0follow the same way. -
Notes/previews/373-toc-depth.htmlis an approved TOC row scaffold, if it exists on your machine. Take only markup and geometry from it, never its copied values. -
.m_desktophides each grip until row hover. For a static grip frame, put one row in its ownasidewith nom_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__headerfirst, with the Pad title "Brief pad" (mock text). Then draw the Title "Project brief" as the first rootli.toc__item. Nest every H2 in itsul.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-themeon<html>. Do not show all three themes on one page. Themenu-activefill 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).
- Today. The card with
TocLevelPicker: chips H1 to H5,originalH2,activeH3. - Recommended. The card with no picker. Draw both card placements:
- (a) The static
translate(-12px, -36px)kept, so the card sits 36px above the source row, as today. - (b) The offset reset to 0, so the card covers the ghosted source row.
- Use the Step 0 numbers for the real distance. Caption: if (b) is ruled, Set the drag level from the row above and indent the drop line #504 changes the offset.
- (a) The static
- Alternative. The picker kept, limited to
1..hiwith reachable chips only. Example: source H2 below an H2 row, sohi = 3, chips H1 to H3. - Grip hover. The grip-hover preview picker today (
TocItemBody.tsx:134), beside the grip with no picker. - 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)
- Today. The full-width line at the target row's left edge.
- 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.
- 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)
- Recommended. The class
is-drop-inside:background-color: color-mix(in oklch, var(--color-primary) 15%, transparent)plusoutline: var(--focus-ring-soft); outline-offset: -2px. No drop line shows at the same time. - Alternative, house offset. The same fill and outline with
outline-offset: 1px, asdesign-system.md:205says today. - 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).
- 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)
- Card fade. The card goes from
opacity: 0.8to 0 over--motion-overlay-outwith--motion-ease-exit. Opacity only; keep the start transform. - Flash.
msg-card-flash var(--motion-flash-hold) var(--motion-ease-enter)on a row::afteroverlay.- Show it on idle,
menu-focusandmenu-activerows. - Show the capture case: the moved row "Roles" and the captured row "Hiring" flash together.
- Show it on idle,
- Reduced motion. A static
color-mix(in oklch, var(--color-primary) 16%, transparent)on the same::after, held for 2200ms by timer. - Undo toast. Copy the existing frame from
ToastNotification.tsx:43-49, mapped to the Step 1 tokens:max-w-mdismax-width: var(--container-md).gap-3andpy-3arecalc(var(--spacing) * 3), andpx-4iscalc(var(--spacing) * 4).rounded-boxisborder-radius: var(--radius-box).shadow-xlisbox-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-2iscalc(var(--spacing) * 2). text-smisfont-size: var(--text-sm)withline-height: var(--text-sm--line-height).font-mediumandfont-semiboldare the two--font-weight-*tokens.- The surface is the class
surface-inverse-raised. Use the neutral variant (no status bar). The action ink isvar(--inverse-action-ink).
- 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
describeMoveResultand 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.
- 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 afile://page, it needs "Allow access to file URLs" turned on, on the extension's page inchrome://extensions. Ask the maintainer to turn it on. - Open the file in a visible tab at 1440×900. Read
document.visibilityStateand confirmvisiblebefore 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 exampletoc-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 commentcannot 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
- Any change in
apps/webapp,.cursor,docsor any tracked file. - Catalog edits in
.cursor/docs/design-system.md. Each child edits its own rows after the ruling. - D1, D5 and D10. They need no design-system ruling, and other children own them.
- Behaviour timing. Drop a section onto a TOC heading to put it inside #508 owns the 500ms spring-open wait and the hit-zone sizes. Show where a moved section landed after a TOC move #506 owns the toast duration and the settle order.
- Moving
MESSAGE_HIGHLIGHT_MSintoutils/motion.tsasMOTION_FLASH_HOLD_MS. Show where a moved section landed after a TOC move #506 does it. - Any mock of a drag-card caption, capture bracket or squash caption. The spec cut them; they return only if the hallway test asks.
- A no-drop cue for the gap above the Title. Rebuild the TOC drop hit test so folded rows and gaps land right #503 owns it (its Decision A).
- Phone visuals.
Decisions
Owner: the maintainer. The recommended answer comes first. All four are design-system rulings.
- D2. Drop the drag level picker, its chips and the grip-hover preview picker? DS. Recommended: drop all three.
tocDragModifierpins 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.
- D7. How does the inside highlight look? DS. Recommended:
is-drop-insidewith thecontext-menu-activefill (primary 15%) plusoutline: 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
-2pxoffset breaks the usage rule atdesign-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:205change, 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:258lists ring-as-shadow as a deliberate exception, and:1317lists it as off-system debt. The recommendation uses the outline token, so it avoids that conflict.
- 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.
- 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-flashon a::afteroverlay 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.
- (1) The card fades out over 80ms (
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.htmlexists 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
+1badge and a deck withdata-count='1'. - The D7 mocks include the
-2pxoutline, the1pxoutline, 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.tsfrom the sources in Step 1.preview.src.htmlholds no literal hex orrgb(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-focusandmenu-activefills survive the flash (the::afteroverlay). - 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
::beforeaccent, adata-leveltype 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.htmlSabotage 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 1Open $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
AGENTS.md§Workflow And Review Expectations (lines 150 and 151: preview rule, peer rule) and §Test Policy.- Root
CLAUDE.md§Hard invariants (design system locked) and §Settled (TOC channel-map rework, TOC presence overhang). CONTEXT.md§Pad outline (Title and Pad title)..cursor/docs/design-system.md§Change protocol (locked), §Semantic tokens (focus-ring and Motion rows), §State language, §TocHeader, §Table of contents (TOC rows, TOC drag system), §ToastNotification.apps/webapp/CLAUDE.md§Motion System (motion v1) and §TOC And Heading Actions.- [Tracking] Move TOC sections like folders: cascade, drop inside, and a menu path #499: the rulings R1 to R6 and the shared rules.
- Show where a moved section landed after a TOC move #506 Step 6 (the
describeMoveResultphrase table) and its settle order. - Drop a section onto a TOC heading to put it inside #508 §Spring-open (the 500ms wait) and its hit-zone table.
- Rebuild the TOC drop hit test so folded rows and gaps land right #503 Decision A (the no-drop cue).
- Run the TOC move hallway test before drop inside ships #509 Step 3 (the seed outline).
Generated by Claude Code
Activity
HMarzban commentedon Nov 3, 2026
Status, 2026-11-03. No preview is built yet:
Notes/previews/toc-move-visuals.htmldoes not exist. This issue has no dependency, so it can start now.Left:
HMarzban commentedon Nov 4, 2026
Preview built, 2026-11-04. Ready for the D2, D7, D8 and D15 ruling.
Notes/previews/toc-move-visuals.html(local, ignored by git). Source commit91aeeaa8a.bun Notes/previews/toc-move-visuals/build.ts. Every colour, radius, shadow and duration comes fromglobals.scss,_entry.scss,_daisyui.scss,_tableOfContents.scss, daisyUImenu.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.Notes/previews/toc-move-visuals/:-geometry,-d2,-d8,-d7,-d15and-d15-reduced-motionfor each theme.ghcannot attach images, so the maintainer adds them here. Reduced motion is emulated in the browser, not set in the OS.Geometry
translate(-12px, -36px)from the source row, plus 24px on x per level step (read from code,DEFAULT_SNAP_CONFIG.stepSize).Recommendations
context-menu-activefill plusoutline: 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 amenu-focusrow is darker thanbase-300, so the target looks less marked than the scroll-spy row. The 1px offset looks like the keyboard focus ring.msg-card-flashrow flash, and the Undo toast. They need no new token.Rows each ruling edits
design-system.md:416removed;:417loses the level-option clause and keeps the badge and grip ink; heading:407and file line:409drop the pickerdesign-system.md:415design-system.md:401,:282, and:205if the -2px offset is ruleddesign-system.md:281widens to "post-move landing";:414gains the release fade;:206andapps/webapp/CLAUDE.md§Motion System list--motion-flash-holdNotes
_entry.scssmotion: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.HMarzban commentedon Nov 4, 2026
Maintainer ruling, 2026-11-04
D7, D8 and D15 are still open.
HMarzban commentedon Nov 5, 2026
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.