Skip to content

Scope a page's stored state to its declared root, and read visual-part admission once - #1218

Merged
max-sixty merged 3 commits into
mainfrom
concept5-page-scope
Sep 26, 2026
Merged

max-sixty merged 3 commits into
mainfrom
concept5-page-scope

Conversation

@max-sixty

@max-sixty max-sixty commented Sep 26, 2026 •

Copy link
Copy Markdown
Owner

A nested page's live root and its version addresses now keep one set of drafts and tab
state. storage.js derived PAGE_SCOPE by stripping /versions/vN.html from the
pathname, so /ex/foo/ scoped to /ex/foo/ and /ex/foo/versions/v2.html to
/ex/foo: on every leaf.page example, a comment typed on the live page was gone on a
version address, against the contract in drafts.js. storage.js now reads the page
root the server declares in the canonical link it adds to every document, and exports
it as PAGE_ROOT; context.js's pageUrl resolves against that export instead of
querying the link itself. An interactive export has no server and no link, so its own
address stays its scope, as before. A root-served page still scopes to "", and
version.js's return to the live page now lands on /ex/foo/ directly instead of
through the redirect from /ex/foo. interaction-log.js still reads the canonical link
itself; another change is editing it, so it is the one remaining reader. A new site test
types a draft on a nested example's live root and finds it on versions/v1.html; it
fails on the old scope rule.

visual-parts.js now owns how an x-visual declaration admits part ids
(visualPartAdmission): the authored parts tokens, or any longer id a prefix begins.
anchor-resolution.js and the render gate's render-checks/widgets.js each parsed the
declaration themselves; both now call the shared reading, and visualPartProblems and
unrevealedVisualParts take the declaration rather than a pre-parsed token list and
predicate. The unfiltered readers in visual-parts.js are renamed registeredVisualParts,
registeredVisualPart, registeredVisualPartAt, registeredVisualPartLabel and
revealRegisteredVisualPart, so they no longer share names with the admitted readers
anchor-resolution.js exports. The gate reports the same problems as before.

reading-place.js's textBlocks reads each word's block through passages.js's
blockAt, so a reading landmark is chosen by the same block rule every passage reading
uses, including its Markdown-island rule. Option prose parsed as inline Markdown can now
serve as a landmark. capturePlace and restorePlace measure a place from the top of
landingBand(box) rather than rebuilding it from the box's border edge and its top
inset, the last such site after #1231; in a bordered reading region a landmark now sits
the border's width lower.

anchor_capture.py's docstrings named the runtime's section rule as closest("[id]")
and pointed at "wherever the capture lives"; they now name selectionAnchor in
composing/capture.js.

Keyboard dispatch's allowed closure in .dependency-cruiser.mjs gains storage.js,
which context.js now imports; it has no imports of its own.

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

🤖 Generated with Claude Code

…t admission once

A nested page's live root and its version addresses now keep one set of drafts and tab
state. `storage.js` derived `PAGE_SCOPE` by stripping `/versions/vN.html` from the
pathname, so `/ex/foo/` scoped to `/ex/foo/` and `/ex/foo/versions/v2.html` to
`/ex/foo`: on every leaf.page example, a comment typed on the live page was gone on a
version address, against the contract in `drafts.js`. `storage.js` now reads the page
root the server declares in the canonical link it adds to every document, and exports
it as `PAGE_ROOT`; `context.js`'s `pageUrl` resolves against that export instead of
querying the link itself. An interactive export has no server and no link, so its own
address stays its scope, as before. A root-served page still scopes to "", and
`version.js`'s return to the live page now lands on `/ex/foo/` directly instead of
through the redirect from `/ex/foo`. `interaction-log.js` still reads the canonical link
itself; another change is editing it, so it is the one remaining reader. A new site test
types a draft on a nested example's live root and finds it on `versions/v1.html`; it
fails on the old scope rule.

`visual-parts.js` now owns how an `x-visual` declaration admits part ids
(`visualPartAdmission`): the authored `parts` tokens, or any longer id a prefix begins.
`anchor-resolution.js` and the render gate's `render-checks/widgets.js` each parsed the
declaration themselves; both now call the shared reading, and `visualPartProblems` and
`unrevealedVisualParts` take the declaration rather than a pre-parsed token list and
predicate. The unfiltered readers in `visual-parts.js` are renamed `registeredVisualParts`,
`registeredVisualPart`, `registeredVisualPartAt`, `registeredVisualPartLabel` and
`revealRegisteredVisualPart`, so they no longer share names with the admitted readers
`anchor-resolution.js` exports. The gate reports the same problems as before.

`reading-place.js`'s `textBlocks` reads each word's block through `passages.js`'s
`blockAt`, so a reading landmark is chosen by the same block rule every passage reading
uses, including its Markdown-island rule. Option prose parsed as inline Markdown can now
serve as a landmark.

`anchor_capture.py`'s docstrings named the runtime's section rule as `closest("[id]")`
and pointed at "wherever the capture lives"; they now name `selectionAnchor` in
`composing/capture.js`.

Keyboard dispatch's allowed closure in `.dependency-cruiser.mjs` gains `storage.js`,
which `context.js` now imports; it has no imports of its own.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
leaf-agent previously approved these changes Sep 26, 2026
max-sixty added a commit that referenced this pull request Sep 26, 2026
…scope (#1231)

Five callers rebuilt the landing band from its top inset alone, and the
Ask view wrote `aria-keyshortcuts` beside the scope register's own
writer. This settles both from the concept survey, plus two small items.

**Landing band.** The page step (`d`/`u`, `navigation.js`), anchor
travel's centring and readable check (`anchor-travel.js`), an Ask
arrival's room and framing (`asks/view.js`) and lf-toc's visible window
now read `landingBand` whole (lf-toc reads both `landingInsets` edges,
since it works in scroll coordinates). `reading-place.js` still reads
the top inset only; it is left for open PR #1218.

The survey's inferred page-step gap does not reproduce: in Chrome at
1280×900 a `d` step moves 508px against a 790px landing band, so a line
just above the foot band lands about 340px down, nowhere near the
banner. The Ask arrival did have a real gap. A region that fit the
window below the banner could leave the ask's foot under the shortcut
bar, and the new test in `test_render_widgets.py` fails on the base with
the foot 28px into a 56px foot band.

**Ask shortcuts.** `projectCommandScope(control, projector, capability)`
now keeps projected scopes as a list per element, keyed by the
projecting owner (margin entries and the Ask view). The Ask projects a
run-less row naming the digit and the command's own bindings that still
reach the control. No row runs, so dispatch, the shortcut bar and the
command reference ignore it. `keyboard/scopes.js` is now the attribute's
only writer, and it paints the union of each scope's live bindings. The
save/restore in `asks/view.js` is gone.

**Also.** `askStep` steps within the list through `clampedRow`.
`passages.py` comments name the runtime's `passages.js` and
`collapse.js` instead of `leaf.js`, and drop the `restsOn` browser
function that no longer exists. The stale "wraps at both ends" comment
was already fixed on main by #1222.

Behaviour that moved:
- `d`/`u` step 60% of the landing band, about 34px less per step on a
desktop window.
- An Ask arrival's region has to fit above the foot band.
- Centred travel centres in the landing band. In the thread panel a
widget sits half the list's heading room lower.
- While the user stands in an Ask, a decision control's
`aria-keyshortcuts` keeps its own scope's bindings, which the Ask view
used to strip. Two scopes on one element that name the same press are
merged rather than refused, and tokens appear in scope order.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty and others added 2 commits September 26, 2026 11:12
capturePlace and restorePlace read landingBand(box).top instead of rebuilding
it from shownBox and landingInsets, the last such site after #1231.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 2ba311b into main Sep 26, 2026
5 checks passed
@max-sixty
max-sixty deleted the concept5-page-scope branch September 26, 2026 18:33
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