Commit 4c1e4f9
authored
feat(web): add URL parameter support for auto-opening plugin install modal (#8)
* feat(web): add URL parameter support for auto-opening plugin install modal
Enable direct linking to specific plugins with automatic install modal display.
Users can now share URLs like ?plugin=nanobanana or ?install=grafana to show
a specific plugin's installation instructions.
Features:
- URL query parameter detection (?plugin= or ?install=)
- Auto-scroll to target plugin card
- Auto-open install modal with smooth animation
- 500ms delay for natural UX after scroll completion
Changes:
- apps/web/app/pages/index.vue: Add route query parameter handling and auto-scroll logic
- apps/web/app/components/PluginCard.vue: Add autoOpenModal prop and watcher
* refactor(web): improve error handling and add VueUse integration
Apply critical fixes from PR review to enhance reliability and user experience.
Changes:
- Add VueUse useTimeoutFn import for proper timer management
- Fix Badge color type safety with proper union types
- Implement retry logic with up to 5 attempts (200ms intervals)
- Add user feedback toast for persistent navigation failures
- Store and cleanup timer references to prevent memory leaks
- Improve network error handling with detailed logging
- Separate HTTP errors from JSON parsing errors
- Remove noisy error logs during normal loading
Error Handling Improvements:
- Silent retries during ref loading (no error spam)
- Only log errors on final failure after max retries
- Add onBeforeUnmount cleanup for timer references
- Guard async callbacks with component lifecycle checks
Type Safety:
- Badge.color now properly typed as Nuxt UI color union
- Prevents TypeScript compilation errors
Fixes:
- Memory leaks from uncleaned timers
- Silent failures with no user feedback
- Noisy error logs during normal page load
- Race conditions during component unmount1 parent 147e728 commit 4c1e4f9
2 files changed
Lines changed: 284 additions & 55 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
| 46 | + | |
46 | 47 | | |
47 | | - | |
| 48 | + | |
48 | 49 | | |
49 | | - | |
| 50 | + | |
50 | 51 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
| 52 | + | |
| 53 | + | |
83 | 54 | | |
84 | 55 | | |
85 | 56 | | |
| |||
140 | 111 | | |
141 | 112 | | |
142 | 113 | | |
| 114 | + | |
| 115 | + | |
143 | 116 | | |
144 | 117 | | |
145 | 118 | | |
| |||
163 | 136 | | |
164 | 137 | | |
165 | 138 | | |
166 | | - | |
| 139 | + | |
167 | 140 | | |
168 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
169 | 145 | | |
170 | 146 | | |
171 | 147 | | |
| |||
183 | 159 | | |
184 | 160 | | |
185 | 161 | | |
186 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
187 | 183 | | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
188 | 190 | | |
189 | 191 | | |
190 | | - | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
191 | 198 | | |
192 | 199 | | |
193 | 200 | | |
| |||
203 | 210 | | |
204 | 211 | | |
205 | 212 | | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
210 | 216 | | |
211 | | - | |
| 217 | + | |
212 | 218 | | |
213 | | - | |
214 | | - | |
| 219 | + | |
| 220 | + | |
215 | 221 | | |
216 | | - | |
| 222 | + | |
217 | 223 | | |
218 | 224 | | |
219 | 225 | | |
| |||
231 | 237 | | |
232 | 238 | | |
233 | 239 | | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
234 | 295 | | |
235 | 296 | | |
236 | 297 | | |
| |||
239 | 300 | | |
240 | 301 | | |
241 | 302 | | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
242 | 320 | | |
0 commit comments