feat(cli): polish onboarding intro and scan-report layout#661
Open
NisargIO wants to merge 12 commits into
Open
feat(cli): polish onboarding intro and scan-report layout#661NisargIO wants to merge 12 commits into
NisargIO wants to merge 12 commits into
Conversation
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Animated welcome scene now plays on every interactive run (not just first run) at the full cadence on first run and 2x on returning runs, with `--verbose` skipping it entirely. Dropped the closing "Let's scan your codebase..." beat so the intro ends on the tagline. Scan report restructured: top-errors detail leads with code frames + fixes, then a divider, then a new bold `All N issues` header introduces the per-category breakdown (Security → Bugs → Performance → Accessibility → Maintainability — fixed order), then the score. Warnings no longer get boxed code frames in `--verbose`. Trailing CTA drops the redundant `+N more rules and +N optional warnings` stats — the breakdown above already carries them — and reads as a clean `Run npx react-doctor@latest --verbose to list every error and warning`. Co-authored-by: Cursor <cursoragent@cursor.com>
|
✅ Parity OK — no diagnostic differences. Baseline:
trace |
commit: |
Contributor
|
React Doctor found 8 files changed in this pull request, but none matched the files covered by its enabled checks. Scope: 8 files changed on Generated by React Doctor. Questions? Contact founders@million.dev. |
…d-scan-report Resolves conflict in packages/react-doctor/src/cli/utils/constants.ts by keeping the halved welcome-scene timings (used alongside the new speedMultiplier in render-welcome.ts) and dropping the now-unused WELCOME_HOLD_MS.
- Drop the local dev-dep install from the "Add to CI" path. The `doctor` package script and the GitHub workflow both invoke `npx react-doctor@latest`, so a pinned local copy adds nothing — and on pnpm with a beta channel the install noisily trips the supply-chain trust guard (ERR_PNPM_TRUST_DOWNGRADE) for zero user benefit. Users who explicitly want a local copy still get one via `react-doctor install`. - For the `install` command path, render `trust-policy-blocked` (and any other install-command failure) as a yellow `⚠` spinner.warn instead of a red `✖` spinner.fail, with the headline tightened to one short line and the manual install command moved to a dim follow-up. The previous wording read like a crash next to its own "React Doctor still works" reassurance. - Add a `warn(text)` method to the spinner wrapper (proxies through to ora's native warn). Co-authored-by: Cursor <cursoragent@cursor.com>
The "Add to CI" option was a single line in a list of four with the social-proof + backlog framing reserved for *after* the user committed. Made the case where it influences the decision instead: - When the GitHub Actions workflow isn't already installed, the handoff opens with a short bold pitch above the prompt: incremental backlog rollout, social proof (PayPal/Rippling/Alibaba), one-time setup, and a dim `Learn more: https://react.doctor/ci` link. The choice title becomes `Add to CI (recommended)` and its description summarises what gets set up. - The post-pick block drops the duplicate social-proof + backlog talking points (now redundant — the user just saw them seconds ago) and confirms what changed plus the docs link. - Users who already have CI configured get neither the pitch nor the "(recommended)" tag — the existing `✔ workflow already configured` spinner line is enough, and we don't want to pester users who are already done. - Added `isReactDoctorWorkflowInstalled(projectRoot)` to `install-github-workflow.ts` and reused it from `runInstallReactDoctor` in place of the inline `existsSync` + `getReactDoctorWorkflowPath` check, so the handoff and the install command agree on what "configured" means in one place. Co-authored-by: Cursor <cursoragent@cursor.com>
The previous attempt put the pitch in a separate block above the handoff prompt — wrong location. Move it where the user actually sees the report's other CTAs (Share / Docs / GitHub), as a peer entry at the top of the footer: CI: https://react.doctor/ci Scan every pull request — new PRs stay clean while you fix the backlog Used by teams at PayPal, Rippling, and Alibaba CI leads the footer because it's the highest-leverage action a user can take after reading the report. The two dim description lines stay under the 88-char wrap budget (`OUTPUT_DETAIL_WRAP_WIDTH_CHARS`) so they don't overflow at 100c terminals. Drop the now-redundant `printCiPitch` helper + pre-prompt call from `handoff-to-agent.ts`. Keep the `Add to CI (recommended)` choice tag gated on `isReactDoctorWorkflowInstalled`, and keep the lean post-pick message — the footer already made the case, the prompt now just labels the recommended action, and the post-pick text confirms what changed. Snapshot updated for the new footer ordering. Co-authored-by: Cursor <cursoragent@cursor.com>
Land it after Share / Docs / GitHub instead of leading the footer, so the CI pitch is the last thing the user reads before the handoff prompt that recommends it. The recency placement reinforces the prompt's `Add to CI (recommended)` choice better than primacy at the top of the footer did. Co-authored-by: Cursor <cursoragent@cursor.com>
Use a colon instead. Style choice for the user-facing strings introduced in this PR; comments and other pre-existing copy left alone. Co-authored-by: Cursor <cursoragent@cursor.com>
Two related polish items:
- The footer entry, prompt choice, and post-pick text all referred to
generic "CI" while the CLI only ever installs a GitHub Actions workflow.
Rename to "GitHub Actions" so the label names the concrete thing this
CLI actually sets up. The `CI_URL` constant + `/ci` docs path are
unchanged.
- Move the choice's "(already configured)" state from the description to
the title (where "(recommended)" also lives), and let the description
always describe what picking the option *does* ("Set up the workflow
file + the doctor package script") rather than the project's current
state.
Internal `setUpCi` and `isCiAlreadyConfigured` renamed to
`setUpGitHubActions` and `isGitHubActionsConfigured` for consistency.
The `CI_CHOICE = "ci"` constant value, `CI_URL`, and `CI_TRUST_COMPANIES`
stay as-is — they're either metric-history continuity keys or stable
shared constants. Snapshot refreshed for the new footer label.
Co-authored-by: Cursor <cursoragent@cursor.com>
Listing the choice when the workflow file is already present only ever produced "✔ GitHub Actions workflow already configured" — clutter. Hide the choice entirely in that state; the first option becomes whichever launchable agent (or Copy prompt) is next. The footer's `GitHub Actions:` entry still appears for those users as an informational docs link with the social-proof description. Co-authored-by: Cursor <cursoragent@cursor.com>
…d path modules This change standardizes the import style across multiple files by replacing default imports of the fs and path modules with namespace imports. This improves consistency and aligns with modern JavaScript practices.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A pass on the first-run onboarding experience and the scan-report layout to make the interactive run friendlier and easier to scan.
Intro
--verboseskips the intro entirely and falls through to the staticReact Doctor vX.Y.Zbranded header — verbose is a power-user review mode, the user already knows what react-doctor is."Let's scan your codebase..."typewriter beat; the intro now ends on the tagline.Scan report layout
Top N errors you should fix+ code frames + fixes) now leads the report — the most actionable content first.All N issuesheader (mirroring the top-errors header) so the section has a clear identity instead of reading as a loose tally.DIAGNOSTIC_CATEGORY_BUCKETS). Rule order within each category still follows score-API priority.--verbose(errors still do). A long warning tail no longer drowns the report.N issuestotal line is gone — it's folded into theAll N issuesheader.--verboseCTA drops the redundant+N more rules and +N optional warningsstats (the breakdown directly above already gives totals and the error/warning split) and reads as a cleanRun npx react-doctor@latest --verbose to list every error and warning. No more "you have all 727 issues — also, 664 warnings are hidden" contradiction.Before → After (example)
Before
```
Performance › 60 errors, 181 warnings
Bugs › 3 errors, 118 warnings
Accessibility › 84 warnings
Maintainability › 280 warnings
Security › 4 warnings
730 issues
───────────────────
Top 3 errors you should fix
✖ ... (3 detail blocks)
+5 more rules and +664 optional warnings - run npx react-doctor@latest --verbose for details
```
After
```
Top 3 errors you should fix
✖ ... (3 detail blocks)
───────────────────
All 730 issues
Security › 4 warnings
Bugs › 3 errors, 118 warnings
Performance › 60 errors, 181 warnings
Accessibility › 84 warnings
Maintainability › 280 warnings
Run npx react-doctor@latest --verbose to list every error and warning
```
Test plan
Made with Cursor