Skip to content

chore: show error in tooltip for failed plans#1055

Merged
adityachoudhari26 merged 2 commits intomainfrom
plan-err-message-tooltip
Apr 23, 2026
Merged

chore: show error in tooltip for failed plans#1055
adityachoudhari26 merged 2 commits intomainfrom
plan-err-message-tooltip

Conversation

@adityachoudhari26
Copy link
Copy Markdown
Member

@adityachoudhari26 adityachoudhari26 commented Apr 23, 2026

fixes #1052

Summary by CodeRabbit

  • New Features

    • Plan status badges now support optional message tooltips to display additional context information when available.
  • Refactor

    • Improved and streamlined plan status display logic for better code clarity and maintainability.

Copilot AI review requested due to automatic review settings April 23, 2026 20:13
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 23, 2026

Warning

Rate limit exceeded

@adityachoudhari26 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 41 minutes and 55 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 41 minutes and 55 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, 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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 479582c1-e84a-43fc-85a6-aebf937b2fb8

📥 Commits

Reviewing files that changed from the base of the PR and between b4f60ca and e3a335a.

📒 Files selected for processing (1)
  • apps/web/app/routes/ws/deployments/_components/plans/PlanStatusBadge.tsx
📝 Walkthrough

Walkthrough

Two files updated to enhance plan error visibility: PlanStatusBadge component now accepts an optional message parameter and displays it in a tooltip with an alert indicator when present, while the plan detail page passes the full result object and removes redundant tooltip logic from the status rendering.

Changes

Cohort / File(s) Summary
Plan Status Badge Message Support
apps/web/app/routes/ws/deployments/_components/plans/PlanStatusBadge.tsx, apps/web/app/routes/ws/deployments/page.$deploymentId.plans.$planId.tsx
Refactored PlanStatusBadge to accept optional message parameter, displaying it in a tooltip with AlertCircle indicator when present. Updated call site to pass full result object instead of just status field, and removed duplicate error message tooltip logic.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • #953: Adds DeploymentPlanTargetResult type with required message field and backend response mapping — provides the data structure that this PR now displays in the UI.

Suggested reviewers

  • jsbroks

Poem

🐰 Hop, hop, the errors now appear,
No mysteries hidden, the path is clear,
A badge with a circle, a message so bright,
Plans shown in full, everything's right!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding error visibility in tooltips for failed plans, which aligns with the primary objective.
Linked Issues check ✅ Passed The PR successfully addresses issue #1052 by adding error message visibility through a tooltip in the PlanStatusBadge component.
Out of Scope Changes check ✅ Passed All changes are directly related to the objective of showing plan errors in tooltips; no extraneous modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch plan-err-message-tooltip

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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
apps/web/app/routes/ws/deployments/page.$deploymentId.plans.$planId.tsx (1)

111-111: Prefer explicit props over spreading the entire result.

<PlanStatusBadge {...result} /> forwards every field on result (e.g., environment, resource, agent, resultId, diffStats, hasChanges, ...) as props. TypeScript's excess-property check doesn't apply to spreads, so these silently flow through and are ignored by the component. Being explicit makes the contract between caller and component clearer and avoids surprises if PlanStatusBadge later adds a prop that happens to collide with a Result field name.

♻️ Proposed change
-        <PlanStatusBadge {...result} />
+        <PlanStatusBadge status={result.status} message={result.message} />
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/web/app/routes/ws/deployments/page`.$deploymentId.plans.$planId.tsx at
line 111, The call currently spreads the entire result object into
PlanStatusBadge which lets unrelated Result fields leak into the component;
replace the spread with explicit prop assignments by reading PlanStatusBadge's
prop signature and passing only those fields from result (for example map
result.status, result.hasChanges, result.diffStats, result.environment,
result.resource, etc. to the corresponding PlanStatusBadge props), removing
{...result} and explicitly mapping each required prop so TypeScript can catch
excess/missing props and avoid accidental prop collisions.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@apps/web/app/routes/ws/deployments/page`.$deploymentId.plans.$planId.tsx:
- Line 111: The call currently spreads the entire result object into
PlanStatusBadge which lets unrelated Result fields leak into the component;
replace the spread with explicit prop assignments by reading PlanStatusBadge's
prop signature and passing only those fields from result (for example map
result.status, result.hasChanges, result.diffStats, result.environment,
result.resource, etc. to the corresponding PlanStatusBadge props), removing
{...result} and explicitly mapping each required prop so TypeScript can catch
excess/missing props and avoid accidental prop collisions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 847edc03-2407-4119-b0ce-71aa07f3c162

📥 Commits

Reviewing files that changed from the base of the PR and between 7b8db28 and b4f60ca.

📒 Files selected for processing (2)
  • apps/web/app/routes/ws/deployments/_components/plans/PlanStatusBadge.tsx
  • apps/web/app/routes/ws/deployments/page.$deploymentId.plans.$planId.tsx

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds inline visibility into deployment plan failures by surfacing plan result error messages via a tooltip on the status badge (fixes #1052).

Changes:

  • Update PlanStatusBadge to optionally render an error/info tooltip when a message is present.
  • Pass plan result message into the status badge from the plan detail results table.
  • Remove the previous title-attribute error display from the “Changes” cell for errored results.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
apps/web/app/routes/ws/deployments/page.$deploymentId.plans.$planId.tsx Passes full result (including message) into PlanStatusBadge and removes the old title tooltip from the “Changes” column.
apps/web/app/routes/ws/deployments/_components/plans/PlanStatusBadge.tsx Adds tooltip UI around the status badge when a message exists and indicates presence via an icon.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +59 to +60
<TooltipTrigger>
<PlanStatusBadgeInner status={status} hasMessage />
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

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

TooltipTrigger is used without asChild, so Radix renders a <button> wrapper. In this table, rows can be clickable (onClick on TableRow), so clicking/focusing the status badge can unintentionally trigger the row click (and the badge is announced as a button even though it’s just a status). Consider using asChild with an explicit element and stopping event propagation (e.g., onClick/onPointerDown) so the tooltip trigger doesn’t activate the row handler.

Suggested change
<TooltipTrigger>
<PlanStatusBadgeInner status={status} hasMessage />
<TooltipTrigger asChild>
<span
onClick={(event) => event.stopPropagation()}
onPointerDown={(event) => event.stopPropagation()}
>
<PlanStatusBadgeInner status={status} hasMessage />
</span>

Copilot uses AI. Check for mistakes.
Comment on lines +62 to +64
<TooltipContent className="wrap-break-word flex max-w-sm items-center gap-1.5">
{message}
</TooltipContent>
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

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

message is rendered as plain text inside the tooltip; any newline characters in stored plan error messages will be collapsed by HTML, making multi-line errors/stack traces hard to read. Consider applying a whitespace-preserving style (e.g., whitespace-pre-wrap) and word-breaking to keep long/multi-line messages readable within the max width.

Copilot uses AI. Check for mistakes.
@adityachoudhari26 adityachoudhari26 merged commit fcdbf32 into main Apr 23, 2026
5 of 6 checks passed
@adityachoudhari26 adityachoudhari26 deleted the plan-err-message-tooltip branch April 23, 2026 20:31
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.

Add visibility to plan errors

2 participants