Commit 3e8410d
authored
🤖 fix: deterministic project sidebar sort order (#1244)
Sort missing projects lexically in `normalizeOrder()` to ensure
deterministic order when projects aren't in the persisted `projectOrder`
(e.g., in Storybook where localStorage may be empty).
**Root cause:** When projects were missing from the persisted
`projectOrder`, `normalizeOrder` would prepend them using
`Array.from(projects.keys())` which depends on Map iteration order. This
order is determined by insertion order into the Map, which could vary
based on how `groupWorkspacesByProject` built it.
**Fix:** Sort the missing projects lexically before prepending to ensure
deterministic order.
---
_Generated with `mux` • Model: `anthropic:claude-opus-4-5` • Thinking:
`high`_1 parent 900af54 commit 3e8410d
2 files changed
+19
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
79 | 93 | | |
80 | 94 | | |
81 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
72 | 75 | | |
73 | 76 | | |
74 | 77 | | |
| |||
0 commit comments