Skip to content

fix(ui): separate terminal safe-retry notice from preceding turn content#1094

Merged
Astro-Han merged 1 commit into
devfrom
claude/notice-reasoning-boundary
Jun 3, 2026
Merged

fix(ui): separate terminal safe-retry notice from preceding turn content#1094
Astro-Han merged 1 commit into
devfrom
claude/notice-reasoning-boundary

Conversation

@Astro-Han

Copy link
Copy Markdown
Owner

Summary

The safe_retry_failed terminal notice rendered as a bare caption with no boundary. When it followed a reasoning or tool trow it sat in the assistant-content column's 12px gap and read as more model thinking. This adds a hairline top rule (the canonical divider treatment) plus padding, guarded by a * + sibling combinator so the divider only appears when the notice follows other turn content.

Why

Fixes #943: the terminal stream-failure notice appears attached to reasoning output, so users read "恢复失败…" as part of the model's thinking rather than a turn-level status line.

Related Issue

Closes #943

Human Review Status

Pending

Review Focus

The * + [data-component="notice-part"] selector. It must add the divider only when the notice follows a sibling, and must NOT draw a leading hairline when the notice is the turn's only part — a real case: a first-attempt connection failure where the failed attempt's reasoning is removed (removeReasoningForAttempt) before the notice is written, leaving the notice alone. Spacing above the divider deliberately relies on the production container's existing gap: 12px; padding-top provides the spacing below.

Risk Notes

UI-only; no behavior, data, permission, or platform surface touched. One nuance: the snap fixture mirrors the real [data-slot="session-turn-assistant-content"] flex/gap via inline style rather than reusing the production CSS, so a future change to that container gap won't auto-propagate to the fixture. The two conditional checklist items left unticked: no platform/packaging surface, and no docs/release/deps surface.

How To Verify

typecheck (ui + app): pass
snap safe-retry: 1 passed — grid shows (a) notice after a reasoning trow with the hairline divider, (b) standalone notice with no leading line
  getComputedStyle assertions: preceded notice border-top 1px / padding-top 12px; standalone 0px / 0px
unit (ui grouping + message-part-registry + session-safe-retry-contract): 22 pass
lint (notice.tsx): clean
codex review (xhigh): PASS — one P2 (snap was visual-only, didn't assert the divider) addressed by the getComputedStyle assertions above

Screenshots or Recordings

Visual surface checked with the safe-retry snap target (bun run snap safe-retry). The regenerated grid under docs/design/preview/screenshots/safe-retry.png shows the notice clearly separated from the preceding "思考中" reasoning block, and a standalone notice with no stray divider.

Checklist

  • Type label — this PR carries exactly one of bug, enhancement, task, documentation. Type labels are author-added; the labeler bot does NOT assign them. Add the label in the GitHub UI, then tick this.
  • Routing labels — this PR carries at least one of app, ui, platform, harness, ci. The labeler bot assigns these on PR open based on changed paths. Confirm the bot's choice (or override if wrong), then tick this.
  • Priority label — this PR carries exactly one of P0, P1, P2, P3. The priority-triage bot suggests one on PR open. Confirm or override, then tick this.
  • Human Review Status above is set to Pending, Approved by @<reviewer>, or Not required: <reason> (default is Pending; "not required" is restricted to bot-authored low-risk PRs).
  • I linked the related issue, or stated in Summary why there is no issue.
  • I described the review focus and any meaningful risks.
  • I replaced the example block in How To Verify with the real verification steps and the key result for each.
  • I did not introduce unrelated refactors, dependencies, generated files, or file changes beyond the stated scope.
  • (conditional) I manually checked visible UI or copy changes when needed, with screenshots or recordings. Leave unticked only if no visible UI or copy changed.
  • (conditional) I considered macOS and Windows impact for platform, packaging, updater, signing, paths, shell, or permissions changes. Leave unticked only if no platform/packaging surface was touched.
  • (conditional) I called out docs, release notes, dependencies, permissions, credentials, deletion behavior, generated content, or local file changes when relevant. Leave unticked only if none of those surfaces was touched.
  • I reviewed the final diff for unrelated changes and suspicious dependency changes.
  • I am targeting dev, and my PR title and commit messages use Conventional Commits in English.

The safe_retry_failed notice rendered as a bare caption with no boundary,
so when it followed a reasoning or tool trow it sat in the 12px column gap
and read as more model thinking (#943). Add a hairline top rule (the
canonical divider treatment) plus padding, guarded by `* +` so it only
applies when the notice follows a sibling — a notice that is the turn's
only part (first-attempt connection failure, where the failed attempt's
reasoning is removed) gets no stray leading line.

Extend the safe-retry snap fixture with a preceding reasoning part, a
standalone-notice case, and the real assistant-content gap. The snap grid
is visual-only, so assert the divider directly via getComputedStyle: a
preceded notice carries a 1px top border + 12px padding, a standalone
notice carries neither.
@Astro-Han Astro-Han added bug Something isn't working P2 Medium priority ui Design system and user interface labels Jun 3, 2026
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@Astro-Han, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 30 minutes and 26 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 8c7462cc-cd1c-4b76-ba7c-dba50ff50f0f

📥 Commits

Reviewing files that changed from the base of the PR and between cd78b3e and 332e876.

📒 Files selected for processing (4)
  • packages/app/e2e/snap/fixtures/safe-retry-snap-fixture.tsx
  • packages/app/e2e/snap/safe-retry.snap.ts
  • packages/ui/src/components/message-part/parts/notice.css
  • packages/ui/src/components/message-part/parts/notice.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/notice-reasoning-boundary

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 and usage tips.

@github-actions github-actions Bot added the app Application behavior and product flows label Jun 3, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested priority: P2 (includes non-doc, non-test paths outside the low-risk bucket).

P1/P0 are reserved for maintainer confirmation. Please relabel manually if this is a release blocker, security issue, data-loss risk, or updater/runtime failure.

@Astro-Han Astro-Han merged commit 7605255 into dev Jun 3, 2026
36 of 37 checks passed
@Astro-Han Astro-Han deleted the claude/notice-reasoning-boundary branch June 3, 2026 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app Application behavior and product flows bug Something isn't working P2 Medium priority ui Design system and user interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Terminal stream failure notice appears attached to reasoning output

1 participant