summaryrefslogtreecommitdiffhomepage
path: root/src/ui.c
AgeCommit message (Collapse)Author
2026-06-29docs: P8 vocabulary governance + WSL run tribal knowledgedevAdam Malczewski
- AGENTS.md §4 'Naming & vocabulary': wire to GLOSSARY.md (P8 — never coin a synonym for an existing concept; propose new terms, don't coin silently). - AGENTS.md §8 'Tribal knowledge (notes/)': establish notes/<topic>.md as the non-inferable-knowledge store with the P6 test. - Rename study_segment_seek_target -> study_portion_seek_target ('segment' was a glossary-proscribed synonym for 'speaking portion'); fix 'Section nav' / 'jump to start' comments to canonical terms (portion nav / seek). - notes/wsl-arch-razer-run.md: how to run the desktop app under WSLg on the Arch/Razer dev machine (the LIBGL_ALWAYS_INDIRECT segfault trap, required env vars, GPU driver options).
2026-06-27fix: extract help text + checkbox into ui_render_overlayAdam Malczewski
The help text and study-mode checkbox were inside ui_render_player, so they only appeared when an audio file was loaded. In the original single-file main.c they rendered unconditionally (outside the 'if loaded' block). Extracted ui_render_overlay() — renders help text + checkbox — and call it from main.c after either ui_render_player or ui_render_empty, matching the original behavior. Also added a screenshot mode (env STUDY_PLAYER_SCREENSHOT) for automated visual testing: renders to an offscreen RenderTexture, fixes FBO alpha artifacts (ClearBackground doesn't fill alpha on some Mesa drivers), and exports a PNG. Verified all UI elements render correctly.
2026-06-27refactor: split single-file main.c into modular .h/.c pairsAdam Malczewski
Decompose the 778-line src/main.c into 7 focused modules with separate headers for code isolation and parallel agent development: types.h shared types: PlayerState, SilenceRegion, UILayout, constants player.{h,c} audio playback: load, play, pause, seek, update, format_time study.{h,c} study mode: silence detection, portion navigation, auto-pause ui.{h,c} rendering + input: fonts, colors, drawing, keyboard/mouse config.{h,c} UI layout persistence (moved UILayout to types.h) layout_editor.{h,c} layout editor tab (unchanged) main.c thin composition root (main loop, tabs, platform glue) Module boundaries follow the dispatch-project style: - .h files are contracts (self-contained, #pragma once, forward-declare) - .c files are private (static helpers, no cross-module .c includes) - All shared state passed by pointer (PlayerState*/UIState*) - font_data.h (xxd-generated array definition) included in exactly one .c Updated documentation (AGENTS.md, ORCHESTRATOR.md, GLOSSARY.md, README.md, tasks.md) and bin/ scripts (dispatch-style conventions, added bin/build-web). Build: make clean && make -j$(nproc) exits 0 with zero warnings.