feat(setup): label headless URL fallback with "Get started:"

When a card's auto-open is gated on `confirmThenOpen`, the URL also
appears inside the surrounding `note(...)` as a copy-paste fallback —
rendered dim because on a GUI device the auto-open is doing the
heavy lifting and the printed URL is just an incidental backup.

On headless devices the auto-open doesn't run (per #2145), so the
URL inside the note is the user's *only* path forward. A dim URL
reads as "incidental reference" exactly when it should be reading
as "this is the action."

Adds `formatNoteLink(url)` to setup/lib/browser.ts:
  - GUI device → `k.dim(url)` (unchanged from today)
  - Headless device → `Get started: <url>` at full strength

Replaces five call sites (Discord ×3, Slack ×1, Telegram ×1).
Single helper, atomic switch via the same `isHeadless()` plumbing
introduced in #2145, so the headless behavior across all five
flows stays in sync.
This commit is contained in:
exe.dev user
2026-04-30 10:31:43 +00:00
committed by gavrielc
parent 4d42bb95fb
commit 6863e0f63b
4 changed files with 24 additions and 8 deletions

View File

@@ -28,7 +28,7 @@ import k from 'kleur';
import * as setupLog from '../logs.js';
import { brightSelect } from '../lib/bright-select.js';
import { confirmThenOpen } from '../lib/browser.js';
import { confirmThenOpen, formatNoteLink } from '../lib/browser.js';
import { askOperatorRole } from '../lib/role-prompt.js';
import { ensureAnswer, fail, runQuietChild } from '../lib/runner.js';
import { accentGreen, brandBody, fmtDuration, note } from '../lib/theme.js';
@@ -165,7 +165,7 @@ async function walkThroughBotCreation(): Promise<void> {
' 3. On the same tab, enable "Message Content Intent"',
' (under Privileged Gateway Intents)',
'',
k.dim(url),
formatNoteLink(url),
].join('\n'),
'Create a Discord bot',
);
@@ -225,7 +225,7 @@ async function walkThroughServerCreation(): Promise<void> {
' 2. Choose "Create My Own" → "For me and my friends"',
' 3. Give it any name (e.g. "NanoClaw")',
'',
k.dim(url),
formatNoteLink(url),
].join('\n'),
'Create a Discord server',
);
@@ -447,7 +447,7 @@ async function promptInviteBot(
' 1. Pick any server you\'re in (a personal one is fine)',
' 2. Click "Authorize"',
'',
k.dim(url),
formatNoteLink(url),
].join('\n'),
'Add bot to a server',
);

View File

@@ -25,7 +25,7 @@ import * as p from '@clack/prompts';
import k from 'kleur';
import * as setupLog from '../logs.js';
import { confirmThenOpen } from '../lib/browser.js';
import { confirmThenOpen, formatNoteLink } from '../lib/browser.js';
import { askOperatorRole } from '../lib/role-prompt.js';
import { ensureAnswer, fail, runQuietChild } from '../lib/runner.js';
import { accentGreen, fmtDuration, note, wrapForGutter } from '../lib/theme.js';
@@ -136,7 +136,7 @@ async function walkThroughAppCreation(): Promise<void> {
' 4. Basic Information → copy the "Signing Secret"',
' 5. Install to Workspace → copy the "Bot User OAuth Token" (xoxb-…)',
'',
k.dim(SLACK_APPS_URL),
formatNoteLink(SLACK_APPS_URL),
].join('\n'),
'Create a Slack app',
);

View File

@@ -21,7 +21,7 @@ import * as p from '@clack/prompts';
import k from 'kleur';
import * as setupLog from '../logs.js';
import { confirmThenOpen } from '../lib/browser.js';
import { confirmThenOpen, formatNoteLink } from '../lib/browser.js';
import { askOperatorRole } from '../lib/role-prompt.js';
import {
type Block,
@@ -51,7 +51,7 @@ export async function runTelegramChannel(displayName: string): Promise<void> {
[
`Opening @${botUsername} in Telegram so it's ready when the pairing code shows up.`,
'',
k.dim(botUrl),
formatNoteLink(botUrl),
].join('\n'),
'Open Telegram',
);