This repository was archived by the owner on May 20, 2026. It is now read-only.
Commit be4f56b
authored
refactor: code consolidation and performance optimizations (#15)
* feat: add Tumblr playlist support via Google Docs
Load a Google Doc containing Tumblr URLs as a navigable playlist with
ToC support. URLs are extracted from HTML export to preserve hyperlinks,
with automatic unwrapping of Google redirect URLs.
- Add tumblr-playlist attribute for loading playlists
- Create TumblrPlaylistReader with index-based navigation
- Generate ToC from playlist entries with labels from URL slugs
- Support parallel EPUB export with blog name as default filename
- Add prefetch all button and skeleton loading states
- Update demo page with playlist button and auto-detect URL input
* refactor: extract shared utilities and optimize caching
- Extract escapeHtml/sanitizeHtml to src/core/utils/html-utils.ts
- Extract renderBlock/renderReblogEntry to src/core/tumblr/tumblr-render.ts
- Remove static reader exports from index.ts for better code splitting
- Cache parsed localStorage in TumblrCache to avoid re-parsing on every read
- Add rollup-plugin-visualizer to vite config for bundle analysis
- Update ROADMAP.md with completed accessibility items
- Add missing error types to API reference
- Consolidate duplicate content in getting-started.md
* perf: optimize readers and extract UI utilities
- Extract loading/error/skeleton HTML to src/core/utils/ui-utils.ts
- Increase CBZ LRU cache from 5 to 10 for fewer re-extractions
- Parallelize PDF 2-page rendering with Promise.all for faster loads
- Refactor Tumblr readers to use shared UI utilities
* refactor: extract keyboard and zoom utilities
- Add keyboard-utils.ts with setupKeyboardNavigation helper
- Add zoom-utils.ts with clampZoom, zoomIn, zoomOut helpers
- Refactor all readers to use shared keyboard navigation
- Refactor all readers to use clampZoom for consistent bounds
- Reduces duplication and ensures consistent behavior
* perf: add adaptive preloading and AbortController for prefetch
- CBZ reader: adaptive preload based on navigation direction (forward/back)
- CBZ reader: preload 3 pages in travel direction, 1 in opposite
- Tumblr fetcher: add AbortSignal support to FetchOptions
- Tumblr playlist reader: cancel stale prefetch requests on navigation
- Uses manual AbortController combination for jsdom compatibility
* docs: update getting-started guide
- Add Tumblr posts section with usage examples
- Reference API reference for error types (removes partial duplicate)
* perf: add HiDPI support for PDF rendering
- Render PDFs at device pixel ratio for sharp display on Retina screens
- Set canvas backing store to actual pixels, CSS size to logical pixels
- Improves clarity on high-density displays without layout changes1 parent 630bbb8 commit be4f56b
23 files changed
Lines changed: 1921 additions & 348 deletions
File tree
- demo
- docs
- src
- components
- core
- tumblr
- utils
- readers
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
238 | | - | |
| 238 | + | |
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
| 248 | + | |
248 | 249 | | |
249 | 250 | | |
250 | 251 | | |
| |||
255 | 256 | | |
256 | 257 | | |
257 | 258 | | |
258 | | - | |
| 259 | + | |
259 | 260 | | |
260 | 261 | | |
261 | | - | |
262 | | - | |
| 262 | + | |
| 263 | + | |
263 | 264 | | |
264 | 265 | | |
265 | 266 | | |
| |||
281 | 282 | | |
282 | 283 | | |
283 | 284 | | |
284 | | - | |
| 285 | + | |
285 | 286 | | |
286 | 287 | | |
287 | 288 | | |
| |||
335 | 336 | | |
336 | 337 | | |
337 | 338 | | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
338 | 342 | | |
339 | 343 | | |
340 | 344 | | |
341 | 345 | | |
342 | 346 | | |
343 | 347 | | |
344 | | - | |
| 348 | + | |
| 349 | + | |
345 | 350 | | |
346 | 351 | | |
347 | 352 | | |
348 | 353 | | |
349 | | - | |
350 | | - | |
351 | | - | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
352 | 369 | | |
353 | 370 | | |
354 | 371 | | |
355 | | - | |
| 372 | + | |
356 | 373 | | |
357 | 374 | | |
358 | 375 | | |
359 | 376 | | |
360 | 377 | | |
361 | | - | |
362 | | - | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
363 | 384 | | |
364 | 385 | | |
365 | 386 | | |
366 | 387 | | |
367 | 388 | | |
368 | | - | |
369 | 389 | | |
370 | 390 | | |
371 | 391 | | |
372 | | - | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
373 | 402 | | |
374 | 403 | | |
375 | 404 | | |
| |||
401 | 430 | | |
402 | 431 | | |
403 | 432 | | |
404 | | - | |
| 433 | + | |
405 | 434 | | |
406 | | - | |
| 435 | + | |
407 | 436 | | |
408 | 437 | | |
409 | 438 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
153 | 157 | | |
154 | 158 | | |
155 | 159 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
125 | 146 | | |
126 | 147 | | |
127 | 148 | | |
| |||
153 | 174 | | |
154 | 175 | | |
155 | 176 | | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
| 177 | + | |
186 | 178 | | |
187 | 179 | | |
188 | 180 | | |
| |||
222 | 214 | | |
223 | 215 | | |
224 | 216 | | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
| 217 | + | |
234 | 218 | | |
235 | 219 | | |
236 | 220 | | |
| |||
0 commit comments