Repository navigation
Keep the floating workspace above a working native chat pane - #18692
Conversation
While an agent is streaming, `data-native-chat-working='true'` promoted the native chat pane shell from z-10 to z-50, above the floating workspace panel's z-45. Both compete in the root stacking context, so the chat column painted over a summoned floating workspace and only the sliver past the chat's right edge stayed visible. Lower the working-state rule to z-44. It still clears the z-40 updater and onboarding chrome the rule was added for (#16729) and the 41-44 band was otherwise empty. Raising the panel instead would put it over the z-50 modal layer it deliberately sits under. The existing layering test pinned z-index 50 with no upper bound, which is what let this through; it now derives both bounds from source.
📝 WalkthroughWalkthroughThe working native chat pane z-index changed from 50 to 44. The CSS comment now documents its position above updater/onboarding chrome and below the floating workspace panel. Tests parse the CSS z-index and verify both stacking relationships. Merge Risk: 🔵 Low · up to The chat pane now sits below the floating workspace panel while remaining above lower-priority chrome. The intended visual behavior is addressed, but the layering test can miss future changes to either referenced layer until its source matching and lower-bound derivation are tightened. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description explains the problem, fix, rationale, and test results, but it does not follow the required template. It omits the required Linked Issue, Visual Proof, ELI5, explicit What Changed and Why sections, checklist confirmations, and platform or manual-testing details. Resolution Update the description to include every required template section. Add a linked issue after "Fixes #", provide visual proof or write "N/A" with a reason, add ELI5, What Changed, and Why sections, complete the Testing and checklist items, and document AI disclosure and cross-platform or SSH considerations as applicable.
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Working chat layering lowered below the floating panel —
main.cssmoves.native-chat-pane-shell:has([data-native-chat-working='true'])fromz-index: 50toz-index: 44, keeping it above thez-40updater/onboarding chrome but below the floating workspace'sz-[45]. - Both layering bounds now pinned in the ratchet test —
native-chat-stop-layering.test.tsreplaces the one-sidedz-index: 50literal with aworkingChatZIndex()helper (parsed from source) and asserts it is> 40and<the panel's source-derivedz-[45](itself asserted exactly45).
The fix is sound: the working pane's intent (above z-40 chrome) is preserved, the 41–43 band is empty, and the 44 < 45 < 46 < 50 ordering (chat pane, floating panel, floating toggle, modal layer) is correct. The new assertion closes the one-sided gap that let this regression in, and I confirmed it can fail in both directions (revert to 50 → toBeLessThan(45) fails; drop to 39 → toBeGreaterThan(40) fails).
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
Visual proofCaptured on an isolated dev instance of this branch (private CDP port 9350 / renderer 5183; The floating workspace panel is the real product surface — opened via the real Before — working chat pane at
|
chat z-index |
top element is panel | top element is chat |
|---|---|---|
50 (pre-fix) |
❌ false | ✅ true |
44 (shipped) |
✅ true | ❌ false |
Disclosed gap
The chat column here is a stand-in div carrying the exact class and attribute the CSS rule keys on (class="native-chat-pane-shell" wrapping data-native-chat-working="true"), not a live agent session. A fresh dev profile launched with --use-mock-keychain has no agent credentials, so a genuinely streaming native chat could not be started in it.
What that does and does not establish: the real floating panel, the real main.css rule, and the real root-stacking-context interaction are all exercised. What is not exercised is a real chat pane mounting through TerminalPaneNativeChatPortal / StructuredAgentSessionPaneOverlayLayer. Both mount with the same native-chat-pane-shell z-10 root, so the cascade is identical, but that last step is inferred from source rather than observed here.
The panel's z-index was read with a lazy match from the data attribute to the first `z-[NN]`. Nearby comments cite bare tiers (the toggle button's own note mentions z-[45]), so a reworded comment landing after the attribute would be read as the class. Strip comments and anchor to `className=`.
Review loopAn independent adversarial pass came back correct, ship it, with one test issue worth fixing and one follow-up out of scope here. Additional symptom this also fixes
At Test hardening (
|
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Hardened the panel-z extraction in the layering ratchet —
native-chat-stop-layering.test.tsnow strips/* */and//comments from the source before matching, and anchors thez-[N]capture toclassName=, so a reworded layering comment citing barez-40/z-50tiers can no longer be misread as the panel's own class.
The change is sound: the reference comment (FloatingTerminalPanel.bounds.test.tsx:182 pins z-[45] via a real render) is accurate, the extracted value still resolves to 45, and the test suite passes (4/4). No production behavior changed.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/renderer/src/components/native-chat/native-chat-stop-layering.test.ts (1)
27-31: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winDerive the lower bound from
main.css.The assertion still compares the working chat z-index with literal
40. If the updater or onboarding chrome changes to a value above44, this test can pass while the chat pane paints below that chrome. Extract the[data-sonner-toaster]z-index fromcssand compare against that value.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: 45d03971-8b87-4f89-be44-02b3ff8037cd
📒 Files selected for processing (1)
src/renderer/src/components/native-chat/native-chat-stop-layering.test.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
| 'src/renderer/src/components/floating-terminal/FloatingTerminalPanelSurface.tsx' | ||
| ).replace(/\/\*[\s\S]*?\*\/|\/\/[^\n]*/g, '') | ||
| const panelZIndex = Number( | ||
| /data-floating-terminal-panel[\s\S]*?className=[\s\S]*?z-\[(\d+)\]/.exec(panel)?.[1] |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Scope the panel match to one opening tag.
The [\s\S]*? parts can cross element boundaries. If data-floating-terminal-panel remains on a wrapper while a nested or later className contains z-[45], the test can extract that unrelated value. Extract the opening tag containing the data attribute, then inspect only its className or parse the TSX structure.
🧰 Tools
🪛 OpenGrep (1.27.1)
[ERROR] 39-39: Dynamic command passed to child_process.exec/execSync. Use child_process.execFile or spawn with an argument array instead.
(coderabbit.command-injection.exec-js)
Electron QA — live native chat (not a stand-in)Validated reviewed head This pass used the real product surfaces:
The Before — working chat pane forced to
|
chat z-index |
top element is panel | top element is chat |
|---|---|---|
50 (override of the real rule) |
❌ false | ✅ true (<p class="my-2 first:mt-0 last:mb-0">) |
44 (shipped) |
✅ true (panel empty-state column) | ❌ false |
Computed styles on the real nodes: shell .native-chat-pane-shell.absolute.inset-0.z-10 → 44 or 50; panel [data-floating-terminal-panel].fixed.z-[45] → 45. Overlap 594×560. Panel lives under app-layout with no ancestor z-index; chat-shell ancestors are positioned with z-index: auto, so the two compete directly.
Idle (working=false) keeps the shell at z-index: 10; the promotion only fires while the agent is working.
Gap
The before state is a runtime z-index: 50 !important on the real rule, not a checkout of pre-fix main.css. The live Grok session, real portal shell, and real floating panel are otherwise the product path. Structured-session overlay and z-40 updater/onboarding chrome were not re-shot. A small Playwright comment-toolbar remnant can appear at the bottom of the screenshots; it is automation chrome.
Final review status — ready to land
Remaining evidence gaps are non-blocking: the before state is a runtime override rather than a historical checkout, and the structured overlay plus neighboring z-40/z-50 chrome were not separately re-shot; source and ratchet tests cover those boundaries. Verdict: ready to land. |
…i#18692) * Keep the floating workspace above a working native chat pane While an agent is streaming, `data-native-chat-working='true'` promoted the native chat pane shell from z-10 to z-50, above the floating workspace panel's z-45. Both compete in the root stacking context, so the chat column painted over a summoned floating workspace and only the sliver past the chat's right edge stayed visible. Lower the working-state rule to z-44. It still clears the z-40 updater and onboarding chrome the rule was added for (stablyai#16729) and the 41-44 band was otherwise empty. Raising the panel instead would put it over the z-50 modal layer it deliberately sits under. The existing layering test pinned z-index 50 with no upper bound, which is what let this through; it now derives both bounds from source. * Stop the layering test reading a comment as the panel class The panel's z-index was read with a lazy match from the data attribute to the first `z-[NN]`. Nearby comments cite bare tiers (the toggle button's own note mentions z-[45]), so a reworded comment landing after the attribute would be read as the class. Strip comments and anchor to `className=`. --------- Co-authored-by: Merge Sim <sim@local>





Problem
With a floating workspace open, the panel disappears behind the native chat column while an agent is streaming — only the sliver sticking out past the chat's right edge stays visible.
main.csspromotes the chat pane shell fromz-10toz-50whenever an agent is working:The floating panel is
position: fixed; z-index: 45at the app root, and no ancestor of the chat pane creates a stacking context, so the two compete directly in the root stacking context.50wins and the chat column paints over the panel.The panel's geometry was never wrong — 920px wide anchored 24px off the right edge puts its right edge exactly where it renders. It also correctly paints over the session-history sidebar, which rules out clipping. Because the rule is gated on the working state, an idle chat shows the panel fine, so this only reproduces mid-stream.
Fix
Lower the working-state rule to
z-index: 44.That preserves the intent it was added with in #16729 — keeping the interruption controls above the
z-40updater/onboarding chrome — and the 41–44 band was otherwise empty, so nothing else shifts.Raising the floating panel instead was rejected: its own comment pins it under the
z-50Radix modal layer, so raising it would put the floating workspace over every dialog.Tests
native-chat-stop-layering.test.tsalready guarded this rule but assertedz-index: 50as a literal with no upper bound — that one-sided assertion is what let the regression in. It now derives both bounds from source (reading the panel'sz-[45]out of the component) so neither side can drift silently.Ablation on the real head: reverting the CSS to
50fails the new assertion (expected 50 to be less than 45) while the other three tests still pass, confirming the prior suite had no coverage here.native-chat+floating-terminalsuites: 113 files / 1115 tests passpnpm tcclean,oxlintclean,oxfmtno reflow