Repository navigation
Fix savedAt after #6413, and add a chart's point to the card placement gallery - #6420
Merged
Merged
Conversation
… traced by the part
A thread on one part of a picture, such as an lf-chart point or an lf-diagram
node, now has a margin entry of its own instead of joining the picture's. The
entry is named by the label the part registers, as the comment box names it
("Thread, chart · week 3, sessions 8,412"), and so is its Page Map group.
It stands level with its part, as a pointed row stands level with its row, and
its thread card opens beside the part. Hovering or focusing the entry traces the
part, on the surface its visual registers, rather than the whole picture. A part
the picture hasn't drawn yet, as in a shut tab, keeps its own entry and name,
stands at the picture's top and traces the picture. A comment the user put away
unsent on a part does the same.
Resolving a part's anchor now carries the part's label with its element and
surface (`resolvedElement`'s `label`), so the margin names a part from the same
lookup that placed it rather than searching the visual's parts again for each
thread on every collection. The inventory builds a part's row with the
pointed-row grouping: the part's id keys the row, the part's element is the
row's point, and `entryPart` gives the part and its surface for the rows whose
point is what the thread is about. A pointed row's point says only where its
comment stands, so hovering it still traces its whole target.
Anchor placement now places each saved comment draft as it places a thread,
and the inventory reads it there (`savedAt`) instead of keeping its own cache
of draft placements per page reading. A draft is then placed again whenever a
thread would be, and its moves count in the placement version. With the cache,
a draft's entry on a chart point traced the whole chart after the chart drew
itself again for a narrower box, until something else refreshed the margin.
The margin's ResizeObserver no longer watches boxes inside a picture (a tag
that declares `visual`), only the picture's box and the boxes around it. A
part's row stands level with a box the picture draws, and lf-chart draws afresh
inside a size delivery, so watching that box raised "ResizeObserver loop
completed with undelivered notifications" when the window narrowed, which
test_a_comment_on_a_chart_s_point_stays_on_its_datum caught. A picture reports
its parts' moves through its registration's `update()`, which runs a margin
pass. The same rule now covers a contribution registered on a part element.
Behavior changes in tests: test_a_comment_on_a_chart_s_point_stays_on_its_datum
now presses the week 3 point's entry, since the chart has an entry per point.
New runtime tests resolve part anchors as placement does and check that two
parts of one picture, a part it hasn't drawn and a saved draft on a part each
stand an entry named by the part, and that `entryPart` gives a part's own
surface and nothing for a pointed row. The seeded placement test now holds a
saved draft's placement to a fresh resolution after every change too, and new
ones check that a saved draft on a part follows the part once it is drawn and
that placement's hearers never hear a saved draft as a thread. New
browser tests check that hovering a chart point's entry rings that point and a
diagram node's entry traces that node, and that a draft put away on a chart's
point still traces it after the chart draws again. Codex reviewed the change
three times; each later pass checked the fixes for the one before.
Worth weighing:
- Entries stand level with their parts, and so do their cards. On a picture
wider than the column the entries are pins at the picture's right edge, so
two nodes on one line of a left-to-right diagram stack there, and which is
which shows only on hover, focus or in Page Map.
- The trace's grey ink on a diagram node's contour is quieter than the brackets
it drew round the whole picture.
- A chart orders its point rings by when each was first asked for, so two
commented dots read in the order their comments were placed rather than by
their data.
> _This was written by Claude Code on behalf of max-sixty_
# Conflicts: # browser/runtime/anchor-placement.js # browser/runtime/annotation-inventory.js # tests/runtime/anchor-placement.test.mjs
…ate() moves them The visual-parts reference now says label(id) names a part in its margin entry and Page Map as well as Threads, and that the margin learns a part moved inside its visual only from update(), since the margin no longer watches boxes the visual draws. Two inventory comments follow the code: the pointed-row record names its surface, not a part. > _This was written by Claude Code on behalf of max-sixty_
`leaf-dev placement cards` could put a thread only on a block or on quoted words, so no case showed where a card opens for a thread on one part of a picture, which #6417 gave a margin entry and a card of its own. A case now takes `visual`, the part as an anchor names it, and the fixture holds a chart of dots after the wide table. The new `chart-point` case puts a question on week 3's dot. Each capture now outlines what the card keeps clear of, the resolved element where the target names one and else the block, so a part's case outlines the point rather than the whole chart. Block and passage cases outline the same boxes as before. Run on main after #6417, the card stands beside the point on the right in the 1728 and 1440 windows; in the 1000×700 window it stands above the point, clear of it, over the chart's upper half.
#6413 and #6417 landed on main 15 seconds apart. #6417's `savedAt` called `placement()` and `reads(placement)`, which #6413 had replaced with versions its readings check, so on main `savedAt` throws a ReferenceError whenever the margin reads a saved comment draft, and the browser type check and three anchor-placement runtime tests fail. `savedAt` now settles and reads placement's version as `placedAt` does, and the merge of main into this branch no longer leaves it written twice.
This was referenced Nov 18, 2026
leaf-agent
approved these changes
Nov 18, 2026
max-sixty
added a commit
that referenced
this pull request
Nov 18, 2026
…6424) A picked option now stands on a neutral grey, the card mixed 18% toward the settled colour, instead of the chips' beige ground it took after #6098. On the reading theme that beige has three times the paper's chroma (OKLCH 0.937 / 0.017 against the card's 0.997 / 0.005), so across a whole card it reads as khaki, and as olive under the pointer right after the click. It also sat level with the pointer's grey wash, so a picked card differed from a hovered one only in hue, and a plain chip on the picked card lost its ground. Just picked, pointer still on the card, before → after (light, then dark): <img src="https://gist.githubusercontent.com/max-sixty/d9a0a9cafabfb36461ed5e4de524ecdc/raw/1cb714e936ce0b393496951be6aa04fa1a9e785b/picked-light-before.png" width="380"> <img src="https://gist.githubusercontent.com/max-sixty/d9a0a9cafabfb36461ed5e4de524ecdc/raw/1cb714e936ce0b393496951be6aa04fa1a9e785b/picked-light-after.png" width="380"> <img src="https://gist.githubusercontent.com/max-sixty/d9a0a9cafabfb36461ed5e4de524ecdc/raw/1cb714e936ce0b393496951be6aa04fa1a9e785b/picked-dark-before.png" width="380"> <img src="https://gist.githubusercontent.com/max-sixty/d9a0a9cafabfb36461ed5e4de524ecdc/raw/1cb714e936ce0b393496951be6aa04fa1a9e785b/picked-dark-after.png" width="380"> Worth weighing: the fill stays, rather than a ring alone, because with the keyboard on a group the blue focus ring covers the pick's ring and a digit replaces its check, so the fill is the only thing left saying which card is picked. The grey is a step deeper than the pointer's wash for that reason, which makes the picked card under the pointer the heaviest block on the page. An opened settled group now washes a hovered option in the same grey as a live one, and a picked card standing alone takes the picked ground too, so the pick is never the one card without a fill. The settled tint stays on answers, Done and the thread summary region (#6379). Max asked whether the brownish pick was intended; it came from reusing the chip token. The grey follows his lean away from it and is his to reverse. Tests: the picked-cell ring test now measures the ring against the cell's own ground, and still fails with the ring removed; `leaf-dev stills` shows only option picks and the settled hover changing. The `test` job's browser type check fails on the undefined `placement` and `reads` in `browser/runtime/anchor-placement.js`, inherited from main, which #6420 and #6422 fix. > _This was written by Claude Code on behalf of max-sixty_
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.
Main is broken until this lands. #6413 and #6417 merged 15 seconds apart, and #6417's
savedAtstill calledplacement()andreads(), which #6413 had removed. On main,savedAtthrows a ReferenceError whenever the margin reads a saved comment draft, and the browser type check and three tests inanchor-placement.test.mjsfail.savedAtnow reads placement asplacedAtdoes; those tests fail on main's file and pass here.leaf-dev placement cardsnow has a case for a thread on one point of a chart. Since #6417 a thread on a part of a picture has its own margin entry and its card opens beside that part, but the gallery could only put a thread on a block or on quoted words. A case now takesvisual, the part as an anchor names it, and the fixture page gains a chart of dots below its wide table. Each capture outlines what the card keeps clear of: the resolved element where the target names one, and the block otherwise. A part's capture therefore outlines the point rather than the whole chart, and every other case outlines the same box as before.In the 1000×700 window the card stands above the point and clear of it, but it covers the chart's upper half, including the week 4 and week 5 dots. It keeps clear of the part alone, as
comment-placement.jshas a card on a pointed table row keep clear of that row rather than the table.The gallery case was a follow-up the user asked for once #6417 landed. Tests:
check:browser, the anchor-placement, annotation-inventory and kept runtime tests, anduv run leaf-dev placement cards --case chart-point --case wordsin Chromium, where thewordscase reads as before.