Commit Graph

8 Commits

Author SHA1 Message Date
Mika Kuns
2a1f26d817 fix(ui): fix live output visibility and editor dialog graying out
- Remove wrapping ScrollViewer from live output TextBox — Avalonia
  TextBox with AcceptsReturn handles its own scrolling; nested
  ScrollViewer caused layout collapse
- Auto-scroll via CaretIndex instead of removed ScrollViewer
- Add OnWindowClosed to both editor ViewModels, ensuring the
  TaskCompletionSource always resolves when the dialog closes
  (including via X button), preventing RelayCommand from staying
  permanently disabled

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 17:01:08 +02:00
Mika Kuns
f8be2c178b feat(ui): add config override fields to TaskEditorView
Adds Model, SystemPrompt, and AgentPath override fields to TaskEditorViewModel and TaskEditorView. Wires agent loading from WorkerClient in TaskListViewModel before opening the editor dialog.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 16:39:50 +02:00
Mika Kuns
503fd69cd1 feat(ui): add starting state feedback to task list
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 16:27:04 +02:00
Mika Kuns
a4da2e23a1 feat(ui): add inline task creation, toggle-done, and list name to TaskListViewModel
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 10:23:58 +02:00
Mika Kuns
473e0f71d5 fix(ui): re-evaluate RunNow CanExecute when worker connection changes
Subscribe to WorkerClient.PropertyChanged in TaskListViewModel and call
NotifyCanExecuteChanged on every TaskItemViewModel.RunNowCommand when
IsConnected flips, so the button enables immediately on reconnect without
waiting for the next task DB refresh.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 15:46:10 +02:00
Mika Kuns
7838f081dd refactor(ui): harden context menu event handling and simplify bindings
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 15:16:09 +02:00
Mika Kuns
5d5a583af0 fix(ui): context menu operates on right-clicked item and gates new-task on list selection
- Add PointerPressed handlers on list/task item templates that set SelectedList/SelectedTask on right-click before the ContextFlyout opens
- Add CanAddTask guard and NotifyCanExecuteChangedFor on CurrentListId so Add Task menu item is disabled when no list is selected

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 15:11:34 +02:00
Mika Kuns
48e4aabeb1 feat(ui): wire avalonia desktop ui to data and worker
App: build a ServiceProvider in Program.cs (AppSettings, SqliteConnectionFactory,
all repositories, GitService, WorkerClient, all view-models), apply schema, then
hand control to Avalonia. App.OnFrameworkInitializationCompleted resolves
MainWindowViewModel from the container.

Ui:
- AppSettings POCO loaded from ~/.todo-app/ui.config.json (db path, hub url).
- WorkerClient wraps HubConnection with auto-reconnect, exposes IsConnected and
  ActiveTasks plus C# events for TaskStarted/Finished/Message/Updated and
  WorktreeUpdated; all inbound events are marshalled to the UI thread.
- ViewModels: MainWindow (lists CRUD via ListEditor dialog), TaskList (load by
  list, add/edit/delete, auto WakeQueue on agent+queued create), TaskItem
  (RunNow gated on connection + status), TaskDetail (description, result, live
  ndjson rolling buffer of 500 lines, worktree branch/diff with merge/keep/
  discard via GitService), StatusBar, ListEditor, TaskEditor.
- Views: 3-pane MainWindow (lists | tasks | detail) with GridSplitters, status
  bar, dialog windows for the editors. Status badges via StatusColorConverter.
- Markdown rendering, folder picker, delete-confirmation, settings dialog and
  scroll-to-bottom on the live log are intentionally TODO -- functional
  scaffold only.

Tests: also debounce the FIFO queue test (poll instead of Task.Delay(200)) so
the assertion isn't racy when the suite runs alongside the slower git tests.
38 tests pass.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 14:01:03 +02:00