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

feat(mobile): show custom base image badge on cloud task detail (port #3492) - #3499

Merged
trunk-io[bot] merged 1 commit into
mainfrom
posthog-code/mobile-custom-image-badge
Jul 16, 2026
Merged

feat(mobile): show custom base image badge on cloud task detail (port #3492)#3499
trunk-io[bot] merged 1 commit into
mainfrom
posthog-code/mobile-custom-image-badge

Conversation

@Gilbert09

Copy link
Copy Markdown
Member

Problem

The desktop/web app shows a badge on the cloud task detail view when a cloud run used a custom sandbox base image (or a sandbox environment tied to a custom image). The mobile app had no equivalent, so mobile users couldn't tell which base image a cloud run used.

Ports #3492 to apps/mobile.

Why: parity with desktop — surface the custom base image on the mobile cloud task detail so it's visible where the other run metadata (PR status, diff stats) lives.

Changes

  • New CustomImageBadge mobile component (RN primitives, consistent with the sibling PrStatusBadge/PrDiffStatsBadge): a small violet cube badge showing the resolved custom image name.
  • New useCustomImageName hook: fetches the sandbox custom-images and environments lists via the app's authed-query pattern and resolves the display name — directly from custom_image_id, or by following sandbox_environment_id → the environment's image. The queries only fire when the latest run is a cloud run carrying a custom image reference, so ordinary tasks add no network calls. Renders nothing when custom images are disabled or the image can't be resolved.
  • Added getSandboxCustomImages / getSandboxEnvironments to the mobile tasks API layer.
  • Rendered the badge in the task detail header next to the PR badges.

How did you test this?

  • Added CustomImageBadge.test.tsx (Vitest): covers non-cloud/local runs, cloud runs without a custom image id, resolving via direct custom_image_id, resolving via sandbox_environment_id → environment.custom_image_id, and the unresolvable case. All 5 pass.
  • Typechecked the mobile package (tsc --noEmit) and ran Biome — clean for the changed files.

Automatic notifications

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

Created with PostHog Code

…3492)

Ports the desktop custom base image badge to the React Native app. The task
detail header now shows a violet "cube" badge with the custom sandbox base
image name when a cloud run used a custom image (directly via custom_image_id
or indirectly via its sandbox environment).

The sandbox image and environment lists are fetched through the mobile app's
authed-query pattern, and only when the latest run is a cloud run that carries
a custom_image_id or sandbox_environment_id, so ordinary tasks add no extra
network calls. The badge renders nothing when custom images are disabled or the
image can't be resolved.

Generated-By: PostHog Code
Task-Id: 1230821c-af71-4788-b81f-dcaeb6442e2d
@Gilbert09
Gilbert09 requested a review from a team July 16, 2026 10:45
@trunk-io

trunk-io Bot commented Jul 16, 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 9dada48.

@tatoalo
tatoalo enabled auto-merge (squash) July 16, 2026 11:57
@trunk-io
trunk-io Bot merged commit afb19ea into main Jul 16, 2026
28 checks passed
@trunk-io
trunk-io Bot deleted the posthog-code/mobile-custom-image-badge branch July 16, 2026 12:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants