Repository navigation
Rebuild defineWidget thin: leave focus, words and moves to Effect UI - #7542
Merged
Merged
Conversation
…Effect UI Not for landing as is: a measurement for the question whether defineWidget should hold the user's place itself. Three Codex reviews of the branch that rebuilt the adapter found new corner cases in each round, most of them in the adapter inferring from DOM mutations where the user was and what a draw did. The adapter no longer holds focus around a draw (holdFocus by data-lf-datum). Effect UI keeps focus, a field's words and its caret on every node a draw keeps, and moves a keyed node within its parent with moveBefore, so the hold did work only for a node a draw replaced: a row moved to another parent, or a row removed. Those now drop focus to the body, as a Lit widget's always did. lf-call-diff's FollowRow, which opened a folded root for the hold to land in, goes with it. What stays Leaf's, each without reading the DOM: - First props. The root mounts once the element has connected and the host has made its sets for this connection: after lf-connect where no host cancels it, else at the host's set of state, which element-integration now makes last in its pass, after the recorded properties. A host sets state again on each return (returned), keeping shown, so a returning widget mounts from fresh state and keeps unsent words in a recorded field. A state set before upgrade goes through the accessor. - declare sets every member Leaf reads off the element (DECLARED, the rule Max picked), climbing from the node's parent, so a Mount on a child widget's element declares for the parent; lf-draft and lf-options declare from a node their view drew. - A descendant's lf-connect moves the inputs' tracked signal, and a report reading told to wait follows the host's askedAgain signal, so a parent hears a new child's reports and a widget draws its reports once ready. Behaviour the tests now check differently: the shelf test asserts that a keyed item moved along its shelf keeps its node, focus and words (Effect UI's), and that a keep-alive item moved to another shelf keeps its node and words. Focus on an item moved to another shelf is no longer kept.
A reader who closed a root and pressed a key within the next frame found it open again (test_call_diff_projects_stable_commentable_rows, line 314). Chromium tells the page a details element folded with a toggle event about a frame after the press. A draw in that frame, here the one the location link's Command starts, writes the controlled open from a Model that hasn't heard the fold, which undoes it, and the toggle that follows reports open. An instrumented run showed the stale write at the next press, 17 ms after the click, with the toggle still unsent. The summary's press now sends ToggledGroup and prevents the browser's own fold, so the Model is the one writer of open and no frame stands between the press and the Model. A modified press keeps the browser's fold. The toggle handler stays for folds the browser makes itself, such as find in page. Making open an attribute instead kept the race out but had Effect UI rewrite an attribute that already stood, which write_watch refuses.
…own draws Main holds focus around each draw the adapter starts (holdFocus by data-lf-datum), and the prototype had dropped that, which left the user on the body when a new reading removed their row or moved it to another parent. The hold is back, without its guesses: - It lands on the datum itself, a stop lent where it is no control, rather than on the control in it with the same tag and classes, which picked the first of two alike buttons (Codex's R1#3). holdFocus takes `alike: false` for this. - It looks for the key among the widget's own datums (`owns`), so a nested widget's datum of the same key can't take the user, as it could on main. - It carries no words into a replacement node and reads no mutations. A draw the component's own message starts still has no hold, as on main: Effect UI gives no hook before its flush. Probed in Chromium and Firefox (the same in both): a row removed or moved by a set lands on its key or the nearest datum; a press whose own message removes or moves the row leaves the user on the body, as on main.
- The hold lands on the control at the user's control's place among those like it, in the item now carrying their key or the nearest one still drawn, and on the item where it has no control at that place. Main took the first alike control, which put a user on a second Remove on the first (R1#3). holdFocus does this for every caller, and `alike` goes. lf-call-diff's FollowRow comes back, so a call a new capture moves into a closed root opens it and keeps the user on its link (test_call_diff_keeps_the_user_on_a_row_a_new_capture_moves). - A fold that changes nothing leaves the Model as it stands, so the toggle that answers the Model's own write of open draws nothing (Codex #16: two passes over the capture per press, now one). - element-integration sets state first again, so a recorded property's setter reads the state it belongs to (Codex #17, lf-select), and gives each set its own attempt, so a setter that throws keeps no other set from the element. The first draw still has every set of the pass: an element whose lf-connect a host cancelled mounts at the end of the pass that sets its state, a microtask later, which the pass waits on through the mount's pending-task. - The readers of declared members follow a redeclare, as branch commit 32570de41e had them: thread placement asks the element for threadOutlets on each pass and registers or retires it on lf-layout; Copy places itself again on lf-layout; lf-draft declares lfCopy and lfBar. lfHold joins DECLARED, since Leaf reads it off an outlet, which may be the widget's element. Tests: the cancelled-lf-connect mount test now checks the mount waits for the pass and holds its later recorded property; the late-outlet browser test comes from 32570de41e.
…rol by its look Codex found three ways the hold's choice of a control by tag, classes and position put a keyboard user on the wrong action: a nested widget's Remove before their Edit, a disabled replacement that refused focus while the row went untried, and a same-class Remove inserted before Save. Each round had patched the same matching. The adapter's hold now lands on the user's own node where it survived the draw (Effect UI kept it, or it is a keep-alive child), else on the datum now carrying their key among the widget's own, else on the nearest one, on the datum itself (holdFocus, `alike: false`). A widget that keeps the user on their control across a move to another parent writes the row as a keep-alive child. holdFocus's other keyed callers (lf-diff's lines, the floating panel, the margin) keep main's pick, the first control like the user's, until each is checked: in lf-diff a user on a diff line whose new patch changes it would land on its gutter Comment, which comes first among the line's keyed nodes. - lf-call-diff: a call a new capture moves into another root lands the user on its row, as the test now says; writing the rows as keep-alive children would have kept them on the link at a cost of about 35 lines. - lfHold leaves DECLARED: Leaf reads it off the outlet a widget returns, which a defineWidget widget's view draws and sets with `.prop`. - Copy settles where it stands and the frame it wears together on each arrival and lf-layout: last in the widget's toolbar without data-lf-bar, or after its block with it.
…e browser The hold (Codex's third review of the thin adapter): - It puts the user on the datum it chose, never on the first control a boxless datum draws: focusDestination and holdOn take `itself`, and the adapter's hold passes it. A display: contents row with Remove before Edit sent the user to Remove; such a row takes no focus, so the hold goes on. - Where a datum takes no focus, it tries the next node its key marks, then the next key's: a disabled node before a focusable one of the same key sent the user to the next row. - lfHold returns to DECLARED, for a widget whose own element is the outlet, as the draft is; a child outlet's lfHold the view sets with `.prop`. - Copy treats a toolbar the renderer took out of the page as none, and stands after its block. The fold: root AGENTS.md has open disclosures belong to the browser until a gesture makes them part of the page's state, and the controlled `.open()` writes the Model's value on every draw, over a fold whose toggle hasn't arrived (a script's reveal, a summary press, find in page). lf-call-diff and lf-toc now write `open` as an attribute that doesn't change, so Effect UI writes it only as the disclosure arrives, and fold through the node: - lf-call-diff's Model hears each fold with toggle, for Expand all and Collapse all to read; their press folds every root from a Mount (`Folds`), which also opens the root a moved row lands in, as FollowRow did. The summary's press handler goes. - lf-toc's posture keeps the reader's choice in its Mount (FollowPosture), which opens the outline where the form hides its summary and restores the choice on return. Its Model loses open and exposed, and Toggled, Exposed and Returned go, with the story tests of that posture; the browser tests of the disclosure cover it. Probed in Chromium and Firefox: a script's open, or a summary's activation, followed in the same task by a draw, now stays open and the Model hears it. The header records each Effect UI gap with the idiom tried: no hook before a draw the component's own message starts (HtmlCommand.focus on a ref lands the user where the component says, and needs HtmlCommand, which the bundle doesn't export yet), the controlled open, and a kept child moved to another parent losing focus.
…s, as write_watch asks
Codex's fourth review of the thin adapter: - lf-call-diff kept the roots' folds in its Model as `toggle` reported them, a task late, and decided from that copy: a bulk press before the toggle closed the other root, and each toggle drew the whole capture again (28/180/648 root-label reads for a bulk fold of 4/12/24 roots, where the commit before made 12/36/72). The fold leaves the Model. One Mount, Folds, reads the roots' folds as Expand all or Collapse all is pressed, folds every root, and paints the control's face from the roots' folds on each toggle and each commit, with no draw; it also opens the root a moved row lands in. The update only announces the fold. - lf-toc read the host's authored open on every draw, so removing it closed a sidebar outline whose summary the form hides, to 0 px. The Model seeds it once, and FollowPosture reopens the outline after any fold from outside while the form holds it open, taking that fold as the reader's choice for flow. - The adapter's hold ends on the widget's own element, with a stop lent, where no datum takes focus, rather than on the body. - The hold looks for the user's own node before it searches the items, so a draw that keeps their control costs one scan of the datums, not two. - A datum whose shadow root delegates focus still hands the hold's focus to its first control, open root or closed; the header states it.
Codex's fifth review of the thin adapter: - Several holds can lose the same focus, as a nested widget's and the one around it do when one task redraws both. The inner hold put the user on its replacement Edit, and the outer hold, which counted no restore as a placement, then moved them to its host. A hold that puts the user back now counts as a placement to every other hold (holdOn), so the first restore ends the others, whatever stand-in they would try next. A runtime test covers the nested case. - lf-call-diff's bulk press already paints the control's face; the toggles it sets off read nothing now. A root's fold can only turn the face to Expand all, and its opening only back from it, so a toggle that can't do either is passed by (Codex: 6/14/26 root queries for one press on 4/12/24 roots). - lf-toc reads the outline's fold as the form shows its summary again, so a fold from outside whose toggle hasn't arrived is the reader's choice too (a script close and a narrowing in one frame reopened it, 402 px).
…t fallback The counting from the last commit made a hold's landing a placement to every other hold, and with the host fallback the outcome turned on which widget's hold ran first: an outer hold that refocused the old Edit, or took focus to its host, cancelled the inner hold that could reach the replacement Edit. A hold now puts the user back only while their focus is lost, on the body or on a node no longer drawn (holdOn, holdFocus). Focus that stands on a drawn node, where another hold or the user put it, stays. A hold's own landing is no placement again, and the yield to a newer placement stays. The adapter's host fallback goes, so where no datum takes focus, as where every row is boxless, the user lands on the body; the header states it. Probed in Chromium and Firefox: with the outer widget's move of a kept inner widget first, the inner hold reaches the replacement Edit; an outer redraw leaves the user on the inner replacement; a user who moves elsewhere in the task stays there. With the inner draw first and the outer move second, the user lands on the body, which main reaches the replacement for: the outer hold searches only its own datums, and the replacement is the inner's.
The ordering cases came from each hold having its own idea of where the user belongs: an outer widget's hold searched only its own datums (`owns`), so when its move lost focus after the nested widget's hold had restored it, it couldn't find the nested replacement. holdFocus now takes `ownerOf`, the widget that drew an item, in place of `owns`. The place it looks up is the user's key under the widget that drew their datum, the same for every hold that lost that focus; where that widget has left the page, the datum around the user that the nearest widget still standing drew; failing both, the user's key among every item under the scope. A caller that names no owner looks among every item under the scope, as before. Probed in Chromium and Firefox: all four orderings of a kept nested widget moved while its own draw replaces the user's Edit land on the replacement; an outer row sharing a key with a nested datum keeps the user in the outer; a nested widget drawn anew elsewhere puts the user on its datum with their key, or on the outer row around it where there is one.
holdFocus promises the user is never left on the body because their row left the list, and a removal that emptied the list left them there. The shared destination now ends on the element of the widget that drew the user's datum, with a stop lent: their key there, then the nearest datum, then the widget. Every hold that lost the same focus computes the same widget, so this fallback can't take focus from a nested hold that would reach an exact replacement: the nested widget's commit and its restore run back to back. Probed in Chromium and Firefox: a removal that empties the list lands on the widget; with a kept nested widget that the outer moves while its own draw empties its rows, in either order, the user lands on the nested widget; the orderings where the nested draw replaces Edit still reach the replacement. A boxless row, which takes no focus, now leaves the user on the widget too.
…owner levels The owner levels (a504bad) carried a per-level lookup for one ordering: a nested widget's draw first, then the outer widget moving the kept nested widget in the same flush. A smaller rule covers it. holdOn tries the user's latest location before the place it held, where that stands again: where a nested hold put the user back and the outer move then took the node out and put it back, every hold that lost the same focus lands there, whatever the order, with no owner logic. holdFocus takes `owns` again, and the fallback for an emptied list is the holder's own element, with a stop lent. Probed in Chromium and Firefox: all six orderings of the kept nested widget land as with the owner levels; a key an outer row shares with a nested datum keeps the user in the outer; the probe table, an emptied list included, is unchanged. One rare case differs: a nested widget drawn anew elsewhere, with no outer row around it, leaves the user on the body, where the owner levels found the new widget's datum.
The adapter is the only caller of holdFocus with `alike: false`, so the fallback to the widget's element belongs to it: #redraws passes the element as the last stand-in, keyed hold or plain, and holdFocus loses the scope it added for an emptied list. The plain path, where the user's node stood in none of the widget's datums, as when the outer widget draws a nested one anew elsewhere, now lands on the outer widget rather than the body. Probed in Chromium and Firefox: a nested widget drawn anew elsewhere, with no outer row, lands on the outer widget; an emptied list lands on the widget; the six orderings of a kept nested widget land as before, with no outer restore taking focus ahead of the nested widget's.
The effect-widget.ts header's limits now say what a user gets where a widget's own draw hides their node and a nested widget's later draw in the same pass draws it anew: the outer hold runs first and leaves them on the outer widget or its row, one Tab from their control. Landing them on it would take holds that restore after every draw of the pass, innermost first, a queue a rare path doesn't pay for. The two comment lines the last rounds left long are reflowed, and oxfmt and eslint now pass on every file the branch changes: oxfmt's layout of earlier changes, and a test that reached a row's control through optional chaining eslint refuses.
… parent The thin adapter keys a held row within one parent, as Effect UI does, so only the widget knows that a row in its new parent is the old one. The root guidance's sentence on promises Leaf keeps for every widget gains that exception: the widget writes such a row as a keep-alive child. Max approved these words on the Effect UI direction review page (28 Nov 2026).
leaf-agent
reviewed
Nov 28, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
The new rule that a hold restores only while focus is lost lives in holdOn, so it changes every hold in the runtime, not just the widget hold this PR is about. That rule now contradicts the closing-layer hand-back contract in focus.ts; details inline.
Tend's review found that holdOn's new rules, restore only while focus is lost and try the last location first, reached every hold. After a closing layer handed the user back to its opener, which is drawn, a hold still waiting on the render that closed it gave up, so a user in a popover strip a render replaced stayed on the opener rather than landing in the new strip. That broke the hand-back contract the placements count keeps. Both rules now apply to a widget's hold (holdFocus with alike: false) only, where they settle the order of a widget's hold and the one around it; holdFocus already checks a lost focus first, so holdOn drops its own check. Other holds are as on main. A runtime test holds a place across a dialog's hand-back and a redraw: it failed on the previous head (restore returned false) and passes now.
leaf-agent
approved these changes
Nov 28, 2026
max-sixty
added a commit
that referenced
this pull request
Nov 28, 2026
… component (#7544) The shipped references now teach one way to write a widget: its declaration, plus, if it draws, an Effect UI component that `defineWidget` defines. `module-plain-elements.md` becomes `module-widgets.md`, which describes the element protocol as what the adapter does for the component, and the other module references drop their Lit and plain-element routes. The starter `leaf package init --widget` writes is now such a component. The eval suite grades the form a fresh agent writes: a new case, `widget-written-as-a-component`, is graded by `dev/leaf_dev/widget_form.py`, which parses the module the page runs, and the rubrics whose expected form changed accept `declare` and a keyed move. The grader and `resource_urls` build their parsers from one grammar, `javascript_language`. Rescored against main, the references lead on 7 of 10 cases and tie on 3. Fresh agents wrote a `defineWidget` component in 3 of 3 runs, against 0 of 3 on main. On keeping focus in a list, 1 of 2 graded runs passed, against 0 of 4. `leaf-dev interface` adds no name. Its protocol count drops from 78 to 77, since the index no longer lists `redraw()`, which a component never defines. `--base` can't read this branch's base, which has no `module-widgets.md`, so compare runs on each tree. Max set the destination, every widget an Effect UI component, on the Effect UI review page and in #7478. This follows #7542, the adapter it describes, and Codex reviewed it. `pnpm run test:runtime` (1240), the grader, interface and reference tests, and the starter's browser test pass. > _This was written by Claude Code on behalf of max-sixty_
max-sixty
added a commit
that referenced
this pull request
Nov 28, 2026
…7545) Leaf stops patching Effect UI. `build/@effect__ui.patch` (#7515, #7522) held one guard: the host skipped writing a `details`' controlled `open` while the user's `toggle` for it was still queued. Since #7542 no view controls `open`. `lf-call-diff` and `lf-toc` seed it with an attribute the view never changes, and `lf-worktree` writes an attribute only when its host's authored `open` changes. Effect UI writes an attribute only when the drawn value changes and never restores one, so the guard ran for no node. The rebuilt `browser/vendor/effect-ui.js` is byte-identical to the bundle before #7515. The race lives in the controlled idiom itself. The browser reports a fold with `toggle` a task after making it, and a draw or restore in that gap undoes the fold, even where the Model follows `toggle`. So a widget leaves a fold to the browser, and `effect-widget.ts`'s list of Effect UI's limits now says why. Max asked to avoid the patch ("it's much more likely we misunderstood something rather than the upstream needs patching"). The two race tests from #7515 and #7522 keep their assertions and pass on the unpatched bundle, 12 of 12 copies each under load; with the views from before #7542 put back, they fail. The `lf-call-diff`, `lf-toc` and `lf-worktree` browser tests, `pnpm run test:runtime` (1240) and `pnpm run check:browser` pass. > _This was written by Claude Code on behalf of max-sixty_
This was referenced Nov 28, 2026
max-sixty
pushed a commit
that referenced
this pull request
Nov 28, 2026
…edCallback (#7557) A widget the host answers waits to mount until Leaf has set its `state` for the connection (`#fresh` in `effect-widget.ts`). #7542 had `connectedCallback` clear that flag before it dispatched `lf-connect`. But a subtree inserted at once is connected before any of its callbacks run, and a callback earlier in tree order can have the host set this element's `state` first. The host then makes no other set, so the root never mounts. That is what happens to the quoted `lf-options` in a thread reply. It mounts, leaves the page long enough for its root to close, and comes back with `state` set before its `connectedCallback` runs. From then on its shadow root holds only its styles and no `<slot>`, so its options have no box. A user saw the reply's quoted exhibit blank, and the test's click on `#rp-memory` (an option in that exhibit) timed out. `#fresh` now records a `state` set made while the element stands in the document. It clears on disconnect, and after the constructor replays a property the page set before the upgrade, so that replay still doesn't count as Leaf's set. `connectedCallback` no longer clears it. `tests/browser/test_render_options.py::test_a_sample_in_a_reply_is_quoted_there_too` fails on main (`3eb3c6b1c`) after its 120 s click timeout and passes with this change in 9 s. Also run: `pnpm run test:runtime` (1244 pass) and 16 focused browser tests on replies, samples, threads and redraws in `test_render_options.py` and `test_render_drawing.py`. The runtime suite has no test of this ordering because happy-dom connects each inserted node only as its own callback's turn comes, so it can't express this gap. The browser test is the reproduction. Closes #7556 — automated triage Co-authored-by: leaf-agent <[email protected]>
max-sixty
pushed a commit
that referenced
this pull request
Nov 28, 2026
…diff keeps its comment controls on return (#7558) Since #7542 the host sets `state` again when an element returns to the page (`returned` in `host/element-integration.ts`), which `defineWidget` needs to mount again. On a LeafElement such as `lf-diff`, that set starts a Lit update before the arrivals batch re-registers the widget's thread surface. The update reads no opener, so `reconcileEntryComments` removes each file's Comment control and turns each line's comment gutter back into a plain number; the registration then puts them back. The write watch reports that as `unchanged write: children of div.lf-diff-file-actions` and `div.lf-diff-line`, which fails `test_a_patch_resumes_preparation_on_return_and_keeps_its_finished_rows[inline]` and `[bound]` at teardown. The thread-surface watch (`records/thread/surfaces.ts`) now also offers a widget through its arrival watch as the widget says `lf-connect`. The host's sets for the connection run in the same dispatch, but the draw they start runs only once the event returns (Lit's update is a microtask, and `defineWidget` mounts after its dispatch), so that draw already reads the opener. The `lf-connect` offer goes through the same arrival watch and departure still unregisters, so a move within one batch still keeps the registration. #7542 meant the return to set `state` again, and that set still happens. A user who tabbed to a file's Comment control no longer loses it when the diff leaves and comes back; nothing else on screen changes. I chose this over making `lf-diff` ignore a missing opener, since any widget that reads `threadSurface(owner).open` in a draw started on return would hit the same gap. It adds one document listener to the thread-surface owner. Verification: - Both parametrizations error on `main` and pass on this branch (`2 passed, 2 errors` → `2 passed`). - Reverting `returned = true` alone also made them pass, which confirms the trigger. Logging the order showed the return's `state` set, then an update with no opener, then the registration. - `pnpm run test:runtime` (1244) passes, and so do `tests/browser/startup/test_thread_surfaces.py`, `tests/browser/threads/test_seated_threads.py`, and the comment, return and thread tests in `test_render_diff_controls.py` and `test_leaf_element.py` (80 in all). - `pnpm run check:browser` passes. Closes #7555 — automated triage --------- Co-authored-by: leaf-agent <[email protected]>
max-sixty
pushed a commit
that referenced
this pull request
Nov 29, 2026
#7602) Tonight's nightly review of the last day's commits and a survey of existing files turned up text that now describes code that has moved or changed, plus two exports nothing imports. This PR corrects them. Nothing it touches changes behavior. `pnpm run check` and pre-commit pass on the branch. - **README:** the Claude Code band line now lists how much waits on the user with the first item's name, the agent's status and the unread threads, with a `more` button for On Me. #7560 dropped the open-threads count the README still described, and #7566 added the button. - **`docs/website.html`:** #7582 runs the plugin's hooks in the hosted Codex, so a message sent during a turn now reaches that turn, as the header of `worker/leaf_website/__init__.py` says. The page still said it waits for the turn to end. - **`packages/detail/defaults.css`, `browser/runtime/readings/user-place.ts`:** these now point at `dial.js`. Since #7591, `dial.js` holds the dial's layout, motion and `holdPlace`, and `lf-dial.js` only registers the widget. - **`lf-toc`:** it no longer exports `Toc` and `TocMessage`. Their only importer outside the module was the story test that #7542 deleted. - **Eval headers and `notes/agent-usability-evals.md`:** `needs_browser` is now cited at `source/browser_judged.py` (#7253), not `render_gate/page_code.py`. authoring-evidence.md's chart line is now named by its subject, since that line no longer names `lf-chart`. - **Small cleanups:** - `src/leaf/commands/hooks.py` had the same `TYPE_CHECKING` import twice in a row; one is removed. - The docstring of `tests/browser/test_render_drafts.py` now says what its one test protects. - The header of `render-checks/scrollbars.js` no longer carries a timing, which belongs in a commit message. Co-authored-by: leaf-agent <[email protected]>
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.
defineWidgetstops guessing. It no longer infers from DOM mutations when a component has drawn, or which node in a new parent is the row the user was on. Effect UI already keeps focus, typed words and the caret on every node a draw keeps. Where a draw Leaf starts replaces the user's row, the adapter's hold (holdFocus, keyed bydata-lf-datumas on main) puts the user on the row now carrying that key, or its nearest neighbour, on the row itself rather than on a control picked by its look. Where nothing it knows stands, as when a removal empties the list, the user lands on the widget's element. The adapter's hold restores only while focus is lost and tries where the user last stood first, so a nested widget and its parent put the user in the same place; other holds are as on main.Also in this change:
declaresets every member Leaf reads off a widget's element (DECLAREDineffect-widget.ts).lf-call-diffandlf-tocleave a fold'sopento the browser, so it stays where the user or a reveal left it.AGENTS.mdnames the one case a widget keeps itself: a row it moves to another parent, written as a keep-alive child.effect-widget.ts's header lists the limits, among them a parent's draw hiding a node that a nested widget's draw then restores, which lands the user on the parent, one Tab away.Max picked this rebuild on the Effect UI review page, with the
AGENTS.mdwords; Codex reviewed it over seven rounds.pnpm run test:runtime(1240) and 13 focused browser tests pass. #7484 (lf-code's port) adapts tolfElementsForinDECLAREDif it lands second.