Repository navigation
Commit 907e62f
fix(web): keep sidebar thread order across restarts and make new rows draggable
Two separate defects in the v2 sidebar's drag-to-reorder.
The persisted order was wiped on every app start. The prune effect only
gated on "is an environment connected", but on a cold start the
environment descriptor arrives before the thread snapshot does — leaving
a window where every environment looks connected with zero live threads.
pruneThreadOrder then dropped every persisted key, and the list fell back
to the default created-date sort. Gate the effect on
useAllEnvironmentShellsBootstrapped() so an absence of threads is only
trusted once the snapshots have actually landed.
Dragging a freshly created thread did nothing — the row moved and snapped
back. reorderThreads can only splice keys already present in the order,
and unranked threads (every new one, which render at the top per
orderThreadsByPreferredKeys) are absent from it by design. The existing
seed only applied when threadOrder was entirely empty, so it never helped
once the user had dragged anything. Build the drag baseline by folding
unranked rendered keys in at their displayed position, making any visible
row draggable — including a thread that is actively working, which is
usually a recently created one.
Co-Authored-By: Claude <[email protected]>1 parent 8dd20ba commit 907e62f
1 file changed
Lines changed: 33 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
109 | 113 | | |
110 | 114 | | |
111 | 115 | | |
| |||
1539 | 1543 | | |
1540 | 1544 | | |
1541 | 1545 | | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
1542 | 1552 | | |
1543 | 1553 | | |
1544 | 1554 | | |
1545 | 1555 | | |
1546 | 1556 | | |
| 1557 | + | |
1547 | 1558 | | |
1548 | | - | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
1549 | 1566 | | |
1550 | 1567 | | |
1551 | 1568 | | |
| |||
1601 | 1618 | | |
1602 | 1619 | | |
1603 | 1620 | | |
1604 | | - | |
1605 | | - | |
1606 | | - | |
1607 | | - | |
1608 | | - | |
1609 | | - | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
1610 | 1635 | | |
1611 | 1636 | | |
1612 | 1637 | | |
| |||
0 commit comments