Skip to content
This repository was archived by the owner on Oct 23, 2026. It is now read-only.

feat(init): redesign the completion screen around the first error - #1444

Merged
betegon merged 5 commits into
mainfrom
feat/init-completion-screen
Aug 20, 2026
Merged

betegon merged 5 commits into
mainfrom
feat/init-completion-screen

Conversation

@betegon

@betegon betegon commented Aug 20, 2026

Copy link
Copy Markdown
Member

What

Redesigns the sentry init completion (exit) screen so finishing the wizard reads as a guided handoff instead of a wall of text. It answers three things, in the order a first-time user cares about:

  1. What happened — Sentry is installed in <project>, with a one-line note per enabled feature and a file-changed count.
  2. See your first error — the focal step: run your app, trigger an error, and watch it land in the Issues feed (with the link).
  3. Next steps — a driveable menu: open Issues, set up the Sentry MCP for your editor, or install the Sentry agent plugin.

The screen speaks init's own visual language (numbered action steps, glyph-aligned rows, colour-coded hierarchy) and stays mounted until dismissed.

Notable behaviour

  • Links to the project's Issues stream (where errors land), not project settings.
  • Reuses init's existing verify step: if it catches the first event, the screen celebrates it and deep-links that exact event.
  • Recovers org/project from the settings URL when the server doesn't send the slugs, so the Issues link and MCP step work even before the server change ships. Companion PR: getsentry/cli-init-apiInvalid auth command in install script #239.
  • Interactive next steps run in the real terminal after the alternate screen tears down (agent-plugin installer), or write config locally (MCP editor config).
  • On exit, leaves a compact confirmation in scrollback instead of re-dumping the whole summary.

Testing

  • pnpm test — 589 init/url tests pass; biome + tsc clean.
  • pnpm run preview:completion (add --verified) renders the screen with sample data for fast iteration.

🤖 Generated with Claude Code

Turn the exit screen into a guided handoff instead of a wall of text: what
was installed, the one thing to do next (trigger an error and watch it land
in the Issues feed), and a driveable menu of next steps.

- Rebuild the screen in init's own visual idiom — numbered action steps,
  glyph-aligned rows, colour-coded hierarchy — and keep it mounted until the
  user dismisses it.
- Link to the project's Issues stream instead of project settings; when the
  verify step catches the first event, celebrate it and deep-link that event.
- Recover org/project from the settings URL when the server doesn't return
  the slugs, so the Issues link and MCP step work regardless of server
  version (see the companion cli-init-api change that sends them directly).
- Drive next steps from the screen: open Issues in the browser, write the
  Sentry MCP config for an editor, or queue the agent-plugin installer to run
  in the real terminal after the alternate screen tears down.
- Leave a compact confirmation in scrollback on exit rather than re-dumping
  the whole summary.

Adds a `preview:completion` script to iterate on the screen without a full run.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 20, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
cli Ready Ready Preview Aug 20, 2026 3:22pm

Request Review

Comment thread packages/cli/src/lib/init/ui/ink-ui.ts Resolved
@betegon
betegon marked this pull request as ready for review August 20, 2026 08:22
Comment thread packages/cli/src/lib/init/formatters.ts Resolved
- Use the bigger, bolder ▶ cursor across all init selectors (was a tiny ▸)
  so the selection is unmistakable, and align the completion menu options
  under the section title.
- Merge the "Here's what we set up" subheader into the ✔ headline
  ("Sentry is set up in <project>, with:") so it reads as one sentence.
- Add an inline "(o) to open" shortcut on the first-error link that opens it
  in the browser directly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@cursor cursor Bot left a comment

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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 3 total unresolved issues (including 2 from previous reviews).

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 ee1c447. Configure here.

- Drop the hand-rolled MCP editor-config step (Cursor/VS Code/Claude Code
  only). The @sentry/ai plugin already wires the MCP server + skills into
  Cursor, Codex, Claude Code and Grok, so a separate, narrower MCP writer was
  redundant and missed Codex. The completion menu now offers just the
  agent-plugin install.
- Trim the post-exit echo to a warm one-liner plus the Issues link, and drop
  the feedback prompt that chained onto the queued `npx @sentry/ai install`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… screen

The CLI creates the Sentry project itself — the `ensure-sentry-project` step
suspends with the `create-sentry-project` client tool, whose result already
carries `{orgSlug, projectSlug, projectId, dsn, url}`. Previously that data made
a redundant round-trip: the CLI sent it to the server, and the server echoed it
back in the workflow output just so the completion screen could build the Issues
link. This captures the tool result in the wizard runner instead and passes it
straight to `formatResult`, so the completion screen is built entirely from local
data — no server echo needed. Makes getsentry/cli-init-api#239 unnecessary.

The captured identity takes precedence over any server-sent fields (the CLI is
authoritative), with the existing `output.*` / settings-URL fallback kept so the
CLI still works against any server version.

Also guards against the dry-run stub's `projectId: "(dry-run)"` sentinel leaking
into the Issues URL — only a genuine numeric id scopes the `?project=` filter;
anything else yields the org-wide stream.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Drop `script/preview-completion.tsx` and its `preview:completion` npm script —
the completion screen is covered by the formatters/wizard-runner tests, so the
standalone preview is no longer needed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Comment on lines +250 to +255
if (isSentrySaasUrl(url)) {
// Org is the subdomain; guard against the bare apex (no org subdomain).
const [subdomain] = parsed.hostname.split(".");
const orgSlug =
parsed.hostname === DEFAULT_SENTRY_HOST ? undefined : subdomain;
return { orgSlug, projectSlug };

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: The parseOrgProjectFromSettingsUrl function incorrectly identifies the region subdomain (e.g., us in us.sentry.io) as the organization slug for multi-region SaaS URLs.
Severity: LOW

Suggested Fix

Update parseOrgProjectFromSettingsUrl to guard against known region subdomains. Before treating a subdomain as an organization slug, check if it is a valid region (e.g., 'us', 'de') and handle it accordingly.

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: packages/cli/src/lib/sentry-urls.ts#L250-L255

Potential issue: The function `parseOrgProjectFromSettingsUrl` incorrectly parses
multi-region Sentry SaaS URLs, such as `us.sentry.io`. It splits the hostname by `.` and
incorrectly assumes the first part (`us`) is the organization slug. This logic is a
fallback that is triggered only when an `orgSlug` is not provided by the server or
captured locally during project creation. While safeguards make this scenario unlikely,
if it occurs, it would lead to the generation of incorrect issue links, pointing to a
non-existent organization based on the region name.

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

false positve.

@betegon
betegon merged commit d72720c into main Aug 20, 2026
32 checks passed
@betegon
betegon deleted the feat/init-completion-screen branch August 20, 2026 19:07

This branch was successfully deployed

1 active deployment
Preview — 51a0ab5e Deployed Aug 20, 2026 by vercel[bot]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant