Skip to content

[luv-303] feat: redesign multi-CLI install/uninstall menu into Detected + Not-installed sections#302

Merged
NiveditJain merged 3 commits into
mainfrom
luv-303
May 8, 2026
Merged

[luv-303] feat: redesign multi-CLI install/uninstall menu into Detected + Not-installed sections#302
NiveditJain merged 3 commits into
mainfrom
luv-303

Conversation

@NiveditJain
Copy link
Copy Markdown
Member

@NiveditJain NiveditJain commented May 8, 2026

Summary

  • Replaces the flat "All / X only / Y only" multi-CLI selection prompt in policies --install with a sectioned layout: a Detected (N) section with a yellow ★ Install for all N detected aggregate row + green rows, and (install action only) a Not installed (M) · install hooks ahead of time section with dim rows so users can prep hooks for a CLI before it lands on PATH.
  • Uninstall flow keeps showing only detected CLIs and now reads "Remove from all N detected" on its aggregate row. Cursor skips section headers — only lands on selectable rows.
  • Refactors the option-building logic out of promptCliTargetSelection into a new exported buildCliMenuOptions(detected, action) so the layout rules (aggregate row only when detected.length > 1, undetected only when action === "install") are unit-testable without driving the keypress loop.
  • Syncs docs/configuration.mdx to describe the new sectioned layout (translated copies will follow via translate-docs.yml).

Preview

Install action with 2 of 7 detected (80-col width):

  Failproof AI — Install Hooks

  ── Detected (2) ──────────────────────────────────────────────────────────────
  ❯ ★  Install for all 2 detected
    ●  Claude Code
    ●  OpenAI Codex

  ── Not installed (5) · install hooks ahead of time ───────────────────────────
    ○  GitHub Copilot
    ○  Cursor Agent
    ○  OpenCode
    ○  Pi
    ○  Gemini CLI

  ──────────────────────────────────────────────────────────────────────────────
  [↑↓] Move  [Enter] Select  [^C] Quit

Test plan

  • bun run test:run — all 1531 tests pass (4 new tests in __tests__/hooks/install-prompt.test.ts cover install-with-mix, uninstall-no-undetected, all-7-detected, and 1-detected-no-aggregate)
  • bun run tsc — clean
  • bun run lint — 0 errors (1 pre-existing unrelated warning)
  • bun run build — clean
  • Manual render preview at 80-col across install (2 / all-7 / 4 detected) and uninstall (4 detected) scenarios — all sections render correctly with proper colors and dash-fill alignment

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Redesigned interactive multi-CLI selection: grouped "Detected (N)" section with an aggregate "Install for all N detected" row, per-CLI rows with visual markers, and a dimmed "Not installed (M)" section for forward-install options (install only). Uninstall shows only detected CLIs with updated aggregate wording.
  • Refactor

    • Option-building logic extracted to make layout rules unit-testable.
  • Tests

    • Added unit tests covering various detection/install/uninstall scenarios.
  • Docs

    • Updated CLI installation docs to describe the new selection UX.

NiveditJain and others added 2 commits May 7, 2026 19:06
…ed + Not-installed sections

Replaces the flat "All / X only / Y only" list in `policies --install`'s
multi-CLI prompt with a sectioned layout: a `Detected (N)` section with a
yellow `★ Install for all N detected` aggregate row + green `●` rows, and
(install action only) a `Not installed (M) · install hooks ahead of time`
section with dim `○` rows so users can prep hooks for a CLI before it
lands on PATH. Uninstall flow keeps showing only detected CLIs and now
reads "Remove from all N detected" on its aggregate row. Cursor skips
section headers — only lands on selectable rows.

Refactors the option-building logic out of `promptCliTargetSelection`
into a new exported `buildCliMenuOptions(detected, action)` so the
layout rules (aggregate row only when `detected.length > 1`, undetected
only when `action === "install"`) are unit-testable without driving the
keypress loop. Adds 4 tests covering install-with-mix, uninstall,
all-7-detected, and 1-detected-no-aggregate.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
… for new sectioned layout

Sync the description of the interactive multi-CLI selection prompt with
the redesign in 6f60904: replace the "Both / All / X only / Y only"
phrasing with the new "Detected (N) + Not installed (M)" sectioned
layout, and note that the uninstall flow shows only the Detected
section. translate-docs workflow will sync the 14 translated copies.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 8, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c00f023c-2e03-4289-9034-470bd5fc4f44

📥 Commits

Reviewing files that changed from the base of the PR and between f521630 and da5183c.

📒 Files selected for processing (1)
  • CHANGELOG.md
✅ Files skipped from review due to trivial changes (1)
  • CHANGELOG.md

📝 Walkthrough

Walkthrough

This PR redesigns the CLI selection menu for policies --install by extracting menu option construction into a reusable buildCliMenuOptions function, refactoring the prompt UI to display grouped "Detected" and "Not installed" sections with aggregate rows and ANSI styling, and adding comprehensive unit tests and documentation for the new layout rules.

Changes

CLI Menu Selection Redesign

Layer / File(s) Summary
Type and Function Definition
src/hooks/install-prompt.ts
Imports INTEGRATION_TYPES; introduces CliMenuOption interface with detected and isAll flags; exports buildCliMenuOptions(detected, action) to generate menu rows with aggregate "Install for all N detected" or "Remove from all N detected" rows and return undetected list.
Prompt UI and Navigation
src/hooks/install-prompt.ts
Refactors promptCliTargetSelection to build a display model with section headers and blank separators; renders "Detected" and (for install) "Not installed" sections with ANSI-styled markers; updates cursor wrap-around to use itemCount instead of options.length.
Unit Tests
__tests__/hooks/install-prompt.test.ts
Adds buildCliMenuOptions test suite covering install with mixed detected/undetected CLIs, uninstall with detected-only and updated wording, all-detected case, and single-CLI edge case.
Documentation and Changelog
docs/configuration.mdx, CHANGELOG.md
Updates configuration docs to describe grouped menu sections with aggregate rows and forward-install options; adds changelog entry documenting the menu redesign and helper extraction.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • exospherehost/failproofai#222: Both PRs modify src/hooks/install-prompt.ts to replace the old single-key prompt with an interactive arrow-key selector and restructure the multi-CLI install flow.
  • exospherehost/failproofai#236: Both PRs modify install-prompt.ts with complementary changes to CLI detection logic and prompt wording; this PR extracts and exports buildCliMenuOptions/CliMenuOption to support that work.
  • exospherehost/failproofai#220: Related changes to resolveTargetClis and the interactive CLI-targeting flow that intersect with the builder/refactor in this PR.

Poem

🐰 Hop hop, hooray! The menu grows wise,
Detected and waiting—what's installed in the skies.
Grouped rows, bold markers, a path crystal clear,
Forward-install options for those not yet here!
Refactored and tested, the flow takes its flight. 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 42.86% 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
Title check ✅ Passed The title clearly and specifically summarizes the main change: redesigning the multi-CLI install/uninstall menu into Detected and Not-installed sections.
Description check ✅ Passed The description covers the summary, type of change (refactor + feature), and includes a comprehensive test plan with all checklist items verified (lint, tsc, test, build).
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.

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


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

Copy link
Copy Markdown

@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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CHANGELOG.md`:
- Around line 5-7: The changelog entry for the new policies --install UX is
missing the required PR number; edit the single-line entry in CHANGELOG.md that
describes the redesign (referencing src/hooks/install-prompt.ts and the exported
helper buildCliMenuOptions) to append the PR identifier in the mandated format,
e.g. change the multiline description to a single-line entry ending with "
(`#302`)"; ensure the final line follows the exact guideline "- <description>
(#<PR_number>)" format.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c075d395-fa5b-45ad-9148-053d18230881

📥 Commits

Reviewing files that changed from the base of the PR and between 12a68d1 and f521630.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • __tests__/hooks/install-prompt.test.ts
  • docs/configuration.mdx
  • src/hooks/install-prompt.ts

Comment thread CHANGELOG.md
…entry

Per the project changelog convention (CLAUDE.md "Each entry should be a
single line: a short description followed by the PR number") and a
CodeRabbit review note on PR #302. Also folds the docs/configuration.mdx
sync (commit f521630) into the same line so the entry mentions both
deliverables of this PR rather than splitting them.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@NiveditJain NiveditJain merged commit 003244a into main May 8, 2026
9 checks passed
@NiveditJain NiveditJain mentioned this pull request May 8, 2026
3 tasks
NiveditJain added a commit that referenced this pull request May 8, 2026
Lock in the four entries currently staged under `## Unreleased` (Features
#302, Fixes #303 + #300, Docs #281) by promoting them to a new
`## 0.0.10-beta.5 — 2026-05-08` section, and add a fresh empty
`## Unreleased` heading on top for the next cycle. Mirrors the post-#301
convention.

Once merged, tag `v0.0.10-beta.5` on main → GitHub Release publishes
to npm under the `beta` dist-tag and auto-bumps `package.json` to
`0.0.10-beta.6` on main.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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