freezmo/lib
Martin Dvorak 982391ca45 Codebase audit: fix bugs, performance issues, dead code, and edge cases
1. Bugs fixed:
- Backup schema now accepts theme: "aero" so backups exported under
  Frutiger Aero pass parseBackup on import, and applyImport in "replace"
  mode replaces SRS schedules, answer history, and chats instead of
  merging into existing SRS or skipping empty arrays.
- Typed FillBlank cards bind the input value to chosen ?? value instead
  of chosen ?? "", and normalise() preserves Unicode letters (\p{L}\p{N})
  when grading non-ASCII answers.
- OpenAI-compatible vision calls (contentFor in lib/openai-compat.ts)
  prefix data:image/jpeg;base64, when routes pass stripped base64.
- Streaming calls (ollamaChatStream, providerChatStream) keep their
  AbortController active across the entire body stream and API routes
  forward request.signal so stopping a chat or cancelling a run aborts
  the upstream request immediately.
- HomeworkCard uses homeworkModeLabelKey so "check" records display the
  Checked label instead of Step-by-step guide.
- Desktop dropzones on /create and /homework accept dropped documents as
  well as images.
- LibraryScreen filters reported questions out of its due and mistake
  counts to match ReviewClient.
- Clearing a provider key resets generation if it pointed at that
  provider; chat conversations persist and restore provider; ModelPicker
  keys items by provider:name.
- RouteTransition no longer mutates module-level lastPath during render.
- Service worker asset handler falls back to Response.error() when an
  uncached asset fetch fails offline.
- Confetti and .ice-orb / .ice-bubble respect the in-app reduce-motion
  toggle.

2. Performance & cleanup:
- Deduplicate window storage listeners across all six localStorage
  stores (one listener while subscribed instead of N^2 notifications).
- Use todayAnswerCount in LibraryScreen and pass sorted folders to
  DeckCard.
- Memoize MessageRow with stable callbacks in ChatScreen and compute
  last message IDs in a single pass.
- Close ImageBitmap after drawing in lib/image.ts and destroy pdf.js
  documents in finally in lib/documents.ts.
- Avoid re-parsing serialized sync payloads in POST /api/sync.
- Deduplicate copyText (lib/share.ts -> lib/clipboard.ts), chatMessageId,
  describeExtraction, ALL_FOLDERS, useIsPhone, and remove unused helpers
  and boilerplate public/*.svg files.

Version 0.5.8, SW -> freezmo-v80.
2026-10-14 19:00:17 +00:00
..
ai.ts Bring-your-own keys for cloud providers (OpenAI-compatible) 2026-10-14 06:29:39 +00:00
backup.ts Codebase audit: fix bugs, performance issues, dead code, and edge cases 2026-10-14 19:00:17 +00:00
chat-active.ts Chat layout: history in the main sidebar, consistent header, cleaner icon 2026-10-11 20:11:11 +00:00
chat-client.ts Bring-your-own keys for cloud providers (OpenAI-compatible) 2026-10-14 06:29:39 +00:00
chat-context.ts Chat mode, phase 1: grounded streaming chat over your notes 2026-10-11 18:32:11 +00:00
chat-seed.ts Chat mode, phase 1: grounded streaming chat over your notes 2026-10-11 18:32:11 +00:00
chat-store.ts Codebase audit: fix bugs, performance issues, dead code, and edge cases 2026-10-14 19:00:17 +00:00
chat-trim.ts Chat mode, phase 1: grounded streaming chat over your notes 2026-10-11 18:32:11 +00:00
chat.ts Codebase audit: fix bugs, performance issues, dead code, and edge cases 2026-10-14 19:00:17 +00:00
client-api.ts Bring-your-own keys for cloud providers (OpenAI-compatible) 2026-10-14 06:29:39 +00:00
clipboard.ts Add “Make my homework”, and finish the mobile polish pass 2026-10-08 18:30:33 +00:00
confetti.ts Codebase audit: fix bugs, performance issues, dead code, and edge cases 2026-10-14 19:00:17 +00:00
config.ts Design pass (all themes + chat UI), model picker, reduce-motion toggle 2026-10-14 05:06:02 +00:00
deck-ops.ts Freezmo: self-hosted notes-to-activities study app 2026-10-06 20:56:55 +00:00
deck-seed.ts Chat mode, phase 2: local history, answer actions, motion polish 2026-10-11 19:03:48 +00:00
dev-mode.ts Infra: split dev and production (releases, services, deploy script) 2026-10-11 19:25:29 +00:00
documents.ts Codebase audit: fix bugs, performance issues, dead code, and edge cases 2026-10-14 19:00:17 +00:00
folders.ts Codebase audit: fix bugs, performance issues, dead code, and edge cases 2026-10-14 19:00:17 +00:00
haptics.ts Native-feel pass: PWA integration, system back, offline, haptics, undo 2026-10-10 12:16:03 +00:00
history.ts Codebase audit: fix bugs, performance issues, dead code, and edge cases 2026-10-14 19:00:17 +00:00
homework.ts Codebase audit: fix bugs, performance issues, dead code, and edge cases 2026-10-14 19:00:17 +00:00
http-guard.ts Add an English/Czech interface language switch 2026-10-08 13:56:32 +00:00
i18n-dict.ts Custom Frutiger Aero 404 2026-10-14 15:27:47 +00:00
i18n.ts Codebase audit: fix bugs, performance issues, dead code, and edge cases 2026-10-14 19:00:17 +00:00
image.ts Codebase audit: fix bugs, performance issues, dead code, and edge cases 2026-10-14 19:00:17 +00:00
install.ts Add the Install the app bottom sheet for mobile browsers 2026-10-07 08:27:43 +00:00
language.ts Freezmo: self-hosted notes-to-activities study app 2026-10-06 20:56:55 +00:00
learning.ts Codebase audit: fix bugs, performance issues, dead code, and edge cases 2026-10-14 19:00:17 +00:00
legal.ts First-run gate offers free Ollama vs paid providers; add Google Gemini 2026-10-14 07:09:05 +00:00
model-errors.ts Phase 1: backup, encrypted sync and monthly-usage handling 2026-10-10 13:43:42 +00:00
model-guard.ts Security: model budget + concurrency caps, SSRF guards, spoof-proof limits 2026-10-12 20:40:57 +00:00
motion-pref.ts Aero button glass + homework report control; reduced-motion sheet glitch 2026-10-14 09:19:54 +00:00
motion.ts Codebase audit: fix bugs, performance issues, dead code, and edge cases 2026-10-14 19:00:17 +00:00
nav.ts Navigation restructure: five-tab bottom bar, no phone drawer 2026-10-10 16:53:55 +00:00
ollama.ts Codebase audit: fix bugs, performance issues, dead code, and edge cases 2026-10-14 19:00:17 +00:00
openai-compat.ts Codebase audit: fix bugs, performance issues, dead code, and edge cases 2026-10-14 19:00:17 +00:00
prompts.ts Fix the clipped answer field + the doubled AI note; ordering only where it fits 2026-10-13 07:27:39 +00:00
providers-client.ts Codebase audit: fix bugs, performance issues, dead code, and edge cases 2026-10-14 19:00:17 +00:00
providers-server.ts Bring-your-own keys for cloud providers (OpenAI-compatible) 2026-10-14 06:29:39 +00:00
providers.ts First-run gate offers free Ollama vs paid providers; add Google Gemini 2026-10-14 07:09:05 +00:00
push-store.ts Security: model budget + concurrency caps, SSRF guards, spoof-proof limits 2026-10-12 20:40:57 +00:00
question-reports.ts Codebase audit: fix bugs, performance issues, dead code, and edge cases 2026-10-14 19:00:17 +00:00
rate-limit.ts Security: model budget + concurrency caps, SSRF guards, spoof-proof limits 2026-10-12 20:40:57 +00:00
schemas.ts Codebase audit: fix bugs, performance issues, dead code, and edge cases 2026-10-14 19:00:17 +00:00
settings.ts Chat mode, phase 1: grounded streaming chat over your notes 2026-10-11 18:32:11 +00:00
share-inbox.ts Native-feel pass: PWA integration, system back, offline, haptics, undo 2026-10-10 12:16:03 +00:00
share-pending.ts Native-feel pass: PWA integration, system back, offline, haptics, undo 2026-10-10 12:16:03 +00:00
share.ts Codebase audit: fix bugs, performance issues, dead code, and edge cases 2026-10-14 19:00:17 +00:00
storage.ts Codebase audit: fix bugs, performance issues, dead code, and edge cases 2026-10-14 19:00:17 +00:00
sync-auto.ts Deck/homework writes sync themselves when sync is on 2026-10-12 16:40:49 +00:00
sync-key.ts Phase 1: backup, encrypted sync and monthly-usage handling 2026-10-10 13:43:42 +00:00
sync-state.ts Codebase audit: fix bugs, performance issues, dead code, and edge cases 2026-10-14 19:00:17 +00:00
sync.ts Chat mode, phase 2: local history, answer actions, motion polish 2026-10-11 19:03:48 +00:00
theme.ts New Aero background (Gemini-made), old credit removed 2026-10-13 08:10:05 +00:00
toast.ts Native-feel pass: PWA integration, system back, offline, haptics, undo 2026-10-10 12:16:03 +00:00
ui-events.ts Phase 1: backup, encrypted sync and monthly-usage handling 2026-10-10 13:43:42 +00:00
use-back-close.ts Navigation restructure: five-tab bottom bar, no phone drawer 2026-10-10 16:53:55 +00:00
use-health.ts Codebase audit: fix bugs, performance issues, dead code, and edge cases 2026-10-14 19:00:17 +00:00
use-notes-intake.ts Add “Make my homework”, and finish the mobile polish pass 2026-10-08 18:30:33 +00:00
use-online.ts Native-feel pass: PWA integration, system back, offline, haptics, undo 2026-10-10 12:16:03 +00:00
use-phone.ts Mobile declutter pass: step flows, compact cards, simplified settings 2026-10-10 10:43:32 +00:00
use-version.ts App versioning + the create page's missing top padding 2026-10-12 20:04:26 +00:00
use-wake-lock.ts Codebase audit: fix bugs, performance issues, dead code, and edge cases 2026-10-14 19:00:17 +00:00
utils.ts Codebase audit: fix bugs, performance issues, dead code, and edge cases 2026-10-14 19:00:17 +00:00
version.ts App versioning + the create page's missing top padding 2026-10-12 20:04:26 +00:00
wizard-busy.ts Lock the wizard mode switch while a run is generating 2026-10-10 17:47:05 +00:00
wizard-draft.ts Codebase audit: fix bugs, performance issues, dead code, and edge cases 2026-10-14 19:00:17 +00:00
xp.ts Freezmo: self-hosted notes-to-activities study app 2026-10-06 20:56:55 +00:00