fix(mobile): rebuild the sessions sheet in RN, and make every sheet look like one
Six commits, all on the mobile home/sheet surface. They're independent — reviewable commit by commit.
What's here
The sessions sheet is React Native again (5ff0fdd43). It was the app's only formSheet whose body was a SwiftUI @expo/ui List. That bought native drag-reorder for free, but no amount of listRowBackground / scrollContentBackground made it read as the same surface as Commits or Pull Requests — it looked out of place in its own app. react-native-reorderable-list owns the drag now (lift, gap, edge auto-scroll, drop settle) over our own uniwind rows, which brings back the design that shipped in #6488: the grip picks up instantly on onPressIn, holding anywhere else on the row also lifts so a scroll flick still scrolls, and close is a visible ✕. Pure JS on the reanimated/gesture-handler already in the app — no dev client rebuild.
Cloud is a scope you pick, not a section pinned above your machine (23fbd0474, 83a66c6fb). The scope chip claimed to name "the scope the list is under" and then the list put Cloud above that scope. On a phone, where the list is the whole screen, that meant sandboxes pushed every local project below the fold — and an asleep machine gave you a full-screen offline placeholder with the only usable workspaces orphaned above it. Cloud now comes from the same chip as your machines, and the list shows exactly one scope. Cloud sits behind FEATURE_FLAGS.CLOUD_WORKSPACES (the flag the cloud hooks already use), and a saved Cloud pick reads as host when the flag is off, so turning it off can't strand anyone. An asleep machine shows as itself, offline, with the Switch host way out it already had.
Two consistency fixes. The workspace actions sheet was the only ✕ in the app that wasn't native — its route set headerShown: false, so there was nowhere to hang a bar button and it drew a bg-secondary circle around a lucide X inside the ScrollView (2bcbf402b). And the organization switcher was the last sheet presenting itself: an @expo/ui BottomSheet in an absolutely-positioned Host that needed the window width as a prop, plus four modifiers dragging a SwiftUI surface back to our theme (95a3ebae5). hslToHex existed only to feed the last of those and goes with it.
And the convention is written down (a5e673c0e), since this is the third time a sheet has had to be redone for inventing its own shape.
Verified
On an iOS simulator against real data: scope switching both directions, the offline-host case, the flag-off fallback (forced locally — landed on the host, no Cloud row, no crash), the actions and organization sheets opening and dismissing on their native ✕. Sessions-sheet drag, tap-select and close-confirm were driven through a fixture harness (deleted before commit).
bun test 33 pass / 0 fail, lint and typecheck clean.
Known gap: the sessions sheet's reorder-persistence and killSession-over-relay paths have only run against fixtures, not a live host — the relay tunnel was down during that work.
Summary by cubic
Rebuilds the sessions sheet in React Native and standardizes all bottom sheets; Cloud is now a selectable scope instead of a section pinned above a machine, so the list always shows one scope and stays coherent when a machine is offline.
-
Sessions sheet: replaces the SwiftUI
@expo/uiList withreact-native-reorderable-listfor lift/drag/auto-scroll/drop; row grip lifts on press-in, long-press anywhere else also lifts; close is a visible ✕; removes SwiftUI-only code and addsreact-native-reorderable-list. -
Scope and filtering: the “Host” filter becomes “Scope” (Cloud or a machine); under Cloud the list is flat (no project headers) and terminal polling only runs for the visible scope; an offline machine shows the offline placeholder instead of stranding Cloud above it.
-
Cloud feature gate: Cloud appears only when
FEATURE_FLAGS.CLOUD_WORKSPACESis on; a saved Cloud pick reads as “host” when the flag is off;workspaces-filternow persistsscopealongsidehostFilter. -
Sheets consistency: organization switcher is a
formSheetroute with the native close button; removes the custom SwiftUI sheet andhslToHex; workspace actions sheet now uses the native close; adds a short convention toAGENTS.md. -
Rollout
- Install
react-native-reorderable-list(works with existingreact-native-reanimatedandreact-native-gesture-handler). - No migrations; verify the “Scope” picker, Cloud flag behavior, offline-host flow, and native close buttons across sheets.
- Known gap: sessions reorder persistence and kill over relay have only been fixture-tested; live-host check recommended.
- Install
Summary by CodeRabbit
- New Features
- Added Cloud workspace scope selection alongside host workspaces.
- Added a dedicated organization switcher sheet for changing organizations, opening settings, and signing out.
- Added drag-and-drop session reordering with haptic feedback and improved session row interactions.
- Updated workspace and organization sheets with native toolbar controls and presentation.
- Improvements
- Home screen content, polling, and empty states now reflect the selected workspace scope.
- Host filtering has been replaced by broader scope filtering.