feat(setup): paint "you" green in the display-name prompt
Adds an `accentGreen` helper (#3fba50) with the same TTY/NO_COLOR/
truecolor gating as the rest of the palette, then wraps the word
"you" in the "What should your assistant call you?" prompt so the
operator parses at a glance who the question is about — the user,
not the assistant. The mirror prompt that asks for the assistant's
name ("What should your assistant be called?") is left for a
follow-up.
This commit is contained in:
@@ -52,7 +52,7 @@ import { claudeCliAvailable, resolveTimezoneViaClaude } from './lib/tz-from-clau
|
|||||||
import * as setupLog from './logs.js';
|
import * as setupLog from './logs.js';
|
||||||
import { ensureAnswer, fail, runQuietChild, runQuietStep } from './lib/runner.js';
|
import { ensureAnswer, fail, runQuietChild, runQuietStep } from './lib/runner.js';
|
||||||
import { emit as phEmit } from './lib/diagnostics.js';
|
import { emit as phEmit } from './lib/diagnostics.js';
|
||||||
import { brandBody, brandBold, brandChip, dimWrap, fitToWidth, note, wrapForGutter } from './lib/theme.js';
|
import { accentGreen, brandBody, brandBold, brandChip, dimWrap, fitToWidth, note, wrapForGutter } from './lib/theme.js';
|
||||||
import { isValidTimezone } from '../src/timezone.js';
|
import { isValidTimezone } from '../src/timezone.js';
|
||||||
|
|
||||||
const CLI_AGENT_NAME = 'Terminal Agent';
|
const CLI_AGENT_NAME = 'Terminal Agent';
|
||||||
@@ -976,7 +976,7 @@ async function runTimezoneStep(): Promise<void> {
|
|||||||
async function askDisplayName(fallback: string): Promise<string> {
|
async function askDisplayName(fallback: string): Promise<string> {
|
||||||
const answer = ensureAnswer(
|
const answer = ensureAnswer(
|
||||||
await p.text({
|
await p.text({
|
||||||
message: 'What should your assistant call you?',
|
message: `What should your assistant call ${accentGreen('you')}?`,
|
||||||
placeholder: fallback,
|
placeholder: fallback,
|
||||||
defaultValue: fallback,
|
defaultValue: fallback,
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -39,6 +39,18 @@ export function brandChip(s: string): string {
|
|||||||
return k.bgCyan(k.black(k.bold(s)));
|
return k.bgCyan(k.black(k.bold(s)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Accent green (#3fba50) for emphasizing a single word inside prompt
|
||||||
|
* messages — currently the "you" in "What should your assistant call
|
||||||
|
* you?" so the operator parses at a glance who the question is about.
|
||||||
|
* Same TTY/NO_COLOR/truecolor gating as the rest of the palette.
|
||||||
|
*/
|
||||||
|
export function accentGreen(s: string): string {
|
||||||
|
if (!USE_ANSI) return s;
|
||||||
|
if (TRUECOLOR) return `\x1b[38;2;63;186;80m${s}\x1b[39m`;
|
||||||
|
return k.green(s);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Brand body color for setup-flow prose. Used for card bodies (via the
|
* Brand body color for setup-flow prose. Used for card bodies (via the
|
||||||
* `note()` formatter) and `p.log.*` body arguments — anywhere the
|
* `note()` formatter) and `p.log.*` body arguments — anywhere the
|
||||||
|
|||||||
Reference in New Issue
Block a user