chore: simplify card introduction comments (#43040)

This commit is contained in:
Jinjing
2026-11-16 00:48:20 -08:00
committed by GitHub
parent 1964094cbc
commit 03e4333b8d
3 changed files with 1 additions and 6 deletions
@@ -32,7 +32,7 @@ function useWorktreeCardsIntroNotice(): WorktreeCardsIntroChoice | null {
return
}
const store = useAppStore.getState()
// Why re-read: a repeated effect run still holds the stale flag and would report 'shown' twice.
// A repeated effect run may still hold the stale flag.
if (store.worktreeCardsIntroNoticeSeen) {
return
}
@@ -160,7 +160,6 @@ export function WorktreeCardsIntroNotice(): React.JSX.Element | null {
void updateSettings({ experimentalNewWorktreeCardStyle: true }).then(() => {
setSaving(false)
if (useAppStore.getState().settings?.experimentalNewWorktreeCardStyle === true) {
// Why after the save: counts only people whose cards actually switched.
trackWorktreeCardsIntroAction('kept', 'new')
trackWorktreeCardStyleChanged(true, 'intro_note')
store().setWorktreeCardsIntroKeptHintOpen(true)
@@ -12,7 +12,6 @@ export function trackWorktreeCardsIntroAction(
track('worktree_cards_intro_action', { action, switch_position: switchPosition })
}
/** Call only for a real change, so counts mean switches rather than re-picks of the same style. */
export function trackWorktreeCardStyleChanged(
experimental: boolean,
source: WorktreeCardStyleChangeSource
@@ -2,16 +2,13 @@ import { z } from 'zod'
const worktreeCardStyleSchema = z.enum(['classic', 'new'])
// Intro note funnel for Classic users; kept over shown is the note's switch rate.
export const worktreeCardsIntroActionSchema = z
.object({
action: z.enum(['shown', 'flipped', 'kept', 'dismissed']),
// Switch position after the action; on 'dismissed' it tells closing mid-preview apart from after flipping back.
switch_position: worktreeCardStyleSchema
})
.strict()
// Every saved card-style change from any surface, so later switches back to Classic show up too.
export const worktreeCardStyleChangedSchema = z
.object({
style: worktreeCardStyleSchema,