Skip to content

improve(ui): show chat reply failures as a system line - #189807

Merged
vyctorbrzezowski merged 3 commits into
mainfrom
brzezowski/reply-failure-line
Nov 1, 2026
Merged

vyctorbrzezowski merged 3 commits into
mainfrom
brzezowski/reply-failure-line

Conversation

@vyctorbrzezowski

@vyctorbrzezowski vyctorbrzezowski commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

A failed reply shows as a tall amber block in the transcript, and opening its Details pushes the rest of the conversation down.

User Impact

User impact: a failed reply is now one centered line between two hairlines with Try again beside it. Selecting the line opens the summary and the full error in a floating panel, and the conversation does not move. The same copy, repeat count, retry eligibility and copied text apply.

Why This Change Was Made

The failure reads as a system event rather than a block of content, so it uses the system divider idiom. Details use the existing Popover (native top layer and overlay anchor), so the panel is out of flow, is not clipped by the transcript scroller, and keeps the app's dismissal, focus and ARIA behavior on the menu surface tokens. The log fades use the existing scroll state observer. CopyButton gains an optional icon-only feedback mode for the well; other copy buttons are unchanged.

Behavior worth reviewing:

  • Copy now lives in the well, so the well always exists. A one-line error has no extra detail, so its summary is the existing "Automatic recovery has stopped…" help and the error sits in the well, rather than the same sentence twice.
  • A multi-line error shows its first line followed by that help as the summary, keeping the copy that was inside Details. A first line over 240 characters still falls back to the help alone.
  • The panel opens below the line, and above it when it would not fit before the end of the transcript. It closes when the transcript scrolls the line out of view, so it cannot sit over the composer or header.
  • The 32 px touch size of the copy control is kept on hover: none.
  • In right-to-left locales the well stays left to right, with copy and the thumb at its right edge, because logs are technical strings. In the summary, the error's first line is isolated from the translated help, so each keeps its own punctuation.

Evidence

Real app on a Vite source server with the mock Gateway. Every state comes from chat.history, sessions.list and config.get at the data layer: nothing was inserted into or hidden in the page. Scrollbars are enabled in Chromium. Copied uses the real clipboard and was read back. Copy failed uses an init script that makes both clipboard transports report failure, as when the browser denies permission. The error text and the 1,280 repeated failures are mock data.

Before is b053d92e095, as 1280x800 full frames. After is 46bc8dc09b6 on 06a71d75b01, cropped to the conversation at 2x, except 390 px which are full frames at 2x. The Before sidebar is empty only because this scenario has a single session.

The follow-up a1577855c7d changes only direction handling. Against 46bc8dc09b6, English Chromium captures keep the same line breaks. All five 1280 px states match byte for byte in both themes, apart from one light log frame that differs only in the faint animated background. At 390 px the second summary line moves by under a pixel.

Nothing moves

Measured before opening, across the opening animation (6 samples), after scrolling the log and after Esc: next message top 276 px, transcript scrollHeight 646 px and scrollTop 0 at every sample, a shift of 0.

Browser, theme Next message top, closed to open scrollHeight, closed to open scrollTop, closed to open
Chromium: Absolutely dark and light, CRT dark and light, Beacon dark and light 276 to 276 646 to 646 0 to 0
Safari 27.0.1: Absolutely dark and light 278.03 to 278.03 714 to 714 0 to 0

Recording, Absolutely dark, Chromium: hover, open, scroll the log to its end, Esc.

reply-failure-after-video-page@88c8b7bf26530ccfe373e4b11153a43f.webm

Other measurements

  • Near the composer: panel opens above in every theme, panel bottom 620 px, line top 626 px, composer top 698 px, chevron at -90 degrees.
  • Safari 27.0.1: backdrop-filter computes to blur(8px) and paints, so transcript text behind the panel is not readable, the same as behind the existing composer menu. The 10 px gutter holds a thumb with no track, the fades clear at each end of the log, and the panel is 460 px wide in the top layer. Near the composer it opens above.
  • Right to left, locale ar, Chromium and Safari 27.0.1 at 1280 and 390 px: log direction ltr, summary direction rtl, panel centered on the line, copy at the well's right edge, document overflow 0. The chevron points at the panel.
  • Reduced motion, Chromium: panel and chevron transitions are none, every sampled frame after the click is already fully open (42 frames, one distinct opacity, scale and rotation), and Esc hides the panel within 60 ms. Without it: 0.1 s, with 10, 10 and 7 distinct values.
  • 390 px: document overflow 0 with a count, with a 1,280 count, and in German. The panel is 374 px wide.
  • Keyboard: Enter opens with focus staying on the line, then Tab goes to the log, the copy control and Try again, which closes the panel. Esc returns focus to the line.

Absolutely dark

State Before After
Closed
Repeated
No retry
One-line error
Details open
390 px
After
Hover
Near the composer, opens above
Copied
Copy failed
Log, start
Log, middle
Log, end
First line over 240 characters
390 px, open
390 px, 1,280 times
390 px, German

Absolutely light

State Before After
Closed
Repeated
No retry
One-line error
Details open
390 px
After
Hover
Near the composer, opens above
Copied
Copy failed
Log, start
Log, middle
Log, end
First line over 240 characters
390 px, open
390 px, 1,280 times
390 px, German

CRT dark

Closed Open Near the composer

CRT light

Closed Open Near the composer

Beacon dark

Closed Open Near the composer

Beacon light

Closed Open Near the composer

Safari 27.0.1, Absolutely

Real Safari on macOS 27.0.1, window captures, with the same mock Gateway data. A small page script presses the real controls and sets the log's scroll position; it inserts and hides nothing. These are at a1577855c7d, except Copied, which is a real press at 46bc8dc09b6.

State Dark Light
Open over transcript text
Log, middle
Log, end
Near the composer, opens above
Copied

Right to left, Absolutely

Locale ar, at a1577855c7d. The mock error stays in English, as a provider error would. The Safari 390 px shots are a 390 px iframe of the same page, because a Safari window cannot be that narrow, cropped to that frame.

Safari 27.0.1 Dark Light
Open
Log, end
Near the composer, opens above
390 px, open
Chromium Dark Light
Open
390 px, open

Checks

  • After the listener-lifecycle correction, controller guard, formatting, typed lint, UI typecheck and diff checks pass.
  • 23 notice/copy unit and Chromium browser tests pass across four files; 10 retry, reload and transcript E2Es pass across three files.
  • Fresh independent review and final source inspection found no actionable issue. Opening and closing the existing Popover now owns scroll/resize subscriptions; component teardown releases them.
  • The existing Chromium and Safari visual evidence is retained; this correction does not change styling.
  • The prior-head performance check passed: total CSS raw +3,167 B and gzip +496 B, startup CSS +0 B, startup JS gzip +30 B. It was not repeated for the lifecycle-only correction.

Test changes: chat-run-failure-notice and the two e2e files now read the error from the well and open the panel through its toggle. chat-retry-failure replaces the hover-revealed copy checks with open, Esc, outside click and no-shift checks, and keeps the 32 px touch check. The new browser test covers out-of-flow opening, Esc and outside click, flipping, closing on scroll, the fades, and the left-to-right well and isolated summary line in a right-to-left locale. No coverage was removed.

Known gaps:

  • At 390 px the title ellipsizes when a count is shown ("Unable to finish thi… · 3 times"), and more in long locales such as German. Without a count, English fits in full.
  • If the copy tooltip is showing, the first Esc dismisses it and the second closes the panel, following the shared tooltip order.
  • Not run: Firefox (no styled thumb offset there, it falls back to a thin scrollbar), real devices, full suites.

@vyctorbrzezowski vyctorbrzezowski self-assigned this Oct 31, 2026
@clawsweeper

clawsweeper Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 31, 2026
@clawsweeper

clawsweeper Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR replaces chat failure cards with a compact system line and floating, copyable error details.

Example: A reply fails with “Provider response: 503 Service Unavailable.”

  • Before: The failure occupies a tall block, and expanding Details moves subsequent messages.
  • After: A compact failure line retains Try again and opens the diagnostic in a floating panel.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Strong visual evidence supports the approved design, but a source-proven controller-guard violation blocks the patch.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after desktop screenshots and open-panel desktop/mobile images show the changed failure presentation through the real Control UI on a Vite server with synthetic Gateway responses; the PR also records unchanged conversation geometry and clipboard outcomes.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Product

Kind: Preference · Worth it: Yes · Fix scope: Complete
User problem: Failure cards take substantial transcript space, and opening diagnostics moves the conversation.
Reason: The maintainer-authored direction reduces visual interruption while preserving diagnostic access, copy behavior, repeat counts, and retry eligibility.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this PR open: the maintainer-approved presentation improvement is useful, but its new effect violates the enforced controller guard and needs a focused repair.

Priority: P3
Reviewed head: 46bc8dc09b6e077e5df9c6119efcbc6d2b82f8cd

Before merge

  • Replace the new effect with existing lifecycle mechanisms (P2) - This call introduces one createEffect in a file with no allowance in config/control-ui-createEffect-baseline.txt. scripts/check-control-ui-controllers.mts counts it and rejects 1 > 0, and scripts/check-changed.mts selects that guard for this UI change. This therefore fails required changed-file lint independently of the unavailable job log. Bind the scroll/resize lifetime through the existing overlay callbacks or shared observer primitives; the Solid policy explicitly prohibits increasing the baseline.

Findings

  • [P2] Replace the new effect with existing lifecycle mechanisms — ui/src/pages/chat/components/chat-run-failure-notice.tsx:56-58

Tests

  • Missing end-to-end proof: The new browser scenarios are reported passing, but a base-red/head-green run for the layout invariant is not supplied.
Agent review details

How this fits together

The Control UI renders terminal run failures from transcript projections; this component presents their diagnostics and delegates eligible retries and clipboard writes to existing owners.

flowchart LR
 A[Terminal run failure] --> B[Transcript projection]
 B --> C[Failure system line]
 C --> D[Shared Popover]
 D --> E[Diagnostic and CopyButton]
 C --> F[Existing retry owner]
Loading

Technical review

Best possible solution:

Keep the shared Popover design and bind its scroll/resize work through existing lifecycle callbacks or observer primitives without adding a per-view effect.

Do we have a high-confidence way to reproduce the issue?

The original component renders expanded details in normal flow, and the supplied before/after browser evidence demonstrates the presentation change; no target code was executed during review.

Is this the best way to solve the issue?

Reusing the existing Popover, clipboard feedback owner, and scroll-state observer is appropriate; the new effect can be replaced with existing lifecycle mechanisms.

Full review comments:

  • [P2] Replace the new effect with existing lifecycle mechanisms — ui/src/pages/chat/components/chat-run-failure-notice.tsx:56-58
    This call introduces one createEffect in a file with no allowance in config/control-ui-createEffect-baseline.txt. scripts/check-control-ui-controllers.mts counts it and rejects 1 > 0, and scripts/check-changed.mts selects that guard for this UI change. This therefore fails required changed-file lint independently of the unavailable job log. Bind the scroll/resize lifetime through the existing overlay callbacks or shared observer primitives; the Solid policy explicitly prohibits increasing the baseline.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against efd616ac8ac5.

Provenance checked

  • Failure notice presentation changes intended behavior with a stated reason (b957f1a: Present one durable terminal failure separately from assistant prose while preserving partial output and explicit recovery.)
  • Diagnostic disclosure and copy placement changes intended behavior with a stated reason (f5028d0: Reduce duplicated diagnostics and redundant recovery actions while retaining copy access and guarded retry.)
  • Shared clipboard feedback keeps the original intent (b5ac9a9: Keep feedback attached to renderer-owned DOM references; later accessibility work shares completion and reset handling with announcement targets.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm check:control-ui-controllers --base 06a71d7
  • pnpm --dir ui test src/pages/chat/components/chat-run-failure-notice.test.ts src/pages/chat/components/chat-run-failure-notice.browser.test.tsx
  • pnpm tsgo:ui

What I checked:

Likely related people:

  • Mitchell Etzel: Raw commit a3a5cd5 adds ui/src/components/copy-button-state.ts:13 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: a3a5cd5f969d; files: ui/src/components/copy-button-state.ts)

PR surface

Source +248, Tests +111. Total +359 across 9 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 5 372 124 +248
Tests 4 134 23 +111
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 506 147 +359

Review metrics

Metric Value Why it matters
Production versus test changes Production +372/-124; tests +134/-23 Most production growth implements replacement styling and floating-panel behavior; the additional per-view effect needs the focused repair described in the finding.

Labels

Label changes:

  • add P3: This is a chat presentation and layout improvement with existing retry behavior preserved.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P3: This is a chat presentation and layout improvement with existing retry behavior preserved.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 31, 2026, 6:25 PM ET / 22:25 UTC.

@vyctorbrzezowski
vyctorbrzezowski enabled auto-merge (squash) November 1, 2026 09:51
@vyctorbrzezowski
vyctorbrzezowski merged commit 6b9eb8a into main Nov 1, 2026
89 of 92 checks passed
@vyctorbrzezowski
vyctorbrzezowski deleted the brzezowski/reply-failure-line branch November 1, 2026 10:01
@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: L status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant