orca icon indicating copy to clipboard operation
orca copied to clipboard

fix: persist CLI install/remove errors inline in Settings

Open brennanb2025 opened this issue 5 months ago • 2 comments

Summary

CLI install/removal failures in Settings → CLI were only surfaced via a transient toast. Once the toast vanished, a failed registration looked identical to "never attempted" — the user had no way to read, copy, or act on the reason (e.g. a missing directory or a permission error).

This persists the last install/remove error inline below the status, styled with the text-destructive token and role="alert", per the STYLEGUIDE guidance to persist errors the user needs to retry, copy, or act on. The inline error clears on a successful install/remove and on a status refresh, so it never lingers stale.

Changes

  • CliSection.tsx — new actionError state; set on install/remove failure, cleared on success and refresh; rendered as an inline role="alert" paragraph.
  • cli-section-platform-labels.ts (new) — extracted the three platform-copy helpers (getRevealLabel, getInstallDescription, getFallbackCommandName) so the file stays under the max-lines limit without a disable.
  • CliSection.install-error.test.tsx (new) — covers persist-then-clear-on-refresh and clear-after-later-success.

Testing

  • Vitest: 3 tests green (CliSection.install-error.test.tsx + existing CliSection.test.tsx).
  • Lint + typecheck + localization catalog: green.
  • Manually validated in the real Electron app via a CLI conflict scenario: the persistent red error renders and survives dismissing the registration dialog.

Note

The raw Electron IPC prefix (Error invoking remote method 'cli:install': Error:) can show through in the surfaced message. This is pre-existing behavior of the thrown error, not introduced here; happy to add a small sanitizer in a follow-up if desired.

Fixes #3952

Made with Orca 🐋


Open in Stage

brennanb2025 avatar Jul 01 '26 20:07 brennanb2025

Ready to review this PR? Stage has broken it down into 4 individual chapters for you:

Title
1 Extract platform-specific labels to separate utility
2 Persist CLI registration errors in the UI
3 Implement persistent errors for WSL registration
4 Add tests for persistent error behavior
Open in Stage

Chapters generated by Stage for commit ca1785c111076dcf4c9a9648da65deffbb069fe8 on Jul 1, 2026 9:21pm UTC.

ghost avatar Jul 01 '26 20:07 ghost

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: e5ae694d-d7a2-446f-bb8e-1e8c77d82f7b

📥 Commits

Reviewing files that changed from the base of the PR and between 3f503c64108bac22c3130db188d79f28cbb0a940 and ca1785c111076dcf4c9a9648da65deffbb069fe8.

📒 Files selected for processing (1)
  • src/renderer/src/components/settings/WslCliRegistration.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/renderer/src/components/settings/WslCliRegistration.tsx

📝 Walkthrough

Walkthrough

This PR adds shared platform-specific CLI label helpers, persists install/remove errors inline in CliSection and WslCliRegistration, passes CLI action errors into the registration dialog, and adds refresh-based clearing for WSL status updates. It also expands test coverage for failed install persistence, clearing after successful refresh or reinstall, and dialog-visible error handling.

Changes

Related issues: None identified.
Related PRs: None identified.
Suggested labels: renderer, settings, tests
Suggested reviewers: None identified.

Sequence Diagram(s)

Included in the hidden review stack artifact above.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers summary, changes, testing, and notes, but it omits required Screenshots, AI Review Report, and Security Audit sections. Add the missing template sections, especially Screenshots, AI Review Report, and Security Audit, and include the required cross-platform review notes.
Out of Scope Changes check ⚠️ Warning The WslCliRegistration changes and tests are not required by #3952 and appear to add separate behavior beyond the linked issue scope. Either remove the WSL error-persistence changes or justify them in the issue/description and split them into a separate PR.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: persisting CLI install/remove errors inline in Settings.
Linked Issues check ✅ Passed The inline error state, persistence, clearing on success/refresh, and specific failure messaging address #3952's requirements.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • [ ] Create stacked PR
  • [ ] Commit on current branch

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.

coderabbitai[bot] avatar Jul 01 '26 20:07 coderabbitai[bot]

Moving this PR to draft because it has been untouched for more than 80 days (latest recorded PR activity or commit timestamp: 2026-07-01T21:23:12Z; checked on 2026-10-27). This keeps the review queue focused on active work while preserving the proposal. Please mark it ready for review when work resumes.

OrcaWin avatar Oct 27 '26 09:10 OrcaWin

Closing as superseded — the linked issue (#3952) has been resolved on main by #3959 (a6c658c325), #18125 (0da52453a7). Thanks for the contribution!

nwparker avatar Nov 05 '26 23:11 nwparker