Repository navigation
fix(agent): wait for the general onboarding before offering Agent consent - #18430
MaanilVerma wants to merge 13 commits into
Conversation
…rding Expose isFirstRunCandidate from useFirstRunEntry so the agent extension can ask whether Getting Started is coming this boot, and cover it over every disqualifier. The new agentPanel cases assert the automatic offer stays silent, with the one-shot key untouched, while Getting Started is owed or a coachmark tour is active. They fail until the gate lands.
…he screen A new cloud user's first boot showed the Agent consent card on top of the Getting Started screen, and accepting it started the Agent coach over a hidden canvas. The automatic offer now returns early while Getting Started is coming this boot or a coachmark tour is active. It returns before the one-shot key is written, so the next boot offers as usual; the Agent button path is untouched, so a user can still opt in during session one. Fixes PM-1497
Add an agentFirstSession fixture option that boots as a new cloud user who is owed the general onboarding, and a cloud spec asserting Getting Started shows with no consent card over it once the flag gate has settled.
Test-file reasoning belongs in the assertion, where it shows on failure. The fixture option needs no doc; its effect is the three lines that read it.
mockAgentBoot now merges initialSettings and initialFeatureFlags from comfyPageFixture into the payloads it routes, so a spec declares a new user the way gettingStartedTour does instead of through a bespoke boolean. Defaults are empty, so every existing agent boot is unchanged. The first-session spec anchors on the settled gate attribute the other agent specs use.
Keep only the ordering constraint in the guard comment; the condition says the rest. Note on isFirstRunCandidate that it is decided once per boot and does not flip when Getting Started is dismissed, which a caller could otherwise take for a live screen check. Drop the consent-reload case, which fails and passes in lockstep with the table, add the explicit case that the offer still fires with neither condition set, and give the candidate table readable titles.
The settled-gate attribute is set in the same callback that only starts the consent read, and the automatic offer runs from that read's continuation, so waiting on the gate proved the flag was known, not that the offer was evaluated. The fixture now records consent reads the way it records writes, and the spec waits for one before asserting absence. The unit deferral cases also pin that consent still loads while the offer is withheld, so the guard cannot drift up into the load path.
The previous gate asked whether a user still qualified for Getting Started, which stays true every boot for a team-workspace user whose restored work skips the screen, and it snapshotted the tour store at boot, which a tour that keeps abandoning re-arms forever. The offer now waits for the boot's first-run stages to report, holds only while Getting Started or a url-intent tour actually took the screen this boot (latched for the session) or a coachmark tour is on screen, and re-runs the moment that tour ends. A boot that never reports releases the hold after a grace period.
Cover the boot flags firstRunEntry now reports (screen taken by Getting Started or a url-intent tour; none for restored, deferred, or refused boots; the grace period) and, in the agent extension, the wait for the decision, the hold for each surface and both at once, the release when a tour ends, and the latch outliving that release.
A boot that never reports its first-run decision now forfeits this session's automatic offer instead of landing it on a late first-run screen; the next boot or any later trigger offers as usual, so nothing is lost. The grace is 60s, which a healthy boot never pays. One helper now waits for the decision on both entry points, so a tour that ends before the decision cannot offer early either. The tour watch reads the null transition alone, since a change to null implies a tour before it.
Cover the offer skipped when the boot never reports, the decision wait on the tour-ended path, no re-entry while an offer is in flight, the exact consent load count while withheld, and in firstRunEntry the flag staying unset while a url-intent tour is still starting, settling when the tour fails to start, resolving at once for a late subscriber, and giving up with false only once the grace has fully passed.
The neighbor-layout specs re-routed /api/settings only because the agent boot ignored initialSettings. It merges them now, so the copy would silently outrank any future default change.
🎭 Playwright: ⏳ Running...🎨 Storybook: ✅ Built — View Storybook📦 Bundle: 9.96 MB gzip 🔴 +270 kBDetailsSummary
Category Glance App Entry Points — 3.87 kB (baseline 3.73 kB) • 🔴 +138 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 1.44 MB (baseline 1.43 MB) • 🔴 +14.3 kBGraph editor runtime, canvas, workflow orchestration
Status: 2 added / 2 removed / 1 unchanged Views & Navigation — 132 kB (baseline 124 kB) • 🔴 +8.02 kBTop-level views, pages, and routed surfaces
Status: 17 added / 16 removed / 1 unchanged Panels & Settings — 639 kB (baseline 621 kB) • 🔴 +17.6 kBConfiguration panels, inspectors, and settings screens
Status: 28 added / 27 removed User & Accounts — 37.9 kB (baseline 27.8 kB) • 🔴 +10.1 kBAuthentication, profile, and account management bundles
Status: 9 added / 9 removed / 2 unchanged Editors & Dialogs — 126 kB (baseline 126 kB) • 🔴 +740 BModals, dialogs, drawers, and in-app editors
Status: 8 added / 8 removed UI Components — 123 kB (baseline 117 kB) • 🔴 +6.31 kBReusable component library chunks
Status: 16 added / 15 removed Data & Services — 3.92 MB (baseline 3.6 MB) • 🔴 +314 kBStores, services, APIs, and repositories
Status: 16 added / 16 removed Utilities & Hooks — 577 kB (baseline 559 kB) • 🔴 +18.7 kBHelpers, composables, and utility bundles
Status: 31 added / 29 removed / 7 unchanged Vendor & Third-Party — 17.4 MB (baseline 18.1 MB) • 🟢 -692 kBExternal libraries and shared vendor chunks
Status: 11 added / 11 removed / 7 unchanged Other — 17.8 MB (baseline 16.4 MB) • 🔴 +1.42 MBBundles that do not match a named category
Status: 179 added / 173 removed / 123 unchanged ⚡ Performance
|
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Repository: Comfy-Org/ComfyUI_frontend/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (7)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Reopened as a same-repo PR from origin (was accidentally raised from my fork): #18431 |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #18430 +/- ##
==========================================
+ Coverage 83.34% 84.34% +0.99%
==========================================
Files 2990 2288 -702
Lines 147204 130015 -17189
Branches 38043 35120 -2923
==========================================
- Hits 122694 109665 -13029
+ Misses 23228 20055 -3173
+ Partials 1282 295 -987
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 706 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Summary
A new cloud user's first login showed the Agent consent card on top of the Getting Started screen, and accepting it started the Agent coach over a hidden canvas. The automatic offer now waits until the general onboarding is out of the way: it holds for the whole first session when Getting Started or the first-run tour takes the screen, and it appears on the next login instead. The Agent button still opens the card at any time.
Changes
offerConsentUnpromptedinagentPanel.tswaits for the boot's first-run decision before evaluating, and returns before writing the one-shot key whilefirstRunTookScreenis set or a coachmark tour is on screen. When a tour ends, the offer runs again through the same wait, so a held offer comes back the moment the screen is free.useFirstRunEntrynow reports two per-boot facts:firstRunTookScreen(Getting Started showed, or a template/share link started the tour) andwhenStartupDecided()(the first-run stages have run, fail-closed after a 60s grace).Review Focus
keeps withholding after a tour ends when Getting Started took the screenpins.whenStartupDecided) rather than asking whether the user qualifies for Getting Started. The earlier draft asked "would it show", which held the offer forever for team-workspace users whose restored work skips Getting Started while their tutorial flag was never written. "Did it show" has no such cohort.firstRunEntry.tsgains only additive state; every existing branch and everyTutorialCompletedwriter is unchanged. Three independent audits of the ~30 PRs that built and stabilized this onboarding found no regressed invariant (reports undertemp/summaries/pm-1497-regression-audit-*.md).src/extensions/corereaches intorenderer/extensions/firstRunTourfor the entry composable, which has precedent in that directory.firstRunEntryhas no renderer dependency and belongs inplatform/onboarding; that move is part of the onboarding unification follow-up, together with registering the consent card into the What's New overlay store from fix(agent): defer What's New popup while agent onboarding runs #18287 and emitting a telemetry stage when the offer is withheld.Testing
@cloud, CI): new user boot shows Getting Started with no consent card, anchored on the consent read; existing "Automatic agent consent" describe is the positive control on a returning-user boot