Commit c9e7bda
observatory: push-mode sidebar + natural compare-mode column widths
The left panel was a `position: fixed` overlay (300 px wide, covering the
main graph area when open). Two issues:
1. **Overlay blocked the graph.** Sidebar slid in over the main panel via
`transform: translateX(-100%)` → `translateX(0)`, never affecting layout.
2. **Compare-mode columns were squeezed.** `grid-template-columns:
repeat(N, 1fr)` divided the fixed 300 px equally, making N-archive
columns unreadably narrow.
Fix:
* **Push layout.** `.index-pane` moves from `position: fixed` to an
in-flow flex child of `.container`. Closed state: `width: 0;
overflow: hidden`. Open state: `width: var(--sidebar-w)` (driven by JS).
`.main-pane` is the second flex child and naturally gets the remaining
width, so the main area shrinks/grows as the sidebar opens/closes.
* **Dynamic sidebar width via CSS variable.** JS sets `--sidebar-w` on
`:root` at toggle time and on `renderIndex` when the archive count changes
(single archive: 300 px; N archives: N × 200 px, capped at 50 vw).
The `sidebar-toggle-btn` reads `left: var(--sidebar-w, 0)` so it always
sits at the sidebar's right edge with no JS positional update.
* **Natural column widths.** `grid-template-columns` changes from
`repeat(N, minmax(0, 1fr))` to `repeat(N, 200px)` with `overflow-x: auto`
on the grid container. Each archive column is 200 px; the panel expands
to accommodate all of them.
* **Hover-to-peek removed.** `.index-pane-trigger` (the invisible fixed
strip that revealed the sidebar on hover) is removed from the HTML and
hidden via CSS. It served the overlay model; in push mode it would
unexpectedly push the main content aside on every mouse-near-edge hover.
Verified: push mode (`mainLeft === sidebarWidth`), `--sidebar-w` driven
correctly for single/compare archives, 98 observatory tests pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent a66f82a commit c9e7bda
2 files changed
Lines changed: 41 additions & 35 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
| 146 | + | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | | - | |
175 | 174 | | |
176 | 175 | | |
177 | 176 | | |
| |||
187 | 186 | | |
188 | 187 | | |
189 | 188 | | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
| 189 | + | |
196 | 190 | | |
197 | 191 | | |
198 | 192 | | |
199 | | - | |
200 | | - | |
201 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
202 | 196 | | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
208 | 200 | | |
209 | 201 | | |
210 | 202 | | |
211 | 203 | | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
| 204 | + | |
223 | 205 | | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | 206 | | |
229 | | - | |
230 | | - | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
231 | 210 | | |
| 211 | + | |
232 | 212 | | |
233 | 213 | | |
234 | 214 | | |
| |||
493 | 473 | | |
494 | 474 | | |
495 | 475 | | |
496 | | - | |
| 476 | + | |
| 477 | + | |
497 | 478 | | |
498 | 479 | | |
499 | 480 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
10 | 30 | | |
11 | 31 | | |
12 | 32 | | |
| |||
24 | 44 | | |
25 | 45 | | |
26 | 46 | | |
27 | | - | |
28 | 47 | | |
29 | 48 | | |
30 | 49 | | |
| |||
40 | 59 | | |
41 | 60 | | |
42 | 61 | | |
| 62 | + | |
43 | 63 | | |
44 | 64 | | |
45 | 65 | | |
| |||
49 | 69 | | |
50 | 70 | | |
51 | 71 | | |
| 72 | + | |
52 | 73 | | |
53 | 74 | | |
54 | 75 | | |
| |||
354 | 375 | | |
355 | 376 | | |
356 | 377 | | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
357 | 381 | | |
358 | 382 | | |
359 | 383 | | |
| |||
366 | 390 | | |
367 | 391 | | |
368 | 392 | | |
| 393 | + | |
369 | 394 | | |
370 | 395 | | |
371 | 396 | | |
| |||
0 commit comments