Skip to content

fix(ui): notification cards lift above a chat composer they would cover - #36233

Merged
nwparker merged 3 commits into
mainfrom
nwparker/sta-12887-cards-clear-composer
Oct 30, 2026
Merged

nwparker merged 3 commits into
mainfrom
nwparker/sta-12887-cards-clear-composer

Conversation

@nwparker

@nwparker nwparker commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​70 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​69
Prod 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​117 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​115

ELI5

With the right sidebar closed, the notification cards in the bottom-right corner (Update Available, the star prompt, unexpected sign-out, the Codex ~/.codex notice) sat on top of the chat composer's Send and Stop buttons, so you couldn't stop a running chat while a card was showing. Now the cards move up and rest just above the composer.

What Changed

  • Before: the card stack was always pinned 2.5rem from the bottom of the window. With the sidebar closed it covered the composer's right end. At 1024 px, a click at the centre of Send/Stop (x 969–1001) landed on the Update card.
  • After: while a chat composer sits under the cards' column, the cards and the toasts stacked above them rise to 0.5rem above the composer. When the composer goes away (another tab, or a narrower layout that moves it out of the column), they drop back.
  • Mechanism:
    • New src/renderer/src/lib/notification-card-composer-clearance.ts. Each main chat composer registers its root element (useNotificationCardComposerClearance, called from NativeChatComposerPane); inline edit composers don't register. One shared ResizeObserver reports composer mounts, unmounts and resizes. A sidebar toggle resizes the composer, so it's covered.
    • NotificationCardStack already published its height for the toaster (fix(ui): toasts sit above the notification cards; the Codex ~/.codex notice is a card #36167). Its publish step now also measures the highest registered composer that overlaps the cards' column at their normal resting position. It publishes how far above the window bottom the cards must sit as --notification-card-composer-clearance. Composers that are hidden, beside the cards, or above where the cards rest are ignored. Measuring against the resting position, not the current one, keeps a raised stack from measuring against its own lift.
    • The stack's bottom and the toaster's bottom both use NOTIFICATION_CARD_STACK_BOTTOM, which is max(2.5rem, var(--notification-card-composer-clearance, 0px)). Toasts therefore stay above the cards. The stack's max height follows the same offset.

Why

The ticket listed three options. This is option 1, but it moves the cards instead of adding space under the chat:

  • Padding the chat column (option 1 as written) would shift the transcript every time a card appears or goes away.
  • Moving the cards only while a chat is working (option 2) leaves Send covered, and makes the cards jump whenever a turn starts or ends.
  • A collapsed pill (option 3) would be a new UI state for every card.

Raising the cards keeps every existing card and token unchanged. A card can still cover part of the transcript, but the transcript scrolls and the composer doesn't.

Linked Issue

STA-12887 (internal tracker). Follow-up to #36167.

Visual Proof

Rendered in a hidden dev window (ORCA_BACKGROUND_LAUNCH=1, CDP) at 1024 × 768 with the right sidebar closed, a chat composer showing, and an Update Available card. The screenshots are cropped to the main column and kept locally; the upload helper isn't available here.

  • Before (the stack forced back to main's fixed offset): the card covers the composer's right end, and a hit-test at the centre of Send/Stop lands inside the card stack.
  • After: the card's bottom edge is at y 616, above the composer's top at y 624. The hit-test at Send/Stop (x 969–1001, y 689–721) lands inside the composer.
  • At 1440 × 900: Send/Stop (x 1205–1237) is hit-tested inside the composer.
  • With the sidebar open: the composer's right end (x 1090) still reaches into the cards' column (x 1064+), so the cards stay raised. On main they covered that end of the composer too, though not Stop.

Testing

  • I manually tested these changes locally: macOS, hidden dev window, as above. The chat was put into a working state through the store; no real agent login was used.
  • Automated tests added/updated, in NotificationCardStack.test.tsx:
    • The cards rise above a composer under them, then drop back once it unmounts.
    • Composers beside the cards, above where they rest, or hidden are ignored.
    • No clearance is published when there are no cards.
  • Local load rule: pnpm tc, pnpm run typecheck:ci, pnpm run check:code-quality:changed, the anti-slop oxlint config, oxlint and the ast-grep gates all pass. pnpm test over the stack, native-chat, ui and UpdateCard tests: 3949 passed.

Review

Flag-off: not WSL-related; behavior is the same with ORCA_INTERNAL_WSL_HOSTS unset or set.
User-risk: low, and it applies to all users. Only the position of the bottom-right cards and the toasts above them changes, and only while a chat composer sits under the cards. Nothing changes in the composer, the transcript or any card's content. No IPC or wire change, so SSH and paired clients are unaffected. Mobile has its own UI and doesn't render this stack.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

Separate and unchanged: the floating-terminal toggle button overlaps the top edge of Send by a few pixels at 1024 px. The centre of Send is still clickable.

Status

Ready for review. Head and checks are in the STATUS comment.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

With the right sidebar closed, the bottom-right cards (Update Available,
star prompt, sign-out, Codex notice) sat over the chat composer's Send and
Stop buttons. Composers register their box; while one sits under the
cards' resting column, the stack (and the toaster above it) rises clear of it.

Fixes STA-12887
@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Walkthrough

The change adds composer registration and clearance measurement for notification cards. The card stack updates its clearance CSS variable when composer layout changes and uses shared bottom-positioning values. The toaster uses the shared bottom offset. Tests cover overlapping, removed, beside, above, and hidden composers, as well as a zero-height card stack.

Priority: Normal

Merge Risk: Moderate · up to 1af31

Notifications can rise unnecessarily or repeatedly shift between positions in a split chat layout. Fix the stack-height feedback loop before merging.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Description check Warning The description is thorough and follows the template. It covers ELI5, What Changed (before/after and mechanism), Why (alternatives considered), Linked Issue (STA-12887, an internal tracker reference),… 1. Attach the BEFORE and AFTER visual proof to the PR, using a format that can be switched or tabbed, such as a video or an image pair. The description says the screenshots exist only locally. 2. Replace or supplement the 'STA-12887 (intern…
Docstring Coverage Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title names the main change: notification cards rise above a chat composer that they would otherwise cover. It matches the raw summary, which adds composer-aware clearance to NotificationCardStack…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: notification cards rise above a chat composer that they would otherwise cover. It matches the raw summary, which adds composer-aware clearance to NotificationCardStack and the toaster. The title is specific and uses the conventional fix(ui) prefix.

Full details: Description check

Explanation

The description is thorough and follows the template. It covers ELI5, What Changed (before/after and mechanism), Why (alternatives considered), Linked Issue (STA-12887, an internal tracker reference), Visual Proof (described screenshots, but none attached inline), Testing (manual and automated), Review, Notes, and Checklist. Two items need attention. The Linked Issue section uses an internal tracker ID and does not use the 'Fixes #' form the template asks for. The Visual Proof section describes screenshots kept locally, and the upload helper was not available, so no BEFORE/AFTER attachment is visible to reviewers. The template marks this section as required for UI changes.

Resolution

  1. Attach the BEFORE and AFTER visual proof to the PR, using a format that can be switched or tabbed, such as a video or an image pair. The description says the screenshots exist only locally. 2. Replace or supplement the 'STA-12887 (internal tracker)' line with an actual linked issue in the 'Fixes #' form. The template states outside contributors must link an issue. If the author is a maintainer, confirm that the existing internal ticket is the correct reference. 3. Optionally, complete the 'AI Disclosure' section, or confirm it is not applicable because the author is a team member. The 'Review' section also needs no changes, but the 'Agent skill upstream boundary' checkbox is marked, which is acceptable.
Full details: Docstring Coverage

Explanation

Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 3 functions across 5 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nwparker

Copy link
Copy Markdown
Contributor Author

STATUS: ready for review. Head e1d7303.
Local checks: pnpm tc, typecheck:ci, check:code-quality:changed, anti-slop oxlint, oxlint and the ast-grep gates all pass; 3949 renderer tests pass. Rendered check in a hidden dev window at 1024 and 1440 px: Send/Stop hit-tests inside the composer while an Update card is showing.
Reviewer: fix-reviewer (renderer-only, so one reviewer).
Open question: none. The floating-terminal button's few-pixel overlap on Send is pre-existing and out of scope.

@nwparker
nwparker merged commit 6efdd36 into main Oct 30, 2026
42 checks passed

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fd68d463-a444-43f3-a0b0-3b0edfb45ee0
Commits

Reviewing files that changed from the base of the PR and between 16f326e and 1af318a.

Files selected for processing: 5
  • src/renderer/src/components/NotificationCardStack.test.tsx
  • src/renderer/src/components/NotificationCardStack.tsx
  • src/renderer/src/components/native-chat/NativeChatComposerPane.tsx
  • src/renderer/src/components/ui/sonner.tsx
  • src/renderer/src/lib/notification-card-composer-clearance.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.

Comment on lines +30 to +34
height > 0
? measureComposerClearance(
stack.getBoundingClientRect(),
window.innerHeight - restingBottom - height,
window.innerHeight

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Major · Stability & Availability · Quick win

Supported by static analysis

Script executed:

git rev-parse HEAD 2>/dev/null || true
test -f src/renderer/src/components/NotificationCardStack.tsx && cat -n src/renderer/src/components/NotificationCardStack.tsx
rg -n -F -e 'measureComposerClearance' -e 'STACK_STYLE' -e 'ResizeObserver' -e 'restingTop' -e 'offsetHeight' -- src/renderer/src/components || test "$?" -eq 1

Repository: stablyai/orca

Length of output: 40584


Script executed:

rg -n -F -e 'NOTIFICATION_CARD_COMPOSER_CLEARANCE_VAR' -e 'NOTIFICATION_CARD_STACK_BOTTOM' -e 'NOTIFICATION_CARD_STACK_HEIGHT_VAR' -e 'notification-card-composer-clearance' -e 'notification-card-stack-height' -e 'composer-clearance' -- src/renderer/src || test "$?" -eq 1
for f in src/renderer/src/lib/notification-card-composer-clearance.ts src/renderer/src/lib/notification-card-stack-height.ts; do
  if test -f "$f"; then cat -n "$f"; else echo "missing: $f"; fi
done

Repository: stablyai/orca

Length of output: 6530


Measure the resting height, not the clipped height, when computing composer clearance.

When a composer is beneath the resting column, publish writes clearance. STACK_STYLE.bottom and maxHeight both read that clearance, so the stack's offsetHeight drops to the clipped height. The next publish derives restingTop from that smaller height. The composer then falls outside the resting column, clearance is removed, the stack grows, and the ResizeObserver runs publish again. The stack keeps alternating between lifted and resting states.

With a 768px viewport, 600px of card content, and a composer at y=300–350:

  • Resting: restingTop = 768 - 40 - 600 = 128. The composer bottom (350) is below 128, so clearance is 768 - 300 = 468.
  • Lifted: maxHeight = 768 - 40 - 468 = 260, so offsetHeight becomes 260.
  • Next pass: restingTop = 768 - 40 - 260 = 468. The composer bottom (350) is not below 468, so clearance becomes 0 and the stack returns to 600px.

Measure the unclipped content height instead. The cards use shrink-0, so each card keeps its full height while the container clips. Sum the card heights and add the row gap:

--- "a/src/renderer/src/components/NotificationCardStack.tsx"
+++ "b/src/renderer/src/components/NotificationCardStack.tsx"
@@ -23,17 +23,22 @@
     const root = stack.ownerDocument.documentElement
     // Why publish: toasts share this corner and would otherwise render behind the cards (z-50).
     const publish = (): void => {
       const height = stack.offsetHeight
+      // Why natural height: offsetHeight shrinks while a lift clips the stack, which moves restingTop.
+      const gap = Number.parseFloat(getComputedStyle(stack).rowGap) || 0
+      const restingHeight =
+        Array.from(stack.children).reduce((sum, card) => sum + (card as HTMLElement).offsetHeight, 0) +
+        gap * Math.max(0, stack.children.length - 1)
       // Why clear a composer: with the right sidebar closed the cards cover its Send and Stop.
       const restingBottom = 2.5 * Number.parseFloat(getComputedStyle(root).fontSize)
       const clearance =
         height > 0
           ? measureComposerClearance(
               stack.getBoundingClientRect(),
-              window.innerHeight - restingBottom - height,
+              window.innerHeight - restingBottom - restingHeight,
               window.innerHeight
             )
           : 0
       if (height > 0) {
         root.style.setProperty(NOTIFICATION_CARD_STACK_HEIGHT_VAR, `calc(${height}px + 0.5rem)`)
       } else {

Keep height for the stack-height variable. The toaster uses that value to sit above the visible stack.

const rect = composer.getBoundingClientRect()
// Zero size: the composer's tab is hidden.
if (
rect.width === 0 ||

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Quick win

Exclude zero-height composers.

If a registered composer collapses to zero height but keeps its width, this check treats it as overlapping whenever its bottom is below restingTop. The cards and toasts then rise for an element with no area to cover. Check rect.height === 0 alongside rect.width === 0.

Proposed change
--- "a/src/renderer/src/lib/notification-card-composer-clearance.ts"
+++ "b/src/renderer/src/lib/notification-card-composer-clearance.ts"
@@ -50,7 +50,8 @@
     const rect = composer.getBoundingClientRect()
     // Zero size: the composer's tab is hidden.
     if (
       rect.width === 0 ||
+      rect.height === 0 ||
       rect.right <= column.left ||
       rect.left >= column.right ||
       rect.bottom <= restingTop
Committable suggestion

IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
rect.width === 0 ||
rect.width === 0 ||
rect.height === 0 ||

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