Skip to content

Drop the dead origin option from a thread surface's open() - #2579

Merged
max-sixty merged 2 commits into
mainfrom
drop-thread-open-origin
Oct 12, 2026
Merged

max-sixty merged 2 commits into
mainfrom
drop-thread-open-origin

Conversation

@max-sixty

@max-sixty max-sixty commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

A widget's thread surface open(node, { origin }) passed origin to the composition surface, whose open forwards to commentOnTarget and reads only its first argument. #2020 (b11e278) removed origin there on purpose, so Escape resolves the same structural parent for every route into a comment. This deletes what that left behind: the option on the registration's open() and on the threadSurface(owner) wrapper #2571 added, lf-diff's two { origin: ... } arguments, the module-authoring sentence promising Escape returns to that control, and the {origin} that #2571 wrote into the surfaces.js header and the x-thread-surface registry entry (with docs/registry.html, which leaf-dev keydocs derives from it). Module-authoring now states the contract that holds instead: Escape from a datum's draft returns focus to the datum element when it can take focus, otherwise to the page.

Lit follow-up review item 76 (the review's own numbering, not a GitHub issue):

  • Behaviour changed: none. A probe on pr-walkthrough (click a file's comment button, press Escape) lands on the .lf-diff-file element on both the merge base and this branch.
  • Hand-written source line delta: +6 / −7 (surfaces.js +4/−5, lf-diff.js +2/−2), net −1.
  • Test line delta: 0.

Ran: test_render_diff_controls.py, the inline-diff comment test in test_render_widgets.py, the two diff thread tests in test_render_threads.py, the data-bound diff aim test in test_render_anchors.py, the panel-cover navigation test, the registry/keydocs product tests, and tests/runtime/thread-surfaces.test.mjs.

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

`placeThreads(...).open(node, { origin })` passed `origin` to the
composition surface's `open`, which forwards to `commentOnTarget` and
reads only its first argument. #2020 removed `origin` there on purpose so
Escape resolves the same structural parent for every route into a comment.
The option, lf-diff's two `{ origin: ... }` arguments and module-authoring's
sentence promising Escape returns to that control were all left behind.

No behaviour changes: Escape from a widget datum's draft still returns
focus to the datum element when it can take focus, otherwise to the page
(probed on pr-walkthrough's file comment, base and worktree alike).
module-authoring now states that contract instead.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
leaf-agent previously approved these changes Oct 12, 2026
# Conflicts:
#	skills/leaf/packages/diff/widgets/lf-diff.js
#	skills/leaf/references/module-authoring.md
@max-sixty
max-sixty merged commit 845ed7f into main Oct 12, 2026
3 checks passed
@max-sixty
max-sixty deleted the drop-thread-open-origin branch October 12, 2026 12:01
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