Commit 1e8a60b
authored
feat(plan): complete sticky actions — pin toolstrip + badges on scroll (#510)
* feat(plan): complete sticky actions — pin toolstrip + badges on scroll
The sticky actions setting previously only pinned the action button cluster
on the right side of the plan card. The annotation toolstrip (selection
mode + editor mode toggles) and the left-side badges (repo / branch /
plan-diff) scrolled away, forcing users to scroll back to the top of long
plans to switch modes or jump into diff view.
Adds a ghost sticky header lane that pins the toolstrip and badges on the
same horizontal plane as the already-sticky action buttons once the user
scrolls past the top of the document. Top-of-document rendering is
unchanged.
- Extract the badge cluster into a reusable `DocBadges` component with
`column` / `row` layouts so the card's absolute cluster and the ghost
bar share the same markup.
- Add a `compact` prop to `AnnotationToolstrip` that disables hover
expansion (only the active button shows its label) and hides the help
link, for use inside the ghost bar.
- Introduce `StickyHeaderLane`: a zero-height sticky wrapper with an
absolute-positioned bar that fades + slides in via IntersectionObserver
on a sentinel. Uses a 72px top rootMargin so the bar only materializes
after the real toolstrip has scrolled off.
- Hidden in plan-diff, archive, and linked-doc modes, and gated by the
existing `stickyActionsEnabled` preference.
For provenance purposes, this commit was AI assisted.
* fix(plan): mobile sticky lane, keyboard a11y, action button overlap
Iteration on the sticky header lane addressing review feedback and
in-browser testing across viewport sizes:
- Mobile (<640px): the bar now drops to its own full-width row at
top: 52px, directly below the action buttons row. Two stacked
horizontal lanes — no horizontal collision possible. The toolstrip
switches to icon-only on mobile so the diff badges fit alongside.
- sm-md (640-1023px): bar shares the top: 12px lane with action
buttons, capped at `max-w-[calc(100%-340px)]` to clear the short-
label action button cluster (Attachments + Comment + Copy ≈ 320px).
- lg+ (1024px+): same shared-lane behavior, cap raised to 400px to
clear the full-label cluster.
- Bar is `inline-flex` (content-width), not flex (full bounding-box
width), so the chrome wraps tightly to the toolstrip + badges and
doesn't extend visually past where it needs to.
- Add `inert` to the bar when not stuck — removes the hidden subtree
from the tab order entirely so keyboard users don't land on
invisible duplicate controls before reaching the real toolstrip.
- Add `iconOnly` prop to AnnotationToolstrip; passed via JS-driven
matchMedia('(max-width: 639px)') in StickyHeaderLane. Active button
expansion is preserved on sm+ so users still see the current mode
label there.
- Bump action button label breakpoint md → lg in Viewer so "Comment"
and "Copy" stay short labels until 1024px, giving the action button
cluster more breathing room on tablet/laptop widths.
For provenance purposes, this commit was AI assisted.1 parent 91f57ad commit 1e8a60b
5 files changed
Lines changed: 427 additions & 83 deletions
File tree
- packages
- editor
- ui/components
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
1597 | 1598 | | |
1598 | 1599 | | |
1599 | 1600 | | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
1600 | 1623 | | |
1601 | 1624 | | |
1602 | 1625 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
11 | 23 | | |
12 | 24 | | |
13 | 25 | | |
| |||
16 | 28 | | |
17 | 29 | | |
18 | 30 | | |
| 31 | + | |
| 32 | + | |
19 | 33 | | |
20 | 34 | | |
21 | 35 | | |
| |||
28 | 42 | | |
29 | 43 | | |
30 | 44 | | |
31 | | - | |
| 45 | + | |
32 | 46 | | |
33 | 47 | | |
34 | 48 | | |
| |||
37 | 51 | | |
38 | 52 | | |
39 | 53 | | |
| 54 | + | |
| 55 | + | |
40 | 56 | | |
41 | 57 | | |
42 | 58 | | |
| |||
53 | 69 | | |
54 | 70 | | |
55 | 71 | | |
| 72 | + | |
| 73 | + | |
56 | 74 | | |
57 | 75 | | |
58 | 76 | | |
| |||
74 | 92 | | |
75 | 93 | | |
76 | 94 | | |
| 95 | + | |
| 96 | + | |
77 | 97 | | |
78 | 98 | | |
79 | 99 | | |
| |||
86 | 106 | | |
87 | 107 | | |
88 | 108 | | |
| 109 | + | |
| 110 | + | |
89 | 111 | | |
90 | 112 | | |
91 | 113 | | |
| |||
98 | 120 | | |
99 | 121 | | |
100 | 122 | | |
| 123 | + | |
| 124 | + | |
101 | 125 | | |
102 | 126 | | |
103 | 127 | | |
| |||
110 | 134 | | |
111 | 135 | | |
112 | 136 | | |
| 137 | + | |
| 138 | + | |
113 | 139 | | |
114 | 140 | | |
115 | 141 | | |
| |||
119 | 145 | | |
120 | 146 | | |
121 | 147 | | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
128 | 156 | | |
129 | 157 | | |
130 | 158 | | |
| |||
241 | 269 | | |
242 | 270 | | |
243 | 271 | | |
244 | | - | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
245 | 275 | | |
246 | 276 | | |
247 | 277 | | |
| |||
255 | 285 | | |
256 | 286 | | |
257 | 287 | | |
258 | | - | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
259 | 296 | | |
260 | 297 | | |
261 | 298 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 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 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
0 commit comments