Repository navigation
refactor(web): composer overlay re-measures from one layout effect - #25915
Conversation
ChatView kept a composerMountedRef plus a second layout effect that compared it with composerMounted and, on change, reset the three composer inset refs and re-published the overlay height. That body is identical to the thread-switch reset effect. The ref also lagged: when ChatView mounted on a provider-subagent thread (composer not mounted), the reset and observer effects published with the ref's initial `true`, and the extra effect then reset and re-published in the same commit. publishComposerOverlayHeight goes through useStableCallback, which updates in an insertion effect, so layout effects already see the current render's closure. It now reads composerMounted directly, and the thread-switch reset effect also keys on composerMounted. Effects in ChatView.tsx: one useLayoutEffect removed (the composerMounted compare); the reset and resize-observer layout effects are kept, they measure DOM after commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Needs Human Approval Macroscope's review found this PR requires human approval — This is a narrowly scoped composer measurement refactor with no schema or product-default changes. It also broadens a line-level oxlint diagnostic suppression, which requires human review under the applicable policy. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Update overlay measurement apps/web/src/components/ChatView.tsx |
publishComposerOverlayHeight now passes composerMounted to overlayComposerIsResting. The overlay measurement effect includes composerMounted as a dependency and handles the reset and measurement. The separate tracking ref and layout effect are removed. |
Priority:
Estimated code review effort: 1 (Trivial) | ~5 minutes
Change: Refactor
Suggested reviewers: t3dotgg, macroscopeapp
Merge Risk: 
Minimal · up to b673c
-
No actionable merge-blocking risk was identified in this focused refactor.
Pre-merge checks: 
4
-
Full details: Description check
-
Explanation
The description explains the problem, change, effects, and verification. It does not include the required “Scope and approval” section or explain why the change qualifies for an exemption, but the rest of the description is detailed and relevant.
-
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Usage-based review receipt
- Mode: Continue automatically
- Reviewed files: 1
- Charged: $0.25
- View usage details
Note
This review was completed with usage-based billing: files reviewed beyond your plan's included limits are billed at $0.25/file. View usage-based billing.
Comment @coderabbitai help to get the list of available commands.
## What's Changed * refactor(mobile): subagent timers share the visible second clock by @juliusmarminge in pingdotgg/t3code#25854 * refactor(mobile): app update checks start with the app by @juliusmarminge in pingdotgg/t3code#25856 * refactor(mobile): workspace tabs, home filters and connection status derive instead of syncing by @juliusmarminge in pingdotgg/t3code#25813 * refactor(mobile): settings permission and update checks without sync effects by @juliusmarminge in pingdotgg/t3code#25895 * fix(desktop): run the packaged bundle self-check on macOS artifacts by @stbenjam in pingdotgg/t3code#25900 * fix(web): the Add ChatGPT account dialog animates closed once the account connects by @juliusmarminge in pingdotgg/t3code#25868 * refactor(web): composer clears scroll-collapse in render, not after paint by @juliusmarminge in pingdotgg/t3code#25909 * refactor(web): composer overlay re-measures from one layout effect by @juliusmarminge in pingdotgg/t3code#25915 * refactor(web): file browser records the right-click position on its own panel by @juliusmarminge in pingdotgg/t3code#25908 * refactor(web): preview element picker drops its unmount guard by @juliusmarminge in pingdotgg/t3code#25920 * fix(web): PR Code tab no longer requests the diff of a commit the PR dropped by @juliusmarminge in pingdotgg/t3code#25916 * perf(mobile): worktree setup updates commit the thread screen once by @juliusmarminge in pingdotgg/t3code#25910 * fix(desktop): a broken release opens an error window instead of hanging by @t3dotgg in pingdotgg/t3code#25903 * ci(web): releases fail when the built web app cannot boot by @t3dotgg in pingdotgg/t3code#25929 * ci(release): desktop builds that cannot open no longer publish by @t3dotgg in pingdotgg/t3code#25928 * refactor(web): file tree drag mentions use React drag handlers by @juliusmarminge in pingdotgg/t3code#25913 * refactor(mobile): git action results buzz from where they are reported by @juliusmarminge in pingdotgg/t3code#25912 * fix(mobile): the Add environment form shows only its own pairing errors by @juliusmarminge in pingdotgg/t3code#25859 * refactor(mobile): showcase capture runs as an app service, not a chain of effects by @juliusmarminge in pingdotgg/t3code#25857 * fix(server): bound hung delegated stop effects so later runs can start by @juliusmarminge in pingdotgg/t3code#25675 * feat(mobile): add One UI navigation preference on Android by @PixPMusic in pingdotgg/t3code#25758 **Full Changelog**: pingdotgg/t3code@v0.1.4-nightly.20261027.3770...v0.1.4-nightly.20261027.3783 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.1.4-nightly.20261027.3783
Problem
ChatView kept a
composerMountedRefplus a second layout effect that compared it withcomposerMountedand, on change, reset the three composer inset refs and re-published the overlay height. Its body was identical to the thread-switch reset effect. The ref also lagged: when ChatView mounted on a provider-subagent thread (composer not mounted), the reset and observer effects published with the ref's initialtrue, and the extra effect then reset and re-published in the same commit.Change
composerMountedRefand the compare effect.publishComposerOverlayHeightreadscomposerMounteddirectly. It is called throughuseStableCallback, which updates in an insertion effect, so every layout effect (and child calls throughonComposerOverlayHeightChange) already sees the current render's closure.composerMounted; its existing exhaustive-deps disable reason now covers composer mount/unmount. The resize-observer effect does not depend oncomposerMounted, so effect order within the commit is unchanged.What this improves
Behavior changes
None intended. The intermediate publish with the stale
composerMounted: trueflag no longer happens (it was immediately overwritten in the same commit).Effects
apps/web/src/components/ChatView.tsx: layout effects 3 -> 2 in this area (compare effect removed; reset and resize-observer effects kept, both measure DOM after commit).Verification
vp run check:changed: format, lint, knip 1/2, knip 2/2, typecheck (3 packages), test (2 files) all pass.Model: Claude Opus 5.5, Claude Code harness.
🤖 Generated with Claude Code