Skip to content

The agent that grows with you

fix(desktop): the free-tier ready screen never interrupts the guided chat

brooklyn!4eb6e1dd343d
diff --git a/apps/desktop/src/components/onboarding-chat/gate.tsx b/apps/desktop/src/components/onboarding-chat/gate.tsx
index d56a9885475..002b3f50254 100644
--- a/apps/desktop/src/components/onboarding-chat/gate.tsx
+++ b/apps/desktop/src/components/onboarding-chat/gate.tsx
@@ -22,17 +22,36 @@ export function OnboardingChatGate({ enabled, onKickoff, requestGateway }: Onboa
return
}
+ // The guide is the free tier's introduction, whichever way it opens: the
+ // film, or the guided chat directly when the film is skipped. Ack the
+ // one-time notice as soon as either takes the screen, or a readiness
+ // round mid-guide raises the ready screen over the conversation.
+ const ack = () => {
+ clearFreeTierIntro()
+ void ackFreeTierNotice(requestGateway).then(acked => {
+ if (acked) {
+ clearFreeTierIntro()
+ }
+ })
+ }
+
// subscribe also sees an intro started by the preceding sibling's effect.
- return $introReveal.subscribe(state => {
+ const offIntro = $introReveal.subscribe(state => {
if (state.phase === 'playing') {
- clearFreeTierIntro()
- void ackFreeTierNotice(requestGateway).then(acked => {
- if (acked) {
- clearFreeTierIntro()
- }
- })
+ ack()
}
})
+
+ const offGate = $onboardingGate.subscribe(state => {
+ if (state.phase === 'guided') {
+ ack()
+ }
+ })
+
+ return () => {
+ offIntro()
+ offGate()
+ }
}, [enabled, requestGateway])
useEffect(() => {
diff --git a/apps/desktop/src/store/onboarding.ts b/apps/desktop/src/store/onboarding.ts
index e54eea2c560..262675c10fc 100644
--- a/apps/desktop/src/store/onboarding.ts
+++ b/apps/desktop/src/store/onboarding.ts
@@ -731,6 +731,15 @@ async function applyFreeTierIntro(ctx: OnboardingContext, runtime: RuntimeReadin
setFreeTierRoute(runtime.freeTier)
const status = await refreshFreeTierStatus(ctx.requestGateway)
+ // The guided first launch IS the introduction. Raising the ready screen on
+ // top of it (a readiness round fires when the layout pick assembles the
+ // window) covered the guide mid-conversation, and dismissing it remounted
+ // the card the user had just answered. The guide acks the notice itself
+ // when it hands off.
+ if (guidedOnboardingActive()) {
+ return
+ }
+
if (freeTierReadyPending(status, runtime.freeTier ?? null)) {
patch({ freeTierReady: true })
}