Skip to content

fix(mobile): scope the project picker to the Home scope and say just "Cloud" under Cloud - #6934

Merged
saddlepaddle merged 1 commit into
mainfrom
fix-mobile-project-picker
Aug 28, 2026
Merged

saddlepaddle merged 1 commit into
mainfrom
fix-mobile-project-picker

Conversation

@saddlepaddle

@saddlepaddle saddlepaddle commented Aug 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • The new-session project picker lists only the projects for the place picked at the top of Home — the selected machine, or Cloud — instead of every online machine plus a Cloud section.
  • Under Cloud scope the composer chip just says "Cloud" and doesn't open a picker: a sandbox has no real project structure yet.
  • The last row of the project/agent/branch pickers no longer sits under the home indicator.

Why / Context

#6651 fanned project.list across every online host and appended a cloud target per API project, and the picker rendered all of it in sections. Home already has a scope filter that picks Cloud or a machine, so the picker was choosing the place twice. Its Cloud section was also the retired v2_projects catalog — nothing writes that table since #6436 (docs/cloud-sandbox-considerations.md › Model tracks it as Open), so presenting it as a project structure was noise.

Separately, the picker's scroll content had 8px of bottom padding, so the last row sat under the home indicator and was only visible by over-scrolling.

How It Works

  • useNewChatTargets reads useWorkspaceScope + useSelectedHost. Host scope → that machine's project.list only, and only while it's online (an offline pick offers nothing rather than quietly moving you to another host or Cloud — same stance as the scope filter). Cloud scope → the API's cloud projects only. The composer, branch query and create path all hang off this hook, so switching scope at the top of Home re-targets the composer without re-picking.
  • ProjectPickerScreen is a flat list; the Cloud/host section headers are gone.
  • NewChatWidget: under Cloud the project chip is a plain "Cloud" label and inert. The row the create resolves against is still picked the way defaultTarget always did (last used, else first alphabetically) — the request is unchanged, the id just isn't surfaced. The "· Cloud" chip suffix is gone under host scope since the scope filter already says where you are.
  • The three pickers pad their scroll content by insets.bottom + 8.

Manual QA Checklist

Run on an iPhone 17 (iOS 26) sim against production with a live host:

  • App boots and lists real workspaces under both the machine scope and Cloud scope
  • Host scope: composer project chip opens a flat list of that machine's projects, no Cloud section
  • Cloud scope: composer header reads "Cloud · ", tapping "Cloud" does nothing, branch chip still lists remote branches
  • Flip scope at the top of Home → composer re-targets without re-picking
  • Project picker: last row fully visible without over-scrolling
  • Agent and branch pickers unchanged apart from bottom padding

Testing

  • bun run test in apps/mobile: 47 pass
  • bunx biome check on the changed files: clean
  • bunx turbo typecheck --filter=@superset/mobile: no errors in the changed files (18 pre-existing errors in packages/workspace-fs, unrelated)

Known Limitations

  • Cloud create still depends on a legacy v2_projects row. With several rows in an org, which repo the sandbox clones is an invisible last-used-or-first choice from the phone. Internal-only, and it goes away when the environment entity replaces the row — the UI here won't need to change.
  • Host scope with the selected machine offline offers no projects, by design.

Summary by cubic

Scopes the new-session project picker to the place already picked at the top of Home, so it no longer lists every online machine's projects plus a Cloud section. Under Cloud scope the composer chip reads just "Cloud" and opens nothing, since a sandbox has no project structure yet. Also pads the picker scroll content by the bottom safe-area inset so the last row no longer sits under the home indicator.

  • Project targets now come only from the selected machine (host scope) or the API's cloud projects (Cloud scope); an offline selected machine offers no projects.
  • Cloud create still resolves against a legacy v2_projects row, unchanged, but the id is no longer surfaced in the UI.
  • Agent and branch pickers changed only for the bottom padding fix.

Written for commit 46896da. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features

    • New chat targets now reflect the selected Home scope, showing only relevant host or cloud projects.
    • Cloud targets are clearly identified with a non-interactive Cloud chip.
    • Project selection now displays all available targets in a single, streamlined list.
  • Bug Fixes

    • Improved picker layouts on devices with home indicators and display cutouts by applying safe-area spacing.
    • Cloud chips no longer trigger navigation or haptic feedback when pressed.

…oud" under Cloud

The new-session project picker listed every online machine's projects plus a
Cloud section, choosing the place a second time when Home's scope filter
already had. Targets now follow that scope: the selected machine's projects,
or the API's cloud projects. Under Cloud the composer chip is a plain "Cloud"
and opens nothing — a sandbox has no real project structure yet, and the
legacy v2_projects row the create resolves against is not worth showing.

Pickers also pad their scroll content by the bottom safe-area inset; the last
row sat under the home indicator and only showed on over-scroll.
@coderabbitai

coderabbitai Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4261de04-dc4d-4d23-b0b0-43e978c58af8

📥 Commits

Reviewing files that changed from the base of the PR and between e3b93eb and 46896da.

📒 Files selected for processing (5)
  • apps/mobile/screens/(authenticated)/(home)/home/components/NewChatWidget/NewChatWidget.tsx
  • apps/mobile/screens/(authenticated)/(home)/home/components/NewChatWidget/hooks/useNewChatTargets/useNewChatTargets.ts
  • apps/mobile/screens/(authenticated)/(home)/new-session/agent/AgentPickerScreen.tsx
  • apps/mobile/screens/(authenticated)/(home)/new-session/branch/BranchPickerScreen.tsx
  • apps/mobile/screens/(authenticated)/(home)/new-session/project/ProjectPickerScreen.tsx

Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

The Home scope now limits chat targets to the selected host or cloud projects. Cloud targets use a non-interactive Cloud chip. New-session pickers use flat project rendering and safe-area-aware bottom padding.

Changes

Scoped chat creation

Layer / File(s) Summary
Scope-aware target resolution
apps/mobile/screens/(authenticated)/(home)/home/components/NewChatWidget/hooks/useNewChatTargets/useNewChatTargets.ts
Targets now come from the selected online host in host scope or from cloud projects in cloud scope.
Cloud chip behavior
apps/mobile/screens/(authenticated)/(home)/home/components/NewChatWidget/NewChatWidget.tsx
Cloud scope displays a non-interactive Cloud chip. Other scopes retain project and branch chips.
Picker rendering and safe-area layout
apps/mobile/screens/(authenticated)/(home)/new-session/{agent,branch,project}/*
The project picker renders a flat target list. All three pickers apply bottom safe-area padding.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 46896

The project picker now follows the selected Home scope and prevents Cloud from exposing a misleading project picker, while preserving server-side validation and picker layout fixes. No actionable merge-blocking risk remains after normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant HomeScope
  participant NewChatTargets
  participant HostProjectAPI
  participant CloudProjectsAPI
  participant NewChatWidget
  HomeScope->>NewChatTargets: provide active host or cloud scope
  alt host scope
    NewChatTargets->>HostProjectAPI: list projects for selected online host
    HostProjectAPI-->>NewChatTargets: return host targets
  else cloud scope
    NewChatTargets->>CloudProjectsAPI: list cloud projects
    CloudProjectsAPI-->>NewChatTargets: return cloud targets
  end
  NewChatTargets-->>NewChatWidget: return scoped targets
  NewChatWidget->>NewChatWidget: render project chip or Cloud chip
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 5 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary mobile changes: scoping the project picker to Home scope and displaying an inert Cloud label.
Description check ✅ Passed The description clearly explains what changed, why it changed, implementation behavior, testing, manual QA status, and known limitations. It does not reproduce the template headings and checklist verb…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description clearly explains what changed, why it changed, implementation behavior, testing, manual QA status, and known limitations. It does not reproduce the template headings and checklist verbatim, but it provides the required information in equivalent sections.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-mobile-project-picker

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ✅ Neon database branch

Thank you for your contribution! 🎉

@saddlepaddle
saddlepaddle merged commit 9aa2ef5 into main Aug 28, 2026
20 checks passed
@Kitenite
Kitenite deleted the fix-mobile-project-picker branch August 29, 2026 22:10

This branch was previously deployed

1 inactive deployment
preview — 46896da9 Deployed Aug 28, 2026 by saddlepaddle via Deploy Admin #8594
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.

1 participant