Skip to content

Read the reading line inside holdPlace, and take readingAt out of the package API - #7002

Merged
max-sixty merged 7 commits into
mainfrom
agent-ab8e8f4ca215b2d07
Nov 24, 2026
Merged

max-sixty merged 7 commits into
mainfrom
agent-ab8e8f4ca215b2d07

Conversation

@max-sixty

@max-sixty max-sixty commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

One step of the package-interface redesign (step six, group one-hold). A module that folds what the reader reads now takes holdPlace(column, standIn), and Leaf reads the reading line and decides where the stand-in lands, as lf-dial did by hand with readingAt and its own list of blocks. readingAt leaves the package API (97 names to 96 on today's main); the runtime's node-level hold becomes holdPlaceOf.

The planned merge, one holdUser for focus and place, was built first (683216e) and did not hold, so holdFocus stays; the user-place.js header records why. Around a diff's redraw it held the reading line for a reader who focused nothing, whom browser/AGENTS.md leaves to anchoring, moved a line read higher in the window 100px, and took Expand all on 46 files from 0.7 s to 6.7 s of script.

To weigh: the runtime gains about 35 lines of code where lf-dial loses 10. Dial cases measure as on main in both engines; words a widget draws in its own shadow tree now find their stand-in on Skim, where main loses the place (the new journey case).

Ran: 64 of the hold-still journey's 160 cases, dial browser tests, pnpm run check, pre-commit, probes against origin/main in both engines, and a keystroke leaf-dev bench.

This was written by Claude Code on behalf of max-sixty

… package API

The trial of one hold for focus and place (the commit before this one) did not
hold, so this keeps the part that shares one rule. holdPlace(column, standIn)
now reads what stands at the reading line itself and picks what to hold, the
block there where its top shows, else its words, which lf-dial did by hand with
readingAt and its own list of blocks. The runtime keeps the node-level hold as
holdPlaceOf, and holdFocus stays as it was.
holdPlace now holds the words at the reading line and reads, once the change
has drawn, which box around them the change hid: the stand-in lands where the
outermost one began, or where the words stood if it began above the window.
That is the rule lf-dial applied to its own blocks, without a list of blocks
or a reading of display. The stand-in is asked of a node in the column's own
tree, so words a widget drew in its shadow tree find their stand-in too.
…node-level hold

A box with no box of its own, as one that is display: contents, counted as
hidden by the change and landed a stand-in at the window's top. holdPlaceOf's
stand-in had no caller left, so holdPlace alone carries it. The journey gains
the case of words a widget draws in its own tree, which main does not hold.
…ey case reads

A range's words can lose their box while every box around them still draws, as
when a change hides an element with no box of its own; the hold then read a
top of zero and scrolled the page by where the words had stood. The journey's
Skim change now checks the block its place reads is the one folded.
@max-sixty
max-sixty merged commit 097bee4 into main Nov 24, 2026
6 checks passed
@max-sixty
max-sixty deleted the agent-ab8e8f4ca215b2d07 branch November 24, 2026 11:45
max-sixty added a commit that referenced this pull request Nov 24, 2026
Brings in two main commits:

- #7001 (9fc720c): a widget's walk is said through an `lf-walk`
  event, and `beginWalk`, `listWalkPosition`, `labelOf` and `saying`
  leave the package API.
- #7002 (097bee4): the reading line is read inside `holdPlace`, which
  now takes a column; the old one-node hold is `holdPlaceOf`, and
  `readingAt` leaves the package API.

One conflict, in the imports of browser/runtime/floating-panel.js:

- This branch added `import { focusByKey, focusKey } from "./carry.js"`
  above the user-place import.
- #7002 renamed that import's `holdPlace` to `holdPlaceOf`.

The resolution keeps the carry.js import and main's
`import { focusPlace, holdPlaceOf, standsAt } from "./user-place.js"`.
main's other floating-panel changes merged cleanly: the press hold
calls `holdPlaceOf(node)`, and a tab's preview reads
`commandBindingsNow`. Nothing this branch adds or moves calls a name
main took out of the package API or the old one-node `holdPlace`.

check-api.js, runtime-globals.d.ts and module-scroll-and-motion.md
merged cleanly, with both sides' additions:

- check-api.js: main's `beginWalk` export and this branch's
  `anchoringIsReady`.
- runtime-globals.d.ts: main's `lf-walk` event and announce words, and
  this branch's `DocumentInputs` and `lfStorage` members.
- module-scroll-and-motion.md: main's `holdPlace(column, standIn)` and
  `{ words, rows }` text, and this branch's entry-state paragraph.

> _This was written by Claude Code on behalf of max-sixty_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants