setup: add back-to-channels exit to "Other…" channel-name prompt
After picking "Other…" from the channel picker, today's flow drops the user straight into a free-text prompt with no way back. Replace it with a brightSelect that offers either "Type the channel name" (existing behavior) or "← Back to channel selection" — same back-affording pattern the channel sub-flows already use. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
committed by
exe.dev user
parent
f2d2ce9aed
commit
1eb55e85a0
@@ -468,7 +468,7 @@ async function main(): Promise<void> {
|
|||||||
} else if (channelChoice === 'imessage') {
|
} else if (channelChoice === 'imessage') {
|
||||||
result = await runIMessageChannel(displayName!);
|
result = await runIMessageChannel(displayName!);
|
||||||
} else if (channelChoice === 'other') {
|
} else if (channelChoice === 'other') {
|
||||||
await askOtherChannelName();
|
result = await askOtherChannelName();
|
||||||
} else {
|
} else {
|
||||||
p.log.info(
|
p.log.info(
|
||||||
brandBody(
|
brandBody(
|
||||||
@@ -1099,10 +1099,26 @@ async function askChannelChoice(): Promise<ChannelChoice> {
|
|||||||
return choice;
|
return choice;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function askOtherChannelName(): Promise<void> {
|
async function askOtherChannelName(): Promise<void | typeof BACK_TO_CHANNEL_SELECTION> {
|
||||||
|
const action = ensureAnswer(
|
||||||
|
await brightSelect<'type' | 'back'>({
|
||||||
|
message: 'Which channel would you like to install?',
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
value: 'type',
|
||||||
|
label: 'Type the channel name',
|
||||||
|
hint: 'e.g. matrix, github, linear, webex',
|
||||||
|
},
|
||||||
|
{ value: 'back', label: '← Back to channel selection' },
|
||||||
|
],
|
||||||
|
initialValue: 'type',
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
if (action === 'back') return BACK_TO_CHANNEL_SELECTION;
|
||||||
|
|
||||||
const answer = ensureAnswer(
|
const answer = ensureAnswer(
|
||||||
await p.text({
|
await p.text({
|
||||||
message: 'Which channel would you like to install?',
|
message: 'Channel name',
|
||||||
placeholder: 'e.g. matrix, github, linear, webex',
|
placeholder: 'e.g. matrix, github, linear, webex',
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user