Skip to content

feat(init): polish ink wizard chrome, colors, and non-tty handling#928

Merged
betegon merged 8 commits into
feat/init-wizard-inkfrom
bt/init-agent-errors-ink-colors
May 7, 2026
Merged

feat(init): polish ink wizard chrome, colors, and non-tty handling#928
betegon merged 8 commits into
feat/init-wizard-inkfrom
bt/init-agent-errors-ink-colors

Conversation

@betegon
Copy link
Copy Markdown
Member

@betegon betegon commented May 7, 2026

Stacked on top of #885 (Ink wizard). Once #885 merges, GitHub auto-retargets this PR to main.

Summary

Polish and hardening pass on the Ink wizard: extracted layout primitives into their own modules, fixed colors for non-TTY and dim terminals, tightened welcome copy, and added outcome-aware feedback prompts shown at the end of every run.

What's in this PR

Seven commits, roughly in order of impact:

  1. 49edbf10 fix(init): harden non-tty init and ink colors — require --yes and explicit feature flags before any network lookup or UI startup in non-TTY mode. Let Ink text inherit the terminal's foreground color instead of the unused theme.ts detection; deleted theme.ts.

  2. 56812003 feat(init): polish ink welcome flow — vertically-centered intro, proportional top padding based on terminal height, trimmed copy.

  3. 7a6718e6 feat(init): streamline ink init screens — condensed screen layouts, removed redundant status bar rows, simplified tab footer.

  4. 68c07bbd fix(init): simplify tracing feature copy — shortened verbose tracing feature description strings.

  5. 6f0824cc feat(init): add outcome feedback prompts — new feedback.ts with formatFeedbackHint() that returns outcome-specific copy (success / cancelled / failed) pointing users to sentry cli feedback.

  6. b3817f2a feat(init): polish ink workflow chrome — extracted layout primitives into ink-frame.tsx (getInkFrameWidth, getInkFrameMargin, TabFooter, ShortcutFooter, InitRenderBoundary) and a shortcut-hint context into ink-shortcuts.tsx. Also adds ink-report.ts for the post-dispose chalk summary.

  7. 1f63face feat(init): clarify sidebar learning copy — revised the sidebar's "learning" block text for conciseness.

Files added

  • src/lib/init/feedback.ts — outcome feedback hint formatter
  • src/lib/init/ui/ink-frame.tsx — frame-level layout components and error boundary
  • src/lib/init/ui/ink-shortcuts.tsx — shortcut hint context + hooks
  • src/lib/init/ui/ink-report.ts — post-dispose chalk report

Files deleted

  • src/lib/init/ui/theme.ts — unused since Ink now inherits terminal foreground

Verification

  • bun run typecheck (clean)
  • bun run lint (no new warnings)
  • bun test --isolate test/lib/init/ (all pass)
  • Manual: bun run src/bin.ts init renders welcome, tabs, shortcuts, and feedback prompt on exit

betegon added 7 commits May 5, 2026 20:42
Require non-TTY callers to pass --yes and explicit features before network lookup or UI startup. Normalize public feature aliases at the command boundary, and let Ink text inherit the terminal foreground instead of using unused theme detection.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://cli.sentry.dev/_preview/pr-928/

Built to branch gh-pages at 2026-05-07 16:23 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

…typecheck

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

Codecov Results 📊

6758 passed | Total: 6758 | Pass Rate: 100% | Execution Time: 0ms

📊 Comparison with Base Branch

Metric Change
Total Tests 📈 +72
Passed Tests 📈 +72
Failed Tests
Skipped Tests

All tests are passing successfully.

❌ Patch coverage is 79.49%. Project has 14185 uncovered lines.
✅ Project coverage is 76.53%. Comparing base (base) to head (head).

Files with missing lines (11)
File Patch % Lines
src/lib/init/ui/ink-app.tsx 81.21% ⚠️ 130 Missing
src/lib/init/ui/ink-report.ts 45.00% ⚠️ 55 Missing
src/lib/init/ui/ink-frame.tsx 62.93% ⚠️ 43 Missing
src/commands/init.ts 87.10% ⚠️ 12 Missing
src/lib/init/wizard-runner.ts 88.37% ⚠️ 5 Missing
src/lib/init/ui/wizard-store.ts 42.86% ⚠️ 4 Missing
src/lib/init/readiness.ts 0.00% ⚠️ 3 Missing
src/lib/init/interactive.ts 88.89% ⚠️ 1 Missing
src/lib/init/preflight.ts 50.00% ⚠️ 1 Missing
src/lib/init/ui/factory.ts 0.00% ⚠️ 1 Missing
src/lib/init/ui/ink-shortcuts.tsx 99.12% ⚠️ 1 Missing
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    75.74%    76.53%    +0.79%
==========================================
  Files          303       317       +14
  Lines        58783     60439     +1656
  Branches         0         0         —
==========================================
+ Hits         44523     46254     +1731
- Misses       14260     14185       -75
- Partials         0         0         —

Generated by Codecov Action

@betegon betegon marked this pull request as ready for review May 7, 2026 16:50
@betegon betegon merged commit 411da3e into feat/init-wizard-ink May 7, 2026
18 checks passed
@betegon betegon deleted the bt/init-agent-errors-ink-colors branch May 7, 2026 16:50
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 915fda0. Configure here.

})}
</Box>
);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exported StatusHistory component is never imported

Low Severity

StatusHistory is exported from ink-frame.tsx but never imported anywhere in the codebase. The old inline StatusBar was removed from the workflow layout in ink-app.tsx, and this extracted replacement was never wired up. It's dead code that adds maintenance burden without being used.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 915fda0. Configure here.

"You'll choose the setup before local files change.",
],
punchline: "Continue to let Sentry use AI for setup.",
};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome options text duplicated across two files

Low Severity

DEFAULT_WELCOME_OPTIONS in ink-app.tsx and buildWelcomeOptions() in wizard-runner.ts contain identical title, body, and punchline strings. If one copy is updated without the other, the fallback in ink-app.tsx will silently diverge from the primary value passed through the prompt flow.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 915fda0. Configure here.

Comment on lines 576 to 582
precomputeSentryDetection(directory).catch(() => null),
]);
const fileCache = await preReadCommonFiles(directory, dirListing);
ui.setIntroMode?.(false);
spin.message("Connecting to wizard...");
run = await workflow.createRun();
// Large shared context (dirListing, fileCache, existingSentry)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: If an error occurs during pre-computation, the call to ui.setIntroMode?.(false) is skipped, which prevents the sidebar timers from starting and updating the UI.
Severity: LOW

Suggested Fix

Move the ui.setIntroMode?.(false) call to a location before the try-catch block that handles pre-computation errors, or add an equivalent call inside the catch block to ensure the sidebar timers are always started.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: src/lib/init/wizard-runner.ts#L576-L582

Potential issue: In the `runWizard` function, pre-computation steps such as
`precomputeDirListing` and `preReadCommonFiles` are wrapped in a `try-catch` block. If
one of these asynchronous operations fails, control jumps to the `catch` block. This
bypasses the `ui.setIntroMode?.(false)` call, which is responsible for triggering
`startSidebarTimers()`. Consequently, the sidebar's educational content and tips will
not start rotating, leaving that part of the UI static, although the main wizard
functionality is not blocked.

Did we get this right? 👍 / 👎 to inform future reviews.

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