Skip to content

fix(projects): mobile project view rendered off-screen#288

Merged
jaylfc merged 1 commit intomasterfrom
fix/mobile-projects-auto-select
May 1, 2026
Merged

fix(projects): mobile project view rendered off-screen#288
jaylfc merged 1 commit intomasterfrom
fix/mobile-projects-auto-select

Conversation

@jaylfc
Copy link
Copy Markdown
Owner

@jaylfc jaylfc commented May 1, 2026

Summary

  • ProjectsApp auto-selects the first project on load. On mobile that flipped MobileSplitView straight into the detail pane; the workspace mount caused a focus event that scrolled the outer overflow:hidden container, doubling the translate and pushing the visible pane off-screen.
  • Skip auto-select on mobile (list is its own screen). Pin scrollLeft=0 in MobileSplitView so any future consumer that auto-routes into detail is safe too.

Repro (pre-fix)

  1. iPhone PWA at 390×844
  2. Open Projects from launchpad
  3. Land on bare wallpaper + dock; the workspace is rendered at viewport x=-386 with only 3.5px visible

Verification

Reproduced via Playwright at 390×844 with the launched gate manually forced. Pre-fix: SV scrollLeft=386.5 + track translate(-390) = pane at -776.5. Post-fix: list visible at x=0, w=390; tapping a project slides to detail at x=0, w=390.

Test plan

  • Build clean
  • All 250 desktop unit tests pass
  • Manual verification on iPhone PWA after Pi rebuild (Settings → Install Update or bin/update.sh)

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Improved mobile navigation behavior when selected items are no longer available—desktop auto-selects the first project while mobile clears the selection to prevent unwanted navigation to the detail view.
    • Fixed mobile split view scroll position to prevent browser-driven scrolling when switching between list and detail views.

ProjectsApp's refresh() auto-selected the first project on every
load. On mobile that flipped MobileSplitView straight into the detail
view, and as the workspace mounted the browser pulled focus into one
of its tab buttons. With the slider track at translateX(-50%),
focusing an off-screen child causes the outer overflow:hidden
container to scroll-into-view, doubling the offset and pushing the
active pane right off the screen — the user lands on the dock + bare
wallpaper.

Two fixes, both small:

1. Skip the auto-select on mobile. Mobile shows the list as its own
   screen, so picking a project should be the user's first action.
   Desktop's split layout still benefits from the auto-select default.

2. MobileSplitView pins scrollLeft = 0 on its outer container. Any
   future consumer that auto-routes into the detail view (or any
   focus event that drags the page sideways) is then safe.

Verified by emulating the iPhone PWA in Playwright at 390×844 with
launched-gate forced. Pre-fix: detail pane at viewport x=-386, only
3.5px sliver visible. Post-fix: list pane visible at x=0, w=390;
tapping a project slides smoothly to detail at x=0, w=390.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 1, 2026

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: f3c7b00e-f13d-4c07-addd-7f7f59cae87c

📥 Commits

Reviewing files that changed from the base of the PR and between 073dfa5 and efaf6e5.

📒 Files selected for processing (22)
  • desktop/src/apps/ProjectsApp/index.tsx
  • desktop/src/components/mobile/MobileSplitView.tsx
  • static/desktop/assets/AgentsApp-mNkbnLYK.js
  • static/desktop/assets/ChannelsApp-CcYJZULE.js
  • static/desktop/assets/ClusterApp-CjWIg7wT.js
  • static/desktop/assets/ContactsApp-CEg2wKdN.js
  • static/desktop/assets/FilesApp-tdBopu2n.js
  • static/desktop/assets/GitHubApp-B_Y7_35T.js
  • static/desktop/assets/LibraryApp-6nMMvUBj.js
  • static/desktop/assets/MCPApp-CoroPwHn.js
  • static/desktop/assets/MessagesApp-CEisDh4y.js
  • static/desktop/assets/MobileSplitView-DUGxG10V.js
  • static/desktop/assets/MobileSplitView-thFIDpng.js
  • static/desktop/assets/ProvidersApp-BRqX_eVk.js
  • static/desktop/assets/RedditApp-DvAqARxC.js
  • static/desktop/assets/ServiceAppWindow-BtrypE96.js
  • static/desktop/assets/SettingsApp-CeO4rPzC.js
  • static/desktop/assets/chat-dxSolGsK.js
  • static/desktop/assets/index-Do7OazQZ.js
  • static/desktop/assets/main-BVi84xDk.js
  • static/desktop/chat.html
  • static/desktop/index.html
💤 Files with no reviewable changes (1)
  • static/desktop/assets/MobileSplitView-DUGxG10V.js

📝 Walkthrough

Walkthrough

Implements conditional selection state handling in ProjectsApp based on mobile/desktop context, and adds scroll position reset behavior to MobileSplitView with a container reference and scroll listener. Multiple build artifacts updated with new hashed filenames.

Changes

Cohort / File(s) Summary
Mobile Selection & Scroll Management
desktop/src/apps/ProjectsApp/index.tsx, desktop/src/components/mobile/MobileSplitView.tsx
ProjectsApp now conditionally clears or auto-selects projects on refresh based on mobile state, and deduplicates isMobile hook. MobileSplitView adds a container reference and scroll management logic to reset and maintain scrollLeft position via an effect and passive event listener.
Build Artifact Updates — App Bundles
static/desktop/assets/ChannelsApp-CcYJZULE.js, static/desktop/assets/ClusterApp-CjWIg7wT.js, static/desktop/assets/ContactsApp-CEg2wKdN.js, static/desktop/assets/FilesApp-tdBopu2n.js, static/desktop/assets/GitHubApp-B_Y7_35T.js, static/desktop/assets/LibraryApp-6nMMvUBj.js, static/desktop/assets/RedditApp-DvAqARxC.js
Updated MobileSplitView module import references to new bundled hashed filenames; all component logic unchanged.
Build Artifact Updates — Service & Provider
static/desktop/assets/MCPApp-CoroPwHn.js, static/desktop/assets/ProvidersApp-BRqX_eVk.js, static/desktop/assets/ServiceAppWindow-BtrypE96.js
Updated MobileSplitView and/or main module import references to new hashed asset filenames; component logic unchanged.
Build Artifact Updates — MobileSplitView Module
static/desktop/assets/MobileSplitView-DUGxG10V.js, static/desktop/assets/MobileSplitView-thFIDpng.js
Old hashed module deleted; new module added with scroll-reset and ref-based position management for horizontal layout control.
Build Artifact Updates — Other Bundles
static/desktop/assets/SettingsApp-CeO4rPzC.js, static/desktop/assets/chat-dxSolGsK.js
Updated main and MessagesApp module import references to new hashed asset filenames.
HTML Entry Points
static/desktop/chat.html, static/desktop/index.html
Updated script src attributes to reference new hashed JavaScript bundle filenames.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 A scroll that dances side-to-side, I hop to keep the view aligned,
Mobile minds now get their zen—when projects vanish, peace they find! ✨
The refs, the listeners, all in place, a bunny's work to set the pace! 🚀

🚥 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(projects): mobile project view rendered off-screen' clearly and specifically describes the main issue being fixed—a mobile rendering problem where the project view was positioned off-screen.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 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-projects-auto-select

Review rate limit: 9/10 reviews remaining, refill in 6 minutes.

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

@kilo-code-bot
Copy link
Copy Markdown

kilo-code-bot Bot commented May 1, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • desktop/src/apps/ProjectsApp/index.tsx - No issues
  • desktop/src/components/mobile/MobileSplitView.tsx - No issues

Reviewed by grok-code-fast-1:optimized:free · 128,834 tokens

@jaylfc jaylfc merged commit 4c66d4f into master May 1, 2026
8 checks passed
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