Skip to content

feat(ux): smart menu, all commands, back nav, and consistent preview cards#60

Open
gpolanco wants to merge 3 commits intomainfrom
feat/ux-overhaul
Open

feat(ux): smart menu, all commands, back nav, and consistent preview cards#60
gpolanco wants to merge 3 commits intomainfrom
feat/ux-overhaul

Conversation

@gpolanco
Copy link
Copy Markdown
Owner

What

Complete UX overhaul of the interactive menu and add command flow.

Why

The menu always showed the same 5 options regardless of project state, causing new users to hit errors immediately. Commands like watch, list, and explain were only accessible via CLI flags, not from the interactive menu. The "Back to categories" option in add was a checkbox item inside a multiselect, which was confusing UX.

Changes

File Change
commands/menu.ts Smart context detection — shows Init+Exit when no .dwf/ found, full menu with mode badge when configured. Added Watch, List (sub-select), Explain. Error guard keeps loop alive.
commands/watch.ts Fixed SIGINT handler to resolve() Promise instead of process.exit(0) — Ctrl+C now returns to the menu. Exported runWatch.
commands/list.ts Exported runList for menu access.
commands/explain.ts Exported runExplain for menu access.
commands/add.ts Replaced BACK_VALUE hack with multiselectPromptOrBack — Esc navigates back cleanly. Unified preview card format between single-rule and multi-select flows.
utils/prompt.ts Added multiselectPromptOrBack<T> — returns null on Escape instead of exiting the process.

Test

pnpm build && cd packages/cli && npm link

# 1. No config — should show only Init + Exit
cd /tmp && mkdir test-devw && cd test-devw
devw

# 2. After init — should show full menu with "local mode · .dwf/" badge
# Select Init project, complete the wizard, menu should refresh

# 3. Watch — Ctrl+C should return to menu (not exit the program)
devw  # → Watch → Ctrl+C → back at menu prompt

# 4. List — should show sub-select: Rules / Tools / Assets
devw  # → List → pick one

# 5. Add → Back nav — Esc in rule multiselect should go back to categories (no checkbox back item)
devw  # → Add rules → pick category → press Esc → back at category list

…n-TTY

- Add 5 e2e tests covering devw add --list, --search, --tag, --dry-run,
  and full install with config/cache verification
- Fix init command crashing when .dwf/ exists and --yes flag is used in
  non-TTY mode: skip confirmPrompt, exit cleanly with exit code 0
- Update test to reflect new idempotent init behavior with -y
- Remove stale compiled rules section from CLAUDE.md (v2 writes to
  .claude/rules/ via directory bridge, not inline to CLAUDE.md)
…d add

- init: show summary card (location, tools, mode, files) + single confirm
  before writing; consolidate 3 spinners into 1
- add (direct): show preview card with rule description, scope, version,
  and target file before confirming install; skipped with --force/--dry-run
- add (interactive): replace header+loop summary with notePrompt for
  consistent visual style
- add: remove redundant ui.info(Downloading) spinner covers it
- resolveRuleVersionCheck: expose registryRule in return type for preview
…k nav

- menu: detect context at startup — show only Init+Exit when no .dwf/ found,
  full menu with local/global badge once configured
- menu: add Watch, List (with sub-select), and Explain as menu options
- menu: error guard keeps loop alive instead of exiting on command failure
- watch: fix SIGINT handler to resolve Promise instead of process.exit(0)
  so Ctrl+C returns to the menu rather than killing the process
- add: replace BACK_VALUE hack in multiselect with multiselectPromptOrBack —
  Esc now navigates back to categories cleanly without a checkbox back option
- add: unify preview card format between single-rule and multi-select flows
- prompt: export runWatch, runList, runExplain; add multiselectPromptOrBack util
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
landing Ready Ready Preview, Comment Apr 15, 2026 10:22pm

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