Commit fba8329
feat(analytics): count anchor opens via card click; close modal on route change
Clicking an anchor card opened the modal by calling showAnchorDetails
directly, without changing the route — so the most common way to open an
anchor was never counted (only deep-links and in-modal cross-refs were).
Route card clicks through navigate('/anchor/:id') instead: the URL now
reflects the open anchor (deep-linkable, shareable) and the router records
it as a pageview, giving real per-anchor view counts.
Also fixes a latent bug this surfaces: leaving an anchor route (Back/forward
or in-app nav) left the modal stranded as an overlay over the page. The
router now closes an open anchor modal whenever a non-anchor route resolves;
on a non-anchor route closeModal() doesn't touch the URL.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent a941c64 commit fba8329
2 files changed
Lines changed: 18 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
368 | 368 | | |
369 | 369 | | |
370 | 370 | | |
371 | | - | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
372 | 375 | | |
373 | 376 | | |
374 | 377 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
162 | 172 | | |
163 | 173 | | |
164 | 174 | | |
| |||
202 | 212 | | |
203 | 213 | | |
204 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
205 | 219 | | |
206 | 220 | | |
207 | 221 | | |
| |||
0 commit comments