Commit 760a69e
fix(pwa): Install button shows steps instead of silently dismissing
The PWA install affordance had two failure modes that looked
identical to the user (click → drawer closes → nothing installs):
1. `kind: "generic"` state hits when Chromium's
beforeinstallprompt hasn't fired yet. The onClick handler called
dismiss() with no fallback path, so a tap just hid the row for
30 days.
2. `kind: "chromium"` with a saved event but the saved event has
already been consumed (Chrome only lets prompt() fire once per
engagement window). prompt() throws, the catch ran dismiss(),
same broken UX.
Fix:
- generic + ios states now expand to show browser-specific
instructions inline ("Tap Share, then Add to Home Screen" /
"Open the three-dot menu → Install app", etc.). The X button
is still the only way to dismiss for 30 days.
- chromium state's failure path also expands instructions so the
user has a working route even when prompt() refuses.
- UA-sniffed step lists for iOS Safari, Android Chrome, Edge,
desktop Chrome, with a generic fallback for everything else.
The native install dialog still triggers on Android Chrome / desktop
Chrome / Edge when beforeinstallprompt has actually been captured
and not yet consumed; the user just gets a useful fallback instead
of an opaque close.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Tim Thomas <0800tim@gmail.com>1 parent b437838 commit 760a69e
2 files changed
Lines changed: 97 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
89 | 132 | | |
90 | 133 | | |
| 134 | + | |
91 | 135 | | |
92 | 136 | | |
93 | 137 | | |
| |||
139 | 183 | | |
140 | 184 | | |
141 | 185 | | |
142 | | - | |
| 186 | + | |
143 | 187 | | |
| 188 | + | |
144 | 189 | | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
145 | 195 | | |
146 | | - | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
147 | 200 | | |
148 | 201 | | |
149 | 202 | | |
150 | | - | |
151 | | - | |
152 | | - | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
153 | 208 | | |
154 | 209 | | |
155 | 210 | | |
| |||
162 | 217 | | |
163 | 218 | | |
164 | 219 | | |
| 220 | + | |
| 221 | + | |
165 | 222 | | |
166 | | - | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
167 | 227 | | |
168 | 228 | | |
169 | 229 | | |
170 | 230 | | |
171 | 231 | | |
| 232 | + | |
172 | 233 | | |
173 | 234 | | |
174 | 235 | | |
| |||
206 | 267 | | |
207 | 268 | | |
208 | 269 | | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
209 | 277 | | |
210 | 278 | | |
211 | 279 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
786 | 786 | | |
787 | 787 | | |
788 | 788 | | |
789 | | - | |
| 789 | + | |
| 790 | + | |
790 | 791 | | |
791 | 792 | | |
792 | 793 | | |
793 | 794 | | |
794 | 795 | | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
795 | 817 | | |
796 | 818 | | |
797 | 819 | | |
| |||
0 commit comments