Repository navigation
Commit ffdc5e9
fix(web): close the mobile sheet on any navigation
The eleven per-item onClick closers missed the inline SearchBox's Enter
path, so "every item in the sheet closes the sheet when activated"
(specs/behaviors/app-shell.md) did not hold there. Derive the open
state from the location.key the sheet was opened at instead: any
client-side navigation closes it, including a same-path re-click.
Derived during render rather than in a useLocation effect because
react-hooks/set-state-in-effect flags the effect form; this is the
same state-sync pattern ProjectEdit.tsx uses. The two anchors that do
not change location (Contact mailto:, GitHub new tab) keep an explicit
closer. Tests cover a sheet link click and the search Enter path.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RdRwHvDupRLV8GuJpYKzEr1 parent bebd034 commit ffdc5e9
2 files changed
Lines changed: 52 additions & 47 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
205 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
206 | 214 | | |
207 | 215 | | |
208 | 216 | | |
| |||
280 | 288 | | |
281 | 289 | | |
282 | 290 | | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
| 291 | + | |
288 | 292 | | |
289 | 293 | | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
| 294 | + | |
295 | 295 | | |
296 | 296 | | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
| 297 | + | |
302 | 298 | | |
303 | 299 | | |
304 | 300 | | |
305 | 301 | | |
306 | 302 | | |
307 | 303 | | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
| 304 | + | |
313 | 305 | | |
314 | 306 | | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
| 307 | + | |
320 | 308 | | |
321 | 309 | | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
| 310 | + | |
327 | 311 | | |
328 | 312 | | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
| 313 | + | |
334 | 314 | | |
335 | 315 | | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
| 316 | + | |
341 | 317 | | |
342 | 318 | | |
343 | 319 | | |
| |||
357 | 333 | | |
358 | 334 | | |
359 | 335 | | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
| 336 | + | |
365 | 337 | | |
366 | 338 | | |
367 | 339 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
140 | 173 | | |
0 commit comments