Commit 04898dc
authored
🤖 Fix Ctrl+J/K workspace navigation to use sorted order (#209)
Workspace navigation (Ctrl+J/K) now follows the visual order displayed
in the sidebar.
## Problem
PR #205 added recency-based sorting to the workspace display, but
Ctrl+J/K navigation still used the unsorted config order. This caused
confusion where pressing "next workspace" wouldn't select the next
visible workspace in the sidebar.
## Solution
Moved the sorting logic from ProjectSidebar to App.tsx so both
navigation and display use the same recency-sorted workspace list. This
ensures Ctrl+J/K navigation matches the visual order users see.
## Changes
- Added `sortedWorkspacesByProject` memo in App.tsx that sorts
workspaces by recency
- Updated `handleNavigateWorkspace` to use the sorted list instead of
raw config order
- Pass sorted list through LeftSidebar → ProjectSidebar props chain
- Removed duplicate sorting logic from ProjectSidebar (now uses parent's
sorted list)
## Testing
- ✅ All 379 unit tests pass
- ✅ Type checking passes
- Manual verification: Ctrl+J/K now navigates in the same order as
displayed in sidebar
_Generated with `cmux`_1 parent 539d428 commit 04898dc
3 files changed
+37
-36
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
290 | 312 | | |
291 | 313 | | |
292 | 314 | | |
293 | 315 | | |
294 | | - | |
295 | | - | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
296 | 319 | | |
297 | | - | |
298 | | - | |
| 320 | + | |
| 321 | + | |
299 | 322 | | |
300 | 323 | | |
301 | 324 | | |
302 | 325 | | |
303 | 326 | | |
304 | 327 | | |
305 | 328 | | |
306 | | - | |
| 329 | + | |
307 | 330 | | |
308 | | - | |
| 331 | + | |
309 | 332 | | |
310 | 333 | | |
311 | | - | |
| 334 | + | |
312 | 335 | | |
313 | 336 | | |
314 | 337 | | |
| |||
321 | 344 | | |
322 | 345 | | |
323 | 346 | | |
324 | | - | |
| 347 | + | |
325 | 348 | | |
326 | 349 | | |
327 | 350 | | |
| |||
554 | 577 | | |
555 | 578 | | |
556 | 579 | | |
557 | | - | |
| 580 | + | |
558 | 581 | | |
559 | 582 | | |
560 | 583 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
585 | 585 | | |
586 | 586 | | |
587 | 587 | | |
588 | | - | |
| 588 | + | |
589 | 589 | | |
590 | 590 | | |
591 | 591 | | |
| |||
605 | 605 | | |
606 | 606 | | |
607 | 607 | | |
608 | | - | |
| 608 | + | |
609 | 609 | | |
610 | 610 | | |
611 | 611 | | |
612 | 612 | | |
613 | | - | |
614 | | - | |
615 | | - | |
616 | | - | |
617 | | - | |
618 | | - | |
619 | | - | |
620 | | - | |
621 | | - | |
622 | | - | |
623 | | - | |
624 | | - | |
625 | | - | |
626 | | - | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | | - | |
631 | | - | |
632 | | - | |
633 | | - | |
634 | | - | |
635 | 613 | | |
636 | 614 | | |
637 | 615 | | |
| |||
0 commit comments