Skip to content

feat(mobile): auto-publish cloud runs toggle (port #3217)#3261

Merged
Gilbert09 merged 3 commits into
mainfrom
posthog-code/mobile-auto-publish-cloud-runs
Jul 8, 2026
Merged

feat(mobile): auto-publish cloud runs toggle (port #3217)#3261
Gilbert09 merged 3 commits into
mainfrom
posthog-code/mobile-auto-publish-cloud-runs

Conversation

@Gilbert09

Copy link
Copy Markdown
Member

Ports the desktop advanced-settings toggle from #3217 to the mobile app.

What this adds

A user-facing setting that makes cloud runs push their work and open a draft PR on completion, without waiting for an explicit ask. Manual cloud runs remain review-first by default on the backend; this toggle opts them into auto-publishing.

Changes (all apps/mobile)

  • preferencesStore.ts — persisted autoPublishCloudRuns boolean (default true, matching desktop) + setAutoPublishCloudRuns.
  • settings/index.tsx — a Switch in the Input section labelled "Always create pull requests for cloud runs" with the same description as desktop.
  • tasks/api.tsRunTaskInCloudOptions.autoPublish?: boolean; runTaskInCloud sends auto_publish in the request body when set.
  • app/task/index.tsx — the new-task composer (initial cloud-run kickoff) threads the setting through, alongside model/reasoningEffort/initialPermissionMode.
  • tasks/api.test.ts — covers that auto_publish is included when enabled, sent as false when disabled, and omitted when unset.

No desktop or shared-package code changed — the backend already interprets auto_publish, so mobile only needs to send it.

Testing

  • pnpm --filter @posthog/mobile test src/features/tasks/api.test.ts — 4 passing.
  • Biome check clean on all touched files.

Adds a persisted mobile setting (default on) that makes cloud runs push
their changes and open a draft pull request on completion, matching the
desktop advanced-settings toggle. The new-task composer sends the setting
as `auto_publish` on the cloud run request; the backend already interprets
it.

Generated-By: PostHog Code
Task-Id: f544ff52-3a2f-47fe-9dbd-c1299fe4b425
@Gilbert09 Gilbert09 requested a review from a team July 8, 2026 10:40
@trunk-io

trunk-io Bot commented Jul 8, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 187b43e.

@greptile-apps

greptile-apps Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "feat(mobile): auto-publish cloud runs to..." | Re-trigger Greptile

Comment thread apps/mobile/src/features/tasks/api.test.ts Outdated
Collapse the enabled/disabled auto_publish assertions into a single
it.each, matching the project's parameterised-test convention.

Generated-By: PostHog Code
Task-Id: f544ff52-3a2f-47fe-9dbd-c1299fe4b425
Generated-By: PostHog Code
Task-Id: 9d49cf24-2cd0-48ba-bdaa-713650b7b2d7
@Gilbert09 Gilbert09 merged commit e7cba13 into main Jul 8, 2026
26 checks passed
@Gilbert09 Gilbert09 deleted the posthog-code/mobile-auto-publish-cloud-runs branch July 8, 2026 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants