Skip to content
This repository was archived by the owner on Aug 6, 2026. It is now read-only.

fix(mobile): show stopped cloud runs as stopped, not failed (port #3697) - #3750

Merged
trunk-io[bot] merged 1 commit into
mainfrom
posthog-code/mobile-stopped-run-not-failed
Jul 23, 2026
Merged

fix(mobile): show stopped cloud runs as stopped, not failed (port #3697)#3750
trunk-io[bot] merged 1 commit into
mainfrom
posthog-code/mobile-stopped-run-not-failed

Conversation

@Gilbert09

Copy link
Copy Markdown
Member

Problem

The mobile app already lets you stop a running cloud task, but a deliberately-stopped run (backend status cancelled) was being treated as a failure. The end-of-run banner showed a red "Run failed" with a Retry button — as if something had gone wrong — even though the user chose to stop it.

Why: this ports the desktop fix in #3697 ("Show stopped cloud tasks as completed") to mobile, where users hit this regularly since the stop-run action shipped.

Changes

  • mapTerminalStatus now maps cancelled to a distinct stopped outcome instead of collapsing it into failed.
  • The terminal banner reads "Run stopped" with neutral/success styling and offers Continue (not Retry) for a stopped run. Failed and completed runs are unchanged.
  • Introduced a shared TerminalStatus type in types.ts (used by the store, session-activity helper, and the banner) to replace the inline union that was being repeated.
  • Extracted the banner into a TerminalStatusBanner component so its wording is unit-testable in isolation.
  • The cloud task-list icon path is intentionally left alone — it short-circuits every cloud task to the chat icon before it inspects status, so a stopped run already renders sensibly.

How did you test this?

  • New parameterised test for mapTerminalStatus covering completed / failed / cancelled / in-flight / nullish inputs.
  • New TerminalStatusBanner tests covering the banner wording and action for each terminal outcome, and that a stopped run is never labelled failed.
  • Ran the mobile suite (taskSessionStore, TerminalStatusBanner, TaskStatusIcon, sessionActivity — 41 tests passing), tsc (no new errors in touched files), and biome check (clean).

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Created with PostHog Code

Ports the desktop fix (#3697) to the mobile app. A cloud run the user
deliberately stops (backend status `cancelled`) was being collapsed into
`failed`, so the end-of-run banner read "Run failed" with a Retry button.

Map `cancelled` to a new terminal outcome `stopped`: the banner now reads
"Run stopped" with neutral/success styling and offers Continue. Introduces a
shared `TerminalStatus` type and extracts the banner into
`TerminalStatusBanner` for isolated testing.

Generated-By: PostHog Code
Task-Id: 880d3028-60e8-4893-b5f6-2b31f4a44456
@Gilbert09
Gilbert09 requested a review from a team July 23, 2026 10:45
@trunk-io

trunk-io Bot commented Jul 23, 2026

Copy link
Copy Markdown

😎 Merged successfully - details.

@github-actions

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 65baa10.

@Gilbert09 Gilbert09 added the Stamphog This will request an autostamp by stamphog on small changes label Jul 23, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Contained mobile UI fix that maps a backend "cancelled" status to a distinct "stopped" outcome instead of "failed"; diff matches the description, includes new unit tests, and touches no risky territory (no auth, billing, migrations, deps, or CI).

  • Author wrote 2% of the modified lines and has 23 merged PRs in these paths (familiarity MODERATE).
Gate mechanics and policy version
Gate Result
prerequisites all clear
deny-list no deny categories matched
size 130L, 5F substantive, 213L/7F incl. docs/generated/snapshots — within ceiling
tier T1-agent / T1c-medium (213L, 7F, single-area, fix)
stamphog 2.0.0b3 .stamphog/policy.yml @ f057f43 · reviewed head 65baa10

@trunk-io
trunk-io Bot merged commit 0d728bc into main Jul 23, 2026
34 checks passed
@trunk-io
trunk-io Bot deleted the posthog-code/mobile-stopped-run-not-failed branch July 23, 2026 13:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Stamphog This will request an autostamp by stamphog on small changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant