agent: dogfood polish 2026/04/19 — Linux native chrome + History redesign + mic picker cleanup
Some checks failed
check / cargo check (macos-latest) (push) Has been cancelled
check / cargo check (ubuntu-22.04) (push) Has been cancelled
check / cargo check (windows-latest) (push) Has been cancelled
check / svelte build + lint (push) Has been cancelled

Second dogfood sprint. Headline fix: Linux now uses native KWin/Mutter
decorations instead of fragile frameless `startResizeDragging`, which
collapsed diagonal corner resize to a single axis and made drag feel
laggy. macOS / Windows keep custom chrome via `useCustomChrome` gate.

Other changes:

- Cross-window preferences sync via `kon:preferences-changed` Tauri
  event — theme and font changes propagate live to float/viewer.
- Hotkey recorder rewritten to use capture-phase document listener
  gated by $effect; button focus was unreliable in webkit2gtk.
- History page redesigned for cognitive-load hygiene: title-first
  compact row, inline title input, Edit popout opening /viewer in
  edit mode, clipboard export as .md with YAML frontmatter, manual
  tag chips + + Add tag input, header tag filter (cap 7), global
  Starred filter, `tag:xyz` search syntax.
- `deriveAutoTags` kept as empty hook for post-Task-7 LLM topic tags;
  research found all previous auto-tag chips redundant with row UI.
- Viewer window adds edit mode with debounced-save textarea; native
  title renamed to "Kon - Transcription Editor".
- Window minimums updated per GNOME HIG + WCAG reflow research:
  main 960x600, float 360x480, editor 560x520.
- Microphone picker filters raw ALSA strings (hw:, plughw:, front:,
  sysdefault:, null) and dedupes by CARD=X. New `description` field
  on DeviceInfo reads /proc/asound/cards so Blue Yeti shows as "Blue
  Microphones" instead of the short "Microphones" card name.
- GPU reporting fixed: get_runtime_capabilities now returns
  accelerators=[cpu,vulkan] and whisper.supports_gpu=true, matching
  the transcribe-rs whisper-vulkan feature linked unconditionally.
- ResizeHandles kept for macOS/Windows frameless: 12px edges, 20px
  corners via CSS vars, pointerdown + setPointerCapture, corners
  above edges in z-order, rendered as sibling (not child) of the
  animated layout root so `position: fixed` is viewport-relative.
- Dueling drag-region handlers removed — `data-tauri-drag-region` and
  manual `startDragging()` were stacked on the same elements; kept
  the manual handler which has the button/input early-return logic.

See HANDOVER.md for the full session log and deferred items.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-19 14:30:42 +01:00
parent 8c9c9390d8
commit ea48d03cee
21 changed files with 1079 additions and 157 deletions

View File

@@ -99,6 +99,20 @@ function loadHistory() {
export const history = $state(loadHistory());
// Keep the in-memory history in sync with edits made by sibling windows
// (e.g. the viewer saving a cleaned-up transcript). Storage events fire
// only on *other* windows than the writer, so we won't re-enter our own
// writes.
if (typeof window !== "undefined") {
window.addEventListener("storage", (e) => {
if (e.key !== HISTORY_KEY || !e.newValue) return;
try {
const next = JSON.parse(e.newValue);
history.splice(0, history.length, ...next);
} catch {}
});
}
export function saveHistory() {
try {
localStorage.setItem(HISTORY_KEY, JSON.stringify(history));

View File

@@ -1,7 +1,27 @@
// src/lib/stores/preferences.svelte.js
import { invoke } from '@tauri-apps/api/core';
import { emit } from '@tauri-apps/api/event';
import { getCurrentWindow } from '@tauri-apps/api/window';
import { toasts } from './toasts.svelte.js';
export const PREFERENCES_CHANGED_EVENT = 'kon:preferences-changed';
function currentWindowLabel() {
try {
return getCurrentWindow().label;
} catch {
return null;
}
}
function broadcastPreferences(prefs) {
const source = currentWindowLabel();
if (source === null) return;
// Fire-and-forget — cross-window sync must never block the local apply path.
emit(PREFERENCES_CHANGED_EVENT, { source, prefs: JSON.parse(JSON.stringify(prefs)) })
.catch(() => {});
}
const DEFAULTS = {
theme: 'dark',
zone: 'default',
@@ -117,12 +137,25 @@ export function updatePreferences(updates) {
Object.assign(preferences, updates);
applyToDOM(preferences);
persistToSQLite(preferences);
broadcastPreferences(preferences);
}
export function updateAccessibility(updates) {
Object.assign(preferences.accessibility, updates);
applyToDOM(preferences);
persistToSQLite(preferences);
broadcastPreferences(preferences);
}
// Apply preferences received from another Tauri window. Mutates local state
// and DOM only — never persists or re-broadcasts, so there is no echo loop.
export function applyExternalPreferences(prefs) {
if (!prefs || typeof prefs !== 'object') return;
Object.assign(preferences, prefs);
if (prefs.accessibility) {
Object.assign(preferences.accessibility, prefs.accessibility);
}
applyToDOM(preferences);
}
// Re-resolve when OS preferences change