Skip to content

Give packages the runtime's arrow, fragment, press and write helpers - #2425

Merged
max-sixty merged 1 commit into
mainfrom
widgets-use-runtime-helpers
Oct 11, 2026
Merged

max-sixty merged 1 commit into
mainfrom
widgets-use-runtime-helpers

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Package widgets wrote their own copies of four runtime behaviors and missed cases (workstream #13 of the duplicate-logic sweep). The helper surface, widget-api.js, now carries each one, and every copy moves onto it.

  • rowArrows(node) (keyboard/bindings.js) returns the [back, ahead] arrows in the row's text direction. lf-tabs, lf-trace, lf-board, the reaction and response rows, margin entries and DISCLOSE use it. In right-to-left text the trace timeline's arrows now step the way its rail runs, a board card moves toward the column its arrow points at, and a disclosure opens with ←. No binding moves between core and widget scopes: every site already declared both arrows, and only which one means "back" changes.
  • lf-trace threw in right-to-left text: Vis names its background plane vis-vertical-rtl there, which the cursor-plane query missed.
  • fragmentTarget(hash) is exported. lf-tabs reads Back/Forward fragments with it, so an id inside a shadow tree or a malformed escape opens the panel the landing goes to. lf-activity links only destinations Leaf's arrival can reach, and names a section with elementById, as Threads does.
  • plainPress(event) (pointer.js) is the primary-button, no-modifier test that media, held-word, lf-shot and lf-call-diff each spelled out.
  • keeps is now in the initial producers' kit (prepaint.js, documented in packages.md). The activity and playground producers use it, as do presentation, banner, css-anchors and the aria-keyshortcuts painter.

The playground's copy button stays a native button, because its initial producer draws it before modules load. It now announces its result through the page's live region, as wa-copy-button does. Per-tab memory stays per widget: an x-views member, the activity view's saved reading and a settled group's open bit are different facts in tabStore.

Tests: a right-to-left trace steps with ← to a later point that lies to the left, and a playground copy is announced on success and on failure. Both fail without their fix.

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

Package widgets wrote their own copies of four runtime behaviors and missed
cases. The helper surface now carries each, and every copy moves onto it:

- rowArrows(node) (keyboard/bindings.js) returns the [back, ahead] arrows in
  the row's text direction. lf-tabs, lf-trace, lf-board, the reaction and
  response rows, margin entries and DISCLOSE use it. In right-to-left text the
  trace timeline's arrows now step the way its rail runs, a board card moves
  toward the column its arrow points at, and a disclosure opens with ←.
- lf-trace threw in right-to-left text: Vis names its background plane
  vis-vertical-rtl there, which the cursor-plane query missed.
- fragmentTarget(hash) is exported. lf-tabs reads Back/Forward fragments with
  it, so an id inside a shadow tree or a malformed escape opens the panel the
  landing goes to; lf-activity links only destinations Leaf's arrival can
  reach, and names a section by elementById as Threads does.
- plainPress(event) (pointer.js) is the primary-button, no-modifier test that
  media, held-word, lf-shot and lf-call-diff each spelled out.
- Initial producers receive keeps in their kit; activity's and the
  playground's producers use it, as do presentation, banner, css-anchors and
  the aria-keyshortcuts painter.

The playground's copy button stays a native button the initial producer draws,
and now announces its result through the page's live region, as wa-copy-button
does. Per-tab memory stays per widget: an x-views member, activity's reading
snapshot and a settled group's open bit are different facts in tabStore.

Tests: a right-to-left trace steps with ← to a later point that lies to the
left; a playground copy is announced on success and failure. Both fail without
their fix.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 3b5abf5 into main Oct 11, 2026
6 checks passed
@max-sixty
max-sixty deleted the widgets-use-runtime-helpers branch October 11, 2026 20:51
max-sixty added a commit that referenced this pull request Oct 11, 2026
Main (#2425) taught the Vis rail to run right to left in RTL text and its
arrows to follow it. The new time scale instead runs left to right in every
text direction, as a chart's time axis does (`direction: ltr` on the
timeline), and its step keys, plain and Shift, read their arrows from the
scale with `rowArrows`, so they follow it if that changes. The RTL test now
protects that: recording zero stands at the left in an RTL page, and →
steps later. It fails without the pin.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
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