fix(ios): keep workspace-list viewport when exiting a workspace - #10292
azooz2003-bit wants to merge 2 commits into
Conversation
Regression test: flipping showsNavigationToolbar (what a compact-stack workspace push/pop does) must not recreate the UITableView-backed list or reset its content offset. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The compact push stack flips showsNavigationToolbar on every workspace enter/exit. The toolbar branch was structural (if around content), so each flip changed the list subtree's identity, SwiftUI dismantled the UITableView-backed list, and the recreated table opened at the top. Move the conditional inside the ToolbarContentBuilder so the subtree identity is stable and UIKit keeps the exact scroll position across enter/exit. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan includes up to 10 reviews per rolling hour; 2 remain after this review. 📝 WalkthroughWalkthroughThe iOS workspace list now keeps its content structurally present while navigation toolbar items change. A UI test verifies that workspace navigation preserves the table view instance and content offset. ChangesWorkspace list toolbar stability
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This localized iOS change preserves the workspace list’s existing view identity so the scroll position remains intact when entering or exiting a workspace; no actionable merge-blocking risk remains beyond normal checks and review. Possibly related PRs
🚥 Pre-merge checks | ✅ 25✅ Passed checks (25 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
|
Red/green evidence (run on branch
The |
Exiting a workspace on iPhone reset the workspace list to the top. The compact push stack flips
showsNavigationToolbaron every workspace enter/exit, andWorkspaceListView+Toolbar.swiftused a structuralifaround the list content, so each flip changed the subtree's view identity. SwiftUI dismantled the UITableView-backed list (WorkspaceListTable) and the recreated table opened at offset zero.Fix: keep one stable subtree and move the conditional inside the
ToolbarContentBuilder(the same idiomWorkspaceShellView.stackLayoutalready uses forrootToolbarContent). With stable identity the sameUITableViewsurvives push/pop and UIKit preserves the exact scroll position natively. Toolbar behavior is unchanged: items still disappear while a workspace is open.Two commits so CI proves the test catches the bug: commit 1 adds
WorkspaceListViewportRestorationTests(hosts the realWorkspaceListView, scrolls, flips the flag both ways, asserts same table instance and same content offset) and fails; commit 2 adds the fix and goes green.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Keep the workspace list viewport on iPhone when exiting a workspace. Previously, exiting reset the list to the top; now the scroll position is preserved by keeping the list subtree identity stable.
showsNavigationToolbarcheck inside the.toolbarbuilder so the list view isn’t structurally replaced during push/pop; matches the pattern used inWorkspaceShellView.stackLayout.WorkspaceListViewportRestorationTeststhat flips the flag around the realWorkspaceListViewand asserts the sameUITableViewinstance and content offset.Written for commit 722aa9f. Summary will update on new commits.
Summary by CodeRabbit
Bug Fixes
Tests