Skip to content

Show mobile workspace creation at the bottom right - #6663

Closed
brennanb2025 wants to merge 15 commits into
mainfrom
brennanb2025/floating-add-worktree
Closed

brennanb2025 wants to merge 15 commits into
mainfrom
brennanb2025/floating-add-worktree

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Jun 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Moves the new-workspace + action on the actual Orca Mobile host/worktree list from the phone top toolbar to a floating bottom-right button. The button opens the existing NewWorktreeModalController path; this does not add a new creation backend path or change SSH/RPC creation behavior.

Embedded/tablet host-list layouts keep their existing toolbar New workspace action.

Design Approach

  • Updated mobile/app/h/[hostId]/index.tsx so the phone toolbar no longer renders the new-workspace +.
  • Uses the merged NewWorkspaceFab component for the bottom-right mobile action, with mobile design tokens, accessibility state, shadow/elevation, and safe-area-aware placement.
  • Added extra SectionList bottom clearance on phone layouts so the last worktree row remains reachable above the floating button.
  • Kept the scratch design doc outside the repo at /tmp/orca-piddock-designs/mobile-host-worktree-fab.md.

Design Review

Design review completed cleanly. The reviewer added guardrails to keep the FAB token-based, accessible, and scoped to the phone host list while preserving the embedded toolbar action.

Implementation

  • mobile/app/h/[hostId]/index.tsx: removed the phone-toolbar create button, renders the bottom-right FAB after the list, and reserves bottom clearance.
  • mobile/src/components/NewWorkspaceFab.tsx: provides the accessible phone FAB used by the host list.
  • mobile/src/worktree/mobile-worktree-activation-source.test.ts: covers phone placement, FAB accessibility/elevation, and embedded toolbar preservation.
  • tests/e2e/golden-core-flows.spec.ts: fixed CodeRabbit's earlier stabilization finding by only using display-name repo fallback when it is unique.

Completeness

Completeness verification confirmed the requested behavior is implemented for the actual mobile host/worktree list from Brennan's screenshot. Embedded/tablet behavior remains intact.

Headline Behavior

Implemented: on phone mobile, the add-worktree/new-workspace + is now a bottom-right floating button instead of a top-toolbar button.

Performance

Perf audit result: clean.

Touched hot paths:

  • Host list render adds one overlay Pressable outside the SectionList rows.
  • List content padding gets a constant clearance value on non-embedded layouts.

No polling, subprocess, cache, startup, subscription, or row-render logic changed.

Code Review

Two-reviewer code-review loop completed. One reviewer was clean; the other found the missing floating elevation/shadow treatment. That was fixed and covered by regression tests.

CodeRabbit actionable feedback was addressed:

  • Authoritative seeded-repo detected worktree readiness.
  • Ambiguous display-name fallback in the golden e2e repo lookup.
  • FAB clearance comment update.

Remaining CodeRabbit notes are non-actionable nits about preferring render tests over source assertions.

Validation

Merge-confidence validation verdict: land.

Local checks run:

  • pnpm exec vitest run --config mobile/vitest.config.ts mobile/src/worktree/mobile-worktree-activation-source.test.ts passed, 4 tests
  • pnpm exec oxlint 'mobile/app/h/[hostId]/index.tsx' mobile/src/components/NewWorkspaceFab.tsx mobile/src/worktree/mobile-worktree-activation-source.test.ts tests/e2e/golden-core-flows.spec.ts passed
  • pnpm exec oxfmt --check 'mobile/app/h/[hostId]/index.tsx' mobile/src/components/NewWorkspaceFab.tsx mobile/src/worktree/mobile-worktree-activation-source.test.ts tests/e2e/golden-core-flows.spec.ts passed
  • pnpm run typecheck passed
  • pnpm run lint passed with one unrelated existing useGitStatusPolling.ts warning
  • pnpm run test:e2e -- tests/e2e/golden-core-flows.spec.ts passed, 2 tests
  • git diff --check passed before commits

Additional delegated validation reported:

  • pnpm --dir mobile test src/worktree/mobile-worktree-activation-source.test.ts passed, 4 tests
  • pnpm --dir mobile test src/worktree/workspace-list-sections.test.ts src/worktree/workspace-view-settings.test.ts src/worktree/workspace-list-picker-options.test.ts src/host-route-action-state.test.ts passed, 33 tests
  • pnpm --dir mobile exec tsc --noEmit passed

Manual screenshot evidence:

  • None for this corrected mobile-app change. iOS Simulator validation is blocked on this machine because xcrun simctl is unavailable and orca emulator attach 'iPhone 17 Pro' returns emulator_simctl_unavailable.
  • The earlier /var/folders/.../mobile-touch-fab-visible.png evidence validated the desktop/touch sidebar surface, not the actual Orca Mobile screen, and should not be treated as evidence for this corrected request.

Post-PR Stabilization

Complete for head d663fa2f4ceb8387d56174af7eb378ab9376b226.

CI checks passing:

  • PR Checks / verify
  • Mobile Checks / verify
  • Golden E2E Experiment / golden e2e linux experiment
  • Golden E2E Experiment / golden e2e mac experiment

Mergeability:

  • mergeable: MERGEABLE
  • mergeStateStatus: CLEAN

Security And Compatibility

No new privileged operations, provider-specific behavior, network calls, subprocesses, or SSH/runtime execution paths were added. The FAB reuses the existing mobile new-worktree modal flow.

Remaining Risk

The remaining gap is visual device/simulator verification for the corrected mobile-app screen because Simulator tools are unavailable in this environment. Static/source validation and focused tests cover placement, action wiring, accessibility, embedded preservation, and list clearance, but they do not replace a real device screenshot.

@coderabbitai

coderabbitai Bot commented Jun 28, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR adds a mobile floating action button for workspace creation in the sidebar and mobile app, plus touch/hover-specific CSS, target-selection helpers, and tour-handoff support for an initial repo id. It also updates WorktreeList, SidebarHeader, related tests, and e2e seeded-repo visibility helpers. Separately, it localizes the workspace cleanup dialog filter/sort UI and expands the associated locale entries and presentation fixtures across English, Spanish, Japanese, Korean, and Chinese.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. 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 matches the main change: moving mobile workspace creation to a bottom-right floating control.
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.
Description check ✅ Passed The PR description is detailed and covers summary, implementation, validation, security, and compatibility, with only minor template fields like screenshots/checklist not explicitly formatted.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/renderer/src/components/sidebar/WorktreeList.tsx (1)

3878-3888: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Only add the mobile bottom spacer when the FAB is shown.

Line 3888 always applies worktree-mobile-create-scroll-padding, so touch layouts still reserve space when showMobileCreateFab is false. That leaves dead space after the last row in repo-less or fully filtered states.

Suggested fix
-        className="worktree-mobile-create-scroll-padding worktree-sidebar-scrollbar h-full overflow-y-scroll overflow-x-hidden pl-1 scrollbar-sleek outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-inset pt-px"
+        className={cn(
+          showMobileCreateFab && 'worktree-mobile-create-scroll-padding',
+          'worktree-sidebar-scrollbar h-full overflow-y-scroll overflow-x-hidden pl-1 scrollbar-sleek outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-inset pt-px'
+        )}
🧹 Nitpick comments (3)
src/renderer/src/components/sidebar/mobile-worktree-create-target.test.ts (1)

58-80: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Avoid source-string assertions that depend on formatting.

This block couples the test to WorktreeList.tsx layout instead of behavior; the literal at Line 76 will fail on a harmless reflow or indentation change. Prefer rendering the component, or at least asserting the relevant tokens separately instead of matching a formatted multiline slice.

src/renderer/src/components/contextual-tours/workspace-creation-tour-handoff.test.ts (1)

42-62: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

This case never enters the handoff branch.

activeContextualTourId stays null, so the new test only verifies the plain modal-open path. Add a variant with workspace-agent-sessions / step 1 and assert that initialRepoId survives alongside contextualTourSource.

src/renderer/src/components/sidebar/WorktreeList.tsx (1)

616-620: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Replace the ad-hoc FAB shadow with a shared token.

Line 620 hard-codes both the shadow tier and color in the component. Move this to an existing sidebar token/class, or define a named token in src/renderer/src/assets/main.css, so the mobile FAB stays aligned with the documented system.

As per coding guidelines, "All UI work — layout, color, typography, spacing, component selection, UX behavior — must follow docs/STYLEGUIDE.md and use tokens defined in src/renderer/src/assets/main.css" and "src/renderer/src/**/*.{ts,tsx,css}: Never invent new color values, font sizes, or shadow tiers when a documented one in STYLEGUIDE.md already covers the role."

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d0b851fe-e3db-4354-a8f8-673f5857999f

📥 Commits

Reviewing files that changed from the base of the PR and between c906405 and 4ce5e47.

📒 Files selected for processing (17)
  • src/renderer/src/assets/main.css
  • src/renderer/src/components/contextual-tours/workspace-creation-tour-handoff.test.ts
  • src/renderer/src/components/contextual-tours/workspace-creation-tour-handoff.ts
  • src/renderer/src/components/sidebar/SidebarHeader.test.tsx
  • src/renderer/src/components/sidebar/SidebarHeader.tsx
  • src/renderer/src/components/sidebar/WorktreeList.lineage-child-real-card.test.tsx
  • src/renderer/src/components/sidebar/WorktreeList.tsx
  • src/renderer/src/components/sidebar/mobile-worktree-create-target.test.ts
  • src/renderer/src/components/sidebar/mobile-worktree-create-target.ts
  • src/renderer/src/components/workspace-cleanup/WorkspaceCleanupDialog.tsx
  • src/renderer/src/components/workspace-cleanup/workspace-cleanup-presentation-fixtures.ts
  • src/renderer/src/components/workspace-cleanup/workspace-cleanup-presentation.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json

brennanb2025 and others added 8 commits June 28, 2026 16:38
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: e8c3c299-fd1a-42c7-8b3e-8192d9e2bbf0

📥 Commits

Reviewing files that changed from the base of the PR and between 7f46c4b and 3ee180c.

📒 Files selected for processing (2)
  • tests/e2e/helpers/orca-app.ts
  • tests/e2e/helpers/seeded-repo-worktree-visibility.ts

brennanb2025 and others added 4 commits June 28, 2026 17:56
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
@brennanb2025

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 29, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@brennanb2025 brennanb2025 changed the title Show mobile workspace creation at the bottom of the sidebar Show mobile workspace creation at the bottom right Jun 29, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
mobile/app/h/[hostId]/index.tsx (1)

1179-1186: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Document the extra FAB clearance in the nearby why-comment.

This padding now reserves space for both the bottom inset and the floating create button, but the comment still only explains the inset case. Please mention the FAB too so the extra clearance does not look accidental.

Suggested comment update
-          // Why: edge-to-edge — the list scrolls under the system nav bar
-          // while reserving insets.bottom keeps the last worktree row reachable
-          // above the Samsung 3-button nav / iOS home indicator.
+          // Why: edge-to-edge — reserve the system bottom inset and, on phone
+          // layouts, extra clearance so the last row can scroll above the FAB.

Source: Coding guidelines

mobile/src/worktree/mobile-worktree-activation-source.test.ts (1)

4-5: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift

Replace source-snapshot assertions with behavior checks
These expectations are tied to JSX/style formatting, so harmless refactors can break the test while real runtime regressions still pass. Render HostScreen / MobileCreateWorkspaceFab and assert the FAB’s visibility/state directly.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 5cbd4365-ee1f-4160-a96d-07b0264a736c

📥 Commits

Reviewing files that changed from the base of the PR and between 7f46c4b and c3f6920.

📒 Files selected for processing (6)
  • mobile/app/h/[hostId]/index.tsx
  • mobile/src/worktree/MobileCreateWorkspaceFab.tsx
  • mobile/src/worktree/mobile-worktree-activation-source.test.ts
  • tests/e2e/golden-core-flows.spec.ts
  • tests/e2e/helpers/orca-app.ts
  • tests/e2e/helpers/seeded-repo-worktree-visibility.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/e2e/helpers/orca-app.ts

Comment thread tests/e2e/golden-core-flows.spec.ts Resolved
Co-authored-by: Orca <help@stably.ai>
@AmethystLiang

Copy link
Copy Markdown
Contributor

@brennanb2025 oops I might have checked in some code for this already

@AmethystLiang

Copy link
Copy Markdown
Contributor

@brennanb2025 here is my PR #6710

I think your PR has more stuff? not sure why it has a lot more files

Co-authored-by: Orca <help@stably.ai>
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Closing this because the actual mobile host-list FAB fix landed separately in #6710. This PR contains extra exploratory/stabilization work beyond the original request.

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