Commit Graph

18 Commits

Author SHA1 Message Date
Alexander eb114fc614 docs: add evil-keys crate implementation plan
Comprehensive design document covering architecture, API surface, dispatch
algorithm, integration steps, testing strategy with 106 test cases, and
design decisions (shift normalization, conflict detection, count overflow).

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/claude-agent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-10 10:59:53 +02:00
Alexander 1c1dadf5cd feat: wire evil-keys dispatcher into event loop and action handlers
Replace 3 hardcoded keys with full trie-based dispatch. Dispatcher created
in main.rs, handle_action() implements all 18 AppAction variants including
GotoFirst/GotoLast per focus pane, NextTab/PrevTab cycling, and HalfPage scroll.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/claude-agent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-10 10:59:43 +02:00
Alexander f859c40eb1 feat: add AppAction enum and Doom Emacs keybinding configuration
18-variant AppAction enum + build_normal_keymap() with hjkl, gg/G, gt/gT,
1-6 tabs, C-d/C-u, SPC leader tree (buffer/help/quit/notifications).

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/claude-agent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-10 10:59:43 +02:00
Alexander bee1f82405 test(evil-keys): add integration and property-based tests
20 integration scenarios (5gg, SPC leader, escape progression, timeout,
mode switch, which-key, stress tests) and 8 proptest invariants (roundtrip,
never-panic, non-Press ignored, count >= 1, escape clears state).

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/claude-agent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-10 10:59:43 +02:00
Alexander 216a11b9db feat(evil-keys): add keybinding crate with trie dispatch, count prefix, and timeout
Plug'n'play modal keybinding system inspired by Doom Emacs + Evil mode.
Generic over consumer Action type. Core: Key parser ("C-d", "SPC"),
trie-based sequence matching with conflict detection, count prefix (5j),
timeout tracking, which-key introspection, and multi-mode dispatch.

78 unit tests covering key parsing, trie conflicts, dispatch state machine,
count accumulation, timeout expiry, and which-key generation.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/claude-agent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-10 10:59:43 +02:00
Alexander 5a34fafd3f style: apply rustfmt to existing files
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/claude-agent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-10 10:59:43 +02:00
Alexander 85093d0ff0 fix: update album counters from GetAlbum response
GetArtists returns albums with total_tracks=0 and no release info.
When GetAlbum response arrives with richer data, update the album
in the artist list (have/total/status/quality/monitored). Also fall
back to release.track_count when total_tracks is 0 in the proto.

Updates proto to match new API: GetAlbumResponse.info wrapper,
AlbumDetail.release field, ReleaseInfo struct, flat TrackDetail
file fields. Passes album download state to convert_track so
tracks show as owned when album download is completed.
2026-05-09 23:31:39 +02:00
Alexander 1232b76fff fix: match 'completed' download state and prefer format over quality
The API returns download.state='completed' but convert_album only
matched 'downloaded', causing monitored+downloaded albums to display
as Wanted with 0 tracks. Also prefer download.format ('FLAC') over
download.quality (empty) for the quality display.
2026-05-09 23:23:43 +02:00
Alexander 7a35958c42 feat: separate albums/tracks into bordered panes, fix click handling
- Replace single Detail pane with separate Albums and Tracks panes,
  each with its own border that highlights yellow when focused
- Store rendered Rect areas on LibraryState instead of hardcoding
  layout offsets, fixing album click selection
- Split render functions into public components for isolated testing
- Restructure snapshot tests by component (artists, albums, tracks,
  header, detail) — 13 tests expanded to 26
2026-05-09 19:42:48 +02:00
Alexander c1205e5fb0 refactor: migrate to DDD layered architecture
Split the monolithic app.rs (762 lines) into four DDD layers:
- domain/: models, navigation enums (Tab, ModalKind), conversions, aggregates
- application/: App state, LibraryState, NotificationManager, event handlers
- infrastructure/: config, gRPC client, system utilities
- presentation/: all render functions, widgets, views, modals

Original modules (app, data, ui, config, grpc) preserved as thin
re-export facades for backward compatibility. All 13 insta snapshot
tests pass without modification.
2026-05-09 12:25:10 +02:00
Alexander 5bee7092d3 feat: add insta snapshot testing for TUI components
- Add insta dev-dependency for visual regression testing
- Create lib.rs to expose modules for integration tests
- Add snapshot tests for progress_bar, topbar, library, help modal
- Add unit tests for LibraryState navigation
- Move all tests to tests/ directory (proper Rust convention)
- Make build.rs skip proto compilation when protoc unavailable
- Add docs/testing-possible-solutions.md with testing strategies
2026-05-09 11:35:10 +02:00
Alexander f7660436c2 feat: add notification history dropdown and track fetching
- Add notifications dropdown in topbar with click-to-expand details
- Implement GetAlbum gRPC call for fetching track details
- Add track caching to avoid duplicate requests
- Guard against albums with empty IDs from server
- Increase notification TTL from 4s to 6s
- Add grpcurl to flake.nix for debugging
2026-05-09 11:19:24 +02:00
Alexander e77e854d2e feat: add gRPC client with config-based server address and album support
- Add tonic/prost gRPC client connecting to music-agregator service
- Add config.yaml for configurable server host/port
- Add build.rs for proto compilation from music-agregator
- Update Artist/Album models to match proto with MonitorState enum
- Convert album list from GetArtists response
- Fix album click selection with correct layout offsets
- Improve monitor state icons for better visibility
2026-05-08 23:10:15 +02:00
Alexander 620bd374de refactor: replace vim keybindings with mouse navigation, remove mock data
- Remove all sample/mock data (artists, albums, tracks, queue, history, calendar)
- Delete input module (vim.rs, leader.rs) and related UI (which_key, cmdline)
- Add mouse support: click tabs, click list items, scroll wheel navigation
- Show real disk space via nix::statvfs instead of hardcoded value
- Simplify topbar/statusbar by removing mode display and key hints
- Hide album/track sections when no artist is selected
2026-05-08 22:16:38 +02:00
Alexander eccf0d8de5 docs: add evil-keys keybinding library implementation plan 2026-05-08 14:51:00 +02:00
Alexander fcefcc02a0 feat: implement harmony TUI with vim/evil-mode navigation and SPC leader
Full Ratatui implementation of the harmony music library manager prototype:
- 6 tab views (Library 3-pane, Wanted, Queue, History, Calendar, Settings)
- Vim/evil-mode keybindings (hjkl, counts, gg/G, w/b/e, Ctrl-d/u, H/M/L, marks, operator-pending)
- SPC leader key with which-key popup (Doom Emacs style)
- Command mode (:q, :theme, :help) and / search filter
- Help and quit confirmation modals
- Toast notification system with auto-dismiss
- Gruvbox dark theme throughout
2026-05-08 13:26:09 +02:00
Alexander f967256708 add flake.lock, gitignore .pre-commit-config.yaml 2026-05-08 12:35:33 +02:00
Alexander e68342c93a init: Rust/Ratatui TUI project scaffold with nix flake 2026-05-08 12:31:19 +02:00