Commit c342ffb
authored
feat(plan): simplify share/copy + sticky header polish (#519)
* refactor(ui): simplify Quick Share/Copy to Share/Copy
Rename "Quick Copy"/"Quick Share" buttons in AnnotationPanel to plain
"Copy"/"Share" and route Share through the existing ExportModal so it
benefits from the short-link path for large payloads. The naive
clipboard.writeText fallback is gone.
For provenance purposes, this commit was AI assisted.
* feat(plan): coordinated sticky header label shrinking
Replace fixed pixel reserves in the sticky ghost header with measured
geometry: a ResizeObserver on the wrapper plus one on the Viewer's
action button cluster (tagged with data-sticky-actions) computes the
exact space available for the toolstrip + badges.
Both sides shrink in coordination so they stay horizontally aligned as
long as possible:
plan area | right side | ghost bar | layout
>= 800 | full labels | active labels | shared lane
680..800 | short labels | active labels | shared lane
500..680 | icons only | active labels | shared lane
340..500 | icons only | icon-only | shared lane
< 340 | icons only | icon-only | stacked
The label-mode bucket lives in App.tsx state so the tree re-renders at
most twice per drag instead of every pixel. Sticky lane measurements
snap to a 16px grid for the same reason. Switches the
IntersectionObserver scroll root from <main> to the OverlayScrollArea
viewport (via useScrollViewport) so the ghost bar actually appears at
the right scroll position. AttachmentsButton's "Images" label now also
collapses with the cluster.
For provenance purposes, this commit was AI assisted.
* fix(plan): float collapsed sidebar rail over the grid background
Absolutely position the SidebarTabs rail and reclaim its 30px gutter
with left padding on the OverlayScrollArea, so the bg-grid pattern
paints edge-to-edge under the flags instead of starting to their right.
The plan card lands in exactly the same place as before.
For provenance purposes, this commit was AI assisted.
* fix(plan): address PR review — mobile share, a11y, snap hoist
- AnnotationPanel mobile Share was opening ExportModal (z-50) underneath
the panel (z-[60]) and its backdrop (z-[59]), creating a dead-end on
mobile. Close the panel before opening the share modal.
- AttachmentsButton trigger had no accessible name when hideLabel was
active and there were no images yet. Add aria-label + title.
- Hoist StickyHeaderLane's snap() to module scope so the effects (which
use [] deps) can't close over a stale per-render instance. Currently
harmless since snap is pure, but removes a footgun.
For provenance purposes, this commit was AI assisted.
* fix(plan): address PR review round 2
- StickyHeaderLane's [data-sticky-actions] ResizeObserver had [] deps
and was attached at mount, but Viewer is keyed by linkedDocHook state
and remounts on linked-doc toggle. The observer would stay bound to
the now-detached old node and freeze actionsWidth, leaving the bar's
geometry permanently wrong. Add a remountToken prop threaded from
App.tsx so the effect re-queries against the fresh DOM.
- Restore the shareUrl gate on the AnnotationPanel Share action — only
pass onShare when a URL has been generated, matching prior behavior.
- Hoist StickyHeaderLane's layout constants (LEFT_OFFSET, GAP,
WIDE_BAR_WIDTH, MIN_BAR_WIDTH) to module scope alongside snap, for
consistency.
For provenance purposes, this commit was AI assisted.
* fix(plan): address PR review round 3 — polish glitches
- snap() uses Math.floor instead of Math.round so the wrapper width
undershoots and the actions width overshoots, both pushing toward a
more cautious layout. Avoids a one-bucket overlap flash right at the
300/460 thresholds during a slow drag.
- Reset actionsWidth to 0 at the top of the [remountToken] effect so
the bar falls back to the safe unmeasured path for the one frame
between Viewer remounting and the new observer's first callback.
- App.tsx switches to useLayoutEffect + a synchronous
getBoundingClientRect to set the initial actionsLabelMode bucket
before paint. Eliminates the one-frame flash of full labels on
narrow viewports during first render.
For provenance purposes, this commit was AI assisted.1 parent ed254cf commit c342ffb
7 files changed
Lines changed: 222 additions & 107 deletions
File tree
- packages
- editor
- ui
- components
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
100 | 130 | | |
101 | 131 | | |
102 | 132 | | |
| |||
1431 | 1461 | | |
1432 | 1462 | | |
1433 | 1463 | | |
1434 | | - | |
| 1464 | + | |
1435 | 1465 | | |
1436 | 1466 | | |
1437 | 1467 | | |
| |||
1492 | 1522 | | |
1493 | 1523 | | |
1494 | 1524 | | |
1495 | | - | |
| 1525 | + | |
1496 | 1526 | | |
1497 | 1527 | | |
1498 | 1528 | | |
| |||
1506 | 1536 | | |
1507 | 1537 | | |
1508 | 1538 | | |
1509 | | - | |
| 1539 | + | |
1510 | 1540 | | |
1511 | 1541 | | |
1512 | 1542 | | |
| |||
1526 | 1556 | | |
1527 | 1557 | | |
1528 | 1558 | | |
| 1559 | + | |
1529 | 1560 | | |
1530 | 1561 | | |
1531 | 1562 | | |
| |||
1605 | 1636 | | |
1606 | 1637 | | |
1607 | 1638 | | |
| 1639 | + | |
1608 | 1640 | | |
1609 | 1641 | | |
1610 | 1642 | | |
| |||
1622 | 1654 | | |
1623 | 1655 | | |
1624 | 1656 | | |
1625 | | - | |
1626 | 1657 | | |
1627 | 1658 | | |
1628 | 1659 | | |
| |||
1631 | 1662 | | |
1632 | 1663 | | |
1633 | 1664 | | |
| 1665 | + | |
1634 | 1666 | | |
1635 | 1667 | | |
1636 | 1668 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
267 | | - | |
| 267 | + | |
268 | 268 | | |
269 | | - | |
| 269 | + | |
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | 36 | | |
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | 47 | | |
49 | 48 | | |
50 | 49 | | |
| |||
59 | 58 | | |
60 | 59 | | |
61 | 60 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | 61 | | |
74 | 62 | | |
75 | 63 | | |
| |||
187 | 175 | | |
188 | 176 | | |
189 | 177 | | |
190 | | - | |
| 178 | + | |
191 | 179 | | |
192 | 180 | | |
193 | 181 | | |
194 | 182 | | |
195 | | - | |
| 183 | + | |
196 | 184 | | |
197 | | - | |
| 185 | + | |
198 | 186 | | |
199 | 187 | | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
215 | 192 | | |
216 | 193 | | |
217 | 194 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
49 | 52 | | |
50 | 53 | | |
51 | 54 | | |
52 | 55 | | |
53 | 56 | | |
54 | 57 | | |
55 | 58 | | |
| 59 | + | |
56 | 60 | | |
57 | 61 | | |
58 | 62 | | |
| |||
210 | 214 | | |
211 | 215 | | |
212 | 216 | | |
| 217 | + | |
| 218 | + | |
213 | 219 | | |
214 | 220 | | |
215 | 221 | | |
| |||
254 | 260 | | |
255 | 261 | | |
256 | 262 | | |
257 | | - | |
258 | | - | |
259 | | - | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
260 | 268 | | |
261 | 269 | | |
262 | 270 | | |
| |||
0 commit comments