Conversation
New workspaces are inserted with a prepend tabOrder (top), but the pending placeholder was pinned to MAX_SAFE_INTEGER (bottom), so the creating/failed indicator visually separated from the row it represents. Flip the constant to MIN_SAFE_INTEGER so the pending sits alongside the just-created workspace at the top.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe dashboard sidebar now displays pending workspaces at the top of the list instead of at the bottom by changing the tab order sentinel value from Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Poem
✨ 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 |
Greptile SummaryThis PR fixes a visual ordering bug where pending workspace placeholders (status: "creating" or "failed") were being displayed at the bottom of the sidebar's workspace list, while the real workspace—once creation succeeded—would appear at the top. The fix is a one-line change: flipping Confidence Score: 5/5Safe to merge — minimal, targeted fix with no regressions to existing logic. The change is a single constant swap that correctly aligns the pending workspace's sort position with the eventual insertion point of the real workspace. The surrounding sort and section-reparenting logic handles Number.MIN_SAFE_INTEGER safely. No unrelated code is touched. No files require special attention.
|
| Filename | Overview |
|---|---|
| apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/hooks/useDashboardSidebarData/useDashboardSidebarData.ts | Single-line constant change from Number.MAX_SAFE_INTEGER to Number.MIN_SAFE_INTEGER; logic is correct and the updated comment accurately describes the intent. |
Reviews (1): Last reviewed commit: "fix(desktop): render pending workspaces ..." | Re-trigger Greptile
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
Summary
getPrependTabOrder, but pending placeholders were pinned toNumber.MAX_SAFE_INTEGER— so the "creating"/"failed" row appeared at the bottom while the real workspace showed up at the top.PENDING_WORKSPACE_TAB_ORDERtoNumber.MIN_SAFE_INTEGERso pending rows render at the top, right where the real workspace will land once creation succeeds.Test plan
Summary by cubic
Fixes sidebar ordering so pending workspace rows (“creating/failed”) render at the top, matching where the new workspace is inserted and preventing a bottom-to-top jump. Changes
PENDING_WORKSPACE_TAB_ORDERfromNumber.MAX_SAFE_INTEGERtoNumber.MIN_SAFE_INTEGERand clarifies the inline comment.Written for commit db66c92. Summary will update on new commits.
Summary by CodeRabbit