Skip to content

fix: match the floating comment scrollbar to its sent thread - #4686

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-4288-scrollbar
Oct 29, 2026
Merged

leaf-agent merged 1 commit into
mainfrom
fix/issue-4288-scrollbar

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

The floating comment editor now shares its sent transcript’s thin, pale scrollbar, without reserving a scrollbar gutter. This changes the overflowing draft in both light and dark mode; short drafts and the sent transcript retain their existing treatment.

Added scrolling-draft states to leaf-dev stills and stopped that command from hiding native scrollbars at launch. The previous captures concealed the reported defect even when the editor overflowed.

Validation: a browser probe’s scrollbarWidth == 'thin' assertion failed before the change (auto) and passes afterward, with scrollbarGutter == 'auto'. All 697 runtime tests pass, Ruff passes, and the light/dark before-and-after captures were inspected. Reproduce the captures with uv run leaf-dev stills HEAD^ --state triage-composer-scrolling --state triage-composer-scrolling-dark.

Screenshot delivery is blocked: publishing the captured pairs to max-sixty/leaf-assets returned HTTP 403, “Permission … denied to leaf-agent.” The bot needs write access there to attach durable visual evidence; no screenshots were committed to this repository.

This is a partial repair. The height limit comes from the screenshot’s capture reading region; choosing whether comments may grow outside that boundary remains open. The current gallery reproduction did not reproduce the previously measured horizontal overflow after Send (transcript client and scroll widths both 306 px).

Refs #4288 — automated triage

The editor used the platform default scrollbar while its sent transcript used a thin, pale thumb. Share the existing treatment across both floating surfaces without reserving a gutter.

Refs #4288
@leaf-agent
leaf-agent merged commit a2befc2 into main Oct 29, 2026
5 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-4288-scrollbar branch October 29, 2026 10:07
max-sixty added a commit that referenced this pull request Oct 30, 2026
…ate capture as a Generator

#4686 launched stills' browser with ignore_default_args, which the test's
headless_shell stand-in refused, so all three stills tests failed on main.
ty (#4647) asks a @contextmanager to return Generator.
max-sixty added a commit that referenced this pull request Oct 30, 2026
…ev stills (#4713)

`leaf-dev stills` now says which rule is behind each computed-style
difference it reports. Under the grouped differences in `styles.txt`, it
takes each group's first element and lists the declarations that match
it in only one arm, or in a different order, each labelled with its
sheet, `@layer`, `@scope` and selector. The declarations come from
Chrome's DevTools protocol (`CSS.getMatchedStylesForNode`). Two of the
sessions surveyed for #4648 wrote this lookup by hand to find a cause.

## What it shows

Replayed against #4637's base (`leaf-dev stills ae2e3f3 --state
on-me`, about 2 minutes), it names both causes that session found by
hand:

```
html
    + theme.css @layer lf-base :where(:root) { color: revert; }
    + theme.css @layer lf-base :where(:root) { font-family: revert; }
…lf-options#ar-3ds-choice > form.lf-another.lf-ui
    + theme.css @layer lf-base lf-options:has(> lf-option > strong) > .lf-another { font: inherit; }
```

It also names a later commit's `:nth-child(1 of :not(.lf-ui,
[data-lf-gen])) { margin-block-start: 0 }` behind a paragraph's margin
change. Where an element's declarations match on both arms, such as the
hidden-widget noise, it says `none: it inherits the difference or reads
it from a custom property`. A separate probe read an element inside
lf-diff's shadow tree on pr-walkthrough, which is where the `.lf-ui`
reorder regression appeared.

## Design

- **Declarations, not a winner.** Naming the declaration that wins would
take part of the cascade. Shorthands such as `font: var(...)` leave
their longhands blank in the protocol, and on top of that it would need
logical properties, `!important` across layers, and shadow-tree
ordering. Listing what changed, in the protocol's order, avoids all of
that, and the reader infers the winner. A declaration that moved shows
as a `-` line and a `+` line with the same text.
- **Labels stable across arms.** The labels use a sheet's file name, or
`constructed`, `<style>` or `user-agent`. Never a URL, since an inline
sheet's URL is its document's and includes the arm's port.
- **Both arms stay open.** `capture` is now a context manager, so the
comparison can read both tabs after `style_changes` has found which
elements differ.

## Also here

`main`'s stills tests have failed since #4686, which launches the
browser with `ignore_default_args`; the test's stand-in for
`headless_shell` now accepts launch options. `capture` is annotated as a
`Generator`, as ty (#4647) asks.

> _This was written by Claude Code on behalf of max-sixty_
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.

1 participant