Skip to content

Commit cb465fd

Browse files
fix: improve channel step UX copy and resume prompt (#568)
* fix: improve channel step UX copy and resume prompt - Replace vague channel prompt with clear explanation of what a channel is, that nothing goes live until a native build ships, and a link to docs (https://capgo.app/docs/live-updates/channels/) - Convert channel confirm to select: "Use production" vs "Choose a custom name" with emoji labels - Convert resume confirm to select with emoji labels for consistency * fix: show relevant examples as placeholder for custom channel name Instead of showing "production" as placeholder when the user chose custom, show "e.g. staging, beta, dev" since they opted out of production.
1 parent e17a6a9 commit cb465fd

File tree

1 file changed

+22
-12
lines changed

1 file changed

+22
-12
lines changed

src/init/command.ts

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -422,9 +422,15 @@ async function readStepsDone(orgId: string, apikey: string): Promise<number | un
422422

423423
const { step_done, pathToPackageJson, channelName, platform, delta, currentVersion } = JSON.parse(rawData)
424424
pLog.info(formatInitResumeMessage(step_done, initOnboardingSteps.length))
425-
const skipSteps = await pConfirm({ message: 'Would you like to continue from where you left off?' })
426-
await cancelCommand(skipSteps, orgId, apikey)
427-
if (skipSteps) {
425+
const resumeChoice = await pSelect({
426+
message: 'Would you like to continue from where you left off?',
427+
options: [
428+
{ value: 'yes', label: '✅ Yes, continue' },
429+
{ value: 'no', label: '❌ No, start over' },
430+
],
431+
})
432+
await cancelCommand(resumeChoice, orgId, apikey)
433+
if (resumeChoice === 'yes') {
428434
if (pathToPackageJson) {
429435
globalPathToPackageJson = pathToPackageJson
430436
}
@@ -1170,20 +1176,24 @@ async function addAppStep(organization: Organization, apikey: string, appId: str
11701176
async function addChannelStep(orgId: string, apikey: string, appId: string) {
11711177
const pm = getPMAndCommand()
11721178
pLog.success(`✅ App ${appId} added — accessible to all members of your organization`)
1173-
pLog.info(`💡 Nothing goes to customers before the native app is in the store.`)
1174-
pLog.info(` This step only affects the test build on your phone.`)
1175-
pLog.info(` Choose Yes unless you already have your own channel setup.`)
1179+
pLog.info(`💡 A channel is a release track — it controls which users get which updates.`)
1180+
pLog.info(` Nothing goes live until you release a native build with Capacitor Updater to the stores.`)
1181+
pLog.info(` Most apps just need one: "production". You can add more later.`)
1182+
pLog.info(` Learn more: https://capgo.app/docs/live-updates/channels/`)
11761183
let channelName = globalChannelName
1177-
const useCustomChannelName = await pConfirm({
1178-
message: `Do you want to choose a custom channel name instead of "${defaultChannel}"?`,
1179-
initialValue: false,
1184+
const channelChoice = await pSelect({
1185+
message: 'Which channel name do you want to use?',
1186+
options: [
1187+
{ value: 'default', label: `✅ Use "${defaultChannel}"` },
1188+
{ value: 'custom', label: '✏️ Choose a custom name' },
1189+
],
11801190
})
1181-
await cancelCommand(useCustomChannelName, orgId, apikey)
1191+
await cancelCommand(channelChoice, orgId, apikey)
11821192

1183-
if (useCustomChannelName) {
1193+
if (channelChoice === 'custom') {
11841194
const selectedChannelName = await pText({
11851195
message: 'Enter the channel name to use for onboarding:',
1186-
placeholder: defaultChannel,
1196+
placeholder: 'e.g. staging, beta, dev',
11871197
validate: validateChannelName,
11881198
})
11891199
await cancelCommand(selectedChannelName, orgId, apikey)

0 commit comments

Comments
 (0)