Repository navigation
Commit 6f34369
committed
The address bar is reconciled, not pushed — so the sidebar moves it too
Walking the sidebar left the URL behind, and the reason is the architecture
rather than a missing line. What is shown can change four ways — a click on
the sidebar, `j` in it, the row menu's "Go to", and the back button — and the
last commit pushed the route from `Message::Select`, which covered three. The
one it missed is how this window is actually driven: in the sidebar the cursor
*is* the selection, so every `j` changes what is shown without going anywhere
near `Select`.
A rule that each call site has to remember is a rule that is already broken.
So `update` is a wrapper now — it runs `step`, then `sync_route` — and
`sync_route` is the only thing in this program that writes the address bar.
Every path reconciles, including the several that `return` early out of `step`
and the ones that recurse back into `update`. Nothing has to remember
anything, which is the only version of this that stays true.
**Walking the sidebar is one navigation, not forty.** Since the cursor is the
selection, holding `j` through forty albums changes what is shown forty times,
and forty history entries is a back button that needs forty presses to undo
one scroll. `Nav::Replace` rewrites rather than adds, `show_under_cursor` is
the only thing that sets it, and `sync_route` resets it every time so only the
step that meant it gets it. The URL is right at every one of the forty — which
is what "one to one" has to mean.
Clean on all three: the desktop, the demo, and wasm32.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XcBd33WHuwVJf6eCw7CpeG1 parent 2674f14 commit 6f34369
3 files changed
Lines changed: 104 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1026 | 1026 | | |
1027 | 1027 | | |
1028 | 1028 | | |
1029 | | - | |
1030 | | - | |
1031 | | - | |
1032 | | - | |
1033 | | - | |
1034 | | - | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
1035 | 1057 | | |
1036 | 1058 | | |
1037 | 1059 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
380 | 380 | | |
381 | 381 | | |
382 | 382 | | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
383 | 394 | | |
384 | 395 | | |
385 | 396 | | |
| |||
710 | 721 | | |
711 | 722 | | |
712 | 723 | | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
713 | 728 | | |
714 | 729 | | |
715 | 730 | | |
| |||
1015 | 1030 | | |
1016 | 1031 | | |
1017 | 1032 | | |
| 1033 | + | |
1018 | 1034 | | |
1019 | 1035 | | |
1020 | 1036 | | |
| |||
1041 | 1057 | | |
1042 | 1058 | | |
1043 | 1059 | | |
| 1060 | + | |
1044 | 1061 | | |
1045 | 1062 | | |
1046 | 1063 | | |
| |||
1339 | 1356 | | |
1340 | 1357 | | |
1341 | 1358 | | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
1342 | 1363 | | |
1343 | 1364 | | |
1344 | 1365 | | |
| |||
1559 | 1580 | | |
1560 | 1581 | | |
1561 | 1582 | | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
1562 | 1593 | | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
1563 | 1622 | | |
1564 | 1623 | | |
1565 | 1624 | | |
| |||
1790 | 1849 | | |
1791 | 1850 | | |
1792 | 1851 | | |
1793 | | - | |
1794 | | - | |
1795 | | - | |
1796 | | - | |
1797 | | - | |
1798 | | - | |
1799 | | - | |
1800 | | - | |
1801 | | - | |
1802 | | - | |
1803 | 1852 | | |
1804 | 1853 | | |
1805 | 1854 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
| 114 | + | |
114 | 115 | | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
121 | 122 | | |
122 | 123 | | |
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
126 | 127 | | |
127 | | - | |
128 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
129 | 135 | | |
130 | 136 | | |
131 | 137 | | |
| |||
138 | 144 | | |
139 | 145 | | |
140 | 146 | | |
141 | | - | |
| 147 | + | |
142 | 148 | | |
143 | 149 | | |
144 | 150 | | |
| |||
0 commit comments