Skip to content

Scope measured-height vars to each chat surface - #71840

Merged
OutThisLife merged 2 commits into
mainfrom
bb/status-stack-scope
Jul 26, 2026
Merged

Scope measured-height vars to each chat surface#71840
OutThisLife merged 2 commits into
mainfrom
bb/status-stack-scope

Conversation

@OutThisLife

Copy link
Copy Markdown
Collaborator

The thread's bottom padding could balloon and the jump-to-bottom button drift into mid-screen, driven by a chat you weren't looking at.

The composer and the out-of-flow status stack each publish a measured height so the thread can reserve clearance for them. Both wrote to document.documentElement — one global slot — while the components writing them mount once per chat surface. Session tiles render a full ChatView (thread, composer, status stack) beside the workspace pane, so several surfaces competed for the same value and the tallest background stack won. Unmount made it worse: whichever surface tore down last cleared the var for every surface still on screen.

Each surface now publishes onto its own root and reads its own measurements through normal inheritance. The clearance calc is re-declared per surface as well — :root substitutes the root values once, so scoping only the inputs would have left every thread resolving the same number. A composer rendered outside a chat surface (the popped-out window) still falls back to the document root.

Remeasuring on session switch can't solve this: multiple surfaces are visible simultaneously, so there is no single correct value to remeasure to.

Verified by reverting to the global write and re-running the new tests: 3 of 4 fail there, all 4 pass here.

The composer and the out-of-flow status stack published their measured
heights onto document.documentElement, but both components mount once per
chat surface. Session tiles render a full ChatView beside the workspace
pane, so N surfaces raced for one value: a background tab with a tall
status stack inflated the foreground thread's bottom clearance and pushed
its jump-to-bottom button into mid-screen. Whichever surface unmounted
last also cleared the var for everyone still showing.

Publish onto the surface's own root instead, and re-declare the clearance
calc there — `:root` substitutes the root measurements once, so scoping
only the inputs would leave every thread reading the same value.
@github-actions

github-actions Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

૮ >ﻌ< ა ci review

ran on e7f4b95

ℹ️ Info

Desktop E2E visual evidence · View test artifacts · View job

1 visual diff.

inline evidence is publishing...

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/desktop Electron desktop app (apps/desktop/*) labels Jul 26, 2026
Fold the null fallback into chatSurfaceRoot so both callers share one
target resolution, hoist the var names next to it, and drop the
duplicated rationale from the status-stack comment.
@OutThisLife
OutThisLife enabled auto-merge July 26, 2026 08:26
@OutThisLife
OutThisLife merged commit d9f1043 into main Jul 26, 2026
30 checks passed
@OutThisLife
OutThisLife deleted the bb/status-stack-scope branch July 26, 2026 08:26
randlee pushed a commit to randlee/hermes-agent that referenced this pull request Aug 11, 2026
…ck-scope

Scope measured-height vars to each chat surface
33hodl pushed a commit to 33hodl/hermes-agent that referenced this pull request Aug 12, 2026
…ck-scope

Scope measured-height vars to each chat surface
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/desktop Electron desktop app (apps/desktop/*) P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants