Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/core/test/app-flow-ui-capture-mode.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ test("the capture mode is persisted when it changes, not when a sweep starts", a
.find(entry => entry.textContent === text) as HTMLButtonElement;
const trigger = document.querySelector('[aria-label="App Flow capture mode"]') as HTMLElement;
assert.ok(trigger, "the toolbar offers the capture mode");
assert.doesNotMatch(document.body.textContent ?? "", /Sign in to this app/, "structure-only needs no sign-in guidance");

await act(async () => { trigger.click(); });
const option = Array.from(document.querySelectorAll('[role="option"]'))
Expand All @@ -55,6 +56,10 @@ test("the capture mode is persisted when it changes, not when a sweep starts", a
await act(async () => { option.click(); });
assert.equal(storage.getItem("app-flow-mode:/projects/demo"), "screen-ui-and-structure",
"the choice is stored before anything is started");
assert.match(document.body.textContent ?? "", /Sign in to this app, if required/,
"the screen sweep names the app and makes sign-in conditional");
assert.match(document.body.textContent ?? "", /app under test.+does not require sign-in, you can continue normally/s,
"the guidance distinguishes app authentication from a Mobile Dev requirement");

// What the workspace does when the panel is hidden and shown again, or another tool is picked.
await act(async () => { root.unmount(); });
Expand Down
2 changes: 2 additions & 0 deletions packages/core/test/app-flow-ui-explore-ui.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ test("App Flow uses adaptive capture and offers AI only for actionable misses",
assert.match(guideText, /release build/, "the guide explains what a release build costs");
assert.match(guideText, /deep link/, "the guide explains the deep-link fallback");
assert.match(guideText, /Structure only.+Screen UI \+ Structure/s, "the guide explains both capture modes");
assert.match(guideText, /If the app requires sign-in, sign in to it first/,
"the guide makes clear that sign-in belongs to the app and is conditional");

// The AI continuation is no longer one click: it lists the eligible screens and starts only the
// ones the user ticks, so a model walk is never spent on a screen nobody asked about.
Expand Down
12 changes: 6 additions & 6 deletions packages/ui/src/components/app-flow-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function AppFlowHelp() {
<div className="space-y-1"><p className="font-medium">Map creation</p>
<ul className="list-disc space-y-1 pl-4 text-muted-foreground">
<li><span className="text-foreground">Structure only</span> reads the navigation out of your source. It takes seconds and needs no device, but has no screenshots.</li>
<li><span className="text-foreground">Screen UI + Structure</span> also walks the app on an iOS simulator and photographs every screen it reaches. Sign in first.</li>
<li><span className="text-foreground">Screen UI + Structure</span> also walks the app on an iOS simulator and photographs every screen it reaches. If the app requires sign-in, sign in to it first.</li>
</ul></div>

<div className="space-y-1"><p className="font-medium">Launching (the walk only)</p>
Expand Down Expand Up @@ -257,11 +257,11 @@ export function AppFlowView({ panel }: { panel: AppFlowPanel }) {
<Button size="sm" onClick={start} disabled={!state.projectPath || state.launching || state.agentStartPending}>
{state.agentStartPending ? "Asking Codex…" : isPaused || resumable ? "Resume" : state.result ? "Regenerate" : "Start"}</Button></>}
</div>
{/* Shown for every mode, not just the deterministic pass. The AI modes do run a sign-in check
and stop to ask, but stopping mid-sweep is the expensive way to learn this, and a user who
signs in first never pays for it. The advice is the same either way, so the banner no
longer depends on which build is selected. */}
{!isRunning && <AppFlowWarning title="Sign in before capture">Launch the app and finish signing in first. A signed-out app captures its sign-in wall instead of the screens behind it.</AppFlowWarning>}
{/* Structure-only never launches the app, so sign-in guidance there implies a prerequisite
that does not exist. The model-free screen sweep does skip its sign-in check, though: if
this app has an auth wall, clearing it before capture prevents every route from recording
that same wall. */}
{!isRunning && mode === "screen-ui-and-structure" && <AppFlowWarning title="Sign in to this app, if required">Before capturing screens, launch the app under test and complete its sign-in flow. If the app does not require sign-in, you can continue normally.</AppFlowWarning>}
</header>
{isRunning && state.progress && <div className="flex items-center gap-3 border-b bg-muted/40 px-4 py-2"><Loader2 className="size-4 animate-spin" />
<div className="min-w-0 flex-1"><div className="text-sm capitalize">{state.progress.phase}</div><div className="truncate text-xs text-muted-foreground">{state.progress.message}</div></div>
Expand Down
Loading