Repository navigation
Task boxes T6b+T6c: natural widths, list slots, held lines and atoms - #81
Merged
Merged
Conversation
The parse fills Markdown::structure in its one pulldown-cmark pass: the items with their content start, the quotes, and the skipped lines, ATX headings now among them. cycle_tasks reads it instead of its own passes and marker grammar, offers - [ ] only where no item opens, reads such a line through the fallback pass, and parses nothing for a batch of flips. Markdown::task_at is the one task lookup; the app's hit test calls it, and Measured and TaskBox carry a TaskShape.
The fallback takes the innermost item of its one-line pass, as an opened line does, so a\n\t- - b under a new item nests its task again. Structure.items holds marker starts only: cmd-L reads the one content start it needs per line from the line's start, which keeps the column carry out of the parse. The spec follows, with every thematic break of - or * named, and its code locations rechecked.
A concealed task part takes its lead, then the box slot in the bullet's place: the advance of the bullet and its space, or the box where wider. A revealed one widens the gutter to its raw text, so its rows hang at the raw end. The X measure goes; Measured never reads Reveal.
parse.rs stood at 390 of its 400 lines, and the gutter flag T6c1 adds to Open would pass the limit (task boxes spec, slice 10).
scenes.rs stands at its line ceiling; the markdown-lists scene of T6c1 needs room beside them.
Room in scenes.rs, at its line ceiling, for the markdown-lists scene.
A gutter item's marker line gets an item part: one blank slot per column of the items holding it, one slot per mark, then the box. Bullets centre on the box's axis, numbers right-align in their list's width, and a revealed item part paints raw, right-aligned, as its own piece. pulldown-cmark's column counting decides each line's quotes, so a tab after a quote's blank still leads the next one (M1).
Between two marker lines the walk visits each held line and hides its blanks below the innermost item's hang column, so the line starts at the item's text. A blank line takes no item part unless a code block holds it. The code-block and quoted-task tests move from T6c1's interim values.
…name Items::numbers becomes list_keys and ItemPart::numbers keys, so numbers names only Marks' slot widths.
Blanks show nothing: revealing a held line's blanks only widened its part and moved its text each time a caret touched it.
CoreText reports no ascent or descent for a line with no glyph, so an empty item's mark painted half a row high.
The leaf text start replaces the span search and Out::text (D11), an item part with no mark has no conceal (D2, D3), a mark's baseline comes from the line's font metrics (D4); citations re-checked.
…no test could see it A paragraph after a code block in an item and a blank line in an HTML comment pin the leaf flag's end and the line-start record.
…etion takes it whole Markdown::snap finds the atom by one binary search over gutters; EditorState's moves and deletions take the host's snap, and EditorView snaps the selection after each new parse. ItemPart::marked is the one predicate both the item conceal and the atom read.
… the review's findings
…; a quoted lazy line is no atom
…s after the swap The review of 0227fbf: restore and a switch to another tab on the same note reset the selection to saved offsets no snap had seen, so a letter typed there landed before the hidden blanks. swap_view, the one sequence that resets the selection, now snaps against the bound buffer's parse before the pin re-parks it.
# Conflicts: # crates/app/src/editor/layout/line.rs # crates/app/src/editor/layout/prefix/gutter.rs # crates/app/src/editor/layout/tests.rs # crates/markdown/src/cycle.rs # crates/markdown/src/gutters.rs # crates/markdown/src/parse.rs # crates/markdown/src/structure.rs # docs/superpowers/specs/2026-11-16-task-boxes-design.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Task boxes T6b, T6c1 and T6c2, per
docs/superpowers/specs/2026-11-16-task-boxes-design.md. Follows #79 (T6a, merged); replaces #80, closed when its base branch was deleted. The merge commit 3ed04c8 takes main after #79's squash; its tree is identical to the verified head 0e0d2f2. T6b must not merge alone: with the real font,•is narrower than the box and text glues to it.What changed
Markdown::width_keys, one shared vector,ItemPart::keys).LeafTextrecords,items/walk.rs).Markdown::snap(offset, Bias)reachesinkra-editoras a closure, so the editor keeps no markdown dependency. The caret never rests inside an atom: after a move, after each parse, and when a saved selection comes back (swap_view). Backspace at a held line's text start joins the lines; on a quoted held line the atom covers the quote part (> - a\n> bjoins to> - ab).LineLayout::text_metricsplaces a mark on its line's baseline, including an empty item.How to verify
./scripts/check.sh(exit 0 on 0e0d2f2).cargo run -p inkra-app --features shot --example shot markdown-listsandmarkdown-lists-end, then look attarget/shots/.←,⌫at a held line's text start, clicks, a tab switch.git diff task-boxes-t6...: markdown 0 missed (2 expected walk timeouts), editor 0 missed, app misses only inshot/scenesbuilders.task-boxes-t6b(ee87f1a): parse +2.25% median over 12 rounds (accepted, spec History); layout −4% to −8%.Risk / rollback
⌥←,⌥⌫) do not exist yet; they must go through the same snap when built.- >```\n\t\t>gets no quote gutter on line 2, as on main.