19 lines
1.6 KiB
Markdown
19 lines
1.6 KiB
Markdown
|
|
# Per-mode Style and Sound Config
|
||
|
|
|
||
|
|
## Task
|
||
|
|
Restructure the cursor-flasher config to have independent visual style and sound settings for "running" (approval pulse) and "completed" (agent stop flash), replacing the shared flat config and `play_on` field.
|
||
|
|
|
||
|
|
## Changes
|
||
|
|
|
||
|
|
- **`src/cursor_flasher/config.py`** — Added `StyleConfig` dataclass (`color`, `width`, `opacity`, `duration`, `pulse_speed`, `sound`, `volume`). `Config` now has `running: StyleConfig` and `completed: StyleConfig` with sensible defaults. Removed flat `flash_*`, `sound_*`, and `play_on` fields. Updated `load_config` to parse `running:` and `completed:` YAML sections.
|
||
|
|
- **`src/cursor_flasher/overlay.py`** — `flash()` and `pulse()` accept a `StyleConfig` parameter. `OverlayManager.__init__` no longer takes `Config`.
|
||
|
|
- **`src/cursor_flasher/sound.py`** — `play_alert()` accepts `StyleConfig` instead of `Config`. Skips playback when `sound` is empty.
|
||
|
|
- **`src/cursor_flasher/daemon.py`** — Passes `config.running` to pulse/play_alert, `config.completed` to flash/play_alert. Removed `play_on` conditionals. `OverlayManager()` instantiated without args.
|
||
|
|
- **`tests/test_config.py`** — Rewritten for new config structure (13 tests).
|
||
|
|
- **`tests/test_daemon.py`** — Updated overlay call assertions to include StyleConfig arg. Replaced `play_on` tests with per-style sound tests. Added `test_custom_colors_per_mode`. 40/40 pass.
|
||
|
|
- **`README.md`** — Updated config docs to show `running:` / `completed:` YAML structure.
|
||
|
|
|
||
|
|
## Follow-up
|
||
|
|
- Restart daemon to pick up new config structure
|
||
|
|
- Update user's `~/.cursor-flasher/config.yaml` if it uses the old `flash:`/`sound:` format
|