Commit 5fa4b5b
committed
💄🔧:keep what the old sidebar got right
Read against bento-sidebar's own source rather than trusting that a
drawer is a drawer. Four things it did that this had dropped:
The panel hangs off the trailing edge, so in a page that reads right to
left it has to leave to the left. It was leaving to the right whatever
the direction, which parked the closed panel in the middle of the
viewport. No page sets `lang: ar` yet, but the layout emits `dir='rtl'`
for one that does.
`overflow-y: auto` alone makes the other axis scrollable too, so a long
entry would have given the drawer a horizontal scrollbar. The old one
pinned `overflow-x: hidden` on purpose.
A drag on the backdrop scrolled the page behind it. The old one made
the backdrop swallow the gesture; `touch-action` says the same thing
without the two hacks it needed to do it.
Escape closed the drawer and carried on to whatever else was listening.
The slide is the old one's again as well, a sharp decelerate over
350ms, so the motion is the one the site had rather than a new one.
Left behind deliberately: `role="menu"` on a list of links, which wants
`menuitem` children to mean anything and reads worse than the labelled
`nav` around it. The toolbar attribute, the `open` attribute as an API,
and pausing media on close were never used here. History integration —
the back button closing the drawer — belonged to `amp-sidebar`, not to
the component this site loaded, so it was never ours to lose.
Signed-off-by: Derek Lewis <DerekNonGeneric@inf.is>
Assisted-by: Claude-Code:claude-opus-51 parent 9228eff commit 5fa4b5b
3 files changed
Lines changed: 30 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
1 | 6 | | |
2 | 7 | | |
3 | 8 | | |
| |||
47 | 52 | | |
48 | 53 | | |
49 | 54 | | |
50 | | - | |
| 55 | + | |
51 | 56 | | |
52 | 57 | | |
53 | 58 | | |
54 | 59 | | |
55 | | - | |
56 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
57 | 69 | | |
58 | 70 | | |
59 | 71 | | |
60 | 72 | | |
61 | 73 | | |
62 | | - | |
| 74 | + | |
63 | 75 | | |
64 | 76 | | |
65 | 77 | | |
| |||
77 | 89 | | |
78 | 90 | | |
79 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
80 | 97 | | |
81 | 98 | | |
82 | 99 | | |
83 | | - | |
84 | | - | |
| 100 | + | |
| 101 | + | |
85 | 102 | | |
86 | 103 | | |
87 | 104 | | |
88 | 105 | | |
89 | 106 | | |
90 | | - | |
| 107 | + | |
91 | 108 | | |
92 | 109 | | |
93 | 110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
57 | 61 | | |
58 | 62 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
0 commit comments