WIP: M3 PWA/offline implementation, M4 auth (backend + frontend), D-013 faster-whisper

- M3: hand-rolled service worker (precache + runtime /ort caching), precache
  manifest injection, SW registration/update toast, manifest + generated icons,
  production build script, offline indicator in ModelPicker (D-005/D-007)
- M4 backend: bun:sqlite users/sessions (D-009), Passport local strategy behind
  connect-compat adapter (D-008), /api/auth routes wired into dev+prod serving,
  Bun.password Argon2id, 38 auth tests
- M4 frontend: AuthForms + useAuth + framework-free authClient, session-aware
  header, anonymous-first fail-silent offline handling, 18 client tests
- D-013: server engine (M5) will use faster-whisper via Python sidecar;
  browser side stays Transformers.js (CTranslate2 has no WASM build)
- bun test: 83 pass / tsc --noEmit clean
- Note: M3 doc closeout (WorkBreakdown/Architecture/tests/offline.md) still in
  flight from a background agent; follow-up commit will finish docs

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Lucas WintherandClaude Fable 5 committed 2026-07-10 04:02:28 +02:00
1 parent eb72a2e646
commit 9f39a82982
38 files changed
+3857 -246

No files matched your search

+321
View File
@@ -25,6 +25,14 @@ body {
gap: 1.5rem;
}
.app-header {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 1rem;
flex-wrap: wrap;
}
.app-header h1 {
margin: 0 0 0.25rem;
font-size: 2.2rem;
@@ -36,6 +44,319 @@ body {
color: var(--muted);
}
/* --- AuthForms (M4) --- */
.auth {
position: relative;
flex-shrink: 0;
display: flex;
align-items: center;
gap: 0.6rem;
/* Roughly align the button with the h1 baseline. */
margin-top: 0.35rem;
}
.auth-username {
color: var(--muted);
font-size: 0.9rem;
overflow-wrap: anywhere;
}
.auth-button {
border: 1px solid var(--border);
background: transparent;
color: inherit;
border-radius: 8px;
padding: 0.3rem 0.9rem;
font-size: 0.85rem;
cursor: pointer;
transition: border-color 0.15s;
}
.auth-button:hover:enabled {
border-color: var(--accent);
}
.auth-button:disabled {
opacity: 0.5;
cursor: default;
}
.auth-panel {
position: absolute;
right: 0;
top: calc(100% + 0.5rem);
width: min(17rem, calc(100vw - 2.5rem));
background: var(--panel);
border: 1px solid var(--border);
border-radius: 14px;
padding: 1rem 1.25rem;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
z-index: 10;
}
.auth-tabs {
display: flex;
gap: 0.4rem;
margin-bottom: 0.75rem;
}
.auth-tab {
flex: 1;
border: 1px solid transparent;
background: transparent;
color: var(--muted);
border-radius: 8px;
padding: 0.3rem 0.5rem;
font-size: 0.85rem;
cursor: pointer;
}
.auth-tab:hover:enabled {
border-color: var(--border);
}
.auth-tab-selected,
.auth-tab-selected:hover:enabled {
border-color: var(--accent);
background: #232a38;
color: inherit;
}
.auth-panel form {
display: flex;
flex-direction: column;
gap: 0.6rem;
}
.auth-panel label {
display: flex;
flex-direction: column;
gap: 0.25rem;
font-size: 0.85rem;
color: var(--muted);
}
.auth-panel input {
background: #262b34;
color: #e8e8e8;
border: 1px solid var(--border);
border-radius: 8px;
padding: 0.35rem 0.5rem;
font-size: 0.9rem;
}
.auth-panel input:focus-visible {
border-color: var(--accent);
outline: none;
}
.auth-hint {
margin: 0;
font-size: 0.8rem;
color: var(--muted);
}
.auth-error {
margin: 0;
font-size: 0.85rem;
color: #f2b8b5;
}
.auth-submit {
background: var(--accent);
color: #16181d;
border: none;
border-radius: 8px;
padding: 0.4rem 0.8rem;
font: inherit;
font-size: 0.9rem;
cursor: pointer;
}
.auth-submit:disabled {
opacity: 0.6;
cursor: default;
}
/* --- ModelPicker --- */
.model-picker {
background: var(--panel);
border: 1px solid var(--border);
border-radius: 14px;
padding: 1rem 1.25rem;
}
.model-picker-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
flex-wrap: wrap;
}
.model-picker-header h2 {
margin: 0;
font-size: 1rem;
}
.model-picker-hint {
margin: 0.5rem 0 0;
color: var(--muted);
font-size: 0.85rem;
}
.device-select,
.transcription-options label {
display: flex;
align-items: center;
gap: 0.5rem;
font-size: 0.85rem;
color: var(--muted);
}
.model-picker select,
.transcription-options select {
background: #262b34;
color: inherit;
border: 1px solid var(--border);
border-radius: 8px;
padding: 0.3rem 0.5rem;
font-size: 0.85rem;
}
.model-group {
border: none;
margin: 0.75rem 0 0;
padding: 0;
}
.model-group legend {
padding: 0;
margin-bottom: 0.35rem;
font-size: 0.8rem;
text-transform: uppercase;
letter-spacing: 0.05em;
color: var(--muted);
}
.model-group ul {
list-style: none;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
gap: 0.25rem;
}
.model-option {
display: flex;
align-items: center;
gap: 0.6rem;
padding: 0.4rem 0.6rem;
border: 1px solid transparent;
border-radius: 10px;
cursor: pointer;
font-size: 0.95rem;
}
.model-group:not(:disabled) .model-option:hover {
border-color: var(--border);
}
.model-option-selected,
.model-group:not(:disabled) .model-option-selected:hover {
border-color: var(--accent);
background: #232a38;
}
.model-group:disabled .model-option {
cursor: default;
opacity: 0.6;
}
.model-option input {
accent-color: var(--accent);
}
.model-option-name {
flex: 1;
}
.model-option-meta {
display: flex;
align-items: center;
gap: 0.6rem;
}
.model-option-size {
color: var(--muted);
font-size: 0.85rem;
white-space: nowrap;
}
.model-badge {
border: 1px solid #3d6b4f;
background: #1d2b23;
color: #9ad6ae;
border-radius: 999px;
padding: 0.1rem 0.55rem;
font-size: 0.75rem;
white-space: nowrap;
}
/* --- PWA / offline (M3) --- */
.offline-status {
margin: 0.5rem 0 0.75rem;
font-size: 0.85rem;
color: var(--muted);
}
.offline-status-ready {
color: #9ad6ae;
}
.update-toast {
position: fixed;
bottom: 1rem;
left: 50%;
transform: translateX(-50%);
display: flex;
align-items: center;
gap: 0.75rem;
background: var(--panel);
border: 1px solid var(--accent);
border-radius: 8px;
padding: 0.6rem 1rem;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
z-index: 10;
}
.update-toast button {
background: var(--accent);
color: #16181d;
border: none;
border-radius: 6px;
padding: 0.3rem 0.8rem;
font: inherit;
cursor: pointer;
}
.update-toast button.update-toast-dismiss {
background: transparent;
color: var(--muted);
border: 1px solid var(--border);
}
/* --- TranscriptionOptions --- */
.transcription-options {
display: flex;
gap: 1.5rem;
flex-wrap: wrap;
}
/* --- FileDropzone --- */
.dropzone {