diff --git a/src/renderer/src/App.tsx b/src/renderer/src/App.tsx index 23ccdf221..9aaf950d6 100644 --- a/src/renderer/src/App.tsx +++ b/src/renderer/src/App.tsx @@ -47,6 +47,7 @@ import { StarNagCard } from './components/StarNagCard' import { FeatureTourNudge } from './components/feature-wall/FeatureTourNudge' import { TelemetryFirstLaunchSurface } from './components/TelemetryFirstLaunchSurface' import { ZoomOverlay } from './components/ZoomOverlay' +import { onOnboardingReopened } from './components/onboarding/show-onboarding-event' import { shouldShowOnboarding } from './components/onboarding/should-show-onboarding' import { SshPassphraseDialog } from './components/settings/SshPassphraseDialog' import DeleteWorktreeDialog from './components/sidebar/DeleteWorktreeDialog' @@ -387,6 +388,10 @@ function App(): React.JSX.Element { useGlobalFileDrop() useAutoAckViewedAgent() + useEffect(() => { + return onOnboardingReopened(setOnboarding) + }, []) + // Why: sidebar open/close flips width instantaneously. useLayoutEffect // runs synchronously after React commits the DOM but before paint, so // dispatching SYNC_FIT_PANES_EVENT here lets the terminal reflow in the @@ -1477,51 +1482,49 @@ function App(): React.JSX.Element { ) : null} - {/* Why: NewWorkspaceComposerCard renders Radix s that crash - when mounted outside a TooltipProvider ancestor. Keep the global - composer modal inside this provider so the card renders safely - whether triggered from Cmd+J or any future entry point. */} + {/* Why: root overlays can render Radix s; keep them inside + the shared provider so lazy surfaces mount safely from any entry point. */} {mountedLazyModalIds.has('new-workspace-composer') ? : null} {mountedLazyModalIds.has('workspace-cleanup') ? : null} - - - {mountedLazyModalIds.has('quick-open') ? : null} - {mountedLazyModalIds.has('worktree-palette') ? : null} - {mountedLazyModalIds.has('feature-wall') ? : null} - - {/* Why: mount PetOverlay only when the experimental flag is on AND + + {mountedLazyModalIds.has('quick-open') ? : null} + {mountedLazyModalIds.has('worktree-palette') ? : null} + {mountedLazyModalIds.has('feature-wall') ? : null} + + {/* Why: mount PetOverlay only when the experimental flag is on AND the user hasn't hit "Hide pet" in the status-bar menu. Both conditions must be true — see design doc (pet-overlay.md) on why the two toggles are kept independent. */} - {petEnabled && petVisible ? ( - - - - ) : null} - - - - {/* Why: the existing-user opt-in banner mounts at App root so it + {petEnabled && petVisible ? ( + + + + ) : null} + + + + {/* Why: the existing-user opt-in banner mounts at App root so it renders once per renderer session, not per view. It gates internally on the cohort markers populated by the migration, so it only shows for users who installed before the telemetry release and have not yet resolved consent. New users get no first-launch surface — see telemetry-plan.md §First-launch experience. */} - - - - - - {onboarding && shouldShowOnboarding(onboarding) ? ( - - - - ) : null} - - + + + + + + {onboarding && shouldShowOnboarding(onboarding) ? ( + + + + ) : null} + + + {/* Why: rendered last so it sits after all -webkit-app-region:drag elements in DOM order. Electron's hit-test for drag regions is DOM-order-based and diff --git a/src/renderer/src/components/NewWorkspaceComposerCard.tsx b/src/renderer/src/components/NewWorkspaceComposerCard.tsx index 05b6fd7a5..55479cc26 100644 --- a/src/renderer/src/components/NewWorkspaceComposerCard.tsx +++ b/src/renderer/src/components/NewWorkspaceComposerCard.tsx @@ -269,7 +269,7 @@ export default function NewWorkspaceComposerCard({
- +