Repository navigation
Commit f9c8a5f
committed
add toast notifications and switch offline download to a dismissible prompt
Ports the generic toast system (ToastProvider/useToast + ToastViewport)
and prompt-driven offline-download UX that was drafted, uncommitted, on
the old nextjs-migration worktree, reconciled with the data+pages
caching fix already on main.
- ToastProvider now wraps the app in layout.tsx, rendering a fixed
bottom-center viewport (title/message/progress bar/actions) shared by
any future notification, not just this one.
- OfflineDownload no longer renders an always-visible control on the
homepage; it prompts once via a toast (skipped if already
downloaded/dismissed, tracked in localStorage) with Download/Not now
actions, live progress, and a Retry action on failure. Moved into the
root layout so it applies site-wide instead of only on "/".
- Extracted the collect/count/download logic into src/lib/offline-cache.ts
so the component stays focused on UI — keeping the existing "data" +
"pages" cache split (the pages cache is what makes offline navigation
to un-visited pages work; see the earlier runtimeCaching fix).
- Extracted the repeated 9-slice card border-image rules into a
`card-border` mixin (src/styles/_mixins.scss) so Card and the new
Toast share the same frame styling, and picked up a few small visual
refinements from the same worktree (list-page row padding to sit
inside the card frame, blacksmith type-icon sizing, list-row gap).
Verified with `tsc --noEmit`, a full `next build` export, and a browser
check that the toast prompts, downloads, and reports progress/completion
with no console errors.1 parent eb24a6b commit f9c8a5f
12 files changed
Lines changed: 572 additions & 213 deletions
File tree
- src
- app
- blacksmith
- components
- context
- lib
- styles
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| 158 | + | |
158 | 159 | | |
159 | | - | |
| 160 | + | |
160 | 161 | | |
161 | 162 | | |
162 | 163 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| |||
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
33 | | - | |
34 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
35 | 40 | | |
36 | 41 | | |
37 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
| |||
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
36 | | - | |
37 | | - | |
38 | 35 | | |
39 | 36 | | |
40 | 37 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
| 4 | + | |
8 | 5 | | |
9 | 6 | | |
10 | 7 | | |
11 | 8 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | 9 | | |
16 | 10 | | |
17 | 11 | | |
| |||
0 commit comments