Commit a349413
feat: mobile responsive layout (#211)
## Summary
- **Collapsible sidebar**: sidebar collapses to a fixed overlay on
viewports below 768px, toggled via hamburger button or `b` keyboard
shortcut. On desktop, pressing `b` hides the sidebar and shows the
hamburger to reopen it.
- **Responsive header**: nav button labels hidden below 1024px (icons
only), nav buttons and project typeahead hidden below 768px,
export/publish buttons hidden on mobile.
- **Touch targets**: header buttons enlarged to 44px minimum on
`pointer: coarse` devices per Apple HIG.
- **Content overflow**: code blocks constrained to viewport width on
mobile, breadcrumb metadata (time, tokens, session ID) and status bar
stats hidden on narrow screens.
- **Reactive viewport tracking**: `matchMedia` listener in UIStore
tracks the 768px breakpoint, auto-closing sidebar on mobile and
auto-opening on desktop resize. Includes proper cleanup.
- **Accessibility**: sidebar backdrop uses a `<button>` with
`aria-label` instead of a plain div.
No new dependencies. No changes to the Go backend. Desktop layout (>=
1024px) is unchanged.
## Test plan
- [x] `cd frontend && npx vitest run` -- 740/740 tests pass (10 new
tests added)
- [x] `cd frontend && npx vite build` -- builds cleanly
- [x] `go vet -tags fts5 ./...` -- no issues
- [x] Browser devtools responsive mode at 375px (phone), 768px (tablet),
1024px, 1440px (desktop)
- [x] Press `b` to toggle sidebar at all widths; hamburger appears when
sidebar is closed
- [x] Resize browser across 768px boundary without reload (simulates
window manager retiling)
- [x] Select a session on mobile; sidebar auto-closes
- [x] All existing keyboard shortcuts (j/k/o/l/r/e/p/s/c/?) still work
- [x] No visual changes at >= 1024px (regression check)
---------
Co-authored-by: 0xjjjjjj <0xjjjjjj@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent f3fb05e commit a349413
File tree
11 files changed
+430
-9
lines changed- frontend/src
- lib
- components
- content
- layout
- stores
- utils
11 files changed
+430
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
75 | 78 | | |
76 | 79 | | |
77 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
| |||
87 | 89 | | |
88 | 90 | | |
89 | 91 | | |
| 92 | + | |
| 93 | + | |
90 | 94 | | |
91 | 95 | | |
92 | 96 | | |
| |||
319 | 323 | | |
320 | 324 | | |
321 | 325 | | |
322 | | - | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
54 | 60 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
72 | 90 | | |
73 | 91 | | |
74 | 92 | | |
| |||
101 | 119 | | |
102 | 120 | | |
103 | 121 | | |
| 122 | + | |
104 | 123 | | |
105 | 124 | | |
106 | 125 | | |
107 | 126 | | |
108 | | - | |
| 127 | + | |
109 | 128 | | |
110 | 129 | | |
111 | 130 | | |
112 | 131 | | |
113 | 132 | | |
114 | 133 | | |
115 | 134 | | |
| 135 | + | |
116 | 136 | | |
117 | 137 | | |
118 | 138 | | |
119 | 139 | | |
120 | | - | |
| 140 | + | |
121 | 141 | | |
122 | 142 | | |
123 | 143 | | |
124 | 144 | | |
125 | 145 | | |
126 | 146 | | |
127 | 147 | | |
| 148 | + | |
128 | 149 | | |
129 | 150 | | |
130 | 151 | | |
131 | 152 | | |
132 | 153 | | |
133 | | - | |
| 154 | + | |
134 | 155 | | |
135 | 156 | | |
136 | 157 | | |
137 | 158 | | |
138 | 159 | | |
139 | 160 | | |
140 | 161 | | |
| 162 | + | |
141 | 163 | | |
142 | 164 | | |
143 | 165 | | |
144 | 166 | | |
145 | 167 | | |
146 | | - | |
| 168 | + | |
147 | 169 | | |
148 | 170 | | |
149 | 171 | | |
| |||
340 | 362 | | |
341 | 363 | | |
342 | 364 | | |
343 | | - | |
| 365 | + | |
344 | 366 | | |
345 | 367 | | |
346 | 368 | | |
| |||
610 | 632 | | |
611 | 633 | | |
612 | 634 | | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
613 | 688 | | |
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
817 | 817 | | |
818 | 818 | | |
819 | 819 | | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
820 | 838 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
210 | 216 | | |
0 commit comments