Skip to content

fix: restore margin folds after reaction choices close - #2753

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-2750
Oct 13, 2026
Merged

leaf-agent merged 1 commit into
mainfrom
fix/issue-2750

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

Reaction mode now borrows a margin disclosure through the projection that owns it. The projection closes any thread preview before recording the prior fold, then returns a release operation that restores that fold only while reaction mode still owns it. This prevents an empty, expanded cluster after the temporary choices disappear and keeps a fold the user opened for themselves.

The two reported browser tests failed on main before this change and pass with it. The nearby reaction and panel browser checks pass, as does pnpm run test:runtime (406 tests).

Closes #2750 — automated triage

@leaf-agent
leaf-agent merged commit 90c2174 into main Oct 13, 2026
2 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-2750 branch October 13, 2026 12:43
leaf-agent added a commit that referenced this pull request Oct 13, 2026
The constrained margin scroll test prepends a 300 px scroller, then
assumes its new target is visible. In [main CI run
38392091985](https://github.com/max-sixty/leaf/actions/runs/38392091985),
browser scroll anchoring left the target and its correctly aligned
margin row at `top: -106`; the visibility assertion failed before the
test made its first inner scroll. This change brings the new target into
view after rendering, then checks the same margin alignment and
visibility through every scroll step.

The `sticky-ancestor` case failed on current `main` before the change.
After it, all three constrained-position cases passed locally (`uv run
pytest -q -n0
'tests/browser/test_render_margin.py::test_observed_scroll_retains_the_seat_of_a_constrained_target'`).
The run's other failures have separate repairs in #2748, #2749, #2752,
and #2753.

Co-authored-by: leaf-agent <[email protected]>
max-sixty added a commit that referenced this pull request Oct 14, 2026
…in pages (#2850)

`pnpm run check:browser` now type-checks `leaf.js`, the kernel's
`widgets/`, and every bundled package's `initial.js` and widget modules
under the same non-strict `checkJs` program #2803 added for the runtime.
Pages no longer carry `vendor/browser-runtime.d.ts`: the build stops
generating it, and a freshly vendored page (`leaf page init --package
diff --package playwright`) has no `.d.ts` file.

## How the framework's types reach the check now

The generated declaration file sat beside `vendor/browser-runtime.js` so
that tsc would prefer it over the compiled, type-blanked facade. Since
it lived in the layer's `vendor/`, `leaf page init` copied it into every
page. Instead:

- `build/browser/tsconfig.json` holds one `paths` map, which
`tsconfig.runtime.json` now `extends`. It resolves the rooted paths a
page serves, including each package's `vendor/` and `widgets/`, and maps
`/vendor/browser-runtime.js` to `index.ts`.
- `paths` applies only to non-relative specifiers, so the 39 runtime
modules (and `leaf.js`) that imported the facade as
`../vendor/browser-runtime.js` now import `/vendor/browser-runtime.js`.
That was already the convention: four runtime modules used it, and
`layer_import_map` says every layer module names its dependencies by
rooted path. The import map, export, kernel bundle and Node test hooks
all resolve it already, and a probe of `pr-walkthrough` boots with no
errors.
- A relative facade import would silently type against the blanked
facade, so the runtime's ESLint ownership rule
(`semanticStoreOwnershipRule`) now refuses one, with a test in
`build/browser/architecture.test.mjs`.
- The build's diagnostic filter drops diagnostics in each package's
`vendor/` as well as the layer's.

## What the wider check found

- **Dead wiring:** `leaf.js` passed `foldMarginEntryOptions` and
`unfoldedMarginEntries` to `createReactionController`, which stopped
reading them in #2753; the overlay no longer exports either, so both
were always `undefined`. Removed, with the stale field in
`tests/runtime/reactions.test.mjs`.
- **Wrong declarations, corrected at their owner:** `claimTraversals`
declared that a claim receives a string, but it receives the traversal's
`URL` (`lf-tabs` reads `url.hash`). `readDiffCoordinate` now declares
the coordinate it returns.
- `lf-trace` used `peer?.#bookmarks`. tsc refuses that as a grammar
error (TS18030), which stopped the whole program, so it now reads `peer
&& peer.#bookmarks`.
- Web Awesome's `wa-comparison` and `wa-radio` declarations join the
program, so `offer()` and `createElement` type those controls.

The rest are JSDoc casts and parameter types. I found no behavior bug.

## Checks

`pnpm run check:framework` (browser build check, including both type
programs, plus 110 Node tests) and `pnpm run test:runtime` (470 tests)
pass. Focused pytest on `test_unused_exports.py`,
`test_interact_document.py`, `test_interact_layer.py`,
`test_distribution.py` and `test_module_url_delivery.py` passes (440
tests), as does pre-commit, including ESLint over every runtime module.
An error injected into a package widget fails `check:browser`.

> _This was written by Claude Code on behalf of max-sixty_

---------

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.

Reaction choices leave a borrowed margin fold open and can disrupt focus

1 participant