feat: add init platform selected summary#125
Conversation
Show the active platform selection outside the options list so detected platform labels stay concise while users still see what will be configured. Co-Authored-By: Codex <noreply@openai.com>
Apply formatter output to keep the platform prompt source consistent with project style. Co-Authored-By: Codex <noreply@openai.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughAdds a custom Inquirer-based multi-select terminal prompt ( ChangesPlatform Select Prompt Feature
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Greptile SummaryThis PR replaces the plain
Confidence Score: 5/5Safe to merge — the change is additive, all state helper logic is unit-tested, and the i18n wiring is verified end-to-end for both locales. The custom prompt correctly calls all @inquirer/core hooks unconditionally, handles empty-list edge cases with explicit guards, and the i18n substitution for labels is complete and tested. The only gap is that the keyboard hint action strings are hardcoded in English, which is a cosmetic inconsistency rather than a functional defect. No files require special attention. Important Files Changed
Sequence Diagram%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant User
participant initCommand
participant selectPlatforms
participant platformSelectPrompt
participant i18n
User->>initCommand: comet init --language zh
initCommand->>selectPlatforms: detected platforms
selectPlatforms->>i18n: t(lang, 'selectPlatforms') / t(lang, 'selectedPlatforms') / t(lang, 'noneSelected') / t(lang, 'selectPlatformsRequired')
i18n-->>selectPlatforms: localized strings
selectPlatforms->>platformSelectPrompt: "{ message, choices, selectedLabel, emptyLabel, requiredErrorLabel, required }"
loop Keypress
User->>platformSelectPrompt: up/down / space / a / i
platformSelectPrompt-->>User: re-render with updated summary line
end
User->>platformSelectPrompt: Enter
platformSelectPrompt-->>selectPlatforms: string[] of selected platform IDs
selectPlatforms-->>initCommand: selected IDs
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant User
participant initCommand
participant selectPlatforms
participant platformSelectPrompt
participant i18n
User->>initCommand: comet init --language zh
initCommand->>selectPlatforms: detected platforms
selectPlatforms->>i18n: t(lang, 'selectPlatforms') / t(lang, 'selectedPlatforms') / t(lang, 'noneSelected') / t(lang, 'selectPlatformsRequired')
i18n-->>selectPlatforms: localized strings
selectPlatforms->>platformSelectPrompt: "{ message, choices, selectedLabel, emptyLabel, requiredErrorLabel, required }"
loop Keypress
User->>platformSelectPrompt: up/down / space / a / i
platformSelectPrompt-->>User: re-render with updated summary line
end
User->>platformSelectPrompt: Enter
platformSelectPrompt-->>selectPlatforms: string[] of selected platform IDs
selectPlatforms-->>initCommand: selected IDs
Reviews (2): Last reviewed commit: "fix(init): Localize platform select vali..." | Re-trigger Greptile |
There was a problem hiding this comment.
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 `@src/commands/platform-select-prompt.ts`:
- Around line 138-140: The hardcoded English error message "At least one choice
must be selected" in the required validation check of the
platform-select-prompt.ts file prevents proper localization for Chinese mode.
Remove the hardcoded string from the setError call in the if block that checks
required && selected.length === 0, add a new field to PlatformSelectPromptConfig
to accept a localized error message for required field validation, update the
setError call to use the passed-in localized message from config, and then pass
the appropriate localized error message when initializing
PlatformSelectPromptConfig from init.ts based on the current language mode.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 8fefc772-9993-4c1e-b686-0b557598c73b
⛔ Files ignored due to path filters (2)
package-lock.jsonis excluded by!**/package-lock.jsonpnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (6)
package.jsonsrc/commands/i18n.tssrc/commands/init.tssrc/commands/platform-select-prompt.tstest/ts/init-e2e.test.tstest/ts/platform-select-prompt.test.ts
|
Please fix the AI Review issues first. |
Pass the required-selection error through the init translation table so Chinese mode no longer falls back to English. Keep the custom prompt pagination hook in a stable render order to match Inquirer prompt behavior. Co-Authored-By: Codex <noreply@openai.com>
|
Fixed the issues raised by AI Review, except for CHANGELOG.md |
|
LGTM |
- Merge master commit 6b2e14a (feat: add init platform selected summary #125) - Resolve package.json/package-lock.json version and dependency conflicts - Keep version at 0.4.0-beta.1 (feat-workflow) - Combine dependencies from both branches (yaml + @inquirer/type) - Add platform-select-prompt feature from master
Show the active platform selection outside the options list so detected platform labels stay concise while users still see what will be configured.
✨ Summary
Add display of currently selected platforms to the platform selection interface for
comet init. The main reason for this change is that the current selection interface requires scrolling through all platforms to fully confirm which ones are selected , especially when some platforms are auto-checked because they were detected, this maks it hard to know which platforms are currently selected.The effect of the current change is shown in the red-boxed area of the screenshot:

🎯 Scope
init,status,doctor,update)assets/skills/,assets/skills-zh/)assets/skills/comet/scripts/)🧪 Testing
pnpm buildpnpm lintpnpm format:checkpnpm testpnpm test -- test/ts/comet-scripts.test.tspnpm test:shell✅ Checklist
fix: handle project-scope initREADME.md,README-zh.md, orCONTRIBUTING.mdCHANGELOG.mdis updated when behavior changesassets/manifest.jsonand relevant tests👀 Notes for Reviewers
Summary by CodeRabbit