Compare commits
89
Commits
cf093e3178
...
v2.13.6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f231f08a27 | ||
|
|
23491d3b49 | ||
|
|
0db9fadee9 | ||
|
|
7c7c33d677 | ||
|
|
c7392e085f | ||
|
|
c16c7b97ef | ||
|
|
cccfe2eca1 | ||
|
|
a8ec550740 | ||
|
|
40d2537486 | ||
|
|
f70503d038 | ||
|
|
9360cd2fe6 | ||
|
|
ee502883f8 | ||
|
|
e64d570554 | ||
|
|
fc25ee45d1 | ||
|
|
51ee505057 | ||
|
|
06bc3d2105 | ||
|
|
bd5aa265d1 | ||
|
|
b298594a2c | ||
|
|
62855ac575 | ||
|
|
18b4dcd56f | ||
|
|
b02e0f80f0 | ||
|
|
df3e7ba0c7 | ||
|
|
a1b20d9f27 | ||
|
|
e0c6b670cb | ||
|
|
2bd48ea1c7 | ||
|
|
77c70d74cb | ||
|
|
f24654dfb8 | ||
|
|
b05b6fbaec | ||
|
|
eb3aee41a4 | ||
|
|
2b8733227d | ||
|
|
d258ab4164 | ||
|
|
574edf6c1a | ||
|
|
fe8186514f | ||
|
|
c2166a0d4f | ||
|
|
c3a418f077 | ||
|
|
2ec3af96d5 | ||
|
|
016b9203f8 | ||
|
|
69898be5c9 | ||
|
|
20b3b4ce2b | ||
|
|
42356241e3 | ||
|
|
675b36e923 | ||
|
|
416997d7e0 | ||
|
|
193752540b | ||
|
|
453d61ca58 | ||
|
|
3cf9628f46 | ||
|
|
b00bdf28ae | ||
|
|
91a37984c6 | ||
|
|
7ee7e33654 | ||
|
|
c25732cff8 | ||
|
|
2330b426c6 | ||
|
|
81a5fc5d33 | ||
|
|
84d955dfc7 | ||
|
|
20685827fb | ||
|
|
4ee1d05f06 | ||
|
|
6c1ea1ae25 | ||
|
|
7e847638cf | ||
|
|
aadc926ffe | ||
|
|
c2ef446fe1 | ||
|
|
7bcca3647e | ||
|
|
244ba9b72f | ||
|
|
0b506f529a | ||
|
|
7a0b97df59 | ||
|
|
a0c277100e | ||
|
|
651ddbc31c | ||
|
|
477a216567 | ||
|
|
6a4fa15372 | ||
|
|
411eb7487b | ||
|
|
ce70ba1c46 | ||
|
|
21769eb928 | ||
|
|
9b3f7ac5c8 | ||
|
|
25f6691aa0 | ||
|
|
dc1e67d07b | ||
|
|
912201770f | ||
|
|
9f90e75a85 | ||
|
|
9e80564665 | ||
|
|
b24ff614ff | ||
|
|
25ead4c8dd | ||
|
|
e099d4f6cf | ||
|
|
4c78a5d6fd | ||
|
|
56bc1651a8 | ||
|
|
80fe188a48 | ||
|
|
c347e4fc5f | ||
|
|
6be62f02cc | ||
|
|
b6e5876b07 | ||
|
|
30d0611b8e | ||
|
|
f640580463 | ||
|
|
b90c5855f4 | ||
|
|
0f04b796f4 | ||
|
|
ae0c7d3771 |
+115
@@ -1,5 +1,120 @@
|
||||
# Changelog
|
||||
|
||||
## v2.13.5 — 2026-09-03
|
||||
|
||||
### Fixes
|
||||
|
||||
- Version im About-Dialog aus der FileVersion lesen (cccfe2ec)
|
||||
|
||||
### Refactoring
|
||||
|
||||
- "Nach Updates suchen" ins Hilfe-Menue verschieben (c16c7b97)
|
||||
|
||||
### Documentation
|
||||
|
||||
- update for v2.13.4 (a8ec5507)
|
||||
|
||||
## v2.13.4 — 2026-09-03
|
||||
|
||||
### Fixes
|
||||
|
||||
- interaktive Session ohne Arbeitsverzeichnis im User-Verzeichnis starten (f70503d0)
|
||||
|
||||
### Documentation
|
||||
|
||||
- update for v2.13.3 (9360cd2f)
|
||||
|
||||
## v2.13.3 — 2026-09-03
|
||||
|
||||
### Fixes
|
||||
|
||||
- raise SignalR MaximumParallelInvocationsPerClient (e64d5705)
|
||||
|
||||
### Documentation
|
||||
|
||||
- update for v2.13.2 (fc25ee45)
|
||||
|
||||
## v2.13.2 — 2026-09-03
|
||||
|
||||
### Features
|
||||
|
||||
- Handler-Run per Knopf abbrechen (bd5aa265)
|
||||
|
||||
### Fixes
|
||||
|
||||
- strip CLAUDE_CODE_CHILD_SESSION/CLAUDECODE before every ConPTY launch (51ee5050)
|
||||
- Dequeue-X auf blockierten Queue-Zeilen anzeigen und Kette konsistent halten (df3e7ba0)
|
||||
- report and gate ListSettingsModal load failures instead of swallowing them (a1b20d9f)
|
||||
- move ScrollViewer padding to inner content in modal bodies (e0c6b670)
|
||||
- Mission Control oeffnen, wenn ein Handler-Run per MCP startet oder ein Handoff eintrifft (b05b6fba)
|
||||
|
||||
### Performance
|
||||
|
||||
- show list settings modal before its seven-round-trip load finishes (f24654df)
|
||||
|
||||
### Documentation
|
||||
|
||||
- remove stale session-skills empty-state entry (2bd48ea1)
|
||||
- update for v2.13.1 (eb3aee41)
|
||||
- update for v2.13.0 (2b873322)
|
||||
|
||||
## v2.13.1 — 2026-09-02
|
||||
|
||||
### Fixes
|
||||
|
||||
- Mission Control oeffnen, wenn ein Handler-Run per MCP startet oder ein Handoff eintrifft (9f64ba50)
|
||||
|
||||
## v2.13.0 — 2026-09-02
|
||||
|
||||
### Features
|
||||
|
||||
- Handler-Session vor dem Usage-Limit warnen und Handoff bis zum Reset zurueckhalten (fe818651)
|
||||
- start_list_handler MCP-Tool startet einen List-Handler-Run wie der Button (c2166a0d)
|
||||
- Handler-Session nach Usage-Limit-Reset automatisch neu starten (016b9203)
|
||||
- PowerUse-Zeitfenster + Handoff-Schwellwert als Settings (69898be5)
|
||||
- PowerUse-Toggle im Usage-Monitor, Opt-in pro Liste (19375254)
|
||||
- PowerUse-Addendum an die Handler-Prompts, Cap aus den Settings (453d61ca)
|
||||
- PowerUse-Flags und konfigurierbares Handoff-Budget (3cf9628f)
|
||||
- depends_on als Menge statt Einzelfeld (c25732cf)
|
||||
- surface the handoff round budget in the merge-helper handoff brief (81a5fc5d)
|
||||
- add ExpectsNoDiff flag for verification/audit tasks (0b506f52)
|
||||
- add dependency audit and diff-review threshold to list-handler prompts (9e805646)
|
||||
- add "move to list" to the task row context menu (80fe188a)
|
||||
- notes get their own list, a day log and an Enter chain (0f04b796)
|
||||
- add_note MCP tool with a per-day agent cap (ae0c7d37)
|
||||
|
||||
### Fixes
|
||||
|
||||
- carry ExpectsNoDiff into the relocated merge MCP tools (4ee1d05f)
|
||||
- stop Ui.Tests order-dependent flakiness on shared Loc.Current (dc1e67d0)
|
||||
- add failureReason field to batch_get_tasks (91220177)
|
||||
- make locale-parity test able to detect a malformed locale file (4c78a5d6)
|
||||
- don't leave an orphaned list behind on cancel (56bc1651)
|
||||
- stop treating git worktrees and submodules as repos (b6e5876b)
|
||||
- fix Bandel ticket sync and reactivate the integration (30d0611b)
|
||||
- Shift+Enter in the capture box, not just in the note rows (f6405804)
|
||||
- let Shift+Enter break the line, and clear the leftovers around the editor (b90c5855)
|
||||
- auto-bootstrap commit-less repos before creating worktrees (e0748ba3)
|
||||
- bootstrap commit-less repos and survive missing git identity (de44196b)
|
||||
|
||||
### Performance
|
||||
|
||||
- switch to workstation GC to cut idle memory (c347e4fc)
|
||||
|
||||
### Refactoring
|
||||
|
||||
- share StubWorkerClient between Ui.Tests and Worker.Tests (9f90e75a)
|
||||
- remove the stale-worker banner (6be62f02)
|
||||
|
||||
### Documentation
|
||||
|
||||
- Handler-Prompt praezisieren (Wave-Plan, Task-Split, review_task-Aufruf) (20b3b4ce)
|
||||
- Test-Scoping fuer Implementer-Tasks, PowerUse in den Explore-Notes (416997d7)
|
||||
- plan for multi-dependency depends_on relation table (84d955df)
|
||||
- empty-repo hardening notes + verification item (cf093e31)
|
||||
- spec + plan for empty-repo (unborn HEAD) hardening (fea8236e)
|
||||
- update for v2.12.0 (1d6cd49b)
|
||||
|
||||
## v2.12.0 — 2026-08-28
|
||||
|
||||
### Features
|
||||
|
||||
@@ -66,14 +66,38 @@ Commit freely (per task + the spec/plan docs). Never push without asking.
|
||||
|
||||
## Building & Testing
|
||||
|
||||
`dotnet build ClaudeDo.slnx` requires .NET 9; on .NET 8 build individual projects with `-c Release` (a running Worker locks the `Debug` output).
|
||||
**Build the whole solution, test only what you touched.** Always `-c Release` — a running Worker locks the `Debug` output.
|
||||
|
||||
```bash
|
||||
dotnet build src/ClaudeDo.App/ClaudeDo.App.csproj -c Release # pulls in Ui + Data
|
||||
dotnet build src/ClaudeDo.Worker/ClaudeDo.Worker.csproj -c Release
|
||||
dotnet test tests/ClaudeDo.Worker.Tests/ClaudeDo.Worker.Tests.csproj -c Release # also: Data.Tests, Ui.Tests, Localization.Tests, Installer.Tests, Releases.Tests
|
||||
dotnet build ClaudeDo.slnx -c Release # ~40s, catches cross-project breaks
|
||||
dotnet test tests/ClaudeDo.Worker.Tests/ClaudeDo.Worker.Tests.csproj -c Release --no-build \
|
||||
--filter "FullyQualifiedName~Handoff" # seconds, not minutes
|
||||
```
|
||||
|
||||
`.slnx` needs SDK 9+ (this machine is on 10). On an older SDK build the projects individually:
|
||||
`src/ClaudeDo.App` (pulls in Ui + Data) and `src/ClaudeDo.Worker`.
|
||||
|
||||
### Do NOT run the full test suite to finish a task
|
||||
|
||||
Measured 2026-09-02, sequentially after one build: **Worker.Tests 507s**, Ui.Tests 33s, Data.Tests 8s,
|
||||
Localization/Installer/Releases 3s each, build 42s — ~10 min for all six. Run in parallel across
|
||||
projects it is *worse*, not better (Worker.Tests 801s, Ui.Tests 82s): these tests create real git
|
||||
worktrees and spawn processes, so they thrash rather than share.
|
||||
|
||||
With up to 5 implementer tasks running at once, a full suite per task costs hours — and **cannot find
|
||||
what it costs that for.** Each task works in its own worktree containing only its own change, so a
|
||||
collision between two parallel tasks is invisible to both. Collisions surface after the merge, which
|
||||
is exactly where `verify_merges` runs the list's verify command **once per batch**. The full suite is
|
||||
the merge gate's job, not the task's.
|
||||
|
||||
So, per task:
|
||||
- **Build:** the whole solution, always. It's cheap and it catches the compile break your change
|
||||
caused three projects over.
|
||||
- **Tests:** `--no-build --filter` scoped to what you touched. Add a filter for the classes covering
|
||||
your change; if you genuinely can't scope it, run the one relevant test project, never all six.
|
||||
- **Report** what you ran and what you did not, so the merge session knows what is still unverified.
|
||||
- Never report "all tests pass" when you ran a filtered subset. Say which filter you used.
|
||||
|
||||
### Gotchas
|
||||
- **Subagents:** use the `sonnet` model; stage files explicitly by path — never `git add -A` (parallel sessions often leave unrelated WIP in the tree).
|
||||
- **Icons:** `PathIcon` *fills* its geometry — line-art icons must be filled geometry or a `Path Classes="icon-stroke"`, else they render invisible. Colour comes from the `ICON PAINTING` block in `IslandStyles.axaml` (class + state); setting `Foreground`/`Stroke` inline kills the hover state.
|
||||
|
||||
@@ -115,6 +115,22 @@ share the same prompt/model as their non-final counterpart and differ only in on
|
||||
rendered into the handoff kickoff file (`PromptKind.MergeHelperHandoff`) marking the final round
|
||||
and forbidding further reruns.
|
||||
|
||||
The chain length is bounded server-side by `HandoffRoundTracker`, whose cap comes from
|
||||
`AppSettingsEntity.ListHandlerMaxHandoffs` (default 4 = two merge rounds; `HandoffMcpTools` reads it
|
||||
per call and `Register` clamps to min 1, so 0 can never mean "unbounded"). Past the cap a
|
||||
`wait`/`merge` request is silently coerced to its `_final` counterpart — check the result's
|
||||
`coerced` flag — and any handoff after a `merge_final` round throws.
|
||||
|
||||
**PowerUse.** When `AppSettingsEntity.PowerUseEnabled` (Settings → Execution) **and** the
|
||||
list's own `ListConfigEntity.PowerUseAllowed` are both set, `InteractiveLaunchSpecService.
|
||||
ComposeHandlerPromptAsync` appends `PromptKind.PowerUseAddendum` to whichever handler prompt the
|
||||
phase resolved to. The addendum is written as an *override* of the base prompt's interactive rules
|
||||
(never ask, decide and record instead; resolve or abort conflicts rather than leaving them in the
|
||||
tree; harvest new tasks when a round would starve). Both keys are required on purpose: the global
|
||||
switch can stay on overnight without turning an unrelated list's handler run unattended. A run that
|
||||
is not in PowerUse gets a byte-identical prompt to the pre-PowerUse behaviour — there is deliberately
|
||||
no second set of handler prompts to keep in sync.
|
||||
|
||||
Each handoff hands the SAME handler task id to a NEW tile, and `MissionControlViewModel.
|
||||
OpenMergeHelperHandoffConPtySessionAsync` closes the outgoing phase's pane (`CloseConPtySession`,
|
||||
which disposes its `PtyTerminalSession` and kills the underlying `claude` process) before opening
|
||||
@@ -127,6 +143,43 @@ outgoing session is only ever told to end its turn, never to exit. This keeps th
|
||||
`MCP_TOOL_TIMEOUT` is 200 s here — `TaskWaitMcpTools` clamps its own timeout to 170 s to stay
|
||||
comfortably under it (see [external-mcp.md](external-mcp.md)).
|
||||
|
||||
### Auto-restart after the usage limit
|
||||
|
||||
A handler session that dies mid-phase used to be a silent dead tile: `InteractiveTerminalViewModel.
|
||||
OnSessionProcessExited` only raised a visible banner for a death **inside** its 5 s
|
||||
`StartupGraceWindow`. It now raises `ExitedAfterStartup` for a later non-zero exit; the pane
|
||||
forwards it as `SessionDiedAfterStartup(taskId, exitCode)` and `MissionControlViewModel` reports it
|
||||
via `WorkerHub.ReportInteractiveSessionExited`. Every task-based pane reports — the UI does no
|
||||
filtering, because the exit code is the *only* thing it knows.
|
||||
|
||||
`HandlerRestartCoordinator` (Worker) decides the rest and **fails closed** — unlike the usage gate,
|
||||
every missing signal means "don't relaunch":
|
||||
|
||||
- **Which round was running** comes from `HandlerRoundState`, a JSON file at
|
||||
`~/.claudeDo/handler-rounds.json` (one `HandlerRound` per handler task id, deliberately not a DB
|
||||
column). `BuildForMergeHelperAsync` writes the opening round as phase `"triage"`;
|
||||
`BuildForMergeHelperHandoffAsync` writes each subsequent `MergeHelperPhase`. Without it the phase
|
||||
and task set exist *only* in the transient `HandoffRequested` broadcast, so a dead tile could not
|
||||
be reopened. A `"triage"` round is never reopened — there is no handoff spec for it.
|
||||
- **Was it really the usage limit?** A ConPTY session has no captured stdout, so `TaskRunner.
|
||||
IsUsageLimitMessage` (which matches the CLI's own "session limit" text) has nothing to read. The
|
||||
corroborating witness is `UsageState.Snapshot.FiveHour.Utilization ≥ 95`
|
||||
(`HandlerRestartCoordinator.UsageLimitProofPct`) at the moment of death. A crash at 40 % is not
|
||||
restarted; no snapshot at all is not restarted.
|
||||
- **PowerUse only** — both keys, exactly like the prompt addendum above.
|
||||
- **One restart per round**, claimed via `HandlerRoundState.TryClaimAutoRestart` before the wait, so
|
||||
a restart that dies again stays dead. `HandlerRoundState.Save` carries `AutoRestartUsed` over when
|
||||
the phase is unchanged, because the restart's own launch-spec build writes the round again — a
|
||||
naive overwrite would hand out a fresh budget every time and loop all night.
|
||||
- The restart waits out `FiveHour.ResetsAt`, then re-broadcasts `HandoffRequested` with the
|
||||
persisted phase + task set, which the UI already handles by reopening the tile. It goes **around**
|
||||
`handoff_list_handler`, so `HandoffRoundTracker.Register` is never called and the run loses no
|
||||
handoff budget.
|
||||
|
||||
Sibling to `UsageLimitAutoContinueCoordinator`, not an extension of it: that one only ever sees
|
||||
headless runs (`FailureReason == "usage_limit"`, resumed through the override slot), and a ConPTY
|
||||
session has no `task_runs` row to classify.
|
||||
|
||||
### The host task and its commit range
|
||||
|
||||
The handler run **owns a real ClaudeDo task**, created by `CreateMergeHelperTask` (hub) →
|
||||
|
||||
@@ -254,6 +254,7 @@ degrades instead of throwing. Worker config: `usage_poll_interval_active_seconds
|
||||
`usage_poll_interval_idle_seconds`.
|
||||
|
||||
The gate percentages are editable in **two** places that both write the same `app_settings` row:
|
||||
Settings → General (typed) and the usage-monitor gauges (dragged). The throttle stages are
|
||||
Settings → Execution (typed) and the usage-monitor gauges (dragged). The throttle stages are
|
||||
gauge-only — `SettingsModalViewModel` therefore carries them load→save verbatim so saving Settings
|
||||
can't reset a dragged value.
|
||||
can't reset a dragged value. PowerUse (switch, time window, handoff %) used to be usage-monitor-only
|
||||
and is now typed on the same Settings tab, so it needs no such round-trip.
|
||||
|
||||
+26
-26
@@ -15,9 +15,7 @@ Checkliste lebt in `docs/verification-handoff.md`.
|
||||
|
||||
- **Planning-aktiver Parent zeigt weiter „Idle":** Parent in `planning_phase=active` hat `Status=Idle` (korrekt im Modell), aber `TaskRowViewModel.StatusLabel` (Zeile 132) kennt nur `HasInteractiveSession`/`IsParked` als Overrides — der `PlanningBadge` ersetzt den Chip nicht sichtbar → liest sich wie ein normaler Idle-Task. Wunsch: klarer „Planning/Draft aktiv"-Zustand, der Idle überschreibt. (Kinder zeigen korrekt „Draft".)
|
||||
- **Blocked-by-Kette nicht sichtbar:** Nach Finalize ist die sequentielle Kette korrekt gesetzt (child[i] blocked-by child[i-1]), aber die UI stellt Reihenfolge/Abhängigkeit nicht dar — es gibt nur den „waiting"-Chip. Wunsch: Kette visualisieren (z.B. „wartet auf <Vorgänger>").
|
||||
- **Dequeue-„X" fehlt auf wartenden (blockierten) Kettengliedern:** `CanRemoveFromQueue = IsQueued || HasQueuedSubtasks` (TaskRowViewModel.cs:99), `IsQueued` verlangt leeres `blocked_by`. Ein gequeuetes, aber blockiertes Kind (`IsWaiting`) bekommt daher kein Remove-from-queue-X — nur Parent + erstes (entsperrtes) Kind.
|
||||
- **Session-Skills-Tab hat keinen Empty-State:** Bei 0 installierten Skills zeigt der Skills-Tab (Settings) nur eine nackte leere Fläche unter der Install-Zeile — kein erklärender Hinweis (z.B. „Noch keine Skills installiert — GitHub-URL oben einfügen"). Im `sessionSkillsTab`-Locale-Namespace (en.json:674) gibt es keinen `empty`-Key.
|
||||
- **Modal-Bodies sind unten abgeschnitten** (Sichtprüfung 2026-08-06, beobachtet in den Listen-Settings: der Hinweistext unter „Verify command" ist mitten in der Zeile vom Footer weggeschnitten und lässt sich nicht herunterscrollen; laut Mika „fast überall" in den Settings-Modals). Gemeinsames Muster: `<ScrollViewer Padding="20,16">` als Modal-Body — in `ListSettingsModalView:36`, `MergeModalView:33`, `WorktreesOverviewModalView:131`, `AboutModalView:20`, `MergeHelperSelectionModal:47`, `RepoImportModalView:45`, `LogVisualizerView:45` sowie `WorkConsole:295/395`. **Vermutete** Ursache (nicht verifiziert): das untere `Padding` des ScrollViewers zählt nicht zum scrollbaren Extent, die letzten Pixel sind also unerreichbar. Erst am echten Fall nachmessen, dann ggf. einheitlich das Padding vom ScrollViewer auf ein `Margin` des inneren Inhalts umziehen.
|
||||
- **Modal-Bodies unten abgeschnitten — gefixt, Sichtprüfung offen** (Ursache 2026-09-02 verifiziert: `ScrollViewer.Padding` zählt in Avalonia 12 nicht zum Extent; Fix ist das Padding auf ein `Margin` des inneren Inhalts umzuziehen). Betraf `AboutModalView`, `MergeHelperSelectionModal`, `MergeModalView`, `RepoImportModalView`, `WorktreesOverviewModalView` — alle fünf umgestellt. `ListSettingsModalView`, `LogVisualizerView` und `WorkConsole` hatten zu diesem Zeitpunkt bereits kein ScrollViewer-Padding mehr.
|
||||
- **Usage-Monitor-Modal: Analyse-Tabellen ausbaufähig** (Sichtprüfung 2026-08-06; Gauges, Info-Bänder, Presets/Custom-Range und Refresh-Button sind in Ordnung). Models-Tab: die Spaltenköpfe „OTHER CACHE" und „SHARE" kollidieren zu `OTHER CACHISHARE`; `claude-haiku-4-5-20251001` läuft in die IN-Spalte; alle Zahlen linksbündig und ohne Tausendertrenner (`506830708`). Tasks-Tab: Task-Titel wird ohne Ellipse hart an der LIST-Spalte abgeschnitten, der LIST-Text ebenfalls; MODEL ist bei Runs von vor der `task_runs.model`-Spalte leer (besser „—"). Wunsch: Zahlen rechtsbündig + `#,##0` (oder k/M), Spaltenbreiten/Truncation fixen.
|
||||
- **Conflict-Resolver: mehrere Konfliktdateien schlecht erkennbar:** Beim 2-Datei-Konflikt schwer zu sehen, dass zwei Dateien betroffen sind (File-Switcher/Anzahl zu unauffällig). Prominentere Datei-Liste / „x von y Dateien".
|
||||
- **Attachments: erster Drag&Drop der Session schlug einmalig fehl („An error occurred"):** Beim allerersten Drop-to-attach einer UI-Session zeigte die `DropStatus`-Zeile inline einen generischen Fehler und es wurde nichts persistiert (kein File, keine DB-Row); alle folgenden Drops derselben Session + der „Add file…"-Picker + Remove funktionierten fehlerfrei. Nicht reproduzierbar nach dem ersten Mal. Kandidaten: transiente SQLite-Contention (der UI-Prozess schreibt `todo.db` direkt via `new TaskAttachmentRepository`, während der Worker dieselbe DB hält) ODER ein Fehler im Drop-Stream-Pfad (`IStorageFile.OpenReadAsync` im Code-Behind, außerhalb des `try` in `AddFilesAsync`). Falls es erneut auftritt: `AddFilesAsync`/`OnDrop` mit robusterem Error-Logging versehen.
|
||||
@@ -46,33 +44,35 @@ verifiziert und deshalb hier entfernt. Es bleiben die Entscheidungen, die daran
|
||||
|
||||
## Offene Verifikation (2026-08-27, Ticketsystem-Anbindung)
|
||||
|
||||
> **PAUSIERT.** `TicketSettingsTabViewModel.FeatureEnabled = false` versteckt Settings-Tab,
|
||||
> Projekt-Dropdown und Kontextmenü-Eintrag; zum Reaktivieren die Konstante umlegen. Grund: die
|
||||
> API ist unter `http://bandelapis.fb-tuning.local` nicht erreichbar (*connection actively
|
||||
> refused* — nichts lauscht dort). Kein ClaudeDo-Bug und kein CORS; wahrscheinlich fehlt eine
|
||||
> IIS-Hostname-Bindung oder der Port stimmt nicht (`deploy/deploy-iis-winrm.ps1` der API notiert,
|
||||
> dass srv-04b diese Sites *by IP:port rather than by hostname* erreicht). Wird mit dem
|
||||
> API-Kollegen geklärt. Die Punkte unten bleiben stehen, bis die Erreichbarkeit steht.
|
||||
> **Reaktiviert am 2026-09-01.** `FeatureEnabled = true`. Die API läuft unter
|
||||
> `http://192.168.45.161` — der Hostname `bandelapis.fb-tuning.local` lehnt die Verbindung
|
||||
> weiterhin ab, die Base-URL muss also die **IP** sein.
|
||||
|
||||
Tasks 1–9 sind implementiert und gemergt (Build + Tests grün, `_broadcaster.TaskUpdated` genau
|
||||
einmal in `TaskStateService.cs`), aber **kein Smoke-Test gegen die echte Bandel-API ist
|
||||
gelaufen**. Die fünf Punkte aus der „Manuellen Verifikation" des Specs
|
||||
(`docs/superpowers/specs/2026-08-27-ticketsystem-integration-design.md`):
|
||||
Alle vier Routen sind jetzt live gegen die echte API geprüft. Die aus dem `Bandel.APIs`-Quellcode
|
||||
abgeleiteten Shapes stimmten bis auf zwei Punkte, beide gefixt und mit Tests belegt:
|
||||
|
||||
- [ ] PAT in den Settings hinterlegen, „Verbindung testen" → korrekter Benutzername + Scopes.
|
||||
- [ ] Liste mit Projekt `393 Bandel.LagerApp` verknüpfen, „Update from Ticketsystem" → nur
|
||||
eigene, offene Tickets erscheinen als Tasks.
|
||||
- [ ] Einen Task laufen lassen → Ticket steht im Ticketsystem auf `InBearbeitung`.
|
||||
- `PATCH /api/Ticket/{id}/status` braucht **`statusId` UND `statusName`** — ohne den Namen 400
|
||||
(„The StatusName field is required."), also hätte *jede* Write-Back fehlgeschlagen. Der Name
|
||||
wird nicht gegen die Id validiert, muss aber nicht-leer sein (`TicketStatusMap.NameOf`).
|
||||
- Das flache `assigneeName` im Board-Item ist auf **jedem** Ticket null (alle 63 in Abteilung
|
||||
Entwicklung geprüft). Der Assignee-Filter des Imports hätte damit immer 0 Tasks erzeugt. Echte
|
||||
Quelle: `ticketAssignees[].assigneeName`, das exakt das Format von `/pat/me`s `userName` hat.
|
||||
`personInChargeName` ist die falsche Quelle (mal Login, mal Anzeigename).
|
||||
|
||||
Import zieht jetzt `Offen` **und** `InBearbeitung`, weiterhin nur eigene Tickets.
|
||||
|
||||
Bleibt manuell zu prüfen (UI-Pfad, nie sichtbar gelaufen):
|
||||
|
||||
- [ ] PAT in Settings → Ticketsystem hinterlegen (Base-URL `http://192.168.45.161`),
|
||||
„Verbindung testen" → `mika.kuns` + 9 Scopes.
|
||||
- [ ] Liste mit einem Projekt verknüpfen (Rechtsklick → Listeneinstellungen → Ticket-Projekt),
|
||||
„Update from Ticketsystem" → nur eigene offene/laufende Tickets erscheinen als Tasks.
|
||||
Achtung: aktuell ist **kein** offenes Ticket in Entwicklung dir zugewiesen — zum Testen
|
||||
erst im Ticketsystem zuweisen, sonst ist 0 importiert das korrekte Ergebnis.
|
||||
- [ ] Einen Task laufen lassen → Ticket steht auf `InBearbeitung`.
|
||||
- [ ] Approve/Merge → Ticket steht auf `Fertig`.
|
||||
- [ ] Base-URL leeren → Menüeintrag verschwindet, keine Netzwerkaufrufe mehr.
|
||||
|
||||
**Wichtig:** die Response-Shapes der Bandel-API (`BandelEnvelope<T>`, `TicketIdentity`,
|
||||
`TicketBoardItem`, `SidebarDepartment`/`SidebarProject`, `TicketDtos.cs`) wurden aus dem
|
||||
**Quellcode** von `Bandel.APIs` abgeleitet, **nie live gegen die echte API verifiziert** — es gab
|
||||
keinen einzigen echten Netzwerkaufruf während der Implementierung. Die Punkte 1–4 oben sind
|
||||
zugleich der erste Test dieser Annahme: schlägt einer davon mit einem Deserialisierungs- oder
|
||||
404/Formatfehler fehl, ist das erwartbar und kein Regressions-Bug — dann müssen die DTOs in
|
||||
`src/ClaudeDo.Worker/Tickets/TicketDtos.cs` an die tatsächliche Antwort angepasst werden.
|
||||
- [ ] Sichtprüfung des Settings-Tabs + des Ticket-Projekt-Dropdowns (nie gerendert gesehen).
|
||||
|
||||
## Offene Verifikation (2026-07-27)
|
||||
|
||||
|
||||
@@ -0,0 +1,147 @@
|
||||
# Mehrfach-Abhängigkeiten (`depends_on` als Menge) — Implementation Plan
|
||||
|
||||
**Goal:** A task can declare *n* predecessors instead of exactly one. The queue picker
|
||||
claims it only once **all** of them are `Done`.
|
||||
|
||||
**Architecture:** Replace the single `tasks.depends_on_task_id` column with a
|
||||
`task_dependencies(task_id, depends_on_task_id)` relation table (composite PK, both FKs to
|
||||
`tasks.id`, `ON DELETE CASCADE`). Cascade reproduces today's `ON DELETE SET NULL` semantics
|
||||
on a join table: deleting a predecessor drops the edge, so the dependent becomes pickable
|
||||
instead of blocked forever. `BlockedByTaskId` (the internal planning chain) is untouched —
|
||||
the split stays deliberate.
|
||||
|
||||
**Tech Stack:** .NET 8, EF Core (SQLite), SignalR, Avalonia 12, xUnit.
|
||||
|
||||
**Not in scope:** `BlockedByTaskId`; rewriting the list-handler prompt to *use* multi-deps;
|
||||
a graph visualizer.
|
||||
|
||||
---
|
||||
|
||||
## File Structure
|
||||
|
||||
**Create:**
|
||||
- `src/ClaudeDo.Data/Models/TaskDependencyEntity.cs`
|
||||
- `src/ClaudeDo.Data/Configuration/TaskDependencyEntityConfiguration.cs`
|
||||
- `src/ClaudeDo.Data/Migrations/<ts>_AddTaskDependencies.cs` — scaffolded
|
||||
- `src/ClaudeDo.Worker/External/TaskBlocking.cs` — the shared `blockedReason` builder
|
||||
(two consumers: `ExternalMcpService`, `TaskWaitMcpTools`)
|
||||
- `tests/ClaudeDo.Data.Tests/TaskDependencyMigrationTests.cs` — real `Migrate()` on a DB
|
||||
seeded with legacy `depends_on_task_id` rows
|
||||
|
||||
**Modify:**
|
||||
- `src/ClaudeDo.Data/Models/TaskEntity.cs` — `DependsOnTaskId` → `Dependencies` nav +
|
||||
`[NotMapped] DependsOnTaskIds`
|
||||
- `src/ClaudeDo.Data/Configuration/TaskEntityConfiguration.cs` — drop column/FK/index
|
||||
- `src/ClaudeDo.Data/ClaudeDoDbContext.cs` — `DbSet<TaskDependencyEntity>`
|
||||
- `src/ClaudeDo.Data/Repositories/TaskRepository.cs` — `.Include(t => t.Dependencies)` on
|
||||
the three read paths; `UpdateAsync` must not push the nav graph
|
||||
- `src/ClaudeDo.Worker/Queue/QueuePicker.cs` — `NOT EXISTS` over the relation table
|
||||
- `src/ClaudeDo.Worker/State/TaskStateService.cs` — `SetDependsOnAsync` takes a set,
|
||||
graph-wide cycle check
|
||||
- `src/ClaudeDo.Worker/State/Interfaces/ITaskStateService.cs`
|
||||
- `src/ClaudeDo.Worker/External/ExternalMcpService.cs` — DTOs, `add_task`, `update_task`,
|
||||
`ComputeBlockedInfoAsync`
|
||||
- `src/ClaudeDo.Worker/External/TaskWaitMcpTools.cs`
|
||||
- `src/ClaudeDo.Ui/ViewModels/Islands/TaskRowViewModel.cs`,
|
||||
`TasksIslandViewModel.cs` — display of *n* predecessors
|
||||
- `src/ClaudeDo.Data/CLAUDE.md`, `src/ClaudeDo.Worker/CLAUDE.md`
|
||||
- test files listed per task below
|
||||
|
||||
---
|
||||
|
||||
## Task 1 — Schema + migration
|
||||
|
||||
- [ ] `TaskDependencyEntity { string TaskId; string DependsOnTaskId; }`, table
|
||||
`task_dependencies`, composite PK, both FKs cascade, index on `depends_on_task_id`.
|
||||
- [ ] `TaskEntity.Dependencies` (`ICollection<TaskDependencyEntity>`), `[NotMapped]
|
||||
DependsOnTaskIds` projection. `DependsOnTaskId` and its FK/index are removed.
|
||||
- [ ] Scaffold the migration, then **hand-edit the Up body** so the data copy sits between
|
||||
create and drop:
|
||||
`CreateTable` → `INSERT INTO task_dependencies (task_id, depends_on_task_id) SELECT
|
||||
id, depends_on_task_id FROM tasks WHERE depends_on_task_id IS NOT NULL` →
|
||||
`DropColumn`. Down reverses it (add column, `UPDATE … FROM` the first edge, drop
|
||||
table) — lossy for >1 edge, which is inherent and documented in the migration.
|
||||
- [ ] Verify: `dotnet ef database update` against a temp DB seeded with legacy rows;
|
||||
`pragma_table_info` diff. **`DropColumn` forces a SQLite table rebuild** — the
|
||||
`ef-migration-parallel-designer-collision` trap applies: if another migration lands
|
||||
in parallel, hand-check both `.Designer.cs` snapshots.
|
||||
|
||||
**Test:** `TaskDependencyMigrationTests` — migrate to the previous migration, seed a task
|
||||
with `depends_on_task_id` via raw SQL, migrate to head, assert the edge is in
|
||||
`task_dependencies` and nothing else changed. (Acceptance #2.)
|
||||
|
||||
## Task 2 — Queue gating
|
||||
|
||||
- [ ] `QueuePicker` replaces the `depends_on_task_id IS NULL OR EXISTS(...)` clause with
|
||||
a doubly-negated `NOT EXISTS` over `task_dependencies`, so a dangling edge keeps
|
||||
blocking exactly as today:
|
||||
```sql
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM task_dependencies td
|
||||
WHERE td.task_id = t.id
|
||||
AND NOT EXISTS (SELECT 1 FROM tasks d
|
||||
WHERE d.id = td.depends_on_task_id AND d.status = 'done')
|
||||
)
|
||||
```
|
||||
|
||||
**Tests** (`QueuePickerTests`, real SQLite): n=2 both `Done` → claimed; one `Done` one
|
||||
`Running` → skipped; zero deps → claimed (regression); one dep `Failed` → still skipped,
|
||||
no cascade (acceptance #6); one dep `Cancelled` → still skipped.
|
||||
|
||||
## Task 3 — Write path + cycle detection
|
||||
|
||||
- [ ] `ITaskStateService.SetDependsOnAsync(string taskId, IReadOnlyList<string>
|
||||
dependsOnTaskIds, CancellationToken)` — empty list clears. Rejects self-reference,
|
||||
unknown id, duplicate handling by de-dup.
|
||||
- [ ] Cycle check walks the **graph**: load the whole edge set once (it only ever holds
|
||||
*declared* dependencies, so it stays small — `ponytail:` note, switch to a recursive
|
||||
CTE if it ever isn't), BFS from every proposed predecessor; reaching `taskId` is a
|
||||
cycle. Visited set guards pre-existing bad data.
|
||||
- [ ] Replace rows transactionally (`ExecuteDelete` for `taskId` + `AddRange`), wake the
|
||||
queue when the set shrank.
|
||||
|
||||
**Tests** (`TaskStateServiceTests`): sets n edges; empty list clears + wakes; self-ref
|
||||
rejected; unknown id rejected; **A→B→C→A rejected** (acceptance #3); adding a second edge
|
||||
leaves the first intact.
|
||||
|
||||
## Task 4 — MCP surface
|
||||
|
||||
- [ ] `add_task` / `update_task` keep `dependsOnTaskId` (string) **and** gain
|
||||
`dependsOnTaskIds` (`string[]?`). Precedence: `dependsOnTaskIds` non-null wins;
|
||||
otherwise the legacy scalar is treated as a one-element set, with `""` still the
|
||||
clear sentinel. Both run through `TaskIdResolver` so `#123` keeps working.
|
||||
- [ ] `TaskDto`/`TaskRefDto`: `DependsOnTaskId` → `DependsOnTaskIds`
|
||||
(`IReadOnlyList<string>`). Only the *input* form is contractually frozen.
|
||||
- [ ] `TaskBlocking.Describe` builds one reason naming **every** unmet predecessor
|
||||
(acceptance #4); `ComputeBlockedInfoAsync` and `TaskWaitMcpTools.CheckOnceAsync`
|
||||
both use it.
|
||||
|
||||
**Tests** (`ExternalMcpServiceTests`, `TaskWaitMcpToolsTests`, `BatchMcpToolsTests`):
|
||||
legacy scalar still sets + clears the link (acceptance #5, explicit back-compat test);
|
||||
`dependsOnTaskIds` sets n; cycle via the list form throws; `blockedReason` names both
|
||||
open predecessors.
|
||||
|
||||
## Task 5 — UI
|
||||
|
||||
- [ ] `TaskRowViewModel.DependsOnTaskIds`; `DependsOnTaskId` becomes a computed
|
||||
"single predecessor or null" so the existing linear-chain rail is unchanged for the
|
||||
1-dependency case.
|
||||
- [ ] `BuildAfterLabel` joins all resolvable predecessors (`#3, #7`); a row with >1
|
||||
predecessor gets the label, never a rail (a rail can only render a line).
|
||||
- [ ] `GroupingKey` folds the joined ids so the reconcile tick still detects a change.
|
||||
- [ ] `.Include(t => t.Dependencies)` on the `TasksIslandViewModel` query sites that
|
||||
hydrate rows.
|
||||
|
||||
**Tests** (`TasksIslandChainTests`, `TasksIslandClassifyItemsTests`,
|
||||
`TasksIslandReconcileTickTests`): existing chain tests keep passing via the 1-dep path;
|
||||
a 2-dep row shows a joined after-label and no rail.
|
||||
|
||||
## Task 6 — Docs + verify
|
||||
|
||||
- [ ] `src/ClaudeDo.Data/CLAUDE.md` (Models, Schema) and
|
||||
`src/ClaudeDo.Worker/CLAUDE.md` (Status Model table, picker bullet,
|
||||
`TaskStateService` bullet) describe the relation table (acceptance #7).
|
||||
- [ ] VERIFY (acceptance #8): `dotnet build src/ClaudeDo.App -c Release`,
|
||||
`dotnet build src/ClaudeDo.Worker -c Release`, `dotnet test` for
|
||||
`ClaudeDo.Data.Tests`, `ClaudeDo.Worker.Tests`, `ClaudeDo.Ui.Tests` (`-c Release`),
|
||||
report counts.
|
||||
@@ -165,13 +165,13 @@ sealed class Program
|
||||
sc.AddSingleton<TasksIslandViewModel>(sp =>
|
||||
new TasksIslandViewModel(
|
||||
sp.GetRequiredService<IDbContextFactory<ClaudeDoDbContext>>(),
|
||||
sp.GetRequiredService<IWorkerClient>()));
|
||||
sp.GetRequiredService<IWorkerClient>(),
|
||||
sp.GetRequiredService<INotesApi>()));
|
||||
sc.AddSingleton<DetailsIslandViewModel>(sp =>
|
||||
new DetailsIslandViewModel(
|
||||
sp.GetRequiredService<IDbContextFactory<ClaudeDoDbContext>>(),
|
||||
sp.GetRequiredService<IWorkerClient>(),
|
||||
sp,
|
||||
sp.GetRequiredService<INotesApi>(),
|
||||
sp.GetRequiredService<MergeCoordinator>()));
|
||||
sc.AddSingleton<UsagePillViewModel>(sp =>
|
||||
new UsagePillViewModel(sp.GetRequiredService<IWorkerClient>()));
|
||||
|
||||
@@ -4,9 +4,10 @@ Shared data layer: models, repositories, SQLite infrastructure, and git operatio
|
||||
|
||||
## Models
|
||||
|
||||
- **TaskEntity** — Id, ListId, Title, Description, Status, PlanningPhase, BlockedByTaskId (FK to predecessor in a chain), DependsOnTaskId (FK to a user/MCP-declared predecessor, distinct from BlockedByTaskId), ScheduledFor, Result, ReviewFeedback, LogPath, timestamps, CommitType, Model / SystemPrompt / AgentPath / MaxTurns / PermissionMode (nullable overrides), IsStarred, IsMyDay, IsManual, Notes, ParentTaskId, PlanningSessionId / PlanningSessionToken / PlanningFinalizedAt, CreatedBy, HandlerBaseCommit / HandlerHeadCommit, InteractiveSessionId, TicketRef, Number (global immutable human-readable alias).
|
||||
- **TaskEntity** — Id, ListId, Title, Description, Status, PlanningPhase, BlockedByTaskId (FK to predecessor in a chain), Dependencies (n user/MCP-declared predecessors via `task_dependencies`, distinct from BlockedByTaskId), ScheduledFor, Result, ReviewFeedback, LogPath, timestamps, CommitType, Model / SystemPrompt / AgentPath / MaxTurns / PermissionMode (nullable overrides), IsStarred, IsMyDay, IsManual, Notes, ParentTaskId, PlanningSessionId / PlanningSessionToken / PlanningFinalizedAt, CreatedBy, HandlerBaseCommit / HandlerHeadCommit, InteractiveSessionId, TicketRef, Number (global immutable human-readable alias).
|
||||
- `TicketRef` (`ticket_ref`, nullable string) — link to an external ticket, format `<provider>:<id>` (currently always `bandel:<ticketId>`). Set by the ticket import, otherwise null. → `ClaudeDo.Worker/CLAUDE.md` Tickets section.
|
||||
- Status / PlanningPhase / BlockedByTaskId / DependsOnTaskId semantics + allowed transitions: `ClaudeDo.Worker/CLAUDE.md` → Status Model.
|
||||
- Status / PlanningPhase / BlockedByTaskId / dependency-set semantics + allowed transitions: `ClaudeDo.Worker/CLAUDE.md` → Status Model.
|
||||
- `Dependencies` (`ICollection<TaskDependencyEntity>`) + the `[NotMapped] DependsOnTaskIds` id projection. **Only populated where the query `Include`s it** — `TaskRepository.GetByIdAsync`/`GetByNumberAsync`/`GetByListIdAsync` do, and so do the `TasksIslandViewModel` row-hydration queries. The queue gate itself is raw SQL in `QueuePicker` and never reads the nav, so a forgotten Include misreports the UI/MCP `blocked` flag but can never let a blocked task run. ⚠️ `TaskRepository.UpdateAsync` marks **only the root entity** Modified (`Entry().State`, not `Update()`) — `Update()` marks the loaded graph, and an all-key `task_dependencies` row has nothing to SET.
|
||||
- `HandlerBaseCommit`/`HandlerHeadCommit` = the review range for a **worktree-less "list handler" host task** ("Let Claude handle it"), which commits straight into the list's working dir instead of a per-task worktree. Everything that reads a task's diff falls back to this pair whenever `Worktree` is null → [conpty-sessions](../../docs/explore-notes/conpty-sessions.md).
|
||||
- `InteractiveSessionId` = the claude session id an embedded ConPTY interactive task session runs under, persisted by `InteractiveLaunchSpecService` before launch so a closed/aborted session can be resumed → [conpty-sessions](../../docs/explore-notes/conpty-sessions.md).
|
||||
- `Number` (INTEGER NOT NULL, unique index `idx_tasks_number`) — a global, monotonically increasing display alias for tasks. **Never reused**: deleting a task leaves a gap in numbering, ensuring that a task number that appears in a log or report always points to the same task (if it exists). Allocated by `TaskNumberAllocator.AddWithNumberAsync` on every insert via a persistent counter (`app_settings.next_task_number`). **Why not `MAX(number) + 1`:** deleting the highest-numbered task would free its number for reuse, breaking the immutability guarantee. The allocator uses an `UPDATE…RETURNING` statement to claim numbers atomically, retrying up to 5 times if a uniqueness collision occurs (the counter advances on each attempt, so retries always allocate fresh numbers). The one-time backfill for pre-existing rows lived in the `AddTaskNumbers` migration, squashed away 2026-08-26.
|
||||
@@ -20,6 +21,7 @@ Shared data layer: models, repositories, SQLite infrastructure, and git operatio
|
||||
- **DailyNoteEntity** — Id, Date (DateOnly), Text, SortOrder, CreatedAt → `daily_notes`
|
||||
- **WeekReportEntity** — Id, StartDate/EndDate (DateOnly), Markdown, GeneratedAt → `week_reports`, unique index on (start_date, end_date)
|
||||
- **TaskAttachmentEntity** — Id, TaskId (FK, ON DELETE CASCADE), FileName, ByteSize, CreatedAt → `task_attachments`
|
||||
- **TaskDependencyEntity** — one declared "run after" edge: TaskId + DependsOnTaskId, composite PK, table `task_dependencies`. Both FKs are `ON DELETE CASCADE`, which is what the old single `depends_on_task_id` column got from `ON DELETE SET NULL`: deleting a predecessor drops the edge so the dependent becomes pickable instead of blocked on a task that's gone. Written **only** by `TaskStateService.SetDependsOnAsync`.
|
||||
- **SubtaskEntity**, **AgentInfo** — subtasks / record for scanned agent files
|
||||
|
||||
### AppSettingsEntity
|
||||
@@ -37,10 +39,20 @@ Beyond the basics it carries:
|
||||
| `ReportExcludedPaths` | `report_excluded_paths` | null | JSON array of excluded path prefixes. |
|
||||
| `StandupWeekday` | `standup_weekday` | Wednesday | int `DayOfWeek`. |
|
||||
| `NextTaskNumber` | `next_task_number` | 1 | Persistent counter for `TaskEntity.Number` allocation. Incremented atomically in `TaskNumberAllocator.AddWithNumberAsync` on every task insert. **Monotonic only:** the counter itself advances across all tasks (no per-list numbering), and it never resets. A deleted task leaves a gap. |
|
||||
| `PowerUseEnabled` | `power_use_enabled` | false | PowerUse master switch, toggled in **Settings → Execution**. ⚠️ Never sufficient alone — a handler run is in PowerUse only when `list_config.power_use_allowed` is also set. |
|
||||
| `ListHandlerMaxHandoffs` | `list_handler_max_handoffs` | 4 | Cap on a list-handler run's wait↔merge handoff chain (`HandoffRoundTracker`). 4 = two merge rounds. Independent of PowerUse — applies to interactive runs too. Clamped to min 1 in `WorkerHub.UpdateAppSettings` and again in `Register`, because 0 would remove the only bound on a runaway chain. |
|
||||
| `PowerUseWindowStart` / `PowerUseWindowEnd` | `power_use_window_*` | null | Optional local-time window (`HH:mm`) narrowing when PowerUse applies. Both null (or only one set) = round the clock, i.e. byte-identical to the pre-window behaviour; end before start wraps over midnight. Semantics live in the pure `PowerUseWindow`; checked in `InteractiveLaunchSpecService.ComposeHandlerPromptAsync` **per phase** at prompt-build time, so a chain handing off past the end time drops the addendum from there on. Unparseable input is stored as null, not rejected. |
|
||||
| `PowerUseHandoffPct` | `power_use_handoff_pct` | 95 | 5h-usage percentage at which a PowerUse handler session should hand off. Clamped 50..99. Typed in Settings → Execution; the consumer is the handoff prompt. |
|
||||
|
||||
All four usage percentages are clamped 0..100 by `AppSettingsRepository.UpdateAsync`.
|
||||
Gate/throttle semantics → [usage-monitoring](../../docs/explore-notes/usage-monitoring.md).
|
||||
|
||||
⚠️ **`AppSettingsRepository.UpdateAsync` copies the incoming entity field by field** onto the
|
||||
singleton row — a property missing from that block never persists, however correctly the caller
|
||||
filled the entity, and nothing fails. `ModelPresets`, `PowerUseEnabled` and
|
||||
`ListHandlerMaxHandoffs` were all silently unwritable that way until 2026-09-02. Add a new column
|
||||
to that block, not just to the entity + the hub.
|
||||
|
||||
### Model / effort registries
|
||||
|
||||
- **ModelPresets / ModelPreset** — per-model run defaults (`Model`, `Effort`, `MaxTurns`), one row per `ModelRegistry.Aliases` entry, supplying the **global** effort and max-turns defaults. Ship defaults: haiku medium/20, sonnet high/30, opus high/40, fable high/25. `Parse`/`Serialize` normalize (unknown models dropped, missing aliases filled from `Defaults`, effort validated, turns clamped 1–200) and **never throw** — a malformed settings row must not stop a run. `For(presets, model, fallbackMaxTurns)` always returns a usable row; resolution order and the fallback trap → [worker-task-pipeline](../../docs/explore-notes/worker-task-pipeline.md).
|
||||
@@ -103,6 +115,7 @@ Tables (one per line so parallel migrations don't collide on the same line):
|
||||
- `daily_notes`
|
||||
- `week_reports`
|
||||
- `task_attachments`
|
||||
- `task_dependencies`
|
||||
|
||||
Managed by EF Core migrations in `Migrations/`. **The 40 incremental migrations were squashed into
|
||||
a single `20260826094154_InitialCreate` on 2026-08-26** — the schema history is git history now,
|
||||
@@ -112,8 +125,9 @@ not a migration chain. Consequences:
|
||||
(pre-EF databases without a history, and databases whose history still lists the old chain ending
|
||||
at `20260825063230_AddPrimeActionKind`). A database that stopped *mid*-chain can no longer be
|
||||
upgraded and throws with a reinstall message instead of being stamped onto a schema it lacks.
|
||||
Covered by `MigrationBaselineTests` — the only test that runs a real `Migrate()` (every other
|
||||
Data.Tests fixture uses `EnsureCreated`, which skips migrations entirely). Its fixture builds the
|
||||
Covered by `MigrationBaselineTests` — one of only two tests that run a real `Migrate()`
|
||||
(`TaskDependencyMigrationTests` is the other; every other Data.Tests fixture uses
|
||||
`EnsureCreated`, which skips migrations entirely). Its fixture builds the
|
||||
legacy database by migrating **to** `InitialCreate` and seeding rows with raw SQL: `EnsureCreated`
|
||||
would build *today's* schema, so every post-squash migration would then re-add an existing column
|
||||
("duplicate column name"). Assert "nothing pending", never "InitialCreate is the only history row".
|
||||
@@ -122,10 +136,12 @@ not a migration chain. Consequences:
|
||||
Release` — `Data` is its own startup project (it holds the `Design` package and a design-time
|
||||
factory), and `--configuration Release` is needed because a running Worker locks `Debug`.
|
||||
|
||||
`tasks` holds `status`, `planning_phase` (default `none`),
|
||||
`blocked_by_task_id` (FK to `tasks.id`, `ON DELETE SET NULL`), and `depends_on_task_id` (same FK
|
||||
shape, but a separate column — see Worker/CLAUDE.md → Status Model for why it isn't unified with
|
||||
`blocked_by_task_id`).
|
||||
`tasks` holds `status`, `planning_phase` (default `none`) and `blocked_by_task_id` (FK to
|
||||
`tasks.id`, `ON DELETE SET NULL`). The user/MCP-declared predecessors live in `task_dependencies`
|
||||
instead — a **set**, so a task can wait on n of them; see Worker/CLAUDE.md → Status Model for why
|
||||
it isn't unified with `blocked_by_task_id`. `AddTaskDependencies` (2026-09-02) migrated the former
|
||||
single `tasks.depends_on_task_id` column into that table (each value became a one-element set) and
|
||||
dropped it; the `Down` direction is inherently lossy for more than one edge.
|
||||
|
||||
## Conventions
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ public class ClaudeDoDbContext : DbContext
|
||||
=> optionsBuilder.AddInterceptors(SqliteForeignKeyInterceptor.Instance);
|
||||
|
||||
public DbSet<TaskEntity> Tasks => Set<TaskEntity>();
|
||||
public DbSet<TaskDependencyEntity> TaskDependencies => Set<TaskDependencyEntity>();
|
||||
public DbSet<ListEntity> Lists => Set<ListEntity>();
|
||||
public DbSet<ListConfigEntity> ListConfigs => Set<ListConfigEntity>();
|
||||
public DbSet<WorktreeEntity> Worktrees => Set<WorktreeEntity>();
|
||||
|
||||
@@ -70,6 +70,17 @@ public class AppSettingsEntityConfiguration : IEntityTypeConfiguration<AppSettin
|
||||
builder.Property(s => s.AutoContinueOnUsageLimit)
|
||||
.HasColumnName("auto_continue_on_usage_limit").IsRequired().HasDefaultValue(false);
|
||||
|
||||
builder.Property(s => s.PowerUseEnabled)
|
||||
.HasColumnName("power_use_enabled").IsRequired().HasDefaultValue(false);
|
||||
builder.Property(s => s.PowerUseWindowStart)
|
||||
.HasColumnName("power_use_window_start");
|
||||
builder.Property(s => s.PowerUseWindowEnd)
|
||||
.HasColumnName("power_use_window_end");
|
||||
builder.Property(s => s.PowerUseHandoffPct)
|
||||
.HasColumnName("power_use_handoff_pct").IsRequired().HasDefaultValue(95);
|
||||
builder.Property(s => s.ListHandlerMaxHandoffs)
|
||||
.HasColumnName("list_handler_max_handoffs").IsRequired().HasDefaultValue(4);
|
||||
|
||||
builder.HasData(new AppSettingsEntity { Id = AppSettingsEntity.SingletonId });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ public class DailyNoteEntityConfiguration : IEntityTypeConfiguration<DailyNoteEn
|
||||
builder.Property(n => n.Date).HasColumnName("note_date").IsRequired();
|
||||
builder.Property(n => n.Text).HasColumnName("text").IsRequired();
|
||||
builder.Property(n => n.SortOrder).HasColumnName("sort_order").IsRequired();
|
||||
builder.Property(n => n.FromAgent).HasColumnName("from_agent").IsRequired();
|
||||
builder.Property(n => n.CreatedAt).HasColumnName("created_at").IsRequired();
|
||||
builder.HasIndex(n => n.Date);
|
||||
}
|
||||
|
||||
@@ -20,5 +20,6 @@ public class ListConfigEntityConfiguration : IEntityTypeConfiguration<ListConfig
|
||||
builder.Property(c => c.VerifyCommand).HasColumnName("verify_command");
|
||||
builder.Property(c => c.PermissionMode).HasColumnName("permission_mode");
|
||||
builder.Property(c => c.TicketProjectId).HasColumnName("ticket_project_id");
|
||||
builder.Property(c => c.PowerUseAllowed).HasColumnName("power_use_allowed");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
using ClaudeDo.Data.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace ClaudeDo.Data.Configuration;
|
||||
|
||||
public class TaskDependencyEntityConfiguration : IEntityTypeConfiguration<TaskDependencyEntity>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<TaskDependencyEntity> builder)
|
||||
{
|
||||
builder.ToTable("task_dependencies");
|
||||
|
||||
builder.HasKey(d => new { d.TaskId, d.DependsOnTaskId });
|
||||
builder.Property(d => d.TaskId).HasColumnName("task_id");
|
||||
builder.Property(d => d.DependsOnTaskId).HasColumnName("depends_on_task_id");
|
||||
|
||||
// Cascade on both sides reproduces what the old single depends_on_task_id column got from
|
||||
// ON DELETE SET NULL: deleting the predecessor drops the edge, so the dependent becomes
|
||||
// pickable rather than blocked forever on a task that no longer exists.
|
||||
builder.HasOne<TaskEntity>()
|
||||
.WithMany(t => t.Dependencies)
|
||||
.HasForeignKey(d => d.TaskId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
builder.HasOne<TaskEntity>()
|
||||
.WithMany()
|
||||
.HasForeignKey(d => d.DependsOnTaskId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
builder.HasIndex(d => d.DependsOnTaskId).HasDatabaseName("idx_task_dependencies_depends_on");
|
||||
}
|
||||
}
|
||||
@@ -75,7 +75,6 @@ public class TaskEntityConfiguration : IEntityTypeConfiguration<TaskEntity>
|
||||
builder.Property(t => t.PlanningPhase).HasColumnName("planning_phase").IsRequired()
|
||||
.HasConversion(PhaseConverter).HasDefaultValue(PlanningPhase.None);
|
||||
builder.Property(t => t.BlockedByTaskId).HasColumnName("blocked_by_task_id");
|
||||
builder.Property(t => t.DependsOnTaskId).HasColumnName("depends_on_task_id");
|
||||
builder.Property(t => t.ScheduledFor).HasColumnName("scheduled_for");
|
||||
builder.Property(t => t.Result).HasColumnName("result");
|
||||
builder.Property(t => t.ReviewFeedback).HasColumnName("review_feedback");
|
||||
@@ -97,6 +96,7 @@ public class TaskEntityConfiguration : IEntityTypeConfiguration<TaskEntity>
|
||||
builder.Property(t => t.IsStarred).HasColumnName("is_starred").HasDefaultValue(false);
|
||||
builder.Property(t => t.IsMyDay).HasColumnName("is_my_day").HasDefaultValue(false);
|
||||
builder.Property(t => t.IsManual).HasColumnName("is_manual").HasDefaultValue(false);
|
||||
builder.Property(t => t.ExpectsNoDiff).HasColumnName("expects_no_diff").HasDefaultValue(false);
|
||||
builder.Property(t => t.Notes).HasColumnName("notes");
|
||||
builder.Property(t => t.SortOrder).HasColumnName("sort_order").IsRequired().HasDefaultValue(0);
|
||||
builder.Property(t => t.SessionSkills).HasColumnName("session_skills");
|
||||
@@ -123,12 +123,8 @@ public class TaskEntityConfiguration : IEntityTypeConfiguration<TaskEntity>
|
||||
.HasForeignKey(t => t.BlockedByTaskId)
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
|
||||
// DependsOn: user/MCP-declared predecessor. SetNull on delete so the dependent becomes
|
||||
// pickable rather than blocked forever on a task that no longer exists.
|
||||
builder.HasOne<TaskEntity>()
|
||||
.WithMany()
|
||||
.HasForeignKey(t => t.DependsOnTaskId)
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
// DependsOn edges live in task_dependencies (a task can declare n predecessors) —
|
||||
// configured in TaskDependencyEntityConfiguration, which also owns the Dependencies nav.
|
||||
|
||||
builder.HasOne(t => t.List)
|
||||
.WithMany(l => l.Tasks)
|
||||
@@ -145,6 +141,5 @@ public class TaskEntityConfiguration : IEntityTypeConfiguration<TaskEntity>
|
||||
builder.HasIndex(t => new { t.ListId, t.SortOrder }).HasDatabaseName("idx_tasks_list_sort");
|
||||
builder.HasIndex(t => t.ParentTaskId).HasDatabaseName("idx_tasks_parent_task_id");
|
||||
builder.HasIndex(t => t.BlockedByTaskId).HasDatabaseName("idx_tasks_blocked_by");
|
||||
builder.HasIndex(t => t.DependsOnTaskId).HasDatabaseName("idx_tasks_depends_on");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -338,6 +338,38 @@ public sealed class GitService
|
||||
return paths;
|
||||
}
|
||||
|
||||
/// <summary>All git-registered worktrees for <paramref name="repoDir"/>, with their branch (short name, null if detached).</summary>
|
||||
public async Task<List<(string Path, string? Branch)>> ListWorktreesAsync(string repoDir, CancellationToken ct = default)
|
||||
{
|
||||
var (exitCode, stdout, _) = await RunGitAsync(repoDir, ["worktree", "list", "--porcelain"], ct);
|
||||
if (exitCode != 0) return new();
|
||||
|
||||
var result = new List<(string Path, string? Branch)>();
|
||||
string? currentPath = null;
|
||||
string? currentBranch = null;
|
||||
foreach (var raw in stdout.Split('\n'))
|
||||
{
|
||||
var line = raw.TrimEnd('\r');
|
||||
if (line.StartsWith("worktree ", StringComparison.Ordinal))
|
||||
{
|
||||
currentPath = line["worktree ".Length..].Trim();
|
||||
}
|
||||
else if (line.StartsWith("branch ", StringComparison.Ordinal))
|
||||
{
|
||||
var b = line["branch ".Length..].Trim();
|
||||
currentBranch = b.StartsWith("refs/heads/", StringComparison.Ordinal) ? b["refs/heads/".Length..] : b;
|
||||
}
|
||||
else if (string.IsNullOrWhiteSpace(line))
|
||||
{
|
||||
if (currentPath is not null) result.Add((currentPath, currentBranch));
|
||||
currentPath = null;
|
||||
currentBranch = null;
|
||||
}
|
||||
}
|
||||
if (currentPath is not null) result.Add((currentPath, currentBranch));
|
||||
return result;
|
||||
}
|
||||
|
||||
public async Task WorktreePruneAsync(string repoDir, CancellationToken ct = default)
|
||||
{
|
||||
var (exitCode, _, stderr) = await RunGitAsync(repoDir, ["worktree", "prune"], ct);
|
||||
|
||||
+982
@@ -0,0 +1,982 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using ClaudeDo.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ClaudeDo.Data.Migrations
|
||||
{
|
||||
[DbContext(typeof(ClaudeDoDbContext))]
|
||||
[Migration("20260828185839_AddDailyNoteFromAgent")]
|
||||
partial class AddDailyNoteFromAgent
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "8.0.11");
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.AppSettingsEntity", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<bool>("AutoContinueOnUsageLimit")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("auto_continue_on_usage_limit");
|
||||
|
||||
b.Property<string>("CentralWorktreeRoot")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("central_worktree_root");
|
||||
|
||||
b.Property<int>("DailyPrepMaxTasks")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(5)
|
||||
.HasColumnName("daily_prep_max_tasks");
|
||||
|
||||
b.Property<string>("DefaultClaudeInstructions")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("")
|
||||
.HasColumnName("default_claude_instructions");
|
||||
|
||||
b.Property<int>("DefaultMaxTurns")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(40)
|
||||
.HasColumnName("default_max_turns");
|
||||
|
||||
b.Property<string>("DefaultModel")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("sonnet")
|
||||
.HasColumnName("default_model");
|
||||
|
||||
b.Property<string>("DefaultPermissionMode")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("bypassPermissions")
|
||||
.HasColumnName("default_permission_mode");
|
||||
|
||||
b.Property<int>("MaxParallelExecutions")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(1)
|
||||
.HasColumnName("max_parallel_executions");
|
||||
|
||||
b.Property<int>("MaxTurnsCeiling")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(80)
|
||||
.HasColumnName("max_turns_ceiling");
|
||||
|
||||
b.Property<string>("ModelPresets")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("model_presets");
|
||||
|
||||
b.Property<int>("NextTaskNumber")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(1)
|
||||
.HasColumnName("next_task_number");
|
||||
|
||||
b.Property<string>("RepoImportFolders")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("repo_import_folders");
|
||||
|
||||
b.Property<string>("ReportExcludedPaths")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("report_excluded_paths");
|
||||
|
||||
b.Property<string>("SessionSkills")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("session_skills");
|
||||
|
||||
b.Property<int>("StandupWeekday")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(3)
|
||||
.HasColumnName("standup_weekday");
|
||||
|
||||
b.Property<int>("UsageGateFiveHourPct")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(80)
|
||||
.HasColumnName("usage_gate_five_hour_pct");
|
||||
|
||||
b.Property<int>("UsageGateSevenDayPct")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(90)
|
||||
.HasColumnName("usage_gate_seven_day_pct");
|
||||
|
||||
b.Property<int>("UsageThrottleFiveHourHardPct")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(65)
|
||||
.HasColumnName("usage_throttle_five_hour_hard_pct");
|
||||
|
||||
b.Property<int>("UsageThrottleFiveHourSoftPct")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(50)
|
||||
.HasColumnName("usage_throttle_five_hour_soft_pct");
|
||||
|
||||
b.Property<int>("UsageThrottleSevenDayHardPct")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(65)
|
||||
.HasColumnName("usage_throttle_seven_day_hard_pct");
|
||||
|
||||
b.Property<int>("UsageThrottleSevenDaySoftPct")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(50)
|
||||
.HasColumnName("usage_throttle_seven_day_soft_pct");
|
||||
|
||||
b.Property<int>("WorktreeAutoCleanupDays")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(7)
|
||||
.HasColumnName("worktree_auto_cleanup_days");
|
||||
|
||||
b.Property<bool>("WorktreeAutoCleanupEnabled")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("worktree_auto_cleanup_enabled");
|
||||
|
||||
b.Property<string>("WorktreeStrategy")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("sibling")
|
||||
.HasColumnName("worktree_strategy");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("app_settings", (string)null);
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = 1,
|
||||
AutoContinueOnUsageLimit = false,
|
||||
DailyPrepMaxTasks = 5,
|
||||
DefaultClaudeInstructions = "",
|
||||
DefaultMaxTurns = 40,
|
||||
DefaultModel = "sonnet",
|
||||
DefaultPermissionMode = "auto",
|
||||
MaxParallelExecutions = 1,
|
||||
MaxTurnsCeiling = 80,
|
||||
NextTaskNumber = 1,
|
||||
StandupWeekday = 3,
|
||||
UsageGateFiveHourPct = 80,
|
||||
UsageGateSevenDayPct = 90,
|
||||
UsageThrottleFiveHourHardPct = 65,
|
||||
UsageThrottleFiveHourSoftPct = 50,
|
||||
UsageThrottleSevenDayHardPct = 65,
|
||||
UsageThrottleSevenDaySoftPct = 50,
|
||||
WorktreeAutoCleanupDays = 7,
|
||||
WorktreeAutoCleanupEnabled = false,
|
||||
WorktreeStrategy = "sibling"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.DailyNoteEntity", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<DateOnly>("Date")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("note_date");
|
||||
|
||||
b.Property<bool>("FromAgent")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("from_agent");
|
||||
|
||||
b.Property<int>("SortOrder")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("sort_order");
|
||||
|
||||
b.Property<string>("Text")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Date");
|
||||
|
||||
b.ToTable("daily_notes", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.ListConfigEntity", b =>
|
||||
{
|
||||
b.Property<string>("ListId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("list_id");
|
||||
|
||||
b.Property<string>("AgentPath")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("agent_path");
|
||||
|
||||
b.Property<int?>("MaxTurns")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("max_turns");
|
||||
|
||||
b.Property<string>("Model")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("model");
|
||||
|
||||
b.Property<string>("PermissionMode")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("permission_mode");
|
||||
|
||||
b.Property<string>("SessionSkills")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("session_skills");
|
||||
|
||||
b.Property<string>("SystemPrompt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("system_prompt");
|
||||
|
||||
b.Property<int?>("TicketProjectId")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("ticket_project_id");
|
||||
|
||||
b.Property<string>("VerifyCommand")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("verify_command");
|
||||
|
||||
b.HasKey("ListId");
|
||||
|
||||
b.ToTable("list_config", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.ListEntity", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<string>("DefaultCommitType")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("chore")
|
||||
.HasColumnName("default_commit_type");
|
||||
|
||||
b.Property<bool>("FindingsTracked")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("findings_tracked");
|
||||
|
||||
b.Property<string>("Icon")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("icon");
|
||||
|
||||
b.Property<bool>("IsManual")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("is_manual");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("name");
|
||||
|
||||
b.Property<int>("SortOrder")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(0)
|
||||
.HasColumnName("sort_order");
|
||||
|
||||
b.Property<string>("WorkingDir")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("working_dir");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("SortOrder")
|
||||
.HasDatabaseName("idx_lists_sort");
|
||||
|
||||
b.ToTable("lists", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.PrimeScheduleEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<DateTimeOffset>("CreatedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<int>("Days")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(31)
|
||||
.HasColumnName("days_of_week");
|
||||
|
||||
b.Property<bool>("Enabled")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(true)
|
||||
.HasColumnName("enabled");
|
||||
|
||||
b.Property<string>("Kind")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("ping")
|
||||
.HasColumnName("action_kind");
|
||||
|
||||
b.Property<DateTimeOffset?>("LastRunAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("last_run_at");
|
||||
|
||||
b.Property<string>("PromptOverride")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("prompt_override");
|
||||
|
||||
b.Property<TimeSpan>("TimeOfDay")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("time_of_day");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("prime_schedules", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.SessionSkillEntity", b =>
|
||||
{
|
||||
b.Property<string>("Name")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("name");
|
||||
|
||||
b.Property<DateTimeOffset>("AddedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("added_at");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("description");
|
||||
|
||||
b.Property<string>("PinnedRef")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("pinned_ref");
|
||||
|
||||
b.Property<string>("SourceUrl")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("source_url");
|
||||
|
||||
b.Property<string>("Subpath")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("subpath");
|
||||
|
||||
b.HasKey("Name");
|
||||
|
||||
b.ToTable("session_skills", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.SubtaskEntity", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<bool>("Completed")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("completed");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<int>("OrderNum")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("order_num");
|
||||
|
||||
b.Property<string>("TaskId")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("task_id");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("title");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("TaskId")
|
||||
.HasDatabaseName("idx_subtasks_task_id");
|
||||
|
||||
b.ToTable("subtasks", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.TaskAttachmentEntity", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<long>("ByteSize")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("byte_size");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<string>("FileName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("file_name");
|
||||
|
||||
b.Property<string>("TaskId")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("task_id");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("TaskId")
|
||||
.HasDatabaseName("idx_task_attachments_task_id");
|
||||
|
||||
b.ToTable("task_attachments", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.TaskEntity", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<string>("AgentPath")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("agent_path");
|
||||
|
||||
b.Property<string>("BlockedByTaskId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("blocked_by_task_id");
|
||||
|
||||
b.Property<string>("CommitType")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("chore")
|
||||
.HasColumnName("commit_type");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_by");
|
||||
|
||||
b.Property<string>("DependsOnTaskId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("depends_on_task_id");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("description");
|
||||
|
||||
b.Property<int?>("FailureMaxTurns")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("failure_max_turns");
|
||||
|
||||
b.Property<string>("FailureReason")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("failure_reason");
|
||||
|
||||
b.Property<int?>("FailureTurnsUsed")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("failure_turns_used");
|
||||
|
||||
b.Property<DateTime?>("FinishedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("finished_at");
|
||||
|
||||
b.Property<string>("HandlerBaseCommit")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("handler_base_commit");
|
||||
|
||||
b.Property<string>("HandlerHeadCommit")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("handler_head_commit");
|
||||
|
||||
b.Property<string>("InteractiveSessionId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("interactive_session_id");
|
||||
|
||||
b.Property<bool>("IsManual")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("is_manual");
|
||||
|
||||
b.Property<bool>("IsMyDay")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("is_my_day");
|
||||
|
||||
b.Property<bool>("IsStarred")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("is_starred");
|
||||
|
||||
b.Property<string>("ListId")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("list_id");
|
||||
|
||||
b.Property<string>("LogPath")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("log_path");
|
||||
|
||||
b.Property<int?>("MaxTurns")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("max_turns");
|
||||
|
||||
b.Property<string>("Model")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("model");
|
||||
|
||||
b.Property<string>("Notes")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("notes");
|
||||
|
||||
b.Property<int>("Number")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("number");
|
||||
|
||||
b.Property<string>("ParentTaskId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("parent_task_id");
|
||||
|
||||
b.Property<string>("PermissionMode")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("permission_mode");
|
||||
|
||||
b.Property<DateTime?>("PlanningFinalizedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("planning_finalized_at");
|
||||
|
||||
b.Property<string>("PlanningPhase")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("none")
|
||||
.HasColumnName("planning_phase");
|
||||
|
||||
b.Property<string>("PlanningSessionId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("planning_session_id");
|
||||
|
||||
b.Property<string>("PlanningSessionToken")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("planning_session_token");
|
||||
|
||||
b.Property<string>("Result")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("result");
|
||||
|
||||
b.Property<string>("ReviewFeedback")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("review_feedback");
|
||||
|
||||
b.Property<int>("RoadblockCount")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(0)
|
||||
.HasColumnName("roadblock_count");
|
||||
|
||||
b.Property<DateTime?>("ScheduledFor")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("scheduled_for");
|
||||
|
||||
b.Property<string>("SessionSkills")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("session_skills");
|
||||
|
||||
b.Property<int>("SortOrder")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(0)
|
||||
.HasColumnName("sort_order");
|
||||
|
||||
b.Property<DateTime?>("StartedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("started_at");
|
||||
|
||||
b.Property<string>("Status")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("status");
|
||||
|
||||
b.Property<string>("SystemPrompt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("system_prompt");
|
||||
|
||||
b.Property<string>("TicketRef")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("ticket_ref");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("title");
|
||||
|
||||
b.Property<DateTime?>("UsageLimitAutoContinuedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("usage_limit_auto_continued_at");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("BlockedByTaskId")
|
||||
.HasDatabaseName("idx_tasks_blocked_by");
|
||||
|
||||
b.HasIndex("DependsOnTaskId")
|
||||
.HasDatabaseName("idx_tasks_depends_on");
|
||||
|
||||
b.HasIndex("ListId")
|
||||
.HasDatabaseName("idx_tasks_list_id");
|
||||
|
||||
b.HasIndex("Number")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("idx_tasks_number");
|
||||
|
||||
b.HasIndex("ParentTaskId")
|
||||
.HasDatabaseName("idx_tasks_parent_task_id");
|
||||
|
||||
b.HasIndex("Status")
|
||||
.HasDatabaseName("idx_tasks_status");
|
||||
|
||||
b.HasIndex("ListId", "SortOrder")
|
||||
.HasDatabaseName("idx_tasks_list_sort");
|
||||
|
||||
b.ToTable("tasks", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.TaskRunEntity", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<int?>("CacheReadTokens")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("cache_read_tokens");
|
||||
|
||||
b.Property<int?>("CacheWriteTokens")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("cache_write_tokens");
|
||||
|
||||
b.Property<string>("ErrorMarkdown")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("error_markdown");
|
||||
|
||||
b.Property<string>("Errors")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("errors");
|
||||
|
||||
b.Property<int?>("ExitCode")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("exit_code");
|
||||
|
||||
b.Property<DateTime?>("FinishedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("finished_at");
|
||||
|
||||
b.Property<bool>("IsRetry")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("is_retry");
|
||||
|
||||
b.Property<string>("LogPath")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("log_path");
|
||||
|
||||
b.Property<string>("Model")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("model");
|
||||
|
||||
b.Property<string>("Prompt")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("prompt");
|
||||
|
||||
b.Property<string>("ResultMarkdown")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("result_markdown");
|
||||
|
||||
b.Property<string>("ResultSubtype")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("result_subtype");
|
||||
|
||||
b.Property<int>("RunNumber")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("run_number");
|
||||
|
||||
b.Property<string>("SessionId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("session_id");
|
||||
|
||||
b.Property<DateTime?>("StartedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("started_at");
|
||||
|
||||
b.Property<string>("StructuredOutputJson")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("structured_output");
|
||||
|
||||
b.Property<string>("TaskId")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("task_id");
|
||||
|
||||
b.Property<string>("TerminalReason")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("terminal_reason");
|
||||
|
||||
b.Property<int?>("TokensIn")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("tokens_in");
|
||||
|
||||
b.Property<int?>("TokensOut")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("tokens_out");
|
||||
|
||||
b.Property<int?>("TurnCount")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("turn_count");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("TaskId")
|
||||
.HasDatabaseName("idx_task_runs_task_id");
|
||||
|
||||
b.ToTable("task_runs", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.WeekReportEntity", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<DateOnly>("EndDate")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("end_date");
|
||||
|
||||
b.Property<DateTime>("GeneratedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("generated_at");
|
||||
|
||||
b.Property<string>("Markdown")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("markdown");
|
||||
|
||||
b.Property<DateOnly>("StartDate")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("start_date");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("StartDate", "EndDate")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("week_reports", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.WorktreeEntity", b =>
|
||||
{
|
||||
b.Property<string>("TaskId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("task_id");
|
||||
|
||||
b.Property<string>("BaseCommit")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("base_commit");
|
||||
|
||||
b.Property<string>("BranchName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("branch_name");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<string>("DiffStat")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("diff_stat");
|
||||
|
||||
b.Property<string>("HeadCommit")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("head_commit");
|
||||
|
||||
b.Property<string>("MergeCommit")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("merge_commit");
|
||||
|
||||
b.Property<string>("Path")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("path");
|
||||
|
||||
b.Property<string>("State")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("active")
|
||||
.HasColumnName("state");
|
||||
|
||||
b.HasKey("TaskId");
|
||||
|
||||
b.ToTable("worktrees", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.ListConfigEntity", b =>
|
||||
{
|
||||
b.HasOne("ClaudeDo.Data.Models.ListEntity", "List")
|
||||
.WithOne("Config")
|
||||
.HasForeignKey("ClaudeDo.Data.Models.ListConfigEntity", "ListId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("List");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.SubtaskEntity", b =>
|
||||
{
|
||||
b.HasOne("ClaudeDo.Data.Models.TaskEntity", "Task")
|
||||
.WithMany("Subtasks")
|
||||
.HasForeignKey("TaskId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Task");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.TaskAttachmentEntity", b =>
|
||||
{
|
||||
b.HasOne("ClaudeDo.Data.Models.TaskEntity", "Task")
|
||||
.WithMany()
|
||||
.HasForeignKey("TaskId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Task");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.TaskEntity", b =>
|
||||
{
|
||||
b.HasOne("ClaudeDo.Data.Models.TaskEntity", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("BlockedByTaskId")
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
|
||||
b.HasOne("ClaudeDo.Data.Models.TaskEntity", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("DependsOnTaskId")
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
|
||||
b.HasOne("ClaudeDo.Data.Models.ListEntity", "List")
|
||||
.WithMany("Tasks")
|
||||
.HasForeignKey("ListId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("ClaudeDo.Data.Models.TaskEntity", "Parent")
|
||||
.WithMany("Children")
|
||||
.HasForeignKey("ParentTaskId")
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
b.Navigation("List");
|
||||
|
||||
b.Navigation("Parent");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.TaskRunEntity", b =>
|
||||
{
|
||||
b.HasOne("ClaudeDo.Data.Models.TaskEntity", "Task")
|
||||
.WithMany("Runs")
|
||||
.HasForeignKey("TaskId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Task");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.WorktreeEntity", b =>
|
||||
{
|
||||
b.HasOne("ClaudeDo.Data.Models.TaskEntity", "Task")
|
||||
.WithOne("Worktree")
|
||||
.HasForeignKey("ClaudeDo.Data.Models.WorktreeEntity", "TaskId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Task");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.ListEntity", b =>
|
||||
{
|
||||
b.Navigation("Config");
|
||||
|
||||
b.Navigation("Tasks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.TaskEntity", b =>
|
||||
{
|
||||
b.Navigation("Children");
|
||||
|
||||
b.Navigation("Runs");
|
||||
|
||||
b.Navigation("Subtasks");
|
||||
|
||||
b.Navigation("Worktree");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ClaudeDo.Data.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddDailyNoteFromAgent : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "from_agent",
|
||||
table: "daily_notes",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "from_agent",
|
||||
table: "daily_notes");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,988 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using ClaudeDo.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ClaudeDo.Data.Migrations
|
||||
{
|
||||
[DbContext(typeof(ClaudeDoDbContext))]
|
||||
[Migration("20260902102003_AddExpectsNoDiff")]
|
||||
partial class AddExpectsNoDiff
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "8.0.11");
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.AppSettingsEntity", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<bool>("AutoContinueOnUsageLimit")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("auto_continue_on_usage_limit");
|
||||
|
||||
b.Property<string>("CentralWorktreeRoot")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("central_worktree_root");
|
||||
|
||||
b.Property<int>("DailyPrepMaxTasks")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(5)
|
||||
.HasColumnName("daily_prep_max_tasks");
|
||||
|
||||
b.Property<string>("DefaultClaudeInstructions")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("")
|
||||
.HasColumnName("default_claude_instructions");
|
||||
|
||||
b.Property<int>("DefaultMaxTurns")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(40)
|
||||
.HasColumnName("default_max_turns");
|
||||
|
||||
b.Property<string>("DefaultModel")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("sonnet")
|
||||
.HasColumnName("default_model");
|
||||
|
||||
b.Property<string>("DefaultPermissionMode")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("bypassPermissions")
|
||||
.HasColumnName("default_permission_mode");
|
||||
|
||||
b.Property<int>("MaxParallelExecutions")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(1)
|
||||
.HasColumnName("max_parallel_executions");
|
||||
|
||||
b.Property<int>("MaxTurnsCeiling")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(80)
|
||||
.HasColumnName("max_turns_ceiling");
|
||||
|
||||
b.Property<string>("ModelPresets")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("model_presets");
|
||||
|
||||
b.Property<int>("NextTaskNumber")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(1)
|
||||
.HasColumnName("next_task_number");
|
||||
|
||||
b.Property<string>("RepoImportFolders")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("repo_import_folders");
|
||||
|
||||
b.Property<string>("ReportExcludedPaths")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("report_excluded_paths");
|
||||
|
||||
b.Property<string>("SessionSkills")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("session_skills");
|
||||
|
||||
b.Property<int>("StandupWeekday")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(3)
|
||||
.HasColumnName("standup_weekday");
|
||||
|
||||
b.Property<int>("UsageGateFiveHourPct")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(80)
|
||||
.HasColumnName("usage_gate_five_hour_pct");
|
||||
|
||||
b.Property<int>("UsageGateSevenDayPct")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(90)
|
||||
.HasColumnName("usage_gate_seven_day_pct");
|
||||
|
||||
b.Property<int>("UsageThrottleFiveHourHardPct")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(65)
|
||||
.HasColumnName("usage_throttle_five_hour_hard_pct");
|
||||
|
||||
b.Property<int>("UsageThrottleFiveHourSoftPct")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(50)
|
||||
.HasColumnName("usage_throttle_five_hour_soft_pct");
|
||||
|
||||
b.Property<int>("UsageThrottleSevenDayHardPct")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(65)
|
||||
.HasColumnName("usage_throttle_seven_day_hard_pct");
|
||||
|
||||
b.Property<int>("UsageThrottleSevenDaySoftPct")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(50)
|
||||
.HasColumnName("usage_throttle_seven_day_soft_pct");
|
||||
|
||||
b.Property<int>("WorktreeAutoCleanupDays")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(7)
|
||||
.HasColumnName("worktree_auto_cleanup_days");
|
||||
|
||||
b.Property<bool>("WorktreeAutoCleanupEnabled")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("worktree_auto_cleanup_enabled");
|
||||
|
||||
b.Property<string>("WorktreeStrategy")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("sibling")
|
||||
.HasColumnName("worktree_strategy");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("app_settings", (string)null);
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = 1,
|
||||
AutoContinueOnUsageLimit = false,
|
||||
DailyPrepMaxTasks = 5,
|
||||
DefaultClaudeInstructions = "",
|
||||
DefaultMaxTurns = 40,
|
||||
DefaultModel = "sonnet",
|
||||
DefaultPermissionMode = "auto",
|
||||
MaxParallelExecutions = 1,
|
||||
MaxTurnsCeiling = 80,
|
||||
NextTaskNumber = 1,
|
||||
StandupWeekday = 3,
|
||||
UsageGateFiveHourPct = 80,
|
||||
UsageGateSevenDayPct = 90,
|
||||
UsageThrottleFiveHourHardPct = 65,
|
||||
UsageThrottleFiveHourSoftPct = 50,
|
||||
UsageThrottleSevenDayHardPct = 65,
|
||||
UsageThrottleSevenDaySoftPct = 50,
|
||||
WorktreeAutoCleanupDays = 7,
|
||||
WorktreeAutoCleanupEnabled = false,
|
||||
WorktreeStrategy = "sibling"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.DailyNoteEntity", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<DateOnly>("Date")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("note_date");
|
||||
|
||||
b.Property<bool>("FromAgent")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("from_agent");
|
||||
|
||||
b.Property<int>("SortOrder")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("sort_order");
|
||||
|
||||
b.Property<string>("Text")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Date");
|
||||
|
||||
b.ToTable("daily_notes", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.ListConfigEntity", b =>
|
||||
{
|
||||
b.Property<string>("ListId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("list_id");
|
||||
|
||||
b.Property<string>("AgentPath")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("agent_path");
|
||||
|
||||
b.Property<int?>("MaxTurns")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("max_turns");
|
||||
|
||||
b.Property<string>("Model")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("model");
|
||||
|
||||
b.Property<string>("PermissionMode")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("permission_mode");
|
||||
|
||||
b.Property<string>("SessionSkills")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("session_skills");
|
||||
|
||||
b.Property<string>("SystemPrompt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("system_prompt");
|
||||
|
||||
b.Property<int?>("TicketProjectId")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("ticket_project_id");
|
||||
|
||||
b.Property<string>("VerifyCommand")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("verify_command");
|
||||
|
||||
b.HasKey("ListId");
|
||||
|
||||
b.ToTable("list_config", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.ListEntity", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<string>("DefaultCommitType")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("chore")
|
||||
.HasColumnName("default_commit_type");
|
||||
|
||||
b.Property<bool>("FindingsTracked")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("findings_tracked");
|
||||
|
||||
b.Property<string>("Icon")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("icon");
|
||||
|
||||
b.Property<bool>("IsManual")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("is_manual");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("name");
|
||||
|
||||
b.Property<int>("SortOrder")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(0)
|
||||
.HasColumnName("sort_order");
|
||||
|
||||
b.Property<string>("WorkingDir")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("working_dir");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("SortOrder")
|
||||
.HasDatabaseName("idx_lists_sort");
|
||||
|
||||
b.ToTable("lists", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.PrimeScheduleEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<DateTimeOffset>("CreatedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<int>("Days")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(31)
|
||||
.HasColumnName("days_of_week");
|
||||
|
||||
b.Property<bool>("Enabled")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(true)
|
||||
.HasColumnName("enabled");
|
||||
|
||||
b.Property<string>("Kind")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("ping")
|
||||
.HasColumnName("action_kind");
|
||||
|
||||
b.Property<DateTimeOffset?>("LastRunAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("last_run_at");
|
||||
|
||||
b.Property<string>("PromptOverride")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("prompt_override");
|
||||
|
||||
b.Property<TimeSpan>("TimeOfDay")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("time_of_day");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("prime_schedules", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.SessionSkillEntity", b =>
|
||||
{
|
||||
b.Property<string>("Name")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("name");
|
||||
|
||||
b.Property<DateTimeOffset>("AddedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("added_at");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("description");
|
||||
|
||||
b.Property<string>("PinnedRef")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("pinned_ref");
|
||||
|
||||
b.Property<string>("SourceUrl")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("source_url");
|
||||
|
||||
b.Property<string>("Subpath")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("subpath");
|
||||
|
||||
b.HasKey("Name");
|
||||
|
||||
b.ToTable("session_skills", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.SubtaskEntity", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<bool>("Completed")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("completed");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<int>("OrderNum")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("order_num");
|
||||
|
||||
b.Property<string>("TaskId")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("task_id");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("title");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("TaskId")
|
||||
.HasDatabaseName("idx_subtasks_task_id");
|
||||
|
||||
b.ToTable("subtasks", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.TaskAttachmentEntity", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<long>("ByteSize")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("byte_size");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<string>("FileName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("file_name");
|
||||
|
||||
b.Property<string>("TaskId")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("task_id");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("TaskId")
|
||||
.HasDatabaseName("idx_task_attachments_task_id");
|
||||
|
||||
b.ToTable("task_attachments", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.TaskEntity", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<string>("AgentPath")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("agent_path");
|
||||
|
||||
b.Property<string>("BlockedByTaskId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("blocked_by_task_id");
|
||||
|
||||
b.Property<string>("CommitType")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("chore")
|
||||
.HasColumnName("commit_type");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_by");
|
||||
|
||||
b.Property<string>("DependsOnTaskId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("depends_on_task_id");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("description");
|
||||
|
||||
b.Property<bool>("ExpectsNoDiff")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("expects_no_diff");
|
||||
|
||||
b.Property<int?>("FailureMaxTurns")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("failure_max_turns");
|
||||
|
||||
b.Property<string>("FailureReason")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("failure_reason");
|
||||
|
||||
b.Property<int?>("FailureTurnsUsed")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("failure_turns_used");
|
||||
|
||||
b.Property<DateTime?>("FinishedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("finished_at");
|
||||
|
||||
b.Property<string>("HandlerBaseCommit")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("handler_base_commit");
|
||||
|
||||
b.Property<string>("HandlerHeadCommit")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("handler_head_commit");
|
||||
|
||||
b.Property<string>("InteractiveSessionId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("interactive_session_id");
|
||||
|
||||
b.Property<bool>("IsManual")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("is_manual");
|
||||
|
||||
b.Property<bool>("IsMyDay")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("is_my_day");
|
||||
|
||||
b.Property<bool>("IsStarred")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("is_starred");
|
||||
|
||||
b.Property<string>("ListId")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("list_id");
|
||||
|
||||
b.Property<string>("LogPath")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("log_path");
|
||||
|
||||
b.Property<int?>("MaxTurns")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("max_turns");
|
||||
|
||||
b.Property<string>("Model")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("model");
|
||||
|
||||
b.Property<string>("Notes")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("notes");
|
||||
|
||||
b.Property<int>("Number")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("number");
|
||||
|
||||
b.Property<string>("ParentTaskId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("parent_task_id");
|
||||
|
||||
b.Property<string>("PermissionMode")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("permission_mode");
|
||||
|
||||
b.Property<DateTime?>("PlanningFinalizedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("planning_finalized_at");
|
||||
|
||||
b.Property<string>("PlanningPhase")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("none")
|
||||
.HasColumnName("planning_phase");
|
||||
|
||||
b.Property<string>("PlanningSessionId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("planning_session_id");
|
||||
|
||||
b.Property<string>("PlanningSessionToken")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("planning_session_token");
|
||||
|
||||
b.Property<string>("Result")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("result");
|
||||
|
||||
b.Property<string>("ReviewFeedback")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("review_feedback");
|
||||
|
||||
b.Property<int>("RoadblockCount")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(0)
|
||||
.HasColumnName("roadblock_count");
|
||||
|
||||
b.Property<DateTime?>("ScheduledFor")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("scheduled_for");
|
||||
|
||||
b.Property<string>("SessionSkills")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("session_skills");
|
||||
|
||||
b.Property<int>("SortOrder")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(0)
|
||||
.HasColumnName("sort_order");
|
||||
|
||||
b.Property<DateTime?>("StartedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("started_at");
|
||||
|
||||
b.Property<string>("Status")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("status");
|
||||
|
||||
b.Property<string>("SystemPrompt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("system_prompt");
|
||||
|
||||
b.Property<string>("TicketRef")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("ticket_ref");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("title");
|
||||
|
||||
b.Property<DateTime?>("UsageLimitAutoContinuedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("usage_limit_auto_continued_at");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("BlockedByTaskId")
|
||||
.HasDatabaseName("idx_tasks_blocked_by");
|
||||
|
||||
b.HasIndex("DependsOnTaskId")
|
||||
.HasDatabaseName("idx_tasks_depends_on");
|
||||
|
||||
b.HasIndex("ListId")
|
||||
.HasDatabaseName("idx_tasks_list_id");
|
||||
|
||||
b.HasIndex("Number")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("idx_tasks_number");
|
||||
|
||||
b.HasIndex("ParentTaskId")
|
||||
.HasDatabaseName("idx_tasks_parent_task_id");
|
||||
|
||||
b.HasIndex("Status")
|
||||
.HasDatabaseName("idx_tasks_status");
|
||||
|
||||
b.HasIndex("ListId", "SortOrder")
|
||||
.HasDatabaseName("idx_tasks_list_sort");
|
||||
|
||||
b.ToTable("tasks", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.TaskRunEntity", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<int?>("CacheReadTokens")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("cache_read_tokens");
|
||||
|
||||
b.Property<int?>("CacheWriteTokens")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("cache_write_tokens");
|
||||
|
||||
b.Property<string>("ErrorMarkdown")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("error_markdown");
|
||||
|
||||
b.Property<string>("Errors")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("errors");
|
||||
|
||||
b.Property<int?>("ExitCode")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("exit_code");
|
||||
|
||||
b.Property<DateTime?>("FinishedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("finished_at");
|
||||
|
||||
b.Property<bool>("IsRetry")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("is_retry");
|
||||
|
||||
b.Property<string>("LogPath")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("log_path");
|
||||
|
||||
b.Property<string>("Model")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("model");
|
||||
|
||||
b.Property<string>("Prompt")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("prompt");
|
||||
|
||||
b.Property<string>("ResultMarkdown")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("result_markdown");
|
||||
|
||||
b.Property<string>("ResultSubtype")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("result_subtype");
|
||||
|
||||
b.Property<int>("RunNumber")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("run_number");
|
||||
|
||||
b.Property<string>("SessionId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("session_id");
|
||||
|
||||
b.Property<DateTime?>("StartedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("started_at");
|
||||
|
||||
b.Property<string>("StructuredOutputJson")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("structured_output");
|
||||
|
||||
b.Property<string>("TaskId")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("task_id");
|
||||
|
||||
b.Property<string>("TerminalReason")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("terminal_reason");
|
||||
|
||||
b.Property<int?>("TokensIn")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("tokens_in");
|
||||
|
||||
b.Property<int?>("TokensOut")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("tokens_out");
|
||||
|
||||
b.Property<int?>("TurnCount")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("turn_count");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("TaskId")
|
||||
.HasDatabaseName("idx_task_runs_task_id");
|
||||
|
||||
b.ToTable("task_runs", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.WeekReportEntity", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<DateOnly>("EndDate")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("end_date");
|
||||
|
||||
b.Property<DateTime>("GeneratedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("generated_at");
|
||||
|
||||
b.Property<string>("Markdown")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("markdown");
|
||||
|
||||
b.Property<DateOnly>("StartDate")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("start_date");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("StartDate", "EndDate")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("week_reports", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.WorktreeEntity", b =>
|
||||
{
|
||||
b.Property<string>("TaskId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("task_id");
|
||||
|
||||
b.Property<string>("BaseCommit")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("base_commit");
|
||||
|
||||
b.Property<string>("BranchName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("branch_name");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<string>("DiffStat")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("diff_stat");
|
||||
|
||||
b.Property<string>("HeadCommit")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("head_commit");
|
||||
|
||||
b.Property<string>("MergeCommit")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("merge_commit");
|
||||
|
||||
b.Property<string>("Path")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("path");
|
||||
|
||||
b.Property<string>("State")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("active")
|
||||
.HasColumnName("state");
|
||||
|
||||
b.HasKey("TaskId");
|
||||
|
||||
b.ToTable("worktrees", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.ListConfigEntity", b =>
|
||||
{
|
||||
b.HasOne("ClaudeDo.Data.Models.ListEntity", "List")
|
||||
.WithOne("Config")
|
||||
.HasForeignKey("ClaudeDo.Data.Models.ListConfigEntity", "ListId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("List");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.SubtaskEntity", b =>
|
||||
{
|
||||
b.HasOne("ClaudeDo.Data.Models.TaskEntity", "Task")
|
||||
.WithMany("Subtasks")
|
||||
.HasForeignKey("TaskId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Task");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.TaskAttachmentEntity", b =>
|
||||
{
|
||||
b.HasOne("ClaudeDo.Data.Models.TaskEntity", "Task")
|
||||
.WithMany()
|
||||
.HasForeignKey("TaskId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Task");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.TaskEntity", b =>
|
||||
{
|
||||
b.HasOne("ClaudeDo.Data.Models.TaskEntity", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("BlockedByTaskId")
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
|
||||
b.HasOne("ClaudeDo.Data.Models.TaskEntity", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("DependsOnTaskId")
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
|
||||
b.HasOne("ClaudeDo.Data.Models.ListEntity", "List")
|
||||
.WithMany("Tasks")
|
||||
.HasForeignKey("ListId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("ClaudeDo.Data.Models.TaskEntity", "Parent")
|
||||
.WithMany("Children")
|
||||
.HasForeignKey("ParentTaskId")
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
b.Navigation("List");
|
||||
|
||||
b.Navigation("Parent");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.TaskRunEntity", b =>
|
||||
{
|
||||
b.HasOne("ClaudeDo.Data.Models.TaskEntity", "Task")
|
||||
.WithMany("Runs")
|
||||
.HasForeignKey("TaskId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Task");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.WorktreeEntity", b =>
|
||||
{
|
||||
b.HasOne("ClaudeDo.Data.Models.TaskEntity", "Task")
|
||||
.WithOne("Worktree")
|
||||
.HasForeignKey("ClaudeDo.Data.Models.WorktreeEntity", "TaskId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Task");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.ListEntity", b =>
|
||||
{
|
||||
b.Navigation("Config");
|
||||
|
||||
b.Navigation("Tasks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.TaskEntity", b =>
|
||||
{
|
||||
b.Navigation("Children");
|
||||
|
||||
b.Navigation("Runs");
|
||||
|
||||
b.Navigation("Subtasks");
|
||||
|
||||
b.Navigation("Worktree");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ClaudeDo.Data.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddExpectsNoDiff : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "expects_no_diff",
|
||||
table: "tasks",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "expects_no_diff",
|
||||
table: "tasks");
|
||||
}
|
||||
}
|
||||
}
|
||||
+1011
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,104 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ClaudeDo.Data.Migrations
|
||||
{
|
||||
/// <summary>
|
||||
/// Turns the single <c>tasks.depends_on_task_id</c> column into a set: one row per declared
|
||||
/// "run after" edge in <c>task_dependencies</c>. Hand-edited after scaffolding so the data copy
|
||||
/// sits between CreateTable and DropColumn — the scaffolded order dropped the column first and
|
||||
/// would have discarded every existing link.
|
||||
/// </summary>
|
||||
public partial class AddTaskDependencies : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "task_dependencies",
|
||||
columns: table => new
|
||||
{
|
||||
task_id = table.Column<string>(type: "TEXT", nullable: false),
|
||||
depends_on_task_id = table.Column<string>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_task_dependencies", x => new { x.task_id, x.depends_on_task_id });
|
||||
table.ForeignKey(
|
||||
name: "FK_task_dependencies_tasks_depends_on_task_id",
|
||||
column: x => x.depends_on_task_id,
|
||||
principalTable: "tasks",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_task_dependencies_tasks_task_id",
|
||||
column: x => x.task_id,
|
||||
principalTable: "tasks",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "idx_task_dependencies_depends_on",
|
||||
table: "task_dependencies",
|
||||
column: "depends_on_task_id");
|
||||
|
||||
// Every existing link becomes a one-element set. The old FK was ON DELETE SET NULL, so
|
||||
// a surviving value always points at an existing task and can't violate the new FK.
|
||||
migrationBuilder.Sql("""
|
||||
INSERT INTO task_dependencies (task_id, depends_on_task_id)
|
||||
SELECT id, depends_on_task_id FROM tasks WHERE depends_on_task_id IS NOT NULL
|
||||
""");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_tasks_tasks_depends_on_task_id",
|
||||
table: "tasks");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "idx_tasks_depends_on",
|
||||
table: "tasks");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "depends_on_task_id",
|
||||
table: "tasks");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "depends_on_task_id",
|
||||
table: "tasks",
|
||||
type: "TEXT",
|
||||
nullable: true);
|
||||
|
||||
// Inherently lossy: a task with several predecessors keeps only one. There is no
|
||||
// single-column shape that could hold the rest.
|
||||
migrationBuilder.Sql("""
|
||||
UPDATE tasks SET depends_on_task_id = (
|
||||
SELECT td.depends_on_task_id FROM task_dependencies td
|
||||
WHERE td.task_id = tasks.id
|
||||
ORDER BY td.depends_on_task_id
|
||||
LIMIT 1
|
||||
)
|
||||
""");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "task_dependencies");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "idx_tasks_depends_on",
|
||||
table: "tasks",
|
||||
column: "depends_on_task_id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_tasks_tasks_depends_on_task_id",
|
||||
table: "tasks",
|
||||
column: "depends_on_task_id",
|
||||
principalTable: "tasks",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.SetNull);
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,58 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ClaudeDo.Data.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddPowerUse : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "power_use_allowed",
|
||||
table: "list_config",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "list_handler_max_handoffs",
|
||||
table: "app_settings",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 4);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "power_use_enabled",
|
||||
table: "app_settings",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "app_settings",
|
||||
keyColumn: "id",
|
||||
keyValue: 1,
|
||||
column: "list_handler_max_handoffs",
|
||||
value: 4);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "power_use_allowed",
|
||||
table: "list_config");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "list_handler_max_handoffs",
|
||||
table: "app_settings");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "power_use_enabled",
|
||||
table: "app_settings");
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,56 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ClaudeDo.Data.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddPowerUseWindow : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "power_use_handoff_pct",
|
||||
table: "app_settings",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 95);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "power_use_window_end",
|
||||
table: "app_settings",
|
||||
type: "TEXT",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "power_use_window_start",
|
||||
table: "app_settings",
|
||||
type: "TEXT",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "app_settings",
|
||||
keyColumn: "id",
|
||||
keyValue: 1,
|
||||
columns: new[] { "power_use_handoff_pct", "power_use_window_end", "power_use_window_start" },
|
||||
values: new object[] { 95, null, null });
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "power_use_handoff_pct",
|
||||
table: "app_settings");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "power_use_window_end",
|
||||
table: "app_settings");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "power_use_window_start",
|
||||
table: "app_settings");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -66,6 +66,12 @@ namespace ClaudeDo.Data.Migrations
|
||||
.HasDefaultValue("bypassPermissions")
|
||||
.HasColumnName("default_permission_mode");
|
||||
|
||||
b.Property<int>("ListHandlerMaxHandoffs")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(4)
|
||||
.HasColumnName("list_handler_max_handoffs");
|
||||
|
||||
b.Property<int>("MaxParallelExecutions")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
@@ -88,6 +94,26 @@ namespace ClaudeDo.Data.Migrations
|
||||
.HasDefaultValue(1)
|
||||
.HasColumnName("next_task_number");
|
||||
|
||||
b.Property<bool>("PowerUseEnabled")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("power_use_enabled");
|
||||
|
||||
b.Property<int>("PowerUseHandoffPct")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(95)
|
||||
.HasColumnName("power_use_handoff_pct");
|
||||
|
||||
b.Property<string>("PowerUseWindowEnd")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("power_use_window_end");
|
||||
|
||||
b.Property<string>("PowerUseWindowStart")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("power_use_window_start");
|
||||
|
||||
b.Property<string>("RepoImportFolders")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("repo_import_folders");
|
||||
@@ -175,9 +201,12 @@ namespace ClaudeDo.Data.Migrations
|
||||
DefaultMaxTurns = 40,
|
||||
DefaultModel = "sonnet",
|
||||
DefaultPermissionMode = "auto",
|
||||
ListHandlerMaxHandoffs = 4,
|
||||
MaxParallelExecutions = 1,
|
||||
MaxTurnsCeiling = 80,
|
||||
NextTaskNumber = 1,
|
||||
PowerUseEnabled = false,
|
||||
PowerUseHandoffPct = 95,
|
||||
StandupWeekday = 3,
|
||||
UsageGateFiveHourPct = 80,
|
||||
UsageGateSevenDayPct = 90,
|
||||
@@ -205,6 +234,10 @@ namespace ClaudeDo.Data.Migrations
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("note_date");
|
||||
|
||||
b.Property<bool>("FromAgent")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("from_agent");
|
||||
|
||||
b.Property<int>("SortOrder")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("sort_order");
|
||||
@@ -243,6 +276,10 @@ namespace ClaudeDo.Data.Migrations
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("permission_mode");
|
||||
|
||||
b.Property<bool>("PowerUseAllowed")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("power_use_allowed");
|
||||
|
||||
b.Property<string>("SessionSkills")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("session_skills");
|
||||
@@ -471,6 +508,24 @@ namespace ClaudeDo.Data.Migrations
|
||||
b.ToTable("task_attachments", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.TaskDependencyEntity", b =>
|
||||
{
|
||||
b.Property<string>("TaskId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("task_id");
|
||||
|
||||
b.Property<string>("DependsOnTaskId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("depends_on_task_id");
|
||||
|
||||
b.HasKey("TaskId", "DependsOnTaskId");
|
||||
|
||||
b.HasIndex("DependsOnTaskId")
|
||||
.HasDatabaseName("idx_task_dependencies_depends_on");
|
||||
|
||||
b.ToTable("task_dependencies", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.TaskEntity", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
@@ -500,14 +555,16 @@ namespace ClaudeDo.Data.Migrations
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_by");
|
||||
|
||||
b.Property<string>("DependsOnTaskId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("depends_on_task_id");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("description");
|
||||
|
||||
b.Property<bool>("ExpectsNoDiff")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("expects_no_diff");
|
||||
|
||||
b.Property<int?>("FailureMaxTurns")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("failure_max_turns");
|
||||
@@ -665,9 +722,6 @@ namespace ClaudeDo.Data.Migrations
|
||||
b.HasIndex("BlockedByTaskId")
|
||||
.HasDatabaseName("idx_tasks_blocked_by");
|
||||
|
||||
b.HasIndex("DependsOnTaskId")
|
||||
.HasDatabaseName("idx_tasks_depends_on");
|
||||
|
||||
b.HasIndex("ListId")
|
||||
.HasDatabaseName("idx_tasks_list_id");
|
||||
|
||||
@@ -902,6 +956,21 @@ namespace ClaudeDo.Data.Migrations
|
||||
b.Navigation("Task");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.TaskDependencyEntity", b =>
|
||||
{
|
||||
b.HasOne("ClaudeDo.Data.Models.TaskEntity", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("DependsOnTaskId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("ClaudeDo.Data.Models.TaskEntity", null)
|
||||
.WithMany("Dependencies")
|
||||
.HasForeignKey("TaskId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.TaskEntity", b =>
|
||||
{
|
||||
b.HasOne("ClaudeDo.Data.Models.TaskEntity", null)
|
||||
@@ -909,11 +978,6 @@ namespace ClaudeDo.Data.Migrations
|
||||
.HasForeignKey("BlockedByTaskId")
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
|
||||
b.HasOne("ClaudeDo.Data.Models.TaskEntity", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("DependsOnTaskId")
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
|
||||
b.HasOne("ClaudeDo.Data.Models.ListEntity", "List")
|
||||
.WithMany("Tasks")
|
||||
.HasForeignKey("ListId")
|
||||
@@ -963,6 +1027,8 @@ namespace ClaudeDo.Data.Migrations
|
||||
{
|
||||
b.Navigation("Children");
|
||||
|
||||
b.Navigation("Dependencies");
|
||||
|
||||
b.Navigation("Runs");
|
||||
|
||||
b.Navigation("Subtasks");
|
||||
|
||||
@@ -60,4 +60,27 @@ public sealed class AppSettingsEntity
|
||||
// automatic ContinueTask once the 5h window resets, and the gate-blocked queue wakes exactly
|
||||
// at that reset time instead of only on the 30s backstop.
|
||||
public bool AutoContinueOnUsageLimit { get; set; }
|
||||
|
||||
// Master switch for PowerUse: list-handler runs go unattended (never ask the user) and harvest
|
||||
// new work when a round would otherwise starve. Toggled in Settings → Execution. Off by default,
|
||||
// and on its own it changes nothing — a run is only in PowerUse when the LIST also opted in via
|
||||
// ListConfigEntity.PowerUseAllowed, so leaving this on cannot make an unrelated list's handler
|
||||
// run unattended. Composition lives in InteractiveLaunchSpecService.
|
||||
public bool PowerUseEnabled { get; set; }
|
||||
|
||||
// Optional local-time window (both `HH:mm`) narrowing when PowerUse applies, checked per phase
|
||||
// at prompt-build time. Both null (the default) = round the clock, byte-identical to the
|
||||
// pre-window behaviour; only one set counts as unset too. End before start wraps over midnight.
|
||||
// Semantics live in PowerUseWindow.
|
||||
public string? PowerUseWindowStart { get; set; }
|
||||
public string? PowerUseWindowEnd { get; set; }
|
||||
|
||||
// Percentage of the 5h usage window at which a PowerUse handler session is told to hand off
|
||||
// rather than start more work. Stored and displayed here; the consumer is the handoff prompt.
|
||||
public int PowerUseHandoffPct { get; set; } = 95;
|
||||
|
||||
// Server-side cap on a list-handler run's wait<->merge handoff chain (HandoffRoundTracker).
|
||||
// 4 = two full wait/merge cycles, the long-standing default. Raise it for a run meant to keep
|
||||
// going for hours. It exists to bound runaway handoff loops, so it must stay >= 1.
|
||||
public int ListHandlerMaxHandoffs { get; set; } = 4;
|
||||
}
|
||||
|
||||
@@ -6,5 +6,9 @@ public sealed class DailyNoteEntity
|
||||
public DateOnly Date { get; set; }
|
||||
public string Text { get; set; } = string.Empty;
|
||||
public int SortOrder { get; set; }
|
||||
|
||||
/// <summary>True when an agent wrote this note through the MCP tool rather than the user.
|
||||
/// Drives the UI marker and the per-day cap in <c>NotesMcpTools</c>.</summary>
|
||||
public bool FromAgent { get; set; }
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
@@ -17,6 +17,12 @@ public sealed class ListConfigEntity
|
||||
// Feld mitführen, sonst setzt es sich still zurück.
|
||||
public int? TicketProjectId { get; set; }
|
||||
|
||||
// Per-Liste-Opt-in für PowerUse. Ein Handler-Run läuft nur unattended, wenn BEIDES gesetzt ist:
|
||||
// dieses Flag und AppSettingsEntity.PowerUseEnabled. Der globale Toggle bleibt damit gefahrlos
|
||||
// an — eine Liste, die hier nicht zugestimmt hat, behält das interaktive Verhalten. Default
|
||||
// false, also opt-in. ⚠️ Gleiche Falle wie TicketProjectId: SetConfigAsync kopiert verbatim.
|
||||
public bool PowerUseAllowed { get; set; }
|
||||
|
||||
// Navigation property
|
||||
public ListEntity List { get; set; } = null!;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
namespace ClaudeDo.Data.Models;
|
||||
|
||||
/// <summary>
|
||||
/// The optional local-time window restricting when PowerUse applies
|
||||
/// (<see cref="AppSettingsEntity.PowerUseWindowStart"/> / <c>End</c>, both <c>HH:mm</c>).
|
||||
/// Pure on purpose — the caller supplies "now", so the window logic is testable without a clock.
|
||||
/// </summary>
|
||||
public static class PowerUseWindow
|
||||
{
|
||||
/// <summary>Parses an <c>HH:mm</c> string; anything else (including null/blank) is null.</summary>
|
||||
public static TimeOnly? Parse(string? value)
|
||||
=> TimeOnly.TryParseExact(value?.Trim(), "HH:mm", out var t) ? t : null;
|
||||
|
||||
/// <summary>Round-trips a stored/typed value through <see cref="Parse"/>, so an unparseable
|
||||
/// string is stored as null instead of sitting in the column pretending to be a window.</summary>
|
||||
public static string? Normalize(string? value) => Parse(value)?.ToString("HH:mm");
|
||||
|
||||
/// <summary>
|
||||
/// True when <paramref name="now"/> falls inside the window. Half-open: start is included,
|
||||
/// end is not. Either bound missing = no window at all = always true (the pre-window
|
||||
/// behaviour). A window whose end is before its start wraps over midnight.
|
||||
/// </summary>
|
||||
public static bool Contains(TimeOnly now, TimeOnly? start, TimeOnly? end)
|
||||
{
|
||||
if (start is not { } from || end is not { } to) return true;
|
||||
return from < to ? now >= from && now < to : now >= from || now < to;
|
||||
}
|
||||
|
||||
/// <summary>Convenience overload for the two stored strings and a wall clock.</summary>
|
||||
public static bool IsOpen(DateTime now, string? start, string? end)
|
||||
=> Contains(TimeOnly.FromDateTime(now), Parse(start), Parse(end));
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace ClaudeDo.Data.Models;
|
||||
|
||||
/// <summary>
|
||||
/// One declared "task must run after task" edge. A task can carry n of them; the queue picker
|
||||
/// claims it only once every predecessor reached <see cref="TaskStatus.Done"/>.
|
||||
/// Deliberately separate from <see cref="TaskEntity.BlockedByTaskId"/>, the planning chain's own
|
||||
/// internal single link — see ClaudeDo.Worker/CLAUDE.md → Status Model.
|
||||
/// </summary>
|
||||
public sealed class TaskDependencyEntity
|
||||
{
|
||||
public required string TaskId { get; init; }
|
||||
public required string DependsOnTaskId { get; init; }
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace ClaudeDo.Data.Models;
|
||||
|
||||
public enum TaskStatus
|
||||
@@ -33,12 +35,17 @@ public sealed class TaskEntity
|
||||
public PlanningPhase PlanningPhase { get; set; } = PlanningPhase.None;
|
||||
public string? BlockedByTaskId { get; set; }
|
||||
|
||||
// A user/MCP-declared predecessor, distinct from BlockedByTaskId (the planning chain's own
|
||||
// internal link): the picker also skips a Queued task while this is set and the referenced
|
||||
// task's Status isn't Done. Unlike the chain, a Failed/Cancelled dependency does NOT cascade
|
||||
// or auto-resolve -- the dependent just stays blocked and reports why (see TaskStateService.
|
||||
// SetDependsOnAsync and QueuePicker).
|
||||
public string? DependsOnTaskId { get; set; }
|
||||
// User/MCP-declared predecessors, distinct from BlockedByTaskId (the planning chain's own
|
||||
// internal link): the picker skips a Queued task until EVERY predecessor reached Done.
|
||||
// Unlike the chain, a Failed/Cancelled dependency does NOT cascade or auto-resolve -- the
|
||||
// dependent just stays blocked and reports why (see TaskStateService.SetDependsOnAsync and
|
||||
// QueuePicker). Only loaded where a read path Includes it; the picker gates in raw SQL and
|
||||
// never relies on this collection.
|
||||
public ICollection<TaskDependencyEntity> Dependencies { get; set; } = new List<TaskDependencyEntity>();
|
||||
|
||||
[NotMapped]
|
||||
public IReadOnlyList<string> DependsOnTaskIds =>
|
||||
Dependencies.Select(d => d.DependsOnTaskId).ToList();
|
||||
public DateTime? ScheduledFor { get; set; }
|
||||
public string? Result { get; set; }
|
||||
public string? ReviewFeedback { get; set; }
|
||||
@@ -71,6 +78,10 @@ public sealed class TaskEntity
|
||||
// list handler) and the Claude affordances are hidden; a hand-driven ConPTY session is still
|
||||
// allowed. New tasks in a manual list default to true.
|
||||
public bool IsManual { get; set; }
|
||||
// Set on verification/audit/research tasks whose correct outcome is an empty diff (e.g. "build
|
||||
// and test, don't change code"). Lets the merge-helper session tell that apart from a task that
|
||||
// silently failed to commit -- both look identical to preview_merge_set otherwise.
|
||||
public bool ExpectsNoDiff { get; set; }
|
||||
public string? Notes { get; set; }
|
||||
public int SortOrder { get; set; }
|
||||
public string? SessionSkills { get; set; }
|
||||
|
||||
@@ -5,7 +5,7 @@ using System.Text.RegularExpressions;
|
||||
|
||||
namespace ClaudeDo.Data;
|
||||
|
||||
public enum PromptKind { System, Planning, PlanningInitial, Retry, DailyPrep, WeeklyReport, ImprovementChild, Refine, MergeHelperTriage, MergeHelperWait, MergeHelperMerge, MergeHelperInitial, MergeHelperHandoff }
|
||||
public enum PromptKind { System, Planning, PlanningInitial, Retry, DailyPrep, WeeklyReport, ImprovementChild, Refine, MergeHelperTriage, MergeHelperWait, MergeHelperMerge, MergeHelperInitial, MergeHelperHandoff, PowerUseAddendum }
|
||||
|
||||
/// <summary>
|
||||
/// How a prompt kind's on-disk override (if any) relates to the bundled default.
|
||||
@@ -44,6 +44,7 @@ public static class PromptFiles
|
||||
PromptKind.MergeHelperMerge => "merge-helper-merge.md",
|
||||
PromptKind.MergeHelperInitial => "merge-helper-initial.md",
|
||||
PromptKind.MergeHelperHandoff => "merge-helper-handoff.md",
|
||||
PromptKind.PowerUseAddendum => "power-use.md",
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(kind))
|
||||
};
|
||||
|
||||
@@ -221,6 +222,7 @@ public static class PromptFiles
|
||||
PromptKind.MergeHelperMerge => MergeHelperMergeDefault,
|
||||
PromptKind.MergeHelperInitial => MergeHelperInitialDefault,
|
||||
PromptKind.MergeHelperHandoff => MergeHelperHandoffDefault,
|
||||
PromptKind.PowerUseAddendum => PowerUseAddendumDefault,
|
||||
_ => ""
|
||||
};
|
||||
|
||||
@@ -448,6 +450,15 @@ public static class PromptFiles
|
||||
|
||||
Cancel nothing without an explicit answer.
|
||||
|
||||
## Phase 1.5 — Audit dependencies
|
||||
For every surviving task that carries a dependsOnTaskId, decide whether the link is real or artificial before you hand off. Real: task B genuinely needs something task A produces — a symbol/type B's code references, a changed signature, a migration that must land before repository code assumes it. Artificial: the tasks just got numbered in sequence by the plan but touch disjoint files for unrelated reasons. Task descriptions usually name their target files explicitly — use that to check for real file/symbol overlap instead of trusting the order.
|
||||
|
||||
Resolve every artificial link with update_task(taskId, dependsOnTaskId="") — a chain numbered 1→2→3→... is the default shape to suspect, not the default shape to trust.
|
||||
|
||||
Group what's left into waves: batches that can run in parallel, where a later wave depends only on tasks in an earlier one. Report this as a wave plan (e.g. "[3] → [4,5,6] → [7]"), not a flat list — the Wait/Merge sessions after you need the batching, not just which ids survived.
|
||||
|
||||
Then check the wave count against the handoff cap. This list-handler chain allows a limited number of handoffs (wait, merge, wait_final, merge_final) — by default 4, i.e. exactly two merge rounds, but it is configurable and may be higher for this run. Assume two rounds unless the kickoff tells you otherwise. If your wave plan needs more rounds than that to clear, say so explicitly when you hand off — name which waves won't fit — so the Merge session ends by telling the user "the rest needs manual approval in the UI" instead of silently stranding mid-chain.
|
||||
|
||||
## Phase 2 — Enhance for execution
|
||||
Before touching any task, check the list's verify command ONCE for this whole run (not per task): call get_list_config. If verifyCommand is already set, leave it alone — never overwrite an existing one — and move straight to sharpening tasks below.
|
||||
|
||||
@@ -471,7 +482,7 @@ public static class PromptFiles
|
||||
Once every surviving task is enhanced, print your triage summary — one line per task from the brief:
|
||||
title — dedupe action (kept / merged into X / cancelled as duplicate of X) — enhanced (yes/no).
|
||||
|
||||
Then call handoff_list_handler(taskId, survivingTaskIds, nextPhase: "wait"). That opens a fresh session to carry out the wait/merge phases with just that list, without dragging along this session's dedupe/rewrite context. Say a short goodbye line, then stop — do not continue into phase 3 yourself.
|
||||
Then print the wave plan from Phase 1.5, including any "won't fit in two rounds" note, and call handoff_list_handler(taskId, survivingTaskIds, nextPhase: "wait"). That opens a fresh session to carry out the wait/merge phases with just that list, without dragging along this session's dedupe/rewrite context. Say a short goodbye line, then stop — do not continue into phase 3 yourself.
|
||||
""";
|
||||
|
||||
private const string MergeHelperWaitDefault = """
|
||||
@@ -505,8 +516,8 @@ public static class PromptFiles
|
||||
|
||||
One task at a time. Default to the order the brief lists them. If the overlap check shows two or more tasks touching the same file, tell the user which tasks collide and merge those in an order you can justify (e.g. the one making the smaller change first) — deviate from brief order only with that stated reason.
|
||||
|
||||
1. Never read a task's diff yourself. Instead start a sonnet subagent (Task tool) per task to inspect get_task_diff and sanity-check it against the task's title and description; only its short verdict (clean / risky + reason) comes back into your own context. If preview_merge_set flagged this task in an overlap, tell the subagent to also skim the diff of the other task(s) sharing that file.
|
||||
2. Before approving, cross-check changedFileCount from preview_merge_set (or the length of get_task_diff's files list — the diff tool has no changedFileCount field). 0 changed files means an empty branch, not a clean success — do not approve it; treat it like a risky diff instead.
|
||||
1. Check this task's changedFileCount from preview_merge_set first. Below 5 changed files, read get_task_diff yourself and sanity-check it against the task's title and description — a subagent hop is wasted context for a diff that small. At 5 or more, delegate instead: start a sonnet subagent (Task tool) to inspect get_task_diff and sanity-check it, so only its short verdict (clean / risky + reason) comes back into your own context — the whole point of never reading a large diff yourself. If preview_merge_set flagged this task in an overlap, also skim (or have the subagent skim) the diff of the other task(s) sharing that file.
|
||||
2. Before approving, cross-check changedFileCount from preview_merge_set (or the length of get_task_diff's files list — the diff tool has no changedFileCount field). 0 changed files means an empty branch, not a clean success — do not approve it; treat it like a risky diff instead. Exception: if preview_merge_set's expectsNoDiff is true for this task (a verification/audit/research task deliberately expected to change nothing), 0 changed files is the correct outcome — read the task's Result to confirm it reports what was checked and that it passed, then approve normally.
|
||||
3. If the subagent's verdict is risky, or the change looks wrong or incomplete, STOP and ask the user before merging — offer reject_rerun (with feedback) or skip.
|
||||
4. Otherwise merge with review_task(taskId, decision="approve", leaveConflictsInTree=true, skipVerify=true). skipVerify defers the list's verify command to ONE verify_merges call after the last merge (below) instead of paying it per merge.
|
||||
- Clean merge → mergeStatus "merged_verify_pending" (expected: the task deliberately stays WaitingForReview until verify_merges passes) or "merged" (list has no verify command; the task is Done). Either way, move on.
|
||||
@@ -539,6 +550,30 @@ public static class PromptFiles
|
||||
|
||||
Allow at most ONE rerun per task in this session.
|
||||
|
||||
## Keep watching the queue
|
||||
|
||||
Do not assume the tasks you were handed are the only ones that matter. A prior Wait session
|
||||
can already have finished before every one of its tasks actually reached a terminal status,
|
||||
or new tasks can still be running when you start — merging only what happened to be ready the
|
||||
moment you looked in and then stopping is how work silently falls through the cracks.
|
||||
|
||||
Before you go to Handoff / end, call get_queue_state and check whether any task id from your
|
||||
brief still shows up in activeSlots or waitingTaskIds. If none do, your list is clear — go to
|
||||
Handoff / end now.
|
||||
|
||||
If some do, call wait_for_task_change with exactly those still-busy task ids,
|
||||
timeoutSeconds=900, treatWaitingForChildrenAsBusy=true. When it reports a change, go back to
|
||||
Phase 4 and merge/review whatever it now says is WaitingForReview, then repeat this check.
|
||||
|
||||
This is NOT a `sleep`-and-poll loop — never write your own retry/sleep loop around get_task or
|
||||
get_queue_state. wait_for_task_change already blocks server-side and reports progress so it
|
||||
survives your own client's idle-silence abort; that is the only waiting mechanism allowed here.
|
||||
|
||||
Hard cap: stop after at most THREE consecutive wait_for_task_change calls made this way (three
|
||||
900s timeouts ≈ 45 minutes total), even if tasks are still busy. When you stop — because the
|
||||
queue cleared or because you hit the cap — report whatever is still Queued/Running in the
|
||||
summary below and proceed to Handoff / end exactly as if this section didn't exist.
|
||||
|
||||
## Handoff / end
|
||||
|
||||
- If you started any reruns: call handoff_list_handler(taskId, <the rerun task ids>, nextPhase: "wait_final"), then stop your turn immediately — do not merge anything yet that you just restarted. Do NOT submit this run for review yet — the chain isn't finished.
|
||||
@@ -584,7 +619,81 @@ public static class PromptFiles
|
||||
|
||||
Start with phase 3 (run), continuing through review/merge and the summary as your
|
||||
instructions describe.
|
||||
{finalNote}
|
||||
{roundInfo}
|
||||
""";
|
||||
|
||||
// Appended to the triage/wait/merge system prompt when a run is in PowerUse (global switch AND
|
||||
// the list's own opt-in). Deliberately an addendum rather than a second set of prompts: the
|
||||
// shared 95% stays in one place, and a normal run's prompt is byte-identical to what it was.
|
||||
// It therefore has to read as an OVERRIDE of the rules above it, not as standalone instructions.
|
||||
private const string PowerUseAddendumDefault = """
|
||||
# PowerUse mode — these rules supersede the ones above
|
||||
|
||||
PowerUse is ON for this run. Everything above was written for a session with a user watching it. That assumption no longer holds, and where the two conflict, this section wins.
|
||||
|
||||
## No user exists
|
||||
|
||||
Nobody is watching and nobody can answer a question. Every instruction above that says to ask the user, confirm with the user, or stop and let the user decide is replaced by: decide it yourself, act, and record the decision in your summary. A question asked here is a hung session and a wasted run.
|
||||
|
||||
This does not lower the bar for what you may do — it removes escalation as an option, so the decisions you make must be ones you can defend in writing afterwards. Where a rule above offered "ask the user" as the safe path, the safe path is now the conservative action plus a written record, never the bold one.
|
||||
|
||||
Specifically:
|
||||
- **Duplicate pairs (Triage Phase 1):** decide them. Clear duplicate — same goal, or one fully contained in the other — fold the loser's unique content into the survivor and cancel the loser. Genuinely different intent that merely touches the same area — keep both and chain them with dependsOnTaskId so they cannot run against the same files at once.
|
||||
- **A task too vague to sharpen (Triage Phase 2):** cancel it with a recorded reason rather than guessing a specification for someone else's half-sentence. Guessing burns a whole slot on work nobody asked for.
|
||||
- **Wave plan vs. handoff cap (Triage Phase 1.5):** do not assume two rounds, and never trim the wave plan to fit a cap or defer waves to "manual approval in the UI" — nobody will be there. Call get_handoff_status with your own handler task id to read this run's real cap, then plan the waves the work actually needs and hand off the first one.
|
||||
- **A task that bundles several independent features (Triage Phase 2):** split it yourself — create the pieces, chain them with dependsOnTaskId where one builds on another, cancel or narrow the original, and record what you did.
|
||||
- **Verify command not set (Triage Phase 2):** determine it, run it once via Bash to prove it works, then set it. Never write a command you have not actually run.
|
||||
- **A risky or wrong-looking diff (Merge Phase 4):** if it contradicts the task's own acceptance criteria, call review_task(taskId, decision="reject_rerun", feedback=...) with concrete feedback naming what was missing. If it merely looks unusual but meets the criteria, merge it and say why. If it looks actively destructive — deletes code no task asked to delete, drops a migration, rewrites unrelated files — leave it unmerged and record it as HELD FOR REVIEW. Never merge something you would describe as destructive.
|
||||
- **A conflict you cannot resolve with confidence (Merge Phase 4):** call abort_merge(taskId) and record it as HELD FOR REVIEW. Aborting is always correct over guessing: the task keeps its status, and a rerun against the new main usually removes the conflict entirely.
|
||||
|
||||
## Conflicts are the normal case
|
||||
|
||||
Never end your turn with a conflicted merge left in the working tree. A half-merged tree makes the repo unbuildable for every session and every task after you, and any verify that runs against it reports a false red.
|
||||
|
||||
Prefer get_merge_conflicts + resolve_conflict_hunk over reading marker text by hand — for a large conflict that is the only tractable route; a 200k-character marker dump is not something to read linearly.
|
||||
|
||||
The common collision shape in a parallel run is one task MOVING code out of a file while another task ADDS to it. The resolution is almost always to keep the move and re-apply the addition in the file the code moved to — not to pick a side. Picking "ours" silently deletes the other task's work.
|
||||
|
||||
When ordering merges that overlap on a file, merge the task that moves or deletes code BEFORE the task that only adds to it. A move landing second turns every addition into a conflict.
|
||||
|
||||
## Rerun budget
|
||||
|
||||
At most TWO reruns per task across the whole run, replacing the single-rerun limit above. A task that has already been rerun twice is recorded as HELD FOR REVIEW instead of getting a third attempt — three failures on the same task is a specification problem, not bad luck, and further attempts starve the rest of the run.
|
||||
|
||||
## Harvest — so the run does not starve
|
||||
|
||||
This applies to the Merge phase only, after its merges and reruns are done.
|
||||
|
||||
If you have fewer than five tasks to hand to the next round, harvest new work for this list's repo before handing off. Only for the list named in the brief — never another list or repo.
|
||||
|
||||
Sources, in this order; prefer one you have not exhausted yet:
|
||||
1. **Verify/build output** — real compiler warnings. One task per warning group.
|
||||
2. **`ponytail:` comments** — deliberate shortcuts with a named ceiling and upgrade path. Take the ones whose upgrade is small.
|
||||
3. **TODO / HACK / FIXME** — only the concretely formulated ones.
|
||||
4. **Unfinished plan slices** — `docs/superpowers/plans/*.md` whose last slices never landed. Check against `git log` before believing a slice is open. One task per slice, naming the plan path and slice number.
|
||||
5. **Test gaps at bug hotspots** — `git log --grep="^fix"` over recent commits; files with repeated fixes and no test.
|
||||
6. **Over-engineering** — the ponytail-audit skill against individual subfolders, never the whole repo at once. Deletion candidates.
|
||||
7. **Feature work** — improvements that follow clearly from what the code already does and from the plans and specs under `docs/`. Ground each one in something you actually read; a feature you cannot point at a file for is a guess, not a proposal.
|
||||
|
||||
Rules for every harvested task, without exception:
|
||||
- Write it the way the Triage phase would: concrete acceptance criteria, real file paths found with Read/Grep/Glob, and what is out of scope. A vague harvested task wastes a whole slot.
|
||||
- Keep it narrow — one concern, ideally under five changed files. Narrow tasks merge in parallel; broad ones collide with everything.
|
||||
- Do not hand two new tasks to the same round if they touch the same file. Stagger them across rounds, or chain them with dependsOnTaskId.
|
||||
- Tag every harvested task `createdBy: "power-use"` so a later review can tell your proposals from the ones a human asked for.
|
||||
- A task that only verifies, audits or researches and is not meant to change code must be created with `expectsNoDiff: true`, or the next Merge session will read its empty diff as a failure.
|
||||
|
||||
## Verify red is the one thing you must not paper over
|
||||
|
||||
If verify_merges returns verify_failed, the target branch is now RED. Do not try to fix it inside this session. Create ONE task with add_task(queueImmediately: true, model: "sonnet") titled `fix: verify red after this round`, put the failing output tail in its description, and hand that task to the next round as its ONLY entry. Merge nothing further until it has landed.
|
||||
|
||||
## The summary is the only record
|
||||
|
||||
Nobody saw you work, so anything not written down did not happen. In addition to the per-task lines the Merge phase already asks for, your summary must carry these sections. An empty section is a valid answer; an omitted one is not:
|
||||
|
||||
- **HELD FOR REVIEW** — every task you did not merge, with the reason.
|
||||
- **Conflicts resolved** — per conflict: the file, which two tasks collided, and which way you resolved it. Someone must be able to find your resolution without re-deriving it.
|
||||
- **Harvested** — every task you created, grouped by source.
|
||||
- **Round state** — which round this was and what you handed to the next one.
|
||||
""";
|
||||
|
||||
private const string WeeklyReportDefault = """
|
||||
|
||||
@@ -93,6 +93,16 @@ public sealed class AppSettingsRepository
|
||||
row.UsageThrottleSevenDaySoftPct = Math.Clamp(updated.UsageThrottleSevenDaySoftPct, 0, 100);
|
||||
row.UsageThrottleSevenDayHardPct = Math.Clamp(updated.UsageThrottleSevenDayHardPct, 0, 100);
|
||||
row.AutoContinueOnUsageLimit = updated.AutoContinueOnUsageLimit;
|
||||
// ModelPresets / PowerUse* / ListHandlerMaxHandoffs were missing from this copy block, so
|
||||
// every write of them was silently dropped (the row keeps whatever it already had). This
|
||||
// block is the single write path for the singleton row — a field absent here does not
|
||||
// persist, no matter how correctly the hub fills the entity.
|
||||
row.ModelPresets = string.IsNullOrWhiteSpace(updated.ModelPresets) ? row.ModelPresets : updated.ModelPresets;
|
||||
row.PowerUseEnabled = updated.PowerUseEnabled;
|
||||
row.PowerUseWindowStart = PowerUseWindow.Normalize(updated.PowerUseWindowStart);
|
||||
row.PowerUseWindowEnd = PowerUseWindow.Normalize(updated.PowerUseWindowEnd);
|
||||
row.PowerUseHandoffPct = Math.Clamp(updated.PowerUseHandoffPct, 50, 99);
|
||||
row.ListHandlerMaxHandoffs = Math.Max(1, updated.ListHandlerMaxHandoffs);
|
||||
|
||||
await _context.SaveChangesAsync(ct);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,13 @@ public sealed class DailyNoteRepository
|
||||
.OrderBy(n => n.Date).ThenBy(n => n.SortOrder)
|
||||
.ToListAsync(ct);
|
||||
|
||||
public async Task<DailyNoteEntity> AddAsync(DateOnly day, string text, CancellationToken ct = default)
|
||||
/// <summary>Notes an agent wrote on <paramref name="day"/> — the number the MCP cap counts against.</summary>
|
||||
public async Task<int> CountAgentNotesAsync(DateOnly day, CancellationToken ct = default) =>
|
||||
await _context.DailyNotes.AsNoTracking()
|
||||
.CountAsync(n => n.Date == day && n.FromAgent, ct);
|
||||
|
||||
public async Task<DailyNoteEntity> AddAsync(
|
||||
DateOnly day, string text, bool fromAgent = false, CancellationToken ct = default)
|
||||
{
|
||||
var nextOrder = await _context.DailyNotes
|
||||
.Where(n => n.Date == day)
|
||||
@@ -34,6 +40,7 @@ public sealed class DailyNoteRepository
|
||||
Date = day,
|
||||
Text = text,
|
||||
SortOrder = nextOrder + 1,
|
||||
FromAgent = fromAgent,
|
||||
CreatedAt = DateTime.UtcNow,
|
||||
};
|
||||
_context.DailyNotes.Add(note);
|
||||
|
||||
@@ -90,6 +90,7 @@ public sealed class ListRepository
|
||||
existing.VerifyCommand = config.VerifyCommand;
|
||||
existing.PermissionMode = config.PermissionMode;
|
||||
existing.TicketProjectId = config.TicketProjectId;
|
||||
existing.PowerUseAllowed = config.PowerUseAllowed;
|
||||
}
|
||||
await _context.SaveChangesAsync(ct);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,10 @@ public sealed class TaskRepository
|
||||
var tracked = _context.Tasks.Local.FirstOrDefault(t => t.Id == entity.Id);
|
||||
if (tracked is not null && !ReferenceEquals(tracked, entity))
|
||||
_context.Entry(tracked).State = Microsoft.EntityFrameworkCore.EntityState.Detached;
|
||||
_context.Tasks.Update(entity);
|
||||
// Entry().State instead of Update(): Update marks the whole loaded graph Modified, which
|
||||
// for the all-key task_dependencies rows means an UPDATE with nothing to set. Dependency
|
||||
// edges are written only by TaskStateService.SetDependsOnAsync.
|
||||
_context.Entry(entity).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
|
||||
await _context.SaveChangesAsync(ct);
|
||||
}
|
||||
|
||||
@@ -46,17 +49,20 @@ public sealed class TaskRepository
|
||||
|
||||
public async Task<TaskEntity?> GetByIdAsync(string taskId, CancellationToken ct = default)
|
||||
{
|
||||
return await _context.Tasks.AsNoTracking().FirstOrDefaultAsync(t => t.Id == taskId, ct);
|
||||
return await _context.Tasks.AsNoTracking().Include(t => t.Dependencies)
|
||||
.FirstOrDefaultAsync(t => t.Id == taskId, ct);
|
||||
}
|
||||
|
||||
public async Task<TaskEntity?> GetByNumberAsync(int number, CancellationToken ct = default)
|
||||
{
|
||||
return await _context.Tasks.AsNoTracking().FirstOrDefaultAsync(t => t.Number == number, ct);
|
||||
return await _context.Tasks.AsNoTracking().Include(t => t.Dependencies)
|
||||
.FirstOrDefaultAsync(t => t.Number == number, ct);
|
||||
}
|
||||
|
||||
public async Task<List<TaskEntity>> GetByListIdAsync(string listId, CancellationToken ct = default)
|
||||
{
|
||||
return await _context.Tasks
|
||||
.Include(t => t.Dependencies)
|
||||
.Where(t => t.ListId == listId)
|
||||
.OrderBy(t => t.SortOrder).ThenBy(t => t.CreatedAt)
|
||||
.ToListAsync(ct);
|
||||
|
||||
@@ -13,8 +13,6 @@ namespace ClaudeDo.Data.Wire;
|
||||
|
||||
public record ActiveTaskDto(string Slot, string TaskId, DateTime StartedAt);
|
||||
|
||||
public record WorkerBuildInfoDto(string? BuildSha);
|
||||
|
||||
public record AppSettingsDto(
|
||||
string DefaultClaudeInstructions,
|
||||
string DefaultModel,
|
||||
@@ -38,7 +36,16 @@ public record AppSettingsDto(
|
||||
int UsageThrottleFiveHourHardPct = 65,
|
||||
int UsageThrottleSevenDaySoftPct = 50,
|
||||
int UsageThrottleSevenDayHardPct = 65,
|
||||
bool AutoContinueOnUsageLimit = false);
|
||||
bool AutoContinueOnUsageLimit = false,
|
||||
// PowerUse master switch — Settings → Execution. Only takes effect for a list that also set
|
||||
// PowerUseAllowed.
|
||||
bool PowerUseEnabled = false,
|
||||
int ListHandlerMaxHandoffs = 4,
|
||||
// PowerUse time window (`HH:mm`, local, null = round the clock) + the 5h-usage percentage at
|
||||
// which a PowerUse handler session should hand off. Same Settings tab.
|
||||
string? PowerUseWindowStart = null,
|
||||
string? PowerUseWindowEnd = null,
|
||||
int PowerUseHandoffPct = 95);
|
||||
|
||||
public record ModelPresetDto(string Model, string Effort, int MaxTurns);
|
||||
|
||||
@@ -97,11 +104,13 @@ public record UpdateListDto(string Id, string Name, string? WorkingDir, string D
|
||||
// TicketProjectId is tri-state on purpose: a caller that doesn't own the field (anything but the
|
||||
// list-settings modal) must not be able to clear it by omission — SetConfigAsync copies the entity
|
||||
// verbatim. Its scale: null = keep stored, <= 0 = clear the link, > 0 = set it.
|
||||
public record UpdateListConfigDto(string ListId, string? Model, string? SystemPrompt, string? AgentPath, int? MaxTurns = null, List<string>? SessionSkills = null, string? VerifyCommand = null, string? PermissionMode = null, int? TicketProjectId = null);
|
||||
// PowerUseAllowed is nullable for the same reason: null = keep stored, false = revoke the opt-in.
|
||||
// A non-nullable bool here would let any caller that omits it silently revoke PowerUse for the list.
|
||||
public record UpdateListConfigDto(string ListId, string? Model, string? SystemPrompt, string? AgentPath, int? MaxTurns = null, List<string>? SessionSkills = null, string? VerifyCommand = null, string? PermissionMode = null, int? TicketProjectId = null, bool? PowerUseAllowed = null);
|
||||
|
||||
public record UpdateTaskAgentSettingsDto(string TaskId, string? Model, string? SystemPrompt, string? AgentPath, int? MaxTurns = null, List<string>? SessionSkills = null, string? PermissionMode = null);
|
||||
|
||||
public record ListConfigDto(string? Model, string? SystemPrompt, string? AgentPath, int? MaxTurns = null, List<string>? SessionSkills = null, string? VerifyCommand = null, string? PermissionMode = null, int? TicketProjectId = null);
|
||||
public record ListConfigDto(string? Model, string? SystemPrompt, string? AgentPath, int? MaxTurns = null, List<string>? SessionSkills = null, string? VerifyCommand = null, string? PermissionMode = null, int? TicketProjectId = null, bool PowerUseAllowed = false);
|
||||
|
||||
public record SeedResultDto(int Copied, int Skipped);
|
||||
|
||||
@@ -207,6 +216,10 @@ public sealed record LaunchSpec(
|
||||
IReadOnlyList<string> Args,
|
||||
IReadOnlyDictionary<string, string> Env);
|
||||
|
||||
// A handler round's still-open (Queued/Running) task, for the Mission Control "abandon run"
|
||||
// action -- confirms with a count, then cancels each one before closing the pane.
|
||||
public record HandlerOpenTaskDto(string Id, string Title);
|
||||
|
||||
public record TicketSettingsDto(string? ApiBaseUrl, bool TokenSet);
|
||||
public record TicketConnectionDto(bool Ok, string? UserName, IReadOnlyList<string> Scopes, string? Error);
|
||||
public record TicketProjectDto(int Id, string Title, string DepartmentName);
|
||||
|
||||
@@ -41,6 +41,15 @@
|
||||
"usageGateSevenDayPct": "7-Tage-Fenster (%)",
|
||||
"autoContinueOnUsageLimit": "Nach Limit-Reset fortsetzen",
|
||||
"autoContinueOnUsageLimitHint": "Ist ein Run am Nutzungslimit abgebrochen, wird er nach Ablauf des 5-Stunden-Fensters automatisch fortgesetzt. Weckt außerdem die pausierte Queue genau zum Reset-Zeitpunkt statt erst beim nächsten Backstop-Check.",
|
||||
"listHandlerMaxHandoffs": "Handoff-Budget des List-Handlers",
|
||||
"listHandlerMaxHandoffsHint": "Wie viele Wait/Merge-Handoffs ein „Let Claude handle it\"-Run verketten darf. 4 entspricht zwei Merge-Runden. Für Läufe, die stundenlang durchlaufen sollen, höher setzen; der Wert begrenzt eine entlaufene Kette und darf daher nicht 0 sein.",
|
||||
"powerUseHeading": "PowerUse",
|
||||
"powerUse": "PowerUse aktivieren",
|
||||
"powerUseHint": "Das restliche Fenster ausnutzen: ein List-Handler-Run fragt nichts, löst Konflikte selbst, sammelt neue Arbeit und handoffet weiter, solange sein Budget reicht. Wirkt nur auf Listen, die PowerUse in ihren Listen-Einstellungen erlaubt haben.",
|
||||
"powerUseWindow": "Nur zwischen",
|
||||
"powerUseWindowPlaceholder": "HH:mm",
|
||||
"powerUseHandoffPct": "Übergabe bei (% von 5h)",
|
||||
"powerUseWindowHint": "Beide Zeiten leer = rund um die Uhr. Das Fenster wird bei jedem Start einer Handler-Phase geprüft — eine Kette, die über das Ende hinausläuft, macht ohne PowerUse weiter.",
|
||||
"throttleStagesHeading": "Throttle-Stufen",
|
||||
"throttleStagesHint": "Die Parallelität wird vor dem harten Gate begrenzt: soft auf 2 Slots, hard auf 1. Eingestellt wird das durch Ziehen der Marker an den Gauges im Usage-Monitor. Der Monitor schließt diese Einstellungen — vorher speichern, wenn du etwas geändert hast.",
|
||||
"throttleStagesValues": "5h: soft {0}% / hard {1}% · 7d: soft {2}% / hard {3}%",
|
||||
@@ -85,6 +94,7 @@
|
||||
"retryPrompt": "Wiederholung",
|
||||
"dailyPrepPrompt": "Tagesplanung",
|
||||
"weeklyReportPrompt": "Wochenbericht",
|
||||
"powerUsePrompt": "PowerUse-Addendum",
|
||||
"viewPrompt": "Ansehen",
|
||||
"customizedSection": "ANGEPASST",
|
||||
"customizedHint": "Diese Prompts weichen vom mitgelieferten Standard ab und werden unverändert beibehalten. Zurücksetzen, um künftige Standard-Verbesserungen zu erhalten.",
|
||||
@@ -177,7 +187,6 @@
|
||||
"listSettingsTip": "Listeneinstellungen",
|
||||
"addPlaceholder": "Aufgabe hinzufügen…",
|
||||
"enterKey": "ENTER",
|
||||
"notesPinnedRow": "Notizen (Tagesnotizen)",
|
||||
"clearDayTip": "Tag leeren",
|
||||
"planMyDayTip": "Meinen Tag planen",
|
||||
"overdue": "ÜBERFÄLLIG",
|
||||
@@ -209,6 +218,7 @@
|
||||
"ctxRefineTask": "Aufgabe verfeinern",
|
||||
"ctxPlanning": "Planung",
|
||||
"ctxSchedule": "Zeitplan",
|
||||
"ctxMoveToList": "In Liste verschieben",
|
||||
"ctxDeleteTask": "Aufgabe löschen",
|
||||
"reasonAlreadyRunning": "Aufgabe läuft bereits",
|
||||
"reasonAlreadyQueued": "Bereits in der Warteschlange",
|
||||
@@ -299,8 +309,11 @@
|
||||
},
|
||||
"notes": {
|
||||
"today": "Heute",
|
||||
"add": "Hinzufügen",
|
||||
"newNotePlaceholder": "Neue Notiz…"
|
||||
"yesterday": "Gestern",
|
||||
"newNotePlaceholder": "Neue Notiz…",
|
||||
"emptyHint": "Noch nichts notiert. Tippen, Enter, fertig.",
|
||||
"deleteTip": "Notiz löschen",
|
||||
"fromAgentTip": "Von Claude notiert"
|
||||
},
|
||||
"session": {
|
||||
"chipLive": "LIVE",
|
||||
@@ -326,12 +339,14 @@
|
||||
"failed": "Fehlgeschlagen",
|
||||
"roadblock": "Blockade gemeldet",
|
||||
"openSession": "Sitzung öffnen",
|
||||
"homeFolder": "Home (Schnellsitzung)",
|
||||
"browseForFolder": "Ordner wählen…",
|
||||
"focusMode": "Fokus",
|
||||
"overviewMode": "Übersicht",
|
||||
"closeSession": "Sitzung beenden",
|
||||
"conptyLaunchFailed": "Interaktive Sitzung konnte nicht geöffnet werden: {0}",
|
||||
"conptyStarting": "Sitzung wird gestartet…",
|
||||
"usageWarningNotDelivered": "Die Listen-Handler-Sitzung konnte nicht vor dem Usage-Limit gewarnt werden.",
|
||||
"mergeHelperTitle": "Merge-Helfer",
|
||||
"mergeHelperHandoffTitleSuffix": " (Übergabe)",
|
||||
"mergeHelperTaskTitle": "Listen-Handler: {0}",
|
||||
@@ -347,6 +362,10 @@
|
||||
"enqueueAlreadyOpen": "Kann nicht in die Warteschlange gestellt werden — dieser Task hat eine offene interaktive Sitzung.",
|
||||
"enqueueFailed": "In die Warteschlange stellen fehlgeschlagen: {0}",
|
||||
"queueRefreshFailed": "Warteschlange konnte nicht aktualisiert werden: {0}",
|
||||
"abandonRun": "Lauf abbrechen",
|
||||
"abandonRunTip": "Die noch offenen Tasks dieses Laufs abbrechen und die Sitzung schließen",
|
||||
"abandonRunConfirm": "{0} offene(n) Task(s) abbrechen und diese Sitzung schließen? Tasks im Review oder bereits erledigt bleiben unangetastet.",
|
||||
"abandonRunFailed": "Offene Tasks konnten nicht abgebrochen werden: {0}",
|
||||
"question": {
|
||||
"title": "Claude fragt nach",
|
||||
"placeholder": "Antwort eingeben…",
|
||||
@@ -395,6 +414,8 @@
|
||||
"manualListHint": "Neue Aufgaben in dieser Liste sind zunächst manuell: kein Einreihen, Ausführen oder Verfeinern, und die Automatik überspringt sie. Eine handgesteuerte Sitzung kannst du weiterhin öffnen.",
|
||||
"findingsTracked": "Findings-Ordner .claudedo einchecken",
|
||||
"findingsTrackedHint": "Aus: der Ordner bleibt über .git/info/exclude aus git heraus. An: Findings reisen mit dem Repo.",
|
||||
"powerUseAllowed": "PowerUse für diese Liste erlauben",
|
||||
"powerUseAllowedHint": "Erlaubt einem List-Handler-Run auf dieser Liste, unbeaufsichtigt zu laufen, sobald PowerUse in Einstellungen → Ausführung eingeschaltet ist: er fragt nichts, löst Konflikte selbst und sammelt neue Arbeit. Beide Schalter sind nötig — ein global aktives PowerUse ändert an einer Liste ohne Opt-in also nichts.",
|
||||
"sectionIcon": "ICON",
|
||||
"icon": "Listen-Icon",
|
||||
"iconHint": "Wird in der Seitenleiste neben dem Listennamen angezeigt.",
|
||||
@@ -497,12 +518,18 @@
|
||||
"regenerate": "Neu erstellen",
|
||||
"emptyStateHint": "Noch kein Bericht für diesen Zeitraum. Klicke auf „Erstellen“."
|
||||
},
|
||||
"cheatSheets": {
|
||||
"title": "CHEAT SHEETS",
|
||||
"windowTitle": "Cheat Sheets",
|
||||
"pin": "Anpinnen",
|
||||
"pinTooltip": "Fenster über den anderen halten",
|
||||
"missing": "Cheat Sheet {0} nicht gefunden."
|
||||
},
|
||||
"usageMonitor": {
|
||||
"title": "USAGE MONITOR",
|
||||
"windowTitle": "Usage Monitor",
|
||||
"noGauges": "Noch keine Nutzungslimits gemeldet.",
|
||||
"refresh": "Jetzt aktualisieren",
|
||||
"refreshHint": "Abruf alle 5 Min., während ein Task läuft, sonst alle 15 Min.",
|
||||
"refreshHint": "Jetzt aktualisieren — Abruf alle 5 Min., während ein Task läuft, sonst alle 15 Min.",
|
||||
"staleFormat": "Werte veraltet (Stand {0})",
|
||||
"staleGateHint": "Das Gate greift in diesem Zustand nicht.",
|
||||
"gateBlockedFormat": "Warteschlange pausiert — {0}",
|
||||
@@ -691,6 +718,9 @@
|
||||
"abort": "Merge abbrechen"
|
||||
},
|
||||
"controls": {
|
||||
"markdown": {
|
||||
"copy": "Befehl kopieren"
|
||||
},
|
||||
"datePicker": {
|
||||
"today": "Heute",
|
||||
"tomorrow": "Morgen",
|
||||
@@ -710,6 +740,13 @@
|
||||
"worktrees": "Worktrees…",
|
||||
"weeklyReport": "Wochenbericht…",
|
||||
"usageMonitor": "Usage Monitor…",
|
||||
"cheatSheets": "Cheat Sheets",
|
||||
"cheatSheetGit": "Git…",
|
||||
"cheatSheetCommits": "Conventional Commits…",
|
||||
"cheatSheetClaude": "Claude CLI…",
|
||||
"cheatSheetClaudeConfig": "Claude-Konfiguration…",
|
||||
"cheatSheetDotnet": "dotnet CLI…",
|
||||
"cheatSheetPowershell": "PowerShell…",
|
||||
"about": "Über…",
|
||||
"addRepos": "Repos als Listen hinzufügen…"
|
||||
},
|
||||
@@ -718,9 +755,6 @@
|
||||
"updateNow": "Jetzt aktualisieren",
|
||||
"dismiss": "Ausblenden"
|
||||
},
|
||||
"staleWorker": {
|
||||
"message": "Der Worker läuft auf einem älteren Stand als der gemergte main-Branch dieses Repos — Neustart nötig, damit gemergte Änderungen wirken."
|
||||
},
|
||||
"externalMerge": {
|
||||
"banner": "Eine Claude-Session löst gerade einen Merge-Konflikt auf — bitte keine Dateien im Repository bearbeiten.",
|
||||
"open": "Resolver öffnen"
|
||||
@@ -737,7 +771,7 @@
|
||||
"planningBadge": { "active": "PLANUNG", "finalized": "GEPLANT" },
|
||||
"taskRow": { "createdPrefix": "Erstellt {0}", "stepsText": "{0}/{1} Schritte" },
|
||||
"queue": { "baseDirtyWarning": "Achtung: Das Repo dieser Liste hat uncommittete Änderungen ({0} geändert, {1} untracked) — ein neuer Worktree startet vom letzten Commit und enthält sie nicht." },
|
||||
"tasksIsland": { "completedHeader": "ABGESCHLOSSEN", "completedHeaderCount": "ABGESCHLOSSEN · {0}", "planningResumeFailed": "Planungssitzung konnte nicht fortgesetzt werden: {0}", "approveFailed": "Genehmigen & Mergen fehlgeschlagen: {0}", "cancelReviewFailed": "Prüfung abbrechen fehlgeschlagen: {0}", "sendToQueueFailed": "In die Warteschlange stellen fehlgeschlagen: {0}", "queuePlanBlockedInteractive": "Plan kann nicht in die Warteschlange gestellt werden — {0} hat eine offene interaktive Sitzung und muss zuerst geschlossen werden.", "moveRunningRejected": "Ein laufender Task kann nicht in eine andere Liste verschoben werden.", "moveWorktreeRejected": "Verschieben nicht möglich — dieser Task hat einen aktiven Worktree, der auf sein aktuelles Repo zeigt.", "moveRepoConfirm": "Unterschiedliche Repos — {0} → {1}. Task trotzdem verschieben?", "moveConfirmUnavailable": "Verschieben nicht möglich — der Bestätigungsdialog ist nicht verfügbar.", "quickClaudeNoWorkingDir": "Für diese Liste ist kein Arbeitsverzeichnis konfiguriert.", "quickClaudeDirMissing": "Arbeitsverzeichnis existiert nicht mehr: {0}", "setStatusFailed": "Status konnte nicht aktualisiert werden: {0}", "cancelFailed": "Abbrechen fehlgeschlagen: {0}", "rejectToQueueFailed": "Zurückweisen in die Warteschlange fehlgeschlagen: {0}", "rejectToIdleFailed": "Zurückweisen fehlgeschlagen: {0}", "deleteTaskConfirm": "\"{0}\" löschen? Dies kann nicht rückgängig gemacht werden.", "deleteTaskFailed": "Löschen fehlgeschlagen: {0}", "toggleDoneFailed": "Erledigt-Status konnte nicht aktualisiert werden: {0}", "removeFromQueueFailed": "Aus der Warteschlange entfernen fehlgeschlagen: {0}", "openWorktreeFailed": "Worktree konnte nicht geöffnet werden: {0}" },
|
||||
"tasksIsland": { "completedHeader": "ABGESCHLOSSEN", "completedHeaderCount": "ABGESCHLOSSEN · {0}", "statusPill": "{0} laufend · {1} Prüfung", "openTaskOne": "1 offene Aufgabe", "openTasks": "{0} offene Aufgaben", "planningResumeFailed": "Planungssitzung konnte nicht fortgesetzt werden: {0}", "approveFailed": "Genehmigen & Mergen fehlgeschlagen: {0}", "cancelReviewFailed": "Prüfung abbrechen fehlgeschlagen: {0}", "sendToQueueFailed": "In die Warteschlange stellen fehlgeschlagen: {0}", "queuePlanBlockedInteractive": "Plan kann nicht in die Warteschlange gestellt werden — {0} hat eine offene interaktive Sitzung und muss zuerst geschlossen werden.", "moveRunningRejected": "Ein laufender Task kann nicht in eine andere Liste verschoben werden.", "moveWorktreeRejected": "Verschieben nicht möglich — dieser Task hat einen aktiven Worktree, der auf sein aktuelles Repo zeigt.", "moveRepoConfirm": "Unterschiedliche Repos — {0} → {1}. Task trotzdem verschieben?", "moveConfirmUnavailable": "Verschieben nicht möglich — der Bestätigungsdialog ist nicht verfügbar.", "quickClaudeNoWorkingDir": "Für diese Liste ist kein Arbeitsverzeichnis konfiguriert.", "quickClaudeDirMissing": "Arbeitsverzeichnis existiert nicht mehr: {0}", "setStatusFailed": "Status konnte nicht aktualisiert werden: {0}", "cancelFailed": "Abbrechen fehlgeschlagen: {0}", "rejectToQueueFailed": "Zurückweisen in die Warteschlange fehlgeschlagen: {0}", "rejectToIdleFailed": "Zurückweisen fehlgeschlagen: {0}", "deleteTaskConfirm": "\"{0}\" löschen? Dies kann nicht rückgängig gemacht werden.", "deleteTaskFailed": "Löschen fehlgeschlagen: {0}", "toggleDoneFailed": "Erledigt-Status konnte nicht aktualisiert werden: {0}", "removeFromQueueFailed": "Aus der Warteschlange entfernen fehlgeschlagen: {0}", "openWorktreeFailed": "Worktree konnte nicht geöffnet werden: {0}" },
|
||||
"diff": { "loadFailed": "Diff konnte nicht geladen werden: {0}", "noChanges": "Keine Änderungen anzuzeigen.", "unavailable": "Diff nicht mehr verfügbar — Commit-Bereich unvollständig." },
|
||||
"planningDiff": { "hubError": "Kombinierte Vorschau konnte nicht erstellt werden (Hub-Fehler).", "conflict": "Kombinierte Vorschau nicht möglich: Teilaufgabe {0} steht im Konflikt mit einer früheren Teilaufgabe ({1} Dateien).", "buildFailed": "Kombinierte Vorschau konnte nicht erstellt werden: {0}" },
|
||||
"merge": { "commitMessage": "chore: merge {0}", "progressMerging": "Wird zusammengeführt…", "progressVerifying": "Verify-Kommando der Liste läuft… ({0})", "workerOfflineBranches": "Worker offline — Branches können nicht aufgelistet werden.", "loadBranchesFailed": "Branches konnten nicht geladen werden: {0}", "merged": "Zusammengeführt.", "blocked": "Blockiert: {0}", "verifyFailed": "Merge ist gelandet, aber das Verify-Kommando der Liste ist fehlgeschlagen — die Aufgabe wurde nicht auf Erledigt gesetzt.", "untrackedCollision": "Merge abgelehnt — er würde eine unversionierte Datei im Ziel-Arbeitsverzeichnis überschreiben.", "unknownStatus": "Unbekannter Status: {0}", "mergeFailed": "Merge fehlgeschlagen: {0}" },
|
||||
@@ -759,11 +793,11 @@
|
||||
"sessionSkillsTab": { "installed": "Installiert: {0}", "installFailed": "Installation fehlgeschlagen: {0}", "updated": "Aktualisiert.", "updateFailed": "Aktualisierung fehlgeschlagen: {0}", "removed": "Entfernt.", "removeFailed": "Entfernen fehlgeschlagen: {0}" },
|
||||
"worktreesTab": { "workerOffline": "Worker offline.", "removed": "{0} Worktree(s) entfernt.", "blocked": "Zwangsentfernung nicht möglich: {0} Aufgabe(n) laufen noch. Brich sie zuerst ab.", "removedFrom": "{0} Worktree(s) von {1} Aufgabe(n) entfernt.", "cleanupFailed": "Aufräumen fehlgeschlagen: {0}", "resetFailed": "Zurücksetzen fehlgeschlagen: {0}" },
|
||||
"worktreesOverview": { "titleAll": "Worktrees", "titleList": "Worktrees — {0}", "listFallback": "Liste", "cleanupFailed": "Aufräumen fehlgeschlagen.", "cleanupFailedDetailed": "Aufräumen fehlgeschlagen: {0}", "removed": "{0} Worktree(s) entfernt.", "discardConfirm": "Worktree für \"{0}\" verwerfen? Nicht committete Arbeit geht verloren.", "discardFailed": "Worktree konnte nicht verworfen werden.", "keepFailed": "Worktree konnte nicht behalten werden.", "cannotForceRunning": "Eine laufende Aufgabe kann nicht zwangsweise entfernt werden.", "forceRemoveFailed": "Zwangsentfernung fehlgeschlagen.", "forceRemoveFailedDetailed": "Zwangsentfernung fehlgeschlagen: {0}", "batchDone": "{0} gemergt, {1} zu lösen.", "openInExplorerFailed": "Pfad konnte nicht geöffnet werden: {0}" },
|
||||
"listSettings": { "untitled": "Unbenannt", "ticketProjectNone": "— keins —" },
|
||||
"listSettings": { "untitled": "Unbenannt", "ticketProjectNone": "— keins —", "loadFailed": "Listeneinstellungen konnten nicht geladen werden: {0}", "ticketProjectsLoadFailed": "Ticket-Projekte konnten nicht geladen werden: {0}" },
|
||||
"detailsIsland": { "verifyFailed": "Merge ist erfolgt, aber das Verifikationskommando der Liste ist fehlgeschlagen — die Aufgabe wurde nicht auf 'Erledigt' gesetzt.", "untrackedCollision": "Merge abgelehnt — er würde eine unversionierte Datei im Ziel-Arbeitsverzeichnis überschreiben.", "stopOffline": "Worker offline — Task kann nicht gestoppt werden.", "stopFailed": "Stoppen fehlgeschlagen: {0}", "enqueueFailed": "In die Warteschlange stellen fehlgeschlagen: {0}", "dequeueFailed": "Aus der Warteschlange entfernen fehlgeschlagen: {0}", "resetAndRetryFailed": "Zurücksetzen & erneut versuchen fehlgeschlagen: {0}", "toggleDoneFailed": "Erledigt-Status konnte nicht aktualisiert werden: {0}" },
|
||||
"mergeSection": { "openWorktreeFailed": "Worktree konnte nicht geöffnet werden: {0}" },
|
||||
"about": { "openPathFailed": "Pfad konnte nicht geöffnet werden: {0}" },
|
||||
"lists": { "localSuffix": "{0} / lokal", "smartMyDay": "Mein Tag", "smartImportant": "Wichtig", "smartPlanned": "Geplant", "virtualQueue": "Warteschlange", "virtualRunning": "Läuft", "virtualReview": "Prüfung", "newList": "Neue Liste", "findingsNotFound": "Für diese Liste gibt es noch keine Findings.", "findingsOpenFailed": "Findings-Ordner konnte nicht geöffnet werden: {0}", "openInExplorerFailed": "Pfad konnte nicht geöffnet werden: {0}" },
|
||||
"lists": { "localSuffix": "{0} / lokal", "smartMyDay": "Mein Tag", "smartImportant": "Wichtig", "smartPlanned": "Geplant", "smartNotes": "Notizen", "virtualQueue": "Warteschlange", "virtualRunning": "Läuft", "virtualReview": "Prüfung", "newList": "Neue Liste", "findingsNotFound": "Für diese Liste gibt es noch keine Findings.", "findingsOpenFailed": "Findings-Ordner konnte nicht geöffnet werden: {0}", "openInExplorerFailed": "Pfad konnte nicht geöffnet werden: {0}" },
|
||||
"repoImport": { "loadFailed": "Gespeicherte Ordner konnten nicht geladen werden: {0}", "saveFailed": "Ordner konnten nicht gespeichert werden: {0}" }
|
||||
},
|
||||
"ops": {
|
||||
|
||||
@@ -41,6 +41,15 @@
|
||||
"usageGateSevenDayPct": "7-day window (%)",
|
||||
"autoContinueOnUsageLimit": "Continue on session limit reset",
|
||||
"autoContinueOnUsageLimitHint": "When a run stops because it hit the usage limit, automatically continue it once the 5-hour window resets. Also wakes the paused queue exactly at reset time instead of waiting for the next backstop check.",
|
||||
"listHandlerMaxHandoffs": "List-handler handoff budget",
|
||||
"listHandlerMaxHandoffsHint": "How many wait/merge handoffs one \"Let Claude handle it\" run may chain. 4 means two merge rounds. Raise it for runs meant to keep going for hours; it bounds a runaway chain, so it cannot be 0.",
|
||||
"powerUseHeading": "PowerUse",
|
||||
"powerUse": "Enable PowerUse",
|
||||
"powerUseHint": "Spend the rest of the window: a list-handler run asks nothing, resolves conflicts itself, harvests new work, and keeps handing off for as long as its budget allows. Only affects lists that allowed PowerUse in their list settings.",
|
||||
"powerUseWindow": "Only between",
|
||||
"powerUseWindowPlaceholder": "HH:mm",
|
||||
"powerUseHandoffPct": "Hand off at (% of 5h)",
|
||||
"powerUseWindowHint": "Leave both times empty for round the clock. A window is checked whenever a handler phase starts, so a chain that runs past the end time continues without PowerUse.",
|
||||
"throttleStagesHeading": "Throttle stages",
|
||||
"throttleStagesHint": "Parallelism is capped before the hard gate: soft caps at 2 slots, hard at 1. Edited by dragging the markers on the usage-monitor gauges. Opening the monitor closes these settings — save first if you changed anything.",
|
||||
"throttleStagesValues": "5h: soft {0}% / hard {1}% · 7d: soft {2}% / hard {3}%",
|
||||
@@ -85,6 +94,7 @@
|
||||
"retryPrompt": "Retry",
|
||||
"dailyPrepPrompt": "Daily prep",
|
||||
"weeklyReportPrompt": "Weekly report",
|
||||
"powerUsePrompt": "PowerUse addendum",
|
||||
"viewPrompt": "View",
|
||||
"customizedSection": "CUSTOMIZED",
|
||||
"customizedHint": "These prompts differ from the bundled default and are kept as-is. Reset to pick up future default improvements.",
|
||||
@@ -177,7 +187,6 @@
|
||||
"listSettingsTip": "List settings",
|
||||
"addPlaceholder": "Add a task…",
|
||||
"enterKey": "ENTER",
|
||||
"notesPinnedRow": "Notes (daily notes)",
|
||||
"clearDayTip": "Clear day",
|
||||
"planMyDayTip": "Plan My Day",
|
||||
"overdue": "OVERDUE",
|
||||
@@ -209,6 +218,7 @@
|
||||
"ctxRefineTask": "Refine task",
|
||||
"ctxPlanning": "Planning",
|
||||
"ctxSchedule": "Schedule",
|
||||
"ctxMoveToList": "Move to list",
|
||||
"ctxDeleteTask": "Delete task",
|
||||
"reasonAlreadyRunning": "Task is already running",
|
||||
"reasonAlreadyQueued": "Already in the queue",
|
||||
@@ -299,8 +309,11 @@
|
||||
},
|
||||
"notes": {
|
||||
"today": "Today",
|
||||
"add": "Add",
|
||||
"newNotePlaceholder": "New note…"
|
||||
"yesterday": "Yesterday",
|
||||
"newNotePlaceholder": "New note…",
|
||||
"emptyHint": "Nothing noted yet. Type, hit Enter, done.",
|
||||
"deleteTip": "Delete note",
|
||||
"fromAgentTip": "Written by Claude"
|
||||
},
|
||||
"session": {
|
||||
"chipLive": "LIVE",
|
||||
@@ -326,12 +339,14 @@
|
||||
"failed": "Failed",
|
||||
"roadblock": "Roadblock reported",
|
||||
"openSession": "Open session",
|
||||
"homeFolder": "Home (quick session)",
|
||||
"browseForFolder": "Choose folder…",
|
||||
"focusMode": "Focus",
|
||||
"overviewMode": "Overview",
|
||||
"closeSession": "Kill session",
|
||||
"conptyLaunchFailed": "Couldn't open interactive session: {0}",
|
||||
"conptyStarting": "Starting session…",
|
||||
"usageWarningNotDelivered": "Couldn't warn the list-handler session about the usage limit.",
|
||||
"mergeHelperTitle": "Merge Helper",
|
||||
"mergeHelperHandoffTitleSuffix": " (Handoff)",
|
||||
"mergeHelperTaskTitle": "List handler: {0}",
|
||||
@@ -347,6 +362,10 @@
|
||||
"enqueueAlreadyOpen": "Can't queue — this task has an open interactive session.",
|
||||
"enqueueFailed": "Queue failed: {0}",
|
||||
"queueRefreshFailed": "Couldn't refresh the queue: {0}",
|
||||
"abandonRun": "Abandon run",
|
||||
"abandonRunTip": "Cancel this run's still-open tasks and close the session",
|
||||
"abandonRunConfirm": "Cancel {0} open task(s) and close this session? Tasks already in review or done are not affected.",
|
||||
"abandonRunFailed": "Couldn't cancel the open tasks: {0}",
|
||||
"question": {
|
||||
"title": "Claude is asking",
|
||||
"placeholder": "Type your answer…",
|
||||
@@ -395,6 +414,8 @@
|
||||
"manualListHint": "New tasks in this list start out manual: no queueing, running or refining, and automation skips them. You can still open a hand-driven session.",
|
||||
"findingsTracked": "Commit the .claudedo findings folder",
|
||||
"findingsTrackedHint": "Off: the folder stays out of git via .git/info/exclude. On: findings travel with the repo.",
|
||||
"powerUseAllowed": "Allow PowerUse for this list",
|
||||
"powerUseAllowedHint": "Lets a list-handler run on this list go unattended when PowerUse is switched on in Settings → Execution: it asks nothing, resolves conflicts itself, and harvests new work. Both switches are needed, so leaving PowerUse on globally never changes a list that hasn't opted in.",
|
||||
"sectionIcon": "ICON",
|
||||
"icon": "List icon",
|
||||
"iconHint": "Shown next to the list name in the sidebar.",
|
||||
@@ -497,12 +518,18 @@
|
||||
"regenerate": "Regenerate",
|
||||
"emptyStateHint": "No report for this range yet. Click “Generate”."
|
||||
},
|
||||
"cheatSheets": {
|
||||
"title": "CHEAT SHEETS",
|
||||
"windowTitle": "Cheat Sheets",
|
||||
"pin": "Pin",
|
||||
"pinTooltip": "Keep this window on top of the others",
|
||||
"missing": "Cheat sheet {0} not found."
|
||||
},
|
||||
"usageMonitor": {
|
||||
"title": "USAGE MONITOR",
|
||||
"windowTitle": "Usage Monitor",
|
||||
"noGauges": "No usage limits reported yet.",
|
||||
"refresh": "Refresh now",
|
||||
"refreshHint": "Polled every 5 min while a task runs, otherwise every 15 min.",
|
||||
"refreshHint": "Refresh now — polled every 5 min while a task runs, otherwise every 15 min.",
|
||||
"staleFormat": "Values stale (as of {0})",
|
||||
"staleGateHint": "The gate does not apply while values are stale.",
|
||||
"gateBlockedFormat": "Queue paused — {0}",
|
||||
@@ -691,6 +718,9 @@
|
||||
"abort": "Abort merge"
|
||||
},
|
||||
"controls": {
|
||||
"markdown": {
|
||||
"copy": "Copy command"
|
||||
},
|
||||
"datePicker": {
|
||||
"today": "Today",
|
||||
"tomorrow": "Tomorrow",
|
||||
@@ -710,6 +740,13 @@
|
||||
"worktrees": "Worktrees…",
|
||||
"weeklyReport": "Weekly Report…",
|
||||
"usageMonitor": "Usage Monitor…",
|
||||
"cheatSheets": "Cheat Sheets",
|
||||
"cheatSheetGit": "Git…",
|
||||
"cheatSheetCommits": "Conventional Commits…",
|
||||
"cheatSheetClaude": "Claude CLI…",
|
||||
"cheatSheetClaudeConfig": "Claude configuration…",
|
||||
"cheatSheetDotnet": "dotnet CLI…",
|
||||
"cheatSheetPowershell": "PowerShell…",
|
||||
"about": "About…",
|
||||
"addRepos": "Add repos as lists…"
|
||||
},
|
||||
@@ -718,9 +755,6 @@
|
||||
"updateNow": "Update now",
|
||||
"dismiss": "Dismiss"
|
||||
},
|
||||
"staleWorker": {
|
||||
"message": "The worker is running an older build than this repo's merged main — restart it so your merged changes take effect."
|
||||
},
|
||||
"externalMerge": {
|
||||
"banner": "A Claude session is resolving a merge conflict — don't edit files in the repository.",
|
||||
"open": "Open resolver"
|
||||
@@ -737,7 +771,7 @@
|
||||
"planningBadge": { "active": "PLANNING", "finalized": "PLANNED" },
|
||||
"taskRow": { "createdPrefix": "Created {0}", "stepsText": "{0}/{1} steps" },
|
||||
"queue": { "baseDirtyWarning": "Heads up: this list's repo has uncommitted changes ({0} modified, {1} untracked) — a new worktree starts from the last commit and won't include them." },
|
||||
"tasksIsland": { "completedHeader": "COMPLETED", "completedHeaderCount": "COMPLETED · {0}", "planningResumeFailed": "Couldn't resume planning session: {0}", "approveFailed": "Approve & merge failed: {0}", "cancelReviewFailed": "Cancel review failed: {0}", "sendToQueueFailed": "Send to queue failed: {0}", "queuePlanBlockedInteractive": "Can't queue the plan — {0} has an open interactive session and must be closed first.", "moveRunningRejected": "Can't move a running task to another list.", "moveWorktreeRejected": "Can't move — this task has an active worktree pointing at its current repo.", "moveRepoConfirm": "Different repos — {0} → {1}. Move the task anyway?", "moveConfirmUnavailable": "Can't move — the confirmation dialog isn't available.", "quickClaudeNoWorkingDir": "This list has no working directory configured.", "quickClaudeDirMissing": "Working directory no longer exists: {0}", "setStatusFailed": "Failed to update status: {0}", "cancelFailed": "Cancel failed: {0}", "rejectToQueueFailed": "Reject to queue failed: {0}", "rejectToIdleFailed": "Reject failed: {0}", "deleteTaskConfirm": "Delete \"{0}\"? This cannot be undone.", "deleteTaskFailed": "Delete failed: {0}", "toggleDoneFailed": "Couldn't update done state: {0}", "removeFromQueueFailed": "Remove from queue failed: {0}", "openWorktreeFailed": "Couldn't open worktree: {0}" },
|
||||
"tasksIsland": { "completedHeader": "COMPLETED", "completedHeaderCount": "COMPLETED · {0}", "statusPill": "{0} running · {1} review", "openTaskOne": "1 open task", "openTasks": "{0} open tasks", "planningResumeFailed": "Couldn't resume planning session: {0}", "approveFailed": "Approve & merge failed: {0}", "cancelReviewFailed": "Cancel review failed: {0}", "sendToQueueFailed": "Send to queue failed: {0}", "queuePlanBlockedInteractive": "Can't queue the plan — {0} has an open interactive session and must be closed first.", "moveRunningRejected": "Can't move a running task to another list.", "moveWorktreeRejected": "Can't move — this task has an active worktree pointing at its current repo.", "moveRepoConfirm": "Different repos — {0} → {1}. Move the task anyway?", "moveConfirmUnavailable": "Can't move — the confirmation dialog isn't available.", "quickClaudeNoWorkingDir": "This list has no working directory configured.", "quickClaudeDirMissing": "Working directory no longer exists: {0}", "setStatusFailed": "Failed to update status: {0}", "cancelFailed": "Cancel failed: {0}", "rejectToQueueFailed": "Reject to queue failed: {0}", "rejectToIdleFailed": "Reject failed: {0}", "deleteTaskConfirm": "Delete \"{0}\"? This cannot be undone.", "deleteTaskFailed": "Delete failed: {0}", "toggleDoneFailed": "Couldn't update done state: {0}", "removeFromQueueFailed": "Remove from queue failed: {0}", "openWorktreeFailed": "Couldn't open worktree: {0}" },
|
||||
"diff": { "loadFailed": "Failed to load diff: {0}", "noChanges": "No changes to show.", "unavailable": "Diff no longer available — commit range incomplete." },
|
||||
"planningDiff": { "hubError": "Could not build combined preview (hub error).", "conflict": "Cannot build combined preview: subtask {0} conflicts with an earlier subtask ({1} files).", "buildFailed": "Could not build combined preview: {0}" },
|
||||
"merge": { "commitMessage": "chore: merge {0}", "progressMerging": "Merging…", "progressVerifying": "Running the list's verify command… ({0})", "workerOfflineBranches": "Worker offline — cannot list branches.", "loadBranchesFailed": "Failed to load branches: {0}", "merged": "Merged.", "blocked": "Blocked: {0}", "verifyFailed": "Merge landed, but the list's verify command failed — the task was kept out of Done.", "untrackedCollision": "Merge refused — it would overwrite an untracked file in the target working directory.", "unknownStatus": "Unknown status: {0}", "mergeFailed": "Merge failed: {0}" },
|
||||
@@ -759,11 +793,11 @@
|
||||
"sessionSkillsTab": { "installed": "Installed: {0}", "installFailed": "Install failed: {0}", "updated": "Updated.", "updateFailed": "Update failed: {0}", "removed": "Removed.", "removeFailed": "Remove failed: {0}" },
|
||||
"worktreesTab": { "workerOffline": "Worker offline.", "removed": "Removed {0} worktree(s).", "blocked": "Cannot force-remove: {0} task(s) still running. Cancel them first.", "removedFrom": "Removed {0} worktree(s) from {1} task(s).", "cleanupFailed": "Cleanup failed: {0}", "resetFailed": "Reset failed: {0}" },
|
||||
"worktreesOverview": { "titleAll": "Worktrees", "titleList": "Worktrees — {0}", "listFallback": "list", "cleanupFailed": "Cleanup failed.", "cleanupFailedDetailed": "Cleanup failed: {0}", "removed": "Removed {0} worktree(s).", "discardConfirm": "Discard the worktree for \"{0}\"? Uncommitted work will be lost.", "discardFailed": "Failed to discard worktree.", "keepFailed": "Failed to keep worktree.", "cannotForceRunning": "Cannot force-remove a running task.", "forceRemoveFailed": "Force remove failed.", "forceRemoveFailedDetailed": "Force remove failed: {0}", "batchDone": "Merged {0}, {1} need resolution.", "openInExplorerFailed": "Couldn't open path: {0}" },
|
||||
"listSettings": { "untitled": "Untitled", "ticketProjectNone": "— none —" },
|
||||
"listSettings": { "untitled": "Untitled", "ticketProjectNone": "— none —", "loadFailed": "Couldn't load list settings: {0}", "ticketProjectsLoadFailed": "Couldn't load ticket projects: {0}" },
|
||||
"detailsIsland": { "verifyFailed": "Merge landed, but the list's verify command failed — the task was kept out of Done.", "untrackedCollision": "Merge refused — it would overwrite an untracked file in the target working directory.", "stopOffline": "Worker offline — can't stop the task.", "stopFailed": "Stop failed: {0}", "enqueueFailed": "Queue failed: {0}", "dequeueFailed": "Remove from queue failed: {0}", "resetAndRetryFailed": "Reset & retry failed: {0}", "toggleDoneFailed": "Couldn't update done state: {0}" },
|
||||
"mergeSection": { "openWorktreeFailed": "Couldn't open worktree: {0}" },
|
||||
"about": { "openPathFailed": "Couldn't open path: {0}" },
|
||||
"lists": { "localSuffix": "{0} / local", "smartMyDay": "My Day", "smartImportant": "Important", "smartPlanned": "Planned", "virtualQueue": "Queue", "virtualRunning": "Running", "virtualReview": "Review", "newList": "New list", "findingsNotFound": "No findings yet for this list.", "findingsOpenFailed": "Couldn't open findings folder: {0}", "openInExplorerFailed": "Couldn't open path: {0}" },
|
||||
"lists": { "localSuffix": "{0} / local", "smartMyDay": "My Day", "smartImportant": "Important", "smartPlanned": "Planned", "smartNotes": "Notes", "virtualQueue": "Queue", "virtualRunning": "Running", "virtualReview": "Review", "newList": "New list", "findingsNotFound": "No findings yet for this list.", "findingsOpenFailed": "Couldn't open findings folder: {0}", "openInExplorerFailed": "Couldn't open path: {0}" },
|
||||
"repoImport": { "loadFailed": "Couldn't load remembered folders: {0}", "saveFailed": "Couldn't save folders: {0}" }
|
||||
},
|
||||
"ops": {
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
# Claude CLI
|
||||
|
||||
## Session starten
|
||||
- `claude` — interaktive Session im aktuellen Verzeichnis
|
||||
- `claude "<prompt>"` — Session mit erstem Prompt starten
|
||||
- `claude -c` — letzte Session in diesem Verzeichnis fortsetzen
|
||||
- `claude -r` — Session aus einer Auswahlliste fortsetzen
|
||||
- `claude -r <session-id>` — bestimmte Session fortsetzen
|
||||
- `claude --fork-session -r <id>` — Session unter neuer ID fortsetzen
|
||||
- `claude -n "<name>"` — Anzeigename für die Session setzen
|
||||
|
||||
## Modell und Aufwand
|
||||
- `claude --model sonnet` — Alias oder voller Name (`fable`, `opus`, `sonnet`, `claude-opus-5`)
|
||||
- `claude --effort high` — Denkaufwand: `low`, `medium`, `high`, `xhigh`, `max`
|
||||
- `claude --fallback-model sonnet` — Ausweichmodell bei Überlast (nur mit `-p`)
|
||||
|
||||
## Nicht interaktiv
|
||||
- `claude -p "<prompt>"` — antworten und beenden
|
||||
- `claude -p --output-format json` — ein JSON-Ergebnis
|
||||
- `claude -p --output-format stream-json` — Streaming-JSON für Skripte
|
||||
- `claude -p --include-partial-messages` — Teil-Chunks mitstreamen
|
||||
- `claude -p --max-budget-usd 5` — Kostendeckel für den Lauf
|
||||
- `claude -p --json-schema '<schema>'` — strukturierte Ausgabe validieren
|
||||
|
||||
## Berechtigungen und Tools
|
||||
- `claude --permission-mode <mode>` — `acceptEdits`, `auto`, `plan`, `manual`, `dontAsk`, `bypassPermissions`
|
||||
- `claude --allowed-tools "Bash(git *)" Edit` — nur diese Tools erlauben
|
||||
- `claude --disallowed-tools "Bash(rm *)"` — diese Tools sperren
|
||||
- `claude --tools "Bash,Edit,Read"` — Built-in-Toolset festlegen
|
||||
- `claude --add-dir <pfad>` — weiteres Arbeitsverzeichnis freigeben
|
||||
- `claude --restricted` — ohne befehlsausführende Tools und ohne lokale Settings
|
||||
|
||||
## Kontext und Konfiguration
|
||||
- `claude --append-system-prompt "<text>"` — Systemprompt ergänzen
|
||||
- `claude --system-prompt "<text>"` — Systemprompt ersetzen
|
||||
- `claude --settings <datei|json>` — zusätzliche Settings laden
|
||||
- `claude --agents '<json>'` — eigene Subagents für diese Session
|
||||
- `claude --mcp-config <datei>` — MCP-Server aus JSON laden
|
||||
- `claude --strict-mcp-config` — nur diese MCP-Server, alle anderen ignorieren
|
||||
- `claude --safe-mode` — alle Anpassungen aus, zum Fehlersuchen
|
||||
- `claude --bare` — Minimalmodus ohne Hooks, Plugins, CLAUDE.md
|
||||
|
||||
## Hintergrund-Sessions
|
||||
- `claude --bg "<prompt>"` — im Hintergrund starten, gibt die Kurz-ID aus
|
||||
- `claude agents` — laufende Hintergrund-Sessions auflisten
|
||||
- `claude attach <id>` — Hintergrund-Session in dieses Terminal holen
|
||||
- `claude logs <id>` — letzte Ausgabe einer Hintergrund-Session
|
||||
- `claude stop <id>` — Session stoppen, Verlauf bleibt
|
||||
- `claude rm <id>` — Session löschen
|
||||
|
||||
## Worktree
|
||||
- `claude -w` — neuen Git-Worktree für diese Session anlegen
|
||||
- `claude -w <name>` — Worktree mit eigenem Namen
|
||||
|
||||
## Verwaltung
|
||||
- `claude doctor` — Installation prüfen
|
||||
- `claude update` — auf neue Version aktualisieren
|
||||
- `claude mcp` — MCP-Server konfigurieren
|
||||
- `claude plugin` — Plugins verwalten
|
||||
- `claude auth` — Authentifizierung verwalten
|
||||
- `claude setup-token` — Langzeit-Token einrichten
|
||||
- `claude -d api,hooks` — Debugmodus mit Kategoriefilter
|
||||
- `claude -v` — Version ausgeben
|
||||
@@ -0,0 +1,48 @@
|
||||
# Claude Konfiguration
|
||||
|
||||
## Dateien und Orte
|
||||
- `~/.claude/settings.json` — globale Settings für alle Projekte
|
||||
- `.claude/settings.json` — Projekt-Settings, eingecheckt fürs Team
|
||||
- `.claude/settings.local.json` — persönliche Projekt-Settings, nicht eingecheckt
|
||||
- `Rangfolge: managed > local > projekt > global` — spezifischer gewinnt
|
||||
- `/config` — Settings interaktiv in der Session ansehen und ändern
|
||||
- `claude doctor` — Konfiguration auf Fehler prüfen
|
||||
|
||||
## CLAUDE.md
|
||||
- `~/.claude/CLAUDE.md` — globale Anweisungen für alle Projekte
|
||||
- `CLAUDE.md` — im Projekt-Root, wird bei Start automatisch geladen
|
||||
- `<unterordner>/CLAUDE.md` — wird geladen, sobald dort gearbeitet wird
|
||||
- `@pfad/zur/datei.md` — Import einer weiteren Datei in eine CLAUDE.md
|
||||
- `# <notiz>` — in der Session: Notiz in die CLAUDE.md übernehmen
|
||||
- `/init` — CLAUDE.md für ein Projekt generieren lassen
|
||||
|
||||
## Berechtigungen
|
||||
- `"permissions": { "allow": [...], "deny": [...], "ask": [...] }` — Struktur in settings.json
|
||||
- `Bash(git *)` — Bash-Befehle per Muster erlauben oder sperren
|
||||
- `Edit(src/**)` — Dateizugriff per Glob einschränken
|
||||
- `WebFetch(domain:example.com)` — Webzugriff auf eine Domain begrenzen
|
||||
- `mcp__<server>__<tool>` — Regel für ein einzelnes MCP-Tool
|
||||
- `/permissions` — Regeln in der Session ansehen und ergänzen
|
||||
|
||||
## MCP-Server
|
||||
- `claude mcp add <name> -- <befehl>` — lokalen stdio-Server anlegen
|
||||
- `claude mcp add --transport http <name> <url>` — HTTP-Server anlegen
|
||||
- `claude mcp add --scope project <name> ...` — in `.mcp.json` fürs Team
|
||||
- `claude mcp list` — konfigurierte Server anzeigen
|
||||
- `claude mcp remove <name>` — Server entfernen
|
||||
- `/mcp` — Serverstatus in der Session, OAuth-Login
|
||||
|
||||
## Hooks
|
||||
- `"hooks": { "PreToolUse": [...] }` — Shell-Befehle an Lifecycle-Events hängen
|
||||
- `PreToolUse / PostToolUse` — vor und nach jedem Tool-Aufruf
|
||||
- `UserPromptSubmit` — beim Absenden eines Prompts
|
||||
- `SessionStart / Stop` — bei Sessionbeginn und -ende
|
||||
- `Exit-Code 2` — blockiert die Aktion, stderr geht an Claude
|
||||
- `/hooks` — Hooks interaktiv verwalten
|
||||
|
||||
## Erweiterungen
|
||||
- `.claude/commands/<name>.md` — eigener Slash-Command `/name`
|
||||
- `.claude/skills/<name>/SKILL.md` — Skill, wird bei passender Aufgabe geladen
|
||||
- `.claude/agents/<name>.md` — eigener Subagent-Typ
|
||||
- `~/.claude/...` — dieselben Ordner global statt pro Projekt
|
||||
- `claude plugin` — Plugins installieren und verwalten
|
||||
@@ -0,0 +1,34 @@
|
||||
# Conventional Commits
|
||||
|
||||
## Format
|
||||
- `<type>(<scope>): <beschreibung>` — Grundform, Scope optional
|
||||
- `feat(auth): add login endpoint` — Beispiel mit Scope
|
||||
- `fix: prevent crash on empty input` — Beispiel ohne Scope
|
||||
- `imperativ, klein, kein Punkt am Ende` — Stil der Beschreibung
|
||||
|
||||
## Types
|
||||
- `feat` — neues Feature
|
||||
- `fix` — Bugfix
|
||||
- `refactor` — Umbau ohne Verhaltensänderung
|
||||
- `perf` — Performance-Verbesserung
|
||||
- `docs` — nur Dokumentation
|
||||
- `test` — Tests hinzufügen oder korrigieren
|
||||
- `style` — Formatierung, kein Code-Effekt
|
||||
- `build` — Build-System oder Dependencies
|
||||
- `ci` — CI-Konfiguration
|
||||
- `chore` — Sonstiges ohne src- oder Test-Änderung
|
||||
|
||||
## Breaking Changes
|
||||
- `feat(api)!: remove legacy endpoint` — `!` markiert einen Breaking Change
|
||||
- `BREAKING CHANGE: <erklärung>` — alternativ als Footer im Commit-Body
|
||||
|
||||
## Body und Footer
|
||||
- `Leerzeile nach der Betreffzeile` — dann optionaler Body mit dem Warum
|
||||
- `Refs: #123` — Footer für Ticket-Referenzen
|
||||
- `Reverts: <hash>` — Footer für Reverts
|
||||
|
||||
## Warum das Ganze
|
||||
- `feat` — löst ein Minor-Release aus (SemVer)
|
||||
- `fix` — löst ein Patch-Release aus (SemVer)
|
||||
- `!` oder `BREAKING CHANGE` — löst ein Major-Release aus
|
||||
- `git log --oneline --grep "^feat"` — Verlauf wird filterbar
|
||||
@@ -0,0 +1,49 @@
|
||||
# dotnet CLI
|
||||
|
||||
## Projekt anlegen
|
||||
- `dotnet new list` — verfügbare Vorlagen anzeigen
|
||||
- `dotnet new console -n <name>` — Projekt aus Vorlage anlegen
|
||||
- `dotnet new sln` — Solution anlegen
|
||||
- `dotnet sln add <projekt>` — Projekt in die Solution aufnehmen
|
||||
|
||||
## Bauen
|
||||
- `dotnet restore` — NuGet-Pakete auflösen
|
||||
- `dotnet build <projekt> -c Release` — Release bauen
|
||||
- `dotnet build --no-restore` — ohne Restore, wenn Pakete aktuell sind
|
||||
- `dotnet build -v minimal` — knappere Ausgabe
|
||||
- `dotnet clean -c Release` — Build-Ausgabe löschen
|
||||
|
||||
## Laufen lassen
|
||||
- `dotnet run --project <projekt> -c Release` — starten
|
||||
- `dotnet run --project <projekt> -- <args>` — Argumente an die App
|
||||
- `dotnet watch --project <projekt> run` — bei Dateiänderung neu starten
|
||||
|
||||
## Testen
|
||||
- `dotnet test <projekt> -c Release --no-build` — Tests ohne Neubau
|
||||
- `dotnet test --filter "FullyQualifiedName~<name>"` — nur passende Tests
|
||||
- `dotnet test --filter "FullyQualifiedName!~<name>"` — Tests ausschließen
|
||||
- `dotnet test --logger "console;verbosity=detailed"` — Details pro Test
|
||||
- `dotnet test --blame-hang-timeout 60s` — hängende Tests aufspüren
|
||||
|
||||
## Pakete
|
||||
- `dotnet add <projekt> package <name>` — Paket hinzufügen
|
||||
- `dotnet add <projekt> package <name> --version 1.2.3` — feste Version
|
||||
- `dotnet remove <projekt> package <name>` — Paket entfernen
|
||||
- `dotnet list <projekt> package --outdated` — veraltete Pakete
|
||||
- `dotnet nuget locals all --clear` — NuGet-Caches leeren
|
||||
|
||||
## EF Core Migrationen
|
||||
- `dotnet ef migrations add <name> -p <daten-projekt>` — Migration anlegen
|
||||
- `dotnet ef migrations list -p <daten-projekt>` — Migrationen anzeigen
|
||||
- `dotnet ef migrations remove -p <daten-projekt>` — letzte Migration zurücknehmen
|
||||
- `dotnet ef database update -p <daten-projekt>` — Schema anwenden
|
||||
|
||||
## Veröffentlichen
|
||||
- `dotnet publish <projekt> -c Release -r win-x64 --self-contained` — eigenständiges Build
|
||||
- `dotnet publish <projekt> -c Release -p:PublishSingleFile=true` — eine Exe
|
||||
|
||||
## Diagnose
|
||||
- `dotnet --info` — SDKs, Runtimes, RID
|
||||
- `dotnet --list-sdks` — installierte SDKs
|
||||
- `dotnet format <projekt>` — Formatierung anwenden
|
||||
- `dotnet build -p:TreatWarningsAsErrors=true` — Warnungen als Fehler
|
||||
@@ -0,0 +1,80 @@
|
||||
# Git
|
||||
|
||||
## Start
|
||||
- `git clone <url>` — Repository klonen
|
||||
- `git init` — neues Repository anlegen
|
||||
- `git remote add origin <url>` — Remote verbinden
|
||||
|
||||
## Stand ansehen
|
||||
- `git status -sb` — Kurzstatus mit Branch-Zeile
|
||||
- `git diff` — nicht gestagete Änderungen
|
||||
- `git diff --staged` — gestagete Änderungen
|
||||
- `git diff main...HEAD` — alles, was dieser Branch gegenüber main bringt
|
||||
- `git diff --stat` — nur Datei- und Zeilenzähler
|
||||
- `git log --oneline --graph --decorate -20` — kompakter Verlauf
|
||||
- `git log -p -- <pfad>` — Verlauf einer Datei mit Diffs
|
||||
- `git show <commit>` — ein Commit im Detail
|
||||
|
||||
## Branch
|
||||
- `git switch <branch>` — Branch wechseln
|
||||
- `git switch -c <name>` — Branch anlegen und wechseln
|
||||
- `git switch -` — zurück zum vorherigen Branch
|
||||
- `git branch -vv` — Branches mit Upstream und letztem Commit
|
||||
- `git branch -d <name>` — gemergten Branch löschen (`-D` erzwingt)
|
||||
|
||||
## Committen
|
||||
- `git add <pfad>` — Änderungen stagen
|
||||
- `git add -p` — Änderungen hunk-weise stagen
|
||||
- `git commit -m "<text>"` — gestagete Änderungen committen
|
||||
- `git commit -- <pfad>` — nur diese Pfade committen
|
||||
- `git commit --amend --no-edit` — letzten Commit um die Staging-Area erweitern
|
||||
- `git commit --fixup <commit>` — Fixup für späteres Autosquash
|
||||
|
||||
## Remote
|
||||
- `git fetch --all --prune` — alles holen, gelöschte Remote-Branches aufräumen
|
||||
- `git pull --rebase` — holen und eigene Commits obendrauf setzen
|
||||
- `git push -u origin <name>` — pushen und Upstream setzen
|
||||
- `git push --force-with-lease` — sicheres Force-Push, nie plain `--force`
|
||||
|
||||
## Rebase und Merge
|
||||
- `git rebase main` — Branch auf aktuellen main setzen
|
||||
- `git rebase -i --autosquash main` — interaktiv aufräumen
|
||||
- `git rebase --continue` — nach gelöstem Konflikt weiter
|
||||
- `git rebase --abort` — Rebase abbrechen, Ausgangszustand zurück
|
||||
- `git merge --no-ff <branch>` — Merge-Commit erzwingen
|
||||
- `git merge --abort` — laufenden Merge abbrechen
|
||||
- `git cherry-pick <commit>` — einzelnen Commit übernehmen
|
||||
|
||||
## Konflikte
|
||||
- `git diff --name-only --diff-filter=U` — konfliktbehaftete Dateien
|
||||
- `git checkout --ours <pfad>` — eigene Seite übernehmen
|
||||
- `git checkout --theirs <pfad>` — fremde Seite übernehmen
|
||||
- `git mergetool` — konfiguriertes Merge-Tool starten
|
||||
|
||||
## Rückgängig
|
||||
- `git restore <pfad>` — Datei auf HEAD zurücksetzen, Änderungen weg
|
||||
- `git restore --staged <pfad>` — unstagen, Änderungen behalten
|
||||
- `git reset --soft HEAD~1` — letzten Commit auflösen, Änderungen gestaged behalten
|
||||
- `git reset --hard <commit>` — alles verwerfen, nicht rückholbar
|
||||
- `git revert <commit>` — Commit durch Gegen-Commit aufheben
|
||||
- `git reflog` — Referenzverlauf, um verlorene Commits wiederzufinden
|
||||
|
||||
## Stash
|
||||
- `git stash push -m "<text>"` — Änderungen wegpacken
|
||||
- `git stash push -u` — inklusive unversionierter Dateien
|
||||
- `git stash list` — Stashes anzeigen
|
||||
- `git stash pop` — letzten Stash zurückholen und entfernen
|
||||
- `git stash apply <stash>` — anwenden, aber behalten
|
||||
|
||||
## Worktrees
|
||||
- `git worktree list` — alle Worktrees
|
||||
- `git worktree add <pfad> <branch>` — Worktree für bestehenden Branch
|
||||
- `git worktree add -b <name> <pfad>` — Worktree mit neuem Branch
|
||||
- `git worktree remove <pfad>` — Worktree entfernen
|
||||
- `git worktree prune` — verwaiste Einträge aufräumen
|
||||
|
||||
## Suchen
|
||||
- `git grep -n "<text>"` — im Arbeitsbaum suchen
|
||||
- `git log -S"<text>"` — Commits, die den Text einfügen oder entfernen
|
||||
- `git blame -L 40,60 <pfad>` — Zeilenbereich zuordnen
|
||||
- `git bisect start` — binäre Suche nach dem Fehler-Commit
|
||||
@@ -0,0 +1,52 @@
|
||||
# PowerShell
|
||||
|
||||
## Navigieren und Dateien
|
||||
- `Get-ChildItem` — Verzeichnis auflisten (`ls`, `-Force` zeigt versteckte)
|
||||
- `Set-Location <pfad>` — Verzeichnis wechseln (`cd`)
|
||||
- `New-Item -ItemType Directory <pfad>` — Ordner anlegen (`mkdir`)
|
||||
- `Copy-Item <quelle> <ziel> -Recurse` — kopieren
|
||||
- `Move-Item <quelle> <ziel>` — verschieben oder umbenennen
|
||||
- `Remove-Item <pfad> -Recurse -Force` — löschen, endgültig
|
||||
- `Test-Path <pfad>` — existiert die Datei oder der Ordner?
|
||||
|
||||
## Ansehen und Suchen
|
||||
- `Get-Content <datei> -Tail 50` — letzte Zeilen (`-Wait` folgt wie tail -f)
|
||||
- `Select-String "<text>" <dateien> -List` — in Dateien suchen (grep)
|
||||
- `Get-ChildItem -Recurse -Filter *.log` — Dateien rekursiv finden
|
||||
- `<befehl> | Select-Object -First 10` — Ausgabe begrenzen (head)
|
||||
- `<befehl> | Where-Object Name -like "*test*"` — Ausgabe filtern
|
||||
- `<befehl> | Measure-Object` — zählen (wc)
|
||||
- `<befehl> | Out-GridView` — Ausgabe in sortierbarem Fenster
|
||||
|
||||
## Prozesse und Dienste
|
||||
- `Get-Process | Sort-Object CPU -Descending | Select-Object -First 10` — Top-Prozesse
|
||||
- `Stop-Process -Name <name>` — Prozess beenden (`-Id <pid>` per PID)
|
||||
- `Get-Service <name>` — Dienststatus
|
||||
- `Restart-Service <name>` — Dienst neu starten (Admin nötig)
|
||||
|
||||
## Netzwerk
|
||||
- `Test-NetConnection <host> -Port 443` — Erreichbarkeit und Port testen
|
||||
- `Get-NetTCPConnection -LocalPort <port>` — wer belegt den Port (OwningProcess = PID)
|
||||
- `Invoke-RestMethod <url>` — HTTP-Aufruf, JSON kommt als Objekt zurück
|
||||
- `Resolve-DnsName <host>` — DNS-Auflösung prüfen
|
||||
|
||||
## Umgebung
|
||||
- `$env:PATH -split ";"` — PATH lesbar ausgeben
|
||||
- `$env:NAME = "wert"` — Variable für diese Session setzen
|
||||
- `[Environment]::SetEnvironmentVariable("NAME", "wert", "User")` — dauerhaft setzen
|
||||
- `Get-Command <name>` — wo liegt ein Befehl (which)
|
||||
- `Get-History` — bisherige Befehle dieser Session
|
||||
|
||||
## Windows-Spezifisches
|
||||
- `explorer .` — aktuellen Ordner im Explorer öffnen
|
||||
- `Start-Process <datei>` — mit Standardprogramm öffnen
|
||||
- `Start-Process pwsh -Verb RunAs` — Terminal als Administrator
|
||||
- `Set-ExecutionPolicy -Scope CurrentUser RemoteSigned` — lokale Skripte erlauben
|
||||
- `winget search <name>` — Software im Paketmanager suchen
|
||||
- `winget install <id>` — installieren
|
||||
- `winget upgrade --all` — alles aktualisieren
|
||||
|
||||
## Hilfe
|
||||
- `Get-Help <befehl> -Examples` — Beispiele zu einem Cmdlet
|
||||
- `Get-Member` — Eigenschaften eines Pipeline-Objekts anzeigen
|
||||
- `Get-Alias <kurzform>` — welches Cmdlet steckt hinter einem Alias
|
||||
@@ -58,13 +58,25 @@ Design/ — Tokens.axaml (design tokens; merged before styles)
|
||||
| `ListSettingsModalViewModel` | Name, working dir, commit type, "manual list" flag, `VerifyCommand`, delete. Hosts the shared `AgentConfigEditorViewModel` as `Agent` (scope=List) — ⚠️ save delegates to `Agent.SaveAsync(verifyCommand)` because both land in the same `list_config` row via one `UpdateListConfig` call and would otherwise clobber each other. |
|
||||
| `WeeklyReportModalViewModel` | Range pickers default "since last standup weekday → today", cached per range. |
|
||||
| `MergeHelperSelectionModalViewModel` | "Let Claude handle it" picker → [conpty-sessions](../../docs/explore-notes/conpty-sessions.md). |
|
||||
| `UsageMonitorModalViewModel` | Opened from the usage pill (shown **before** the data loads via `BeginLoad`); gauges are **dynamic** per `UsageSnapshotDto.Limits` row, and the 5h/7d ones carry three draggable stage markers (soft/hard/gate) via `UsageGaugeBar` + the pure `UsageThresholdDrag`, plus a colour-matched legend with a `NumericUpDown` per stage → [usage-monitoring](../../docs/explore-notes/usage-monitoring.md). The **analytics** part (models/tasks/cost) comes from the external TokenTracker export, not from us: without the CLI the modal shows a hint card with an install button (gated on Node ≥ 20) instead of the totals header. Gauges, gate and throttle are unaffected by it. |
|
||||
| `UsageMonitorModalViewModel` | Opened from the usage pill (shown **before** the data loads via `BeginLoad`); gauges are **dynamic** per `UsageSnapshotDto.Limits` row, and the 5h/7d ones carry three draggable stage markers (soft/hard/gate) via `UsageGaugeBar` + the pure `UsageThresholdDrag`, plus a colour-matched legend with a `NumericUpDown` per stage → [usage-monitoring](../../docs/explore-notes/usage-monitoring.md). The **analytics** part (models/tasks/cost) comes from the external TokenTracker export, not from us: without the CLI the modal shows a hint card with an install button (gated on Node ≥ 20) instead of the totals header. Gauges, gate and throttle are unaffected by it. The modal is **display + threshold drag only** — the PowerUse switch/window/handoff % it used to host moved to Settings → Execution (`GeneralSettingsTabViewModel`), and "Refresh now" is an icon in the titlebar via `ModalShell.HeaderActions` rather than a body row. |
|
||||
|
||||
Self-explanatory: `RepoImportModalViewModel` (bulk-create lists from git repos; already-wired
|
||||
repos disabled), `MergeModalViewModel`, `WorktreesOverviewModalViewModel`,
|
||||
`UnfinishedPlanningModalViewModel`, `LogVisualizerViewModel` (last 30 min, all levels + a
|
||||
warn/error filter), `WorkerConnectionModalViewModel`, `AboutModalViewModel`.
|
||||
|
||||
`CheatSheetsViewModel` backs the modeless `CheatSheetsWindow` (Help → Cheat Sheets): content is
|
||||
markdown under `Assets/CheatSheets/*.md` as **EmbeddedResource** (not `AvaloniaResource` —
|
||||
`AssetLoader` throws without an initialized Avalonia app, which would make the VM unconstructible
|
||||
in tests), rendered through `MarkdownView`, with a `Topmost` pin so it can sit docked beside the
|
||||
shell. A new sheet = a new `.md` file + its key in `CheatSheetsViewModel.Keys` (+ a menu entry if
|
||||
it should be directly reachable). `MarkdownView` has no table/fenced-code support, so sheets are
|
||||
bullet lists with inline code — rendered via its opt-in `CommandRows` property, which turns a
|
||||
`` `command` — description `` bullet into a mono chip + copy button + description and wraps each
|
||||
`##` section in a collapsible `Expander` (blocks are added to the open section's panel, not to the
|
||||
host). The flag is opt-in because the other three `MarkdownView` call sites (prompt-file viewer,
|
||||
weekly report, task-description preview) render prose where copy buttons would be noise.
|
||||
|
||||
## Diff & Conflicts
|
||||
|
||||
`UnifiedDiffParser` (static) + `DiffModels.cs` shared types + `DiffViewerViewModel` (one unified
|
||||
@@ -106,6 +118,9 @@ There is no null→bool converter — bind
|
||||
Modals use `TaskCompletionSource` results behind the reusable `ModalShell` control — the dialog
|
||||
sets the result on save/cancel, the caller awaits the TCS.
|
||||
|
||||
`ModalShell.HeaderActions` is the titlebar slot left of maximise/close — for a window-level action
|
||||
that should stay visible without costing a body row (currently only the usage monitor's refresh).
|
||||
|
||||
`ModalShell` also owns the window chrome for every modal: the titlebar drag goes through
|
||||
`Window.BeginMoveDrag` (so Windows snap works — drag to the top edge to maximise; the OS only
|
||||
snaps `CanResize="True"` windows, which is the opt-in), and it insets itself by the window's
|
||||
|
||||
@@ -36,6 +36,9 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<!-- EmbeddedResource, not AvaloniaResource: reading these needs no initialized Avalonia
|
||||
app, so the VM stays constructible in tests. -->
|
||||
<EmbeddedResource Include="Assets/CheatSheets/*.md" />
|
||||
<AvaloniaResource Include="Assets/Fonts/*.ttf" />
|
||||
<AvaloniaResource Include="Assets/Fonts/OFL-InterTight.txt" />
|
||||
<AvaloniaResource Include="Assets/Fonts/OFL-JetBrainsMono.txt" />
|
||||
|
||||
@@ -36,4 +36,7 @@ public interface IDialogService
|
||||
|
||||
/// <summary>Show (or re-show + focus) the modeless Mission Control window. Lazily created; hides on close.</summary>
|
||||
void ShowMissionControl(MissionControlViewModel vm);
|
||||
|
||||
/// <summary>Show (or re-show + focus) the modeless cheat-sheet window for the shell's shared VM.</summary>
|
||||
void ShowCheatSheets(CheatSheetsViewModel vm);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@ namespace ClaudeDo.Ui.Services.Interfaces;
|
||||
public interface INotesApi
|
||||
{
|
||||
Task<List<DailyNoteDto>> ListAsync(DateOnly day);
|
||||
/// <summary>Both ends inclusive — today plus its history in one call.</summary>
|
||||
Task<List<DailyNoteDto>> ListBetweenAsync(DateOnly start, DateOnly end);
|
||||
Task<DailyNoteDto?> AddAsync(DateOnly day, string text);
|
||||
Task UpdateAsync(string id, string text);
|
||||
Task DeleteAsync(string id);
|
||||
|
||||
@@ -30,6 +30,17 @@ public interface IWorkerClient : INotifyPropertyChanged
|
||||
/// task to carry out nextPhase ("wait" | "merge" | "wait_final" | "merge_final").</summary>
|
||||
event Action<string, IReadOnlyList<string>, string>? HandoffRequestedEvent;
|
||||
|
||||
/// <summary>start_list_handler was called through the external MCP: (listId, taskIds). The UI
|
||||
/// starts a list-handler run for them exactly like the "Let Claude handle it" button.</summary>
|
||||
event Action<string, IReadOnlyList<string>>? ListHandlerStartRequestedEvent;
|
||||
/// <summary>The 5h usage window is running out under a running list-handler session:
|
||||
/// (handlerTaskId, message). Mission Control types the message into that task's ConPTY pane so
|
||||
/// the session can hand off cleanly; no pane for the task means nothing happens.</summary>
|
||||
event Action<string, string>? HandlerUsageWarningEvent;
|
||||
|
||||
/// <summary>An agent added a note through the MCP tool — an open notes editor reloads.</summary>
|
||||
event Action? NotesUpdatedEvent;
|
||||
|
||||
event Action? PrepStartedEvent;
|
||||
event Action<string>? PrepLineEvent;
|
||||
event Action<bool>? PrepFinishedEvent;
|
||||
@@ -143,6 +154,14 @@ public interface IWorkerClient : INotifyPropertyChanged
|
||||
/// session's role: "wait" | "merge" | "wait_final" | "merge_final".</summary>
|
||||
Task<LaunchSpec> GetMergeHelperHandoffLaunchSpecAsync(
|
||||
string taskId, IReadOnlyList<string> survivingTaskIds, string nextPhase, CancellationToken ct = default);
|
||||
/// <summary>Reports that a task-based ConPTY session's process exited non-zero after it had been
|
||||
/// running. The exit code only exists in this process; the worker decides whether it was a
|
||||
/// list-handler session killed by the usage limit and reopens the same phase after the 5h reset.</summary>
|
||||
Task ReportInteractiveSessionExitedAsync(string taskId, int exitCode, CancellationToken ct = default);
|
||||
/// <summary>The handler round's still-open (Queued/Running) tasks, for the Mission Control
|
||||
/// "abandon run" action. Empty when the round has no entry or nothing open -- the caller then
|
||||
/// closes the pane without a confirmation dialog.</summary>
|
||||
Task<IReadOnlyList<HandlerOpenTaskDto>> GetHandlerOpenTasksAsync(string handlerTaskId, CancellationToken ct = default);
|
||||
/// <summary>Starts a planning session and returns the launch spec for an embedded ConPTY
|
||||
/// planning terminal (replaces StartPlanningSessionAsync's external wt window).</summary>
|
||||
Task<LaunchSpec> GetPlanningStartLaunchSpecAsync(string taskId, CancellationToken ct = default);
|
||||
@@ -172,15 +191,14 @@ public interface IWorkerClient : INotifyPropertyChanged
|
||||
Task<AppSettingsDto?> GetAppSettingsAsync();
|
||||
Task UpdateAppSettingsAsync(AppSettingsDto dto);
|
||||
Task<List<DailyNoteDto>> GetDailyNotesAsync(DateOnly day);
|
||||
/// <summary>Both ends inclusive.</summary>
|
||||
Task<List<DailyNoteDto>> GetDailyNotesBetweenAsync(DateOnly start, DateOnly end);
|
||||
Task<DailyNoteDto?> AddDailyNoteAsync(DateOnly day, string text);
|
||||
Task UpdateDailyNoteAsync(string id, string text);
|
||||
Task DeleteDailyNoteAsync(string id);
|
||||
Task<string> GetLastPrepLogAsync();
|
||||
Task<IReadOnlyList<WorkerLogEntry>> GetRecentLogsAsync();
|
||||
|
||||
/// <summary>Git SHA the running worker was built from (null when offline or the build isn't stamped).</summary>
|
||||
Task<WorkerBuildInfoDto?> GetWorkerBuildInfoAsync();
|
||||
|
||||
Task<List<PrimeScheduleDto>> GetPrimeSchedulesAsync();
|
||||
Task<PrimeScheduleDto?> UpsertPrimeScheduleAsync(PrimeScheduleDto dto);
|
||||
Task DeletePrimeScheduleAsync(Guid id);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Iciclecreek.Terminal;
|
||||
@@ -67,6 +68,14 @@ public sealed class PtyTerminalSession : IDisposable
|
||||
await WaitForLaunchGateAsync(s_launchGate, s_launchGateTimeout, ct);
|
||||
try
|
||||
{
|
||||
// If ClaudeDo.App itself was started from inside a claude session (e.g. a dev/test
|
||||
// launch), it inherits these markers and every embedded PTY session would otherwise
|
||||
// inherit them too — the child claude then thinks it's a spawned subagent and
|
||||
// disables transcript saving / degrades its own startup banner. Every ConPTY tile
|
||||
// must look like a fresh top-level session regardless of how ClaudeDo.App was launched.
|
||||
Environment.SetEnvironmentVariable("CLAUDE_CODE_CHILD_SESSION", null);
|
||||
Environment.SetEnvironmentVariable("CLAUDECODE", null);
|
||||
|
||||
foreach (var (key, value) in descriptor.Env)
|
||||
Environment.SetEnvironmentVariable(key, value);
|
||||
|
||||
@@ -93,6 +102,92 @@ public sealed class PtyTerminalSession : IDisposable
|
||||
ProcessExited?.Invoke(this, e.ExitCode);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Types <paramref name="text"/> into the running session and submits it, exactly as if the user
|
||||
/// had typed it — used to warn a list-handler session before the usage limit
|
||||
/// (<c>HandlerUsageWarning</c>). Verified against a real `claude` TUI, including while it was
|
||||
/// mid-turn (the message is queued and acted on when the turn ends).
|
||||
///
|
||||
/// Three non-obvious details, all established by that spike:
|
||||
/// • <see cref="TerminalControl"/> exposes no public write path at all — its only public paste is
|
||||
/// <c>TerminalView.PasteAsync()</c>, which takes no argument and reads the clipboard. The
|
||||
/// private <c>SendToPtyAsync</c> on the inner view is the write seam, hence the reflection.
|
||||
/// • The text and the Enter must be TWO writes. A single <c>text + "\r"</c> chunk lands in
|
||||
/// claude's composer but is never submitted — a chunk carrying an embedded CR reads as pasted
|
||||
/// text, not as a keypress.
|
||||
/// • The Enter bytes come from the emulator (<c>GenerateKeyInput</c>) rather than a literal
|
||||
/// "\r", because claude turns Win32 input mode on and the emulator owns that encoding.
|
||||
///
|
||||
/// Best-effort by design: a package upgrade that renames the private member costs a warning that
|
||||
/// never arrives, never a crashed Mission Control.
|
||||
/// </summary>
|
||||
public async Task<bool> SendLineAsync(string text)
|
||||
{
|
||||
if (_control is not { } control || !IsRunning || string.IsNullOrEmpty(text)) return false;
|
||||
try
|
||||
{
|
||||
await SendRawAsync(control, text);
|
||||
await Task.Delay(SubmitDelay);
|
||||
await SendRawAsync(control, control.Terminal.GenerateKeyInput(XTerm.Input.Key.Enter, XTerm.Input.KeyModifiers.None));
|
||||
return true;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Inserts <paramref name="text"/> at the cursor without submitting it — the drop-a-file-path
|
||||
/// case. Same write seam as <see cref="SendLineAsync"/>, just without the Enter.
|
||||
/// </summary>
|
||||
public async Task<bool> SendTextAsync(string text)
|
||||
{
|
||||
if (_control is not { } control || !IsRunning || string.IsNullOrEmpty(text)) return false;
|
||||
try
|
||||
{
|
||||
await SendRawAsync(control, text);
|
||||
return true;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Pastes the clipboard into the session. <see cref="TerminalControl"/> wires paste to the
|
||||
/// right-click menu only, so Ctrl+V otherwise reaches the child as a raw control byte and does
|
||||
/// nothing. Goes through the emulator's own <see cref="TerminalView.PasteAsync"/> rather than
|
||||
/// writing the clipboard text raw, because that is what honours bracketed-paste mode — without
|
||||
/// it a multi-line paste is read line by line and submits on the first newline.
|
||||
/// </summary>
|
||||
public async Task PasteAsync()
|
||||
{
|
||||
if (_control is not { } control || !IsRunning) return;
|
||||
try
|
||||
{
|
||||
if (s_terminalViewField?.GetValue(control) is TerminalView view)
|
||||
await view.PasteAsync();
|
||||
}
|
||||
catch (Exception) { /* best-effort, same as SendLineAsync */ }
|
||||
}
|
||||
|
||||
// Long enough that the two writes can't be read as one chunk by the child's stdin reader.
|
||||
private static readonly TimeSpan SubmitDelay = TimeSpan.FromMilliseconds(150);
|
||||
|
||||
private static readonly FieldInfo? s_terminalViewField =
|
||||
typeof(TerminalControl).GetField("_terminalView", BindingFlags.Instance | BindingFlags.NonPublic);
|
||||
private static readonly MethodInfo? s_sendToPty =
|
||||
typeof(TerminalView).GetMethod("SendToPtyAsync", BindingFlags.Instance | BindingFlags.NonPublic);
|
||||
|
||||
private static Task SendRawAsync(TerminalControl control, string data)
|
||||
{
|
||||
if (s_terminalViewField?.GetValue(control) is not TerminalView view || s_sendToPty is null)
|
||||
throw new InvalidOperationException("Iciclecreek.Avalonia.Terminal no longer exposes a PTY write seam.");
|
||||
return (Task)s_sendToPty.Invoke(view, new object[] { data, CancellationToken.None })!;
|
||||
}
|
||||
|
||||
public void Kill()
|
||||
{
|
||||
try { _control?.Kill(); }
|
||||
|
||||
@@ -67,9 +67,7 @@ public static class RepoScanner
|
||||
}
|
||||
}
|
||||
|
||||
private static bool IsRepo(string dir)
|
||||
{
|
||||
var gitPath = Path.Combine(dir, ".git");
|
||||
return Directory.Exists(gitPath) || File.Exists(gitPath);
|
||||
}
|
||||
// A real clone has .git as a directory. Worktrees and submodules have it as a file
|
||||
// ("gitdir: ...") — those are not standalone repos and would flood the list.
|
||||
private static bool IsRepo(string dir) => Directory.Exists(Path.Combine(dir, ".git"));
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
namespace ClaudeDo.Ui.Services;
|
||||
|
||||
public sealed record DailyNoteDto(string Id, string Date, string Text, int SortOrder);
|
||||
public sealed record DailyNoteDto(string Id, string Date, string Text, int SortOrder, bool FromAgent);
|
||||
|
||||
@@ -49,11 +49,14 @@ public partial class WorkerClient : ObservableObject, IAsyncDisposable, IWorkerC
|
||||
public event Action<string, string, string>? TaskQuestionAskedEvent;
|
||||
public event Action<string, string>? TaskQuestionResolvedEvent;
|
||||
public event Action<string, IReadOnlyList<string>, string>? HandoffRequestedEvent;
|
||||
public event Action<string, IReadOnlyList<string>>? ListHandlerStartRequestedEvent;
|
||||
public event Action<string, string>? HandlerUsageWarningEvent;
|
||||
public event Action? ConnectionRestoredEvent;
|
||||
public event Action<string>? WorktreeUpdatedEvent;
|
||||
public event Action<string>? ListUpdatedEvent;
|
||||
public event Action<WorkerLogEntry>? WorkerLogReceivedEvent;
|
||||
|
||||
public event Action? NotesUpdatedEvent;
|
||||
public event Action? PrepStartedEvent;
|
||||
public event Action<string>? PrepLineEvent;
|
||||
public event Action<bool>? PrepFinishedEvent;
|
||||
@@ -158,6 +161,16 @@ public partial class WorkerClient : ObservableObject, IAsyncDisposable, IWorkerC
|
||||
Dispatcher.UIThread.Post(() => HandoffRequestedEvent?.Invoke(taskId, survivingTaskIds, nextPhase));
|
||||
});
|
||||
|
||||
_hub.On<string, IReadOnlyList<string>>("ListHandlerStartRequested", (listId, taskIds) =>
|
||||
{
|
||||
Dispatcher.UIThread.Post(() => ListHandlerStartRequestedEvent?.Invoke(listId, taskIds));
|
||||
});
|
||||
|
||||
_hub.On<string, string>("HandlerUsageWarning", (taskId, message) =>
|
||||
{
|
||||
Dispatcher.UIThread.Post(() => HandlerUsageWarningEvent?.Invoke(taskId, message));
|
||||
});
|
||||
|
||||
_hub.On<string>("WorktreeUpdated", taskId =>
|
||||
{
|
||||
Dispatcher.UIThread.Post(() => WorktreeUpdatedEvent?.Invoke(taskId));
|
||||
@@ -213,6 +226,7 @@ public partial class WorkerClient : ObservableObject, IAsyncDisposable, IWorkerC
|
||||
Dispatcher.UIThread.Post(() => PrimeFired?.Invoke(new PrimeFiredEvent(id, ok, msg, when)));
|
||||
});
|
||||
|
||||
_hub.On("NotesUpdated", () => Dispatcher.UIThread.Post(() => NotesUpdatedEvent?.Invoke()));
|
||||
_hub.On("PrepStarted", () => Dispatcher.UIThread.Post(() => PrepStartedEvent?.Invoke()));
|
||||
_hub.On<string>("PrepLine", line => Dispatcher.UIThread.Post(() => PrepLineEvent?.Invoke(line)));
|
||||
_hub.On<bool>("PrepFinished", ok => Dispatcher.UIThread.Post(() => PrepFinishedEvent?.Invoke(ok)));
|
||||
@@ -475,6 +489,9 @@ public partial class WorkerClient : ObservableObject, IAsyncDisposable, IWorkerC
|
||||
public async Task<List<DailyNoteDto>> GetDailyNotesAsync(DateOnly day)
|
||||
=> await TryInvokeAsync<List<DailyNoteDto>>("GetDailyNotes", IsoDay(day)) ?? new List<DailyNoteDto>();
|
||||
|
||||
public async Task<List<DailyNoteDto>> GetDailyNotesBetweenAsync(DateOnly start, DateOnly end)
|
||||
=> await TryInvokeAsync<List<DailyNoteDto>>("GetDailyNotesBetween", IsoDay(start), IsoDay(end)) ?? new List<DailyNoteDto>();
|
||||
|
||||
public async Task<DailyNoteDto?> AddDailyNoteAsync(DateOnly day, string text)
|
||||
=> await InvokeTimedAsync<DailyNoteDto>("AddDailyNote", () => _hub.InvokeAsync<DailyNoteDto>("AddDailyNote", IsoDay(day), text));
|
||||
|
||||
@@ -487,9 +504,6 @@ public partial class WorkerClient : ObservableObject, IAsyncDisposable, IWorkerC
|
||||
public async Task<string> GetLastPrepLogAsync()
|
||||
=> await TryInvokeAsync<string>("GetLastPrepLog") ?? string.Empty;
|
||||
|
||||
public Task<WorkerBuildInfoDto?> GetWorkerBuildInfoAsync()
|
||||
=> TryInvokeAsync<WorkerBuildInfoDto>("GetWorkerBuildInfo");
|
||||
|
||||
public async Task<IReadOnlyList<WorkerLogEntry>> GetRecentLogsAsync()
|
||||
=> await TryInvokeAsync<List<WorkerLogEntry>>("GetRecentLogs") ?? new List<WorkerLogEntry>();
|
||||
|
||||
@@ -624,6 +638,12 @@ public partial class WorkerClient : ObservableObject, IAsyncDisposable, IWorkerC
|
||||
string taskId, IReadOnlyList<string> survivingTaskIds, string nextPhase, CancellationToken ct = default)
|
||||
=> await InvokeTimedAsync<LaunchSpec>("GetMergeHelperHandoffLaunchSpec", () => _hub.InvokeAsync<LaunchSpec>("GetMergeHelperHandoffLaunchSpec", taskId, survivingTaskIds, nextPhase, ct));
|
||||
|
||||
public Task ReportInteractiveSessionExitedAsync(string taskId, int exitCode, CancellationToken ct = default)
|
||||
=> InvokeTimedAsync("ReportInteractiveSessionExited", () => _hub.InvokeAsync("ReportInteractiveSessionExited", taskId, exitCode, ct));
|
||||
|
||||
public async Task<IReadOnlyList<HandlerOpenTaskDto>> GetHandlerOpenTasksAsync(string handlerTaskId, CancellationToken ct = default)
|
||||
=> await InvokeTimedAsync<List<HandlerOpenTaskDto>>("GetHandlerOpenTasks", () => _hub.InvokeAsync<List<HandlerOpenTaskDto>>("GetHandlerOpenTasks", handlerTaskId, ct));
|
||||
|
||||
public async Task<LaunchSpec> GetPlanningStartLaunchSpecAsync(string taskId, CancellationToken ct = default)
|
||||
=> await InvokeTimedAsync<LaunchSpec>("GetPlanningStartLaunchSpec", () => _hub.InvokeAsync<LaunchSpec>("GetPlanningStartLaunchSpec", taskId, ct));
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ public sealed class WorkerNotesApi : INotesApi
|
||||
private readonly IWorkerClient _client;
|
||||
public WorkerNotesApi(IWorkerClient client) => _client = client;
|
||||
public Task<List<DailyNoteDto>> ListAsync(DateOnly day) => _client.GetDailyNotesAsync(day);
|
||||
public Task<List<DailyNoteDto>> ListBetweenAsync(DateOnly start, DateOnly end) => _client.GetDailyNotesBetweenAsync(start, end);
|
||||
public Task<DailyNoteDto?> AddAsync(DateOnly day, string text) => _client.AddDailyNoteAsync(day, text);
|
||||
public Task UpdateAsync(string id, string text) => _client.UpdateDailyNoteAsync(id, text);
|
||||
public Task DeleteAsync(string id) => _client.DeleteDailyNoteAsync(id);
|
||||
|
||||
@@ -208,11 +208,13 @@ public sealed partial class AgentConfigEditorViewModel : ViewModelBase, IDisposa
|
||||
catch { }
|
||||
}
|
||||
|
||||
// verifyCommand and ticketProjectId are List-only fields owned by ListSettingsModalViewModel
|
||||
// (not this editor, which is also reused for Task scope); the caller passes them through so the
|
||||
// single UpdateListConfig call carries the full desired row instead of clobbering it.
|
||||
// verifyCommand, ticketProjectId and powerUseAllowed are List-only fields owned by
|
||||
// ListSettingsModalViewModel (not this editor, which is also reused for Task scope); the caller
|
||||
// passes them through so the single UpdateListConfig call carries the full desired row instead
|
||||
// of clobbering it. powerUseAllowed stays null-by-default for the same reason ticketProjectId
|
||||
// does: a caller that doesn't own it must not revoke the list's opt-in by omission.
|
||||
public async System.Threading.Tasks.Task SaveAsync(
|
||||
string? verifyCommand = null, int? ticketProjectId = null)
|
||||
string? verifyCommand = null, int? ticketProjectId = null, bool? powerUseAllowed = null)
|
||||
{
|
||||
if (TargetId is null) return;
|
||||
var model = string.IsNullOrWhiteSpace(Model) ? null : Model;
|
||||
@@ -225,7 +227,7 @@ public sealed partial class AgentConfigEditorViewModel : ViewModelBase, IDisposa
|
||||
if (_scope == AgentConfigScope.Task)
|
||||
await _worker.UpdateTaskAgentSettingsAsync(new UpdateTaskAgentSettingsDto(TargetId, model, sp, ap, turns, skills, permission));
|
||||
else
|
||||
await _worker.UpdateListConfigAsync(new UpdateListConfigDto(TargetId, model, sp, ap, turns, skills, verifyCommand, permission, ticketProjectId));
|
||||
await _worker.UpdateListConfigAsync(new UpdateListConfigDto(TargetId, model, sp, ap, turns, skills, verifyCommand, permission, ticketProjectId, powerUseAllowed));
|
||||
}
|
||||
|
||||
private List<string>? SelectedSessionSkillNames()
|
||||
@@ -234,6 +236,10 @@ public sealed partial class AgentConfigEditorViewModel : ViewModelBase, IDisposa
|
||||
return names.Count == 0 ? null : names;
|
||||
}
|
||||
|
||||
// The list_config row fetched by the most recent LoadForListAsync — exposed so a caller that
|
||||
// needs the same row (ListSettingsModalViewModel) can reuse it instead of fetching it again.
|
||||
public ListConfigDto? LastLoadedListConfig { get; private set; }
|
||||
|
||||
public async System.Threading.Tasks.Task LoadForListAsync(string listId, CancellationToken ct = default)
|
||||
{
|
||||
_suppressSave = true;
|
||||
@@ -244,6 +250,7 @@ public sealed partial class AgentConfigEditorViewModel : ViewModelBase, IDisposa
|
||||
await LoadGlobalDefaultsAsync();
|
||||
|
||||
var cfg = await _worker.GetListConfigAsync(listId);
|
||||
LastLoadedListConfig = cfg;
|
||||
ApplyConfig(cfg?.Model, cfg?.MaxTurns, cfg?.SystemPrompt, cfg?.AgentPath, cfg?.PermissionMode);
|
||||
await ReloadSessionSkillsAsync(cfg?.SessionSkills);
|
||||
|
||||
|
||||
@@ -96,6 +96,13 @@ public sealed partial class InteractiveTerminalViewModel : ViewModelBase, IDispo
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Raised when the process died non-zero *after* clearing <see cref="StartupGraceWindow"/> —
|
||||
/// i.e. a session that ran, then broke. That used to be a silent dead tile with no signal at all;
|
||||
/// the worker turns it into a usage-limit auto-restart for list-handler sessions
|
||||
/// (<c>HandlerRestartCoordinator</c>). A startup death keeps using <see cref="StartError"/> instead:
|
||||
/// it never reached a state worth resuming.</summary>
|
||||
public event Action<int>? ExitedAfterStartup;
|
||||
|
||||
/// <summary>Internal (not private) so tests can drive it directly without a real ConPTY spawn.</summary>
|
||||
internal void OnSessionProcessExited(object? sender, int exitCode)
|
||||
{
|
||||
@@ -103,11 +110,16 @@ public sealed partial class InteractiveTerminalViewModel : ViewModelBase, IDispo
|
||||
HasExited = true;
|
||||
ExitCode = exitCode;
|
||||
|
||||
if (exitCode == 0) return;
|
||||
if (_startedAtUtc is not { } startedAt) return; // never reached "running" — nothing ran to resume
|
||||
|
||||
// Died at startup: route through the same banner as a launch-time failure instead of
|
||||
// leaving a dead terminal with no Retry affordance (ConPtyPaneViewModel.CanRetry
|
||||
// requires StartError).
|
||||
if (exitCode != 0 && _startedAtUtc is { } startedAt && _utcNow() - startedAt < StartupGraceWindow)
|
||||
if (_utcNow() - startedAt < StartupGraceWindow)
|
||||
StartError = $"Session exited immediately (code {exitCode}).";
|
||||
else
|
||||
ExitedAfterStartup?.Invoke(exitCode);
|
||||
}
|
||||
|
||||
/// <summary>Reports a failure that happened before <see cref="Start"/> could be called (e.g. the
|
||||
@@ -119,6 +131,19 @@ public sealed partial class InteractiveTerminalViewModel : ViewModelBase, IDispo
|
||||
StartError = message;
|
||||
}
|
||||
|
||||
/// <summary>Types a line into the live session and submits it — see
|
||||
/// <see cref="PtyTerminalSession.SendLineAsync"/>. False when there is no running process to
|
||||
/// type into (or the write seam is gone).</summary>
|
||||
public Task<bool> SendLineAsync(string text) => _session.SendLineAsync(text);
|
||||
|
||||
/// <summary>Inserts text at the cursor without submitting — see
|
||||
/// <see cref="PtyTerminalSession.SendTextAsync"/> (dropped file paths).</summary>
|
||||
public Task<bool> SendTextAsync(string text) => _session.SendTextAsync(text);
|
||||
|
||||
/// <summary>Pastes the clipboard into the session (Ctrl+V) — see
|
||||
/// <see cref="PtyTerminalSession.PasteAsync"/>.</summary>
|
||||
public Task PasteAsync() => _session.PasteAsync();
|
||||
|
||||
public void Kill() => _session.Kill();
|
||||
|
||||
public void Dispose()
|
||||
|
||||
@@ -20,7 +20,6 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase, IDisposable
|
||||
private readonly IDbContextFactory<ClaudeDoDbContext> _dbFactory;
|
||||
private readonly IWorkerClient _worker;
|
||||
private readonly IServiceProvider _services;
|
||||
private readonly INotesApi _notesApi;
|
||||
private readonly MergeCoordinator _merge;
|
||||
|
||||
// ── Section view models ───────────────────────────────────────────────────
|
||||
@@ -39,29 +38,20 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase, IDisposable
|
||||
private readonly Action<string, string?> _workerPlanningMergeAbortedHandler;
|
||||
private readonly Action<string> _workerPlanningCompletedHandler;
|
||||
|
||||
[ObservableProperty] private bool _isNotesMode;
|
||||
[ObservableProperty] private bool _isPrepMode;
|
||||
|
||||
public bool IsTaskDetailVisible => !IsNotesMode && !IsPrepMode;
|
||||
public bool IsTaskDetailVisible => !IsPrepMode;
|
||||
|
||||
/// <summary>Centered placeholder shown when no task is selected — hidden in Notes/Prep mode,
|
||||
/// <summary>Centered placeholder shown when no task is selected — hidden in Prep mode,
|
||||
/// where <see cref="IsTaskDetailVisible"/> is already false.</summary>
|
||||
public bool IsEmptyStateVisible => Task is null && IsTaskDetailVisible;
|
||||
|
||||
partial void OnIsNotesModeChanged(bool value)
|
||||
{
|
||||
OnPropertyChanged(nameof(IsTaskDetailVisible));
|
||||
OnPropertyChanged(nameof(IsEmptyStateVisible));
|
||||
}
|
||||
|
||||
partial void OnIsPrepModeChanged(bool value)
|
||||
{
|
||||
OnPropertyChanged(nameof(IsTaskDetailVisible));
|
||||
OnPropertyChanged(nameof(IsEmptyStateVisible));
|
||||
}
|
||||
|
||||
public NotesEditorViewModel Notes { get; private set; } = null!;
|
||||
|
||||
// Current task row (set by IslandsShellViewModel via Bind)
|
||||
[ObservableProperty]
|
||||
[NotifyCanExecuteChangedFor(nameof(EnqueueCommand))]
|
||||
@@ -324,13 +314,11 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase, IDisposable
|
||||
IDbContextFactory<ClaudeDoDbContext> dbFactory,
|
||||
IWorkerClient worker,
|
||||
IServiceProvider services,
|
||||
INotesApi notesApi,
|
||||
MergeCoordinator merge)
|
||||
{
|
||||
_dbFactory = dbFactory;
|
||||
_worker = worker;
|
||||
_services = services;
|
||||
_notesApi = notesApi;
|
||||
_merge = merge;
|
||||
|
||||
Monitor = new TaskMonitorViewModel(dbFactory, worker);
|
||||
@@ -374,8 +362,6 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase, IDisposable
|
||||
if (e.PropertyName == nameof(OperationStatus.IsRunning)) ParkReviewCommand.NotifyCanExecuteChanged();
|
||||
};
|
||||
|
||||
Notes = new NotesEditorViewModel(_notesApi);
|
||||
Notes.ErrorReported += msg => { if (ShowErrorAsync is not null) _ = ShowErrorAsync(msg); };
|
||||
Subtasks.CollectionChanged += (_, _) => NotifyStepsChanged();
|
||||
Subtasks.CollectionChanged += (_, _) => Merge.SyncChildOutcomes(HasChildOutcomes, Subtasks.Count);
|
||||
Attachments.CollectionChanged += (_, _) => OnPropertyChanged(nameof(FilesBadge));
|
||||
@@ -592,18 +578,9 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase, IDisposable
|
||||
catch { }
|
||||
}
|
||||
|
||||
public void ShowNotes()
|
||||
{
|
||||
Bind(null, "notes");
|
||||
IsPrepMode = false;
|
||||
IsNotesMode = true;
|
||||
_ = Notes.LoadDayAsync(DateOnly.FromDateTime(DateTime.Today));
|
||||
}
|
||||
|
||||
public void ShowPrep()
|
||||
{
|
||||
Bind(null, "prep");
|
||||
IsNotesMode = false;
|
||||
IsPrepMode = true;
|
||||
_ = Prep.LoadLastPrepLogIfEmptyAsync();
|
||||
}
|
||||
@@ -612,7 +589,6 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase, IDisposable
|
||||
/// logged with the bind timing so rebind churn can be attributed to a trigger.</param>
|
||||
public void Bind(TaskRowViewModel? row, string source = "?")
|
||||
{
|
||||
IsNotesMode = false;
|
||||
IsPrepMode = false;
|
||||
_loadCts?.Cancel();
|
||||
_loadCts?.Dispose();
|
||||
|
||||
@@ -22,6 +22,10 @@ public sealed record MergeHelperRequest(string ListId, IReadOnlyList<string> Tas
|
||||
|
||||
public sealed partial class ListsIslandViewModel : ViewModelBase, IDisposable
|
||||
{
|
||||
/// <summary>The day-log list. A smart list with no tasks in it: selecting it makes the tasks
|
||||
/// island show the notes editor instead of rows.</summary>
|
||||
public const string NotesListId = "smart:notes";
|
||||
|
||||
private readonly IDbContextFactory<ClaudeDoDbContext> _dbFactory;
|
||||
private readonly IServiceProvider? _services;
|
||||
private readonly IWorkerClient? _worker;
|
||||
@@ -54,7 +58,8 @@ public sealed partial class ListsIslandViewModel : ViewModelBase, IDisposable
|
||||
if (row is null || Dialogs is null || _services is null) return;
|
||||
var rawId = row.Id.StartsWith("user:", StringComparison.Ordinal) ? row.Id["user:".Length..] : row.Id;
|
||||
var vm = _services.GetRequiredService<ListSettingsModalViewModel>();
|
||||
await vm.LoadAsync(rawId, row.Name, row.WorkingDir, row.DefaultCommitType, row.IsManual, row.FindingsTracked, row.IconKey);
|
||||
vm.ErrorReported += msg => ErrorReported?.Invoke(msg);
|
||||
vm.BeginLoad(rawId, row.Name, row.WorkingDir, row.DefaultCommitType, row.IsManual, row.FindingsTracked, row.IconKey);
|
||||
await Dialogs.ShowListSettingsAsync(vm);
|
||||
if (vm.Deleted) await LoadAsync();
|
||||
else await RefreshRowAsync(row.Id);
|
||||
@@ -255,6 +260,7 @@ public sealed partial class ListsIslandViewModel : ViewModelBase, IDisposable
|
||||
"smart:my-day" => "vm.lists.smartMyDay",
|
||||
"smart:important" => "vm.lists.smartImportant",
|
||||
"smart:planned" => "vm.lists.smartPlanned",
|
||||
NotesListId => "vm.lists.smartNotes",
|
||||
"virtual:queued" => "vm.lists.virtualQueue",
|
||||
"virtual:running" => "vm.lists.virtualRunning",
|
||||
"virtual:review" => "vm.lists.virtualReview",
|
||||
@@ -277,6 +283,7 @@ public sealed partial class ListsIslandViewModel : ViewModelBase, IDisposable
|
||||
var smart = new[]
|
||||
{
|
||||
new ListNavItemViewModel { Id = "smart:my-day", Name = Loc.T("vm.lists.smartMyDay"), Kind = ListKind.Smart, IconKey = "Sun" },
|
||||
new ListNavItemViewModel { Id = NotesListId, Name = Loc.T("vm.lists.smartNotes"), Kind = ListKind.Smart, IconKey = "Text" },
|
||||
new ListNavItemViewModel { Id = "smart:important", Name = Loc.T("vm.lists.smartImportant"), Kind = ListKind.Smart, IconKey = "Star" },
|
||||
new ListNavItemViewModel { Id = "smart:planned", Name = Loc.T("vm.lists.smartPlanned"), Kind = ListKind.Smart, IconKey = "Calendar" },
|
||||
new ListNavItemViewModel { Id = "virtual:queued", Name = Loc.T("vm.lists.virtualQueue"), Kind = ListKind.Virtual, IconKey = "Inbox" },
|
||||
@@ -402,9 +409,18 @@ public sealed partial class ListsIslandViewModel : ViewModelBase, IDisposable
|
||||
if (Dialogs is not null && _services is not null)
|
||||
{
|
||||
var vm = _services.GetRequiredService<ListSettingsModalViewModel>();
|
||||
await vm.LoadAsync(entity.Id, entity.Name, entity.WorkingDir, entity.DefaultCommitType, entity.IsManual, entity.FindingsTracked, entity.Icon);
|
||||
vm.ErrorReported += msg => ErrorReported?.Invoke(msg);
|
||||
vm.BeginLoad(entity.Id, entity.Name, entity.WorkingDir, entity.DefaultCommitType, entity.IsManual, entity.FindingsTracked, entity.Icon);
|
||||
await Dialogs.ShowListSettingsAsync(vm);
|
||||
if (vm.Deleted) await LoadAsync();
|
||||
if (!vm.Saved && !vm.Deleted)
|
||||
{
|
||||
// Cancel/close right after "New list" means "never mind" — drop the row we
|
||||
// pre-created, otherwise an untitled empty list is left behind.
|
||||
await using var ctx = await _dbFactory.CreateDbContextAsync();
|
||||
await new ListRepository(ctx).DeleteAsync(entity.Id);
|
||||
await LoadAsync();
|
||||
}
|
||||
else if (vm.Deleted) await LoadAsync();
|
||||
else await RefreshRowAsync(item.Id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,25 +1,57 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using ClaudeDo.Ui.Localization;
|
||||
using ClaudeDo.Ui.Services;
|
||||
using ClaudeDo.Ui.Services.Interfaces;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
|
||||
namespace ClaudeDo.Ui.ViewModels.Islands;
|
||||
|
||||
/// <summary>Date separator between the note groups. Rows carry these inline (like the task list's
|
||||
/// HeaderRow) so one ItemsControl renders today and the history without a nested control per day.</summary>
|
||||
public sealed class NoteDayHeaderViewModel
|
||||
{
|
||||
public DateOnly Day { get; }
|
||||
public string Label { get; }
|
||||
public bool IsToday { get; }
|
||||
|
||||
public NoteDayHeaderViewModel(DateOnly day, DateOnly today)
|
||||
{
|
||||
Day = day;
|
||||
IsToday = day == today;
|
||||
Label = day == today ? Loc.T("notes.today")
|
||||
: day == today.AddDays(-1) ? Loc.T("notes.yesterday")
|
||||
: day.ToString("dddd, dd.MM.");
|
||||
}
|
||||
}
|
||||
|
||||
public sealed partial class NoteBulletViewModel : ViewModelBase
|
||||
{
|
||||
public string Id { get; }
|
||||
/// <summary>Empty until the note is persisted — a row the user started but hasn't typed into
|
||||
/// yet exists only in the list, so an abandoned Enter leaves nothing behind in the database.</summary>
|
||||
public string Id { get; set; }
|
||||
|
||||
public DateOnly Day { get; }
|
||||
public bool FromAgent { get; }
|
||||
public bool IsNew => Id.Length == 0;
|
||||
|
||||
[ObservableProperty] private string _text;
|
||||
|
||||
public NoteBulletViewModel(string id, string text)
|
||||
public NoteBulletViewModel(string id, DateOnly day, string text, bool fromAgent = false)
|
||||
{
|
||||
Id = id;
|
||||
Day = day;
|
||||
_text = text;
|
||||
FromAgent = fromAgent;
|
||||
}
|
||||
}
|
||||
|
||||
public sealed partial class NotesEditorViewModel : ViewModelBase
|
||||
{
|
||||
/// <summary>How far the history scrolls back. Older notes stay in the database and in the week
|
||||
/// report; they are simply not worth the round trip in a day log.</summary>
|
||||
public const int HistoryDays = 14;
|
||||
|
||||
private readonly INotesApi _api;
|
||||
|
||||
public NotesEditorViewModel(INotesApi api) => _api = api;
|
||||
@@ -27,32 +59,58 @@ public sealed partial class NotesEditorViewModel : ViewModelBase
|
||||
// Raised when a worker call fails so the host VM can surface it (e.g. via ShowErrorAsync).
|
||||
public event Action<string>? ErrorReported;
|
||||
|
||||
public ObservableCollection<NoteBulletViewModel> Bullets { get; } = new();
|
||||
/// <summary>Raised after a row is inserted so the view can move the caret into it.</summary>
|
||||
public event Action<NoteBulletViewModel>? FocusRequested;
|
||||
|
||||
/// <summary>NoteDayHeaderViewModel | NoteBulletViewModel, newest day first.</summary>
|
||||
public ObservableCollection<object> Rows { get; } = new();
|
||||
|
||||
[ObservableProperty] private DateOnly _currentDay = DateOnly.FromDateTime(DateTime.Today);
|
||||
[ObservableProperty] private string _newBulletText = "";
|
||||
[ObservableProperty] private bool _isEmpty = true;
|
||||
|
||||
public DateTime CurrentDate
|
||||
public DateOnly Today { get; private set; } = DateOnly.FromDateTime(DateTime.Today);
|
||||
|
||||
/// <summary>Loads today plus <see cref="HistoryDays"/> days of history.</summary>
|
||||
public async Task LoadAsync()
|
||||
{
|
||||
get => CurrentDay.ToDateTime(TimeOnly.MinValue);
|
||||
set { var d = DateOnly.FromDateTime(value); if (d != CurrentDay) _ = LoadDayAsync(d); }
|
||||
Today = DateOnly.FromDateTime(DateTime.Today);
|
||||
List<DailyNoteDto> notes;
|
||||
try
|
||||
{
|
||||
notes = await _api.ListBetweenAsync(Today.AddDays(-HistoryDays), Today);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ErrorReported?.Invoke(ex.Message);
|
||||
return;
|
||||
}
|
||||
|
||||
Rows.Clear();
|
||||
// Today always gets a header, even with nothing under it — it is where typing lands.
|
||||
Rows.Add(new NoteDayHeaderViewModel(Today, Today));
|
||||
foreach (var n in notes.Where(n => Day(n) == Today).OrderBy(n => n.SortOrder))
|
||||
Rows.Add(Bullet(n));
|
||||
|
||||
foreach (var group in notes.Where(n => Day(n) != Today)
|
||||
.GroupBy(Day).OrderByDescending(g => g.Key))
|
||||
{
|
||||
Rows.Add(new NoteDayHeaderViewModel(group.Key, Today));
|
||||
foreach (var n in group.OrderBy(n => n.SortOrder))
|
||||
Rows.Add(Bullet(n));
|
||||
}
|
||||
|
||||
RefreshEmpty();
|
||||
}
|
||||
|
||||
public string CurrentDayLabel => CurrentDay.ToString("dddd, dd.MM.yyyy");
|
||||
private static DateOnly Day(DailyNoteDto n) => DateOnly.Parse(n.Date);
|
||||
|
||||
public async Task LoadDayAsync(DateOnly day)
|
||||
{
|
||||
CurrentDay = day;
|
||||
OnPropertyChanged(nameof(CurrentDate));
|
||||
OnPropertyChanged(nameof(CurrentDayLabel));
|
||||
Bullets.Clear();
|
||||
foreach (var dto in await _api.ListAsync(day))
|
||||
Bullets.Add(MakeBullet(dto.Id, dto.Text));
|
||||
}
|
||||
private static NoteBulletViewModel Bullet(DailyNoteDto n) =>
|
||||
new(n.Id, Day(n), n.Text, n.FromAgent);
|
||||
|
||||
private NoteBulletViewModel MakeBullet(string id, string text) =>
|
||||
new(id, text);
|
||||
private void RefreshEmpty() => IsEmpty = !Rows.OfType<NoteBulletViewModel>().Any();
|
||||
|
||||
/// <summary>The box above the list: Enter files the note under today and keeps the box focused,
|
||||
/// so a burst of notes is one uninterrupted stream of typing.</summary>
|
||||
[RelayCommand]
|
||||
private async Task AddBullet()
|
||||
{
|
||||
@@ -60,9 +118,10 @@ public sealed partial class NotesEditorViewModel : ViewModelBase
|
||||
if (text.Length == 0) return;
|
||||
try
|
||||
{
|
||||
var dto = await _api.AddAsync(CurrentDay, text);
|
||||
if (dto is not null) Bullets.Add(MakeBullet(dto.Id, dto.Text));
|
||||
var dto = await _api.AddAsync(Today, text);
|
||||
if (dto is not null) Rows.Insert(1, Bullet(dto));
|
||||
NewBulletText = "";
|
||||
RefreshEmpty();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -70,21 +129,68 @@ public sealed partial class NotesEditorViewModel : ViewModelBase
|
||||
}
|
||||
}
|
||||
|
||||
[RelayCommand] private Task PrevDay() => LoadDayAsync(CurrentDay.AddDays(-1));
|
||||
[RelayCommand] private Task NextDay() => LoadDayAsync(CurrentDay.AddDays(1));
|
||||
[RelayCommand] private Task Today() => LoadDayAsync(DateOnly.FromDateTime(DateTime.Today));
|
||||
/// <summary>Enter inside a note: save it, then open an empty row underneath and focus it.</summary>
|
||||
[RelayCommand]
|
||||
private async Task SplitBullet(NoteBulletViewModel? b)
|
||||
{
|
||||
if (b is null) return;
|
||||
await CommitBullet(b);
|
||||
if (!Rows.Contains(b)) return; // committing an emptied note removed it
|
||||
|
||||
var fresh = new NoteBulletViewModel("", b.Day, "");
|
||||
Rows.Insert(Rows.IndexOf(b) + 1, fresh);
|
||||
FocusRequested?.Invoke(fresh);
|
||||
}
|
||||
|
||||
/// <summary>Backspace in an already-empty note: drop it and put the caret in the one above.</summary>
|
||||
[RelayCommand]
|
||||
private async Task DeleteBullet(NoteBulletViewModel? b)
|
||||
{
|
||||
if (b is null) return;
|
||||
var index = Rows.IndexOf(b);
|
||||
await RemoveAsync(b);
|
||||
|
||||
for (var i = index - 1; i >= 0; i--)
|
||||
if (Rows[i] is NoteBulletViewModel previous)
|
||||
{
|
||||
FocusRequested?.Invoke(previous);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private async Task CommitBullet(NoteBulletViewModel? b)
|
||||
{
|
||||
if (b is null) return;
|
||||
var text = b.Text?.Trim() ?? "";
|
||||
if (text.Length == 0)
|
||||
try
|
||||
{
|
||||
await _api.DeleteAsync(b.Id);
|
||||
Bullets.Remove(b);
|
||||
return;
|
||||
if (text.Length == 0)
|
||||
{
|
||||
await RemoveAsync(b);
|
||||
return;
|
||||
}
|
||||
|
||||
if (b.IsNew)
|
||||
{
|
||||
var dto = await _api.AddAsync(b.Day, text);
|
||||
if (dto is not null) b.Id = dto.Id;
|
||||
}
|
||||
else
|
||||
{
|
||||
await _api.UpdateAsync(b.Id, text);
|
||||
}
|
||||
}
|
||||
await _api.UpdateAsync(b.Id, text);
|
||||
catch (Exception ex)
|
||||
{
|
||||
ErrorReported?.Invoke(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task RemoveAsync(NoteBulletViewModel b)
|
||||
{
|
||||
if (!b.IsNew) await _api.DeleteAsync(b.Id);
|
||||
Rows.Remove(b);
|
||||
RefreshEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,67 +8,214 @@ namespace ClaudeDo.Ui.ViewModels.Islands;
|
||||
public sealed partial class TaskRowViewModel : ViewModelBase
|
||||
{
|
||||
public required string Id { get; init; }
|
||||
[ObservableProperty] private int _number;
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(ShowNumberBadge))]
|
||||
private int _number;
|
||||
[ObservableProperty] private string _title = "";
|
||||
[ObservableProperty] private string _listName = "";
|
||||
[ObservableProperty] private bool _done;
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(IsOverdue))]
|
||||
[NotifyPropertyChangedFor(nameof(CanAddToMyDay))]
|
||||
private bool _done;
|
||||
[ObservableProperty] private bool _isStarred;
|
||||
[ObservableProperty] private bool _isMyDay;
|
||||
[ObservableProperty] private bool _isSelected;
|
||||
[ObservableProperty] private TaskStatus _status;
|
||||
[ObservableProperty] private PlanningPhase _planningPhase;
|
||||
[ObservableProperty] private string? _branch;
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(CanAddToMyDay))]
|
||||
private bool _isMyDay;
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(ShowRowActions))]
|
||||
private bool _isSelected;
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(StatusChipClass))]
|
||||
[NotifyPropertyChangedFor(nameof(StatusLabel))]
|
||||
[NotifyPropertyChangedFor(nameof(ShowStatusChip))]
|
||||
[NotifyPropertyChangedFor(nameof(IsRunning))]
|
||||
[NotifyPropertyChangedFor(nameof(IsWaitingForReview))]
|
||||
[NotifyPropertyChangedFor(nameof(IsParked))]
|
||||
[NotifyPropertyChangedFor(nameof(IsQueued))]
|
||||
[NotifyPropertyChangedFor(nameof(IsWaiting))]
|
||||
[NotifyPropertyChangedFor(nameof(HasFailureReason))]
|
||||
[NotifyPropertyChangedFor(nameof(FailureReasonTooltip))]
|
||||
[NotifyPropertyChangedFor(nameof(StatusChipTooltip))]
|
||||
[NotifyPropertyChangedFor(nameof(IsDraft))]
|
||||
[NotifyPropertyChangedFor(nameof(IsPlanned))]
|
||||
[NotifyPropertyChangedFor(nameof(CanOpenPlanningSession))]
|
||||
[NotifyPropertyChangedFor(nameof(CanRemoveFromQueue))]
|
||||
[NotifyPropertyChangedFor(nameof(CanSendToQueue))]
|
||||
[NotifyPropertyChangedFor(nameof(CanRefine))]
|
||||
[NotifyPropertyChangedFor(nameof(SendToQueueDisabledReason))]
|
||||
[NotifyPropertyChangedFor(nameof(CancelDisabledReason))]
|
||||
[NotifyPropertyChangedFor(nameof(RefineDisabledReason))]
|
||||
[NotifyPropertyChangedFor(nameof(PlanningDisabledReason))]
|
||||
[NotifyPropertyChangedFor(nameof(MarkAsDisabledReason))]
|
||||
private TaskStatus _status;
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(IsPlanningParent))]
|
||||
[NotifyPropertyChangedFor(nameof(PlanningBadge))]
|
||||
[NotifyPropertyChangedFor(nameof(ShowStatusChip))]
|
||||
[NotifyPropertyChangedFor(nameof(IsPlanActive))]
|
||||
[NotifyPropertyChangedFor(nameof(IsPlanFinalized))]
|
||||
[NotifyPropertyChangedFor(nameof(CanOpenPlanningSession))]
|
||||
[NotifyPropertyChangedFor(nameof(CanResumeOrDiscardPlanning))]
|
||||
[NotifyPropertyChangedFor(nameof(CanQueuePlan))]
|
||||
[NotifyPropertyChangedFor(nameof(CanSendToQueue))]
|
||||
[NotifyPropertyChangedFor(nameof(CanFinalizePlanning))]
|
||||
[NotifyPropertyChangedFor(nameof(CanRefine))]
|
||||
[NotifyPropertyChangedFor(nameof(SendToQueueDisabledReason))]
|
||||
[NotifyPropertyChangedFor(nameof(RefineDisabledReason))]
|
||||
[NotifyPropertyChangedFor(nameof(PlanningDisabledReason))]
|
||||
private PlanningPhase _planningPhase;
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(HasBranch))]
|
||||
private string? _branch;
|
||||
[ObservableProperty] private string? _diffStat;
|
||||
[ObservableProperty] private ClaudeDo.Data.Models.WorktreeState? _worktreeState;
|
||||
[ObservableProperty] private string? _worktreePath;
|
||||
[ObservableProperty] private DateTime? _scheduledFor;
|
||||
[ObservableProperty] private int _diffAdditions;
|
||||
[ObservableProperty] private int _diffDeletions;
|
||||
[ObservableProperty] private bool _dropHintAbove;
|
||||
[ObservableProperty] private bool _dropHintBelow;
|
||||
[ObservableProperty] private string? _parentTaskId;
|
||||
[ObservableProperty] private string? _createdBy;
|
||||
[ObservableProperty] private string? _blockedByTaskId;
|
||||
[ObservableProperty] private string? _dependsOnTaskId;
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(IsParked))]
|
||||
[NotifyPropertyChangedFor(nameof(StatusLabel))]
|
||||
private ClaudeDo.Data.Models.WorktreeState? _worktreeState;
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(CanOpenWorktree))]
|
||||
[NotifyPropertyChangedFor(nameof(OpenWorktreeDisabledReason))]
|
||||
private string? _worktreePath;
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(IsOverdue))]
|
||||
[NotifyPropertyChangedFor(nameof(HasSchedule))]
|
||||
private DateTime? _scheduledFor;
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(HasDiff))]
|
||||
[NotifyPropertyChangedFor(nameof(DiffAdditionsText))]
|
||||
private int _diffAdditions;
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(HasDiff))]
|
||||
[NotifyPropertyChangedFor(nameof(DiffDeletionsText))]
|
||||
private int _diffDeletions;
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(IsDropTarget))]
|
||||
private bool _dropHintAbove;
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(IsDropTarget))]
|
||||
private bool _dropHintBelow;
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(IsChild))]
|
||||
[NotifyPropertyChangedFor(nameof(IsAgentSuggested))]
|
||||
[NotifyPropertyChangedFor(nameof(ShowAsChild))]
|
||||
[NotifyPropertyChangedFor(nameof(IsDraft))]
|
||||
[NotifyPropertyChangedFor(nameof(IsPlanned))]
|
||||
[NotifyPropertyChangedFor(nameof(CanSendToQueue))]
|
||||
[NotifyPropertyChangedFor(nameof(CanOpenPlanningSession))]
|
||||
[NotifyPropertyChangedFor(nameof(SendToQueueDisabledReason))]
|
||||
[NotifyPropertyChangedFor(nameof(PlanningDisabledReason))]
|
||||
private string? _parentTaskId;
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(IsAgentSuggested))]
|
||||
private string? _createdBy;
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(IsQueued))]
|
||||
[NotifyPropertyChangedFor(nameof(IsWaiting))]
|
||||
[NotifyPropertyChangedFor(nameof(StatusChipClass))]
|
||||
[NotifyPropertyChangedFor(nameof(CanRemoveFromQueue))]
|
||||
private string? _blockedByTaskId;
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(DependsOnTaskId))]
|
||||
private IReadOnlyList<string> _dependsOnTaskIds = [];
|
||||
|
||||
// The single predecessor, or null when the task has none or several. The chain rail can only
|
||||
// draw a line, so a task waiting on n predecessors gets a ChainAfterLabel instead — see
|
||||
// TasksIslandViewModel.ApplyChainGrouping.
|
||||
public string? DependsOnTaskId => DependsOnTaskIds.Count == 1 ? DependsOnTaskIds[0] : null;
|
||||
[ObservableProperty] private bool _isExpanded = true;
|
||||
[ObservableProperty] private bool _hasPlanningChildren;
|
||||
[ObservableProperty] private bool _hasQueuedSubtasks;
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(IsPlanningParent))]
|
||||
[NotifyPropertyChangedFor(nameof(CanQueuePlan))]
|
||||
private bool _hasPlanningChildren;
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(CanRemoveFromQueue))]
|
||||
[NotifyPropertyChangedFor(nameof(CanSendToQueue))]
|
||||
[NotifyPropertyChangedFor(nameof(CanQueuePlan))]
|
||||
[NotifyPropertyChangedFor(nameof(SendToQueueDisabledReason))]
|
||||
private bool _hasQueuedSubtasks;
|
||||
[ObservableProperty] private bool _showListChip = true;
|
||||
[ObservableProperty] private bool _parentFinalized;
|
||||
[ObservableProperty] private bool _parentInView = true;
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(IsDraft))]
|
||||
[NotifyPropertyChangedFor(nameof(IsPlanned))]
|
||||
[NotifyPropertyChangedFor(nameof(CanSendToQueue))]
|
||||
[NotifyPropertyChangedFor(nameof(SendToQueueDisabledReason))]
|
||||
private bool _parentFinalized;
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(ShowAsChild))]
|
||||
[NotifyPropertyChangedFor(nameof(IsDraft))]
|
||||
[NotifyPropertyChangedFor(nameof(IsPlanned))]
|
||||
private bool _parentInView = true;
|
||||
// The three below are extrinsic — computed and assigned by TasksIslandViewModel.Regroup
|
||||
// (it alone has the cross-row graph needed to walk DependsOnTaskId chains), mirroring how
|
||||
// ParentInView is assigned by the same pass rather than derived locally.
|
||||
[ObservableProperty] private bool _showAsChainMember;
|
||||
[ObservableProperty] private int? _chainStep;
|
||||
[ObservableProperty] private string? _chainAfterLabel;
|
||||
[ObservableProperty] private int _roadblockCount;
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(HasRoadblock))]
|
||||
[NotifyPropertyChangedFor(nameof(RoadblockTooltip))]
|
||||
private int _roadblockCount;
|
||||
// Only meaningful when Status=Failed; stamped by TaskRunner.MarkFailed. "unknown" for a
|
||||
// Failed task that predates this field. Null on every other status.
|
||||
[ObservableProperty] private string? _failureReason;
|
||||
[ObservableProperty] private int? _failureTurnsUsed;
|
||||
[ObservableProperty] private int? _failureMaxTurns;
|
||||
[ObservableProperty] private bool _isRefining;
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(HasFailureReason))]
|
||||
[NotifyPropertyChangedFor(nameof(FailureReasonLabel))]
|
||||
[NotifyPropertyChangedFor(nameof(FailureReasonTooltip))]
|
||||
[NotifyPropertyChangedFor(nameof(StatusChipTooltip))]
|
||||
private string? _failureReason;
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(FailureReasonTooltip))]
|
||||
private int? _failureTurnsUsed;
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(FailureReasonTooltip))]
|
||||
private int? _failureMaxTurns;
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(CanRefine))]
|
||||
[NotifyPropertyChangedFor(nameof(RefineDisabledReason))]
|
||||
private bool _isRefining;
|
||||
// Manual = a reminder only the user can do. Every "hand this to Claude" affordance is hidden
|
||||
// and automation skips it; opening a hand-driven ConPTY session stays allowed.
|
||||
[ObservableProperty] private bool _isManual;
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(ManualBadge))]
|
||||
[NotifyPropertyChangedFor(nameof(CanRefine))]
|
||||
[NotifyPropertyChangedFor(nameof(CanSendToQueue))]
|
||||
[NotifyPropertyChangedFor(nameof(CanOpenPlanningSession))]
|
||||
[NotifyPropertyChangedFor(nameof(SendToQueueDisabledReason))]
|
||||
[NotifyPropertyChangedFor(nameof(RefineDisabledReason))]
|
||||
[NotifyPropertyChangedFor(nameof(PlanningDisabledReason))]
|
||||
private bool _isManual;
|
||||
// Set by the shell from Mission Control's open ConPTY panes: this task has a live hand-driven
|
||||
// session, which outranks the persisted status on the lifecycle chip (an interactive task is
|
||||
// typically Idle+Active-worktree, i.e. would otherwise read "Parked").
|
||||
[ObservableProperty] private bool _hasInteractiveSession;
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(IsParked))]
|
||||
[NotifyPropertyChangedFor(nameof(StatusChipClass))]
|
||||
[NotifyPropertyChangedFor(nameof(StatusLabel))]
|
||||
[NotifyPropertyChangedFor(nameof(ShowStatusChip))]
|
||||
[NotifyPropertyChangedFor(nameof(StatusChipTooltip))]
|
||||
[NotifyPropertyChangedFor(nameof(CanSendToQueue))]
|
||||
[NotifyPropertyChangedFor(nameof(SendToQueueDisabledReason))]
|
||||
[NotifyPropertyChangedFor(nameof(CanDeleteTask))]
|
||||
[NotifyPropertyChangedFor(nameof(DeleteDisabledReason))]
|
||||
private bool _hasInteractiveSession;
|
||||
// Set by the custom drag while this row is being dragged — drives the "grabbed" row style.
|
||||
[ObservableProperty] private bool _isDragging;
|
||||
|
||||
// Set from PointerEntered/PointerExited in TaskRowView.axaml.cs. Drives ShowRowActions
|
||||
// together with IsSelected, so hover-only affordances (refine button, unset star, dequeue-X)
|
||||
// stay reachable via keyboard/selection, not just mouse hover.
|
||||
[ObservableProperty] private bool _isHovered;
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(ShowRowActions))]
|
||||
private bool _isHovered;
|
||||
|
||||
// Transient: set from HubBroadcaster's OperationProgress while the worker is still creating
|
||||
// this task's worktree (the silent gap between Queued and the first agent output). Cleared
|
||||
// by the next entity refresh — UpdateFromEntity always reflects a settled state, so there's
|
||||
// nothing left to show past that point.
|
||||
[ObservableProperty] private string? _creationPhase;
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(HasCreationPhase))]
|
||||
[NotifyPropertyChangedFor(nameof(CreationPhaseLabel))]
|
||||
private string? _creationPhase;
|
||||
|
||||
// True while a drag is hovering this row (i.e. it would show a drop-hint gap). Used to
|
||||
// suppress the ordinary hover highlight/transitions so they don't fight the hint.
|
||||
@@ -130,7 +277,7 @@ public sealed partial class TaskRowViewModel : ViewModelBase
|
||||
&& !HasInteractiveSession;
|
||||
public bool IsQueued => Status == TaskStatus.Queued && string.IsNullOrEmpty(BlockedByTaskId);
|
||||
public bool IsWaiting => Status == TaskStatus.Queued && !string.IsNullOrEmpty(BlockedByTaskId);
|
||||
public bool CanRemoveFromQueue => IsQueued || HasQueuedSubtasks;
|
||||
public bool CanRemoveFromQueue => IsQueued || IsWaiting || HasQueuedSubtasks;
|
||||
// "Send to queue" is the single queue entry. On a finalized planning parent it queues the
|
||||
// plan (children) via CanQueuePlan; an Active (not-yet-finalized) planning parent is hidden —
|
||||
// it must be finalized first. The worker never sees a UI-hosted ConPTY session (it never
|
||||
@@ -309,179 +456,6 @@ public sealed partial class TaskRowViewModel : ViewModelBase
|
||||
_ => "idle",
|
||||
};
|
||||
|
||||
partial void OnStatusChanged(TaskStatus value)
|
||||
{
|
||||
OnPropertyChanged(nameof(StatusChipClass));
|
||||
OnPropertyChanged(nameof(StatusLabel));
|
||||
OnPropertyChanged(nameof(ShowStatusChip));
|
||||
OnPropertyChanged(nameof(IsRunning));
|
||||
OnPropertyChanged(nameof(IsWaitingForReview));
|
||||
OnPropertyChanged(nameof(IsParked));
|
||||
OnPropertyChanged(nameof(IsQueued));
|
||||
OnPropertyChanged(nameof(IsWaiting));
|
||||
OnPropertyChanged(nameof(HasFailureReason));
|
||||
OnPropertyChanged(nameof(FailureReasonTooltip));
|
||||
OnPropertyChanged(nameof(StatusChipTooltip));
|
||||
OnPropertyChanged(nameof(IsDraft));
|
||||
OnPropertyChanged(nameof(IsPlanned));
|
||||
OnPropertyChanged(nameof(CanOpenPlanningSession));
|
||||
OnPropertyChanged(nameof(CanRemoveFromQueue));
|
||||
OnPropertyChanged(nameof(CanSendToQueue));
|
||||
OnPropertyChanged(nameof(CanRefine));
|
||||
OnPropertyChanged(nameof(SendToQueueDisabledReason));
|
||||
OnPropertyChanged(nameof(CancelDisabledReason));
|
||||
OnPropertyChanged(nameof(RefineDisabledReason));
|
||||
OnPropertyChanged(nameof(PlanningDisabledReason));
|
||||
OnPropertyChanged(nameof(MarkAsDisabledReason));
|
||||
}
|
||||
|
||||
partial void OnParentTaskIdChanged(string? value)
|
||||
{
|
||||
OnPropertyChanged(nameof(IsChild));
|
||||
OnPropertyChanged(nameof(IsAgentSuggested));
|
||||
OnPropertyChanged(nameof(ShowAsChild));
|
||||
OnPropertyChanged(nameof(IsDraft));
|
||||
OnPropertyChanged(nameof(IsPlanned));
|
||||
OnPropertyChanged(nameof(CanSendToQueue));
|
||||
OnPropertyChanged(nameof(CanOpenPlanningSession));
|
||||
OnPropertyChanged(nameof(SendToQueueDisabledReason));
|
||||
OnPropertyChanged(nameof(PlanningDisabledReason));
|
||||
}
|
||||
|
||||
partial void OnParentInViewChanged(bool value)
|
||||
{
|
||||
OnPropertyChanged(nameof(ShowAsChild));
|
||||
OnPropertyChanged(nameof(IsDraft));
|
||||
OnPropertyChanged(nameof(IsPlanned));
|
||||
}
|
||||
|
||||
partial void OnCreatedByChanged(string? value) => OnPropertyChanged(nameof(IsAgentSuggested));
|
||||
|
||||
partial void OnParentFinalizedChanged(bool value)
|
||||
{
|
||||
OnPropertyChanged(nameof(IsDraft));
|
||||
OnPropertyChanged(nameof(IsPlanned));
|
||||
OnPropertyChanged(nameof(CanSendToQueue));
|
||||
OnPropertyChanged(nameof(SendToQueueDisabledReason));
|
||||
}
|
||||
|
||||
partial void OnPlanningPhaseChanged(PlanningPhase value)
|
||||
{
|
||||
OnPropertyChanged(nameof(IsPlanningParent));
|
||||
OnPropertyChanged(nameof(PlanningBadge));
|
||||
OnPropertyChanged(nameof(ShowStatusChip));
|
||||
OnPropertyChanged(nameof(IsPlanActive));
|
||||
OnPropertyChanged(nameof(IsPlanFinalized));
|
||||
OnPropertyChanged(nameof(CanOpenPlanningSession));
|
||||
OnPropertyChanged(nameof(CanResumeOrDiscardPlanning));
|
||||
OnPropertyChanged(nameof(CanQueuePlan));
|
||||
OnPropertyChanged(nameof(CanSendToQueue));
|
||||
OnPropertyChanged(nameof(CanFinalizePlanning));
|
||||
OnPropertyChanged(nameof(CanRefine));
|
||||
OnPropertyChanged(nameof(SendToQueueDisabledReason));
|
||||
OnPropertyChanged(nameof(RefineDisabledReason));
|
||||
OnPropertyChanged(nameof(PlanningDisabledReason));
|
||||
}
|
||||
|
||||
partial void OnIsRefiningChanged(bool value)
|
||||
{
|
||||
OnPropertyChanged(nameof(CanRefine));
|
||||
OnPropertyChanged(nameof(RefineDisabledReason));
|
||||
}
|
||||
|
||||
partial void OnIsManualChanged(bool value)
|
||||
{
|
||||
OnPropertyChanged(nameof(ManualBadge));
|
||||
OnPropertyChanged(nameof(CanRefine));
|
||||
OnPropertyChanged(nameof(CanSendToQueue));
|
||||
OnPropertyChanged(nameof(CanOpenPlanningSession));
|
||||
OnPropertyChanged(nameof(SendToQueueDisabledReason));
|
||||
OnPropertyChanged(nameof(RefineDisabledReason));
|
||||
OnPropertyChanged(nameof(PlanningDisabledReason));
|
||||
}
|
||||
|
||||
partial void OnHasInteractiveSessionChanged(bool value)
|
||||
{
|
||||
OnPropertyChanged(nameof(IsParked));
|
||||
OnPropertyChanged(nameof(StatusChipClass));
|
||||
OnPropertyChanged(nameof(StatusLabel));
|
||||
OnPropertyChanged(nameof(ShowStatusChip));
|
||||
OnPropertyChanged(nameof(StatusChipTooltip));
|
||||
OnPropertyChanged(nameof(CanSendToQueue));
|
||||
OnPropertyChanged(nameof(SendToQueueDisabledReason));
|
||||
OnPropertyChanged(nameof(CanDeleteTask));
|
||||
OnPropertyChanged(nameof(DeleteDisabledReason));
|
||||
}
|
||||
|
||||
partial void OnFailureReasonChanged(string? value)
|
||||
{
|
||||
OnPropertyChanged(nameof(HasFailureReason));
|
||||
OnPropertyChanged(nameof(FailureReasonLabel));
|
||||
OnPropertyChanged(nameof(FailureReasonTooltip));
|
||||
OnPropertyChanged(nameof(StatusChipTooltip));
|
||||
}
|
||||
|
||||
partial void OnFailureTurnsUsedChanged(int? value) => OnPropertyChanged(nameof(FailureReasonTooltip));
|
||||
partial void OnFailureMaxTurnsChanged(int? value) => OnPropertyChanged(nameof(FailureReasonTooltip));
|
||||
|
||||
partial void OnHasQueuedSubtasksChanged(bool value)
|
||||
{
|
||||
OnPropertyChanged(nameof(CanRemoveFromQueue));
|
||||
OnPropertyChanged(nameof(CanSendToQueue));
|
||||
OnPropertyChanged(nameof(CanQueuePlan));
|
||||
OnPropertyChanged(nameof(SendToQueueDisabledReason));
|
||||
}
|
||||
|
||||
partial void OnIsHoveredChanged(bool value) => OnPropertyChanged(nameof(ShowRowActions));
|
||||
partial void OnIsSelectedChanged(bool value) => OnPropertyChanged(nameof(ShowRowActions));
|
||||
|
||||
partial void OnBlockedByTaskIdChanged(string? value)
|
||||
{
|
||||
OnPropertyChanged(nameof(IsQueued));
|
||||
OnPropertyChanged(nameof(IsWaiting));
|
||||
OnPropertyChanged(nameof(StatusChipClass));
|
||||
}
|
||||
|
||||
partial void OnHasPlanningChildrenChanged(bool value)
|
||||
{
|
||||
OnPropertyChanged(nameof(IsPlanningParent));
|
||||
OnPropertyChanged(nameof(CanQueuePlan));
|
||||
}
|
||||
|
||||
partial void OnNumberChanged(int value) => OnPropertyChanged(nameof(ShowNumberBadge));
|
||||
partial void OnBranchChanged(string? value) => OnPropertyChanged(nameof(HasBranch));
|
||||
partial void OnWorktreePathChanged(string? value)
|
||||
{
|
||||
OnPropertyChanged(nameof(CanOpenWorktree));
|
||||
OnPropertyChanged(nameof(OpenWorktreeDisabledReason));
|
||||
}
|
||||
partial void OnWorktreeStateChanged(ClaudeDo.Data.Models.WorktreeState? value)
|
||||
{
|
||||
OnPropertyChanged(nameof(IsParked));
|
||||
OnPropertyChanged(nameof(StatusLabel));
|
||||
}
|
||||
partial void OnDoneChanged(bool value)
|
||||
{
|
||||
OnPropertyChanged(nameof(IsOverdue));
|
||||
OnPropertyChanged(nameof(CanAddToMyDay));
|
||||
}
|
||||
partial void OnIsMyDayChanged(bool value) => OnPropertyChanged(nameof(CanAddToMyDay));
|
||||
partial void OnScheduledForChanged(DateTime? value)
|
||||
{
|
||||
OnPropertyChanged(nameof(IsOverdue));
|
||||
OnPropertyChanged(nameof(HasSchedule));
|
||||
}
|
||||
partial void OnDiffAdditionsChanged(int value) { OnPropertyChanged(nameof(HasDiff)); OnPropertyChanged(nameof(DiffAdditionsText)); }
|
||||
partial void OnDiffDeletionsChanged(int value) { OnPropertyChanged(nameof(HasDiff)); OnPropertyChanged(nameof(DiffDeletionsText)); }
|
||||
partial void OnRoadblockCountChanged(int value) { OnPropertyChanged(nameof(HasRoadblock)); OnPropertyChanged(nameof(RoadblockTooltip)); }
|
||||
partial void OnDropHintAboveChanged(bool value) => OnPropertyChanged(nameof(IsDropTarget));
|
||||
partial void OnDropHintBelowChanged(bool value) => OnPropertyChanged(nameof(IsDropTarget));
|
||||
partial void OnCreationPhaseChanged(string? value)
|
||||
{
|
||||
OnPropertyChanged(nameof(HasCreationPhase));
|
||||
OnPropertyChanged(nameof(CreationPhaseLabel));
|
||||
}
|
||||
|
||||
public void RefreshLocalized()
|
||||
{
|
||||
OnPropertyChanged(nameof(StatusLabel));
|
||||
@@ -522,7 +496,10 @@ public sealed partial class TaskRowViewModel : ViewModelBase
|
||||
ParentTaskId = t.ParentTaskId;
|
||||
CreatedBy = t.CreatedBy;
|
||||
BlockedByTaskId = t.BlockedByTaskId;
|
||||
DependsOnTaskId = t.DependsOnTaskId;
|
||||
// Guarded: TaskEntity.DependsOnTaskIds projects a fresh List every read, so a plain
|
||||
// assignment would fire PropertyChanged on every reconcile tick even when nothing moved.
|
||||
var deps = t.DependsOnTaskIds;
|
||||
if (!DependsOnTaskIds.SequenceEqual(deps)) DependsOnTaskIds = deps;
|
||||
RoadblockCount = t.RoadblockCount;
|
||||
FailureReason = t.FailureReason;
|
||||
FailureTurnsUsed = t.FailureTurnsUsed;
|
||||
|
||||
@@ -9,6 +9,7 @@ using ClaudeDo.Data.Models;
|
||||
using ClaudeDo.Data.Repositories;
|
||||
using ClaudeDo.Ui.Localization;
|
||||
using ClaudeDo.Ui.Services;
|
||||
using ClaudeDo.Ui.Services.Interfaces;
|
||||
using ClaudeDo.Ui.ViewModels.Modals;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using TaskStatus = ClaudeDo.Data.Models.TaskStatus;
|
||||
@@ -62,18 +63,10 @@ public sealed partial class TasksIslandViewModel : ViewModelBase, IDisposable
|
||||
|
||||
public event EventHandler? FocusAddTaskRequested;
|
||||
public event EventHandler? TasksChanged;
|
||||
public event Action? NotesRequested;
|
||||
public event Action? PrepRequested;
|
||||
public event Action<string>? ErrorReported;
|
||||
public void RequestFocusAddTask() => FocusAddTaskRequested?.Invoke(this, EventArgs.Empty);
|
||||
|
||||
[RelayCommand]
|
||||
private void OpenNotes()
|
||||
{
|
||||
SelectFrom(null, "notes");
|
||||
NotesRequested?.Invoke();
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private void ShowPrepLog() => PrepRequested?.Invoke();
|
||||
|
||||
@@ -118,8 +111,17 @@ public sealed partial class TasksIslandViewModel : ViewModelBase, IDisposable
|
||||
private bool _hasCompleted;
|
||||
[ObservableProperty] private bool _showOpenLabel;
|
||||
[ObservableProperty] private string _completedHeader = "";
|
||||
[ObservableProperty] private bool _showNotesRow;
|
||||
[ObservableProperty] private bool _isMyDayList;
|
||||
|
||||
/// <summary>The notes list is content, not a task list — the island swaps its rows for the
|
||||
/// notes editor instead of showing an empty task list.</summary>
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(IsTasksEmptyHintVisible))]
|
||||
[NotifyPropertyChangedFor(nameof(IsTasksEmptyRepoHintVisible))]
|
||||
private bool _isNotesList;
|
||||
|
||||
/// <summary>Null only in tests that construct the island without a notes API.</summary>
|
||||
public NotesEditorViewModel? Notes { get; }
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(IsTasksEmptyRepoHintVisible))]
|
||||
private bool _isLetClaudeVisible;
|
||||
@@ -128,7 +130,7 @@ public sealed partial class TasksIslandViewModel : ViewModelBase, IDisposable
|
||||
|
||||
/// <summary>No visible tasks below the add-task row — every item lands in one of
|
||||
/// Overdue/Open/Completed, so all-false here always means the list has zero items.</summary>
|
||||
public bool IsTasksEmptyHintVisible => !HasOverdue && !HasOpen && !HasCompleted;
|
||||
public bool IsTasksEmptyHintVisible => !HasOverdue && !HasOpen && !HasCompleted && !IsNotesList;
|
||||
|
||||
/// <summary>Extra empty-state line for a User list with no linked working dir, where the
|
||||
/// execution features (queue, Let Claude handle it, Quick session) are unavailable. Derived
|
||||
@@ -182,10 +184,20 @@ public sealed partial class TasksIslandViewModel : ViewModelBase, IDisposable
|
||||
|
||||
private readonly EventHandler _langChangedHandler;
|
||||
|
||||
public TasksIslandViewModel(IDbContextFactory<ClaudeDoDbContext> dbFactory, IWorkerClient? worker = null)
|
||||
public TasksIslandViewModel(
|
||||
IDbContextFactory<ClaudeDoDbContext> dbFactory,
|
||||
IWorkerClient? worker = null,
|
||||
INotesApi? notesApi = null)
|
||||
{
|
||||
_dbFactory = dbFactory;
|
||||
_worker = worker;
|
||||
if (notesApi is not null)
|
||||
{
|
||||
Notes = new NotesEditorViewModel(notesApi);
|
||||
Notes.ErrorReported += msg => ErrorReported?.Invoke(msg);
|
||||
if (worker is not null)
|
||||
worker.NotesUpdatedEvent += () => { if (IsNotesList) _ = Notes.LoadAsync(); };
|
||||
}
|
||||
_completedHeaderRow = new() { ActionCommand = ClearCompletedCommand };
|
||||
CompletedHeader = Loc.T("vm.tasksIsland.completedHeader");
|
||||
if (_worker is not null)
|
||||
@@ -301,6 +313,7 @@ public sealed partial class TasksIslandViewModel : ViewModelBase, IDisposable
|
||||
var entity = await db.Tasks
|
||||
.Include(t => t.List)
|
||||
.Include(t => t.Worktree)
|
||||
.Include(t => t.Dependencies)
|
||||
.FirstOrDefaultAsync(t => t.Id == taskId);
|
||||
|
||||
// A newer refresh for this task started while we were reading — its result is fresher.
|
||||
@@ -417,14 +430,14 @@ public sealed partial class TasksIslandViewModel : ViewModelBase, IDisposable
|
||||
HasOpen = false;
|
||||
HasCompleted = false;
|
||||
ShowOpenLabel = false;
|
||||
ShowNotesRow = false;
|
||||
if (listChanged) SelectFrom(null, "list-change");
|
||||
if (list is null) { IsLetClaudeVisible = false; IsQuickClaudeVisible = false; IsMergeReviewsVisible = false; LoadTask = Task.CompletedTask; return; }
|
||||
|
||||
HeaderTitle = list.Name;
|
||||
HeaderEyebrow = DateTime.Now.ToString("dddd · MMM dd", CultureInfo.InvariantCulture).ToUpperInvariant();
|
||||
ShowNotesRow = list.Id == "smart:my-day";
|
||||
IsMyDayList = list.Id == "smart:my-day";
|
||||
IsNotesList = list.Id == ListsIslandViewModel.NotesListId;
|
||||
if (IsNotesList && Notes is not null) _ = Notes.LoadAsync();
|
||||
IsLetClaudeVisible = list.Kind == ListKind.User && !string.IsNullOrWhiteSpace(list.WorkingDir);
|
||||
IsQuickClaudeVisible = IsLetClaudeVisible;
|
||||
IsMergeReviewsVisible = list.Id == "virtual:review";
|
||||
@@ -441,7 +454,7 @@ public sealed partial class TasksIslandViewModel : ViewModelBase, IDisposable
|
||||
{
|
||||
await using var db = await _dbFactory.CreateDbContextAsync(ct);
|
||||
var filter = _filters.Resolve(list.Id);
|
||||
var baseQuery = db.Tasks.Include(t => t.List).Include(t => t.Worktree);
|
||||
var baseQuery = db.Tasks.Include(t => t.List).Include(t => t.Worktree).Include(t => t.Dependencies);
|
||||
|
||||
var filteredList = filter is null
|
||||
? new List<TaskEntity>()
|
||||
@@ -710,12 +723,17 @@ public sealed partial class TasksIslandViewModel : ViewModelBase, IDisposable
|
||||
}
|
||||
|
||||
// Content only — "after " + localization is Slice 2's concern (the view), which is why this
|
||||
// holds just the identifying fragment rather than an assembled sentence.
|
||||
// holds just the identifying fragment rather than an assembled sentence. Names every
|
||||
// predecessor it can resolve: a task can wait on n of them, and hiding all but the first
|
||||
// would misreport what the row is actually waiting for.
|
||||
private static string? BuildAfterLabel(TaskRowViewModel row, Dictionary<string, TaskRowViewModel> rowsById)
|
||||
{
|
||||
if (string.IsNullOrEmpty(row.DependsOnTaskId)) return null;
|
||||
if (!rowsById.TryGetValue(row.DependsOnTaskId, out var predecessor)) return null;
|
||||
return predecessor.Number > 0 ? $"#{predecessor.Number}" : predecessor.Title;
|
||||
var parts = row.DependsOnTaskIds
|
||||
.Select(id => rowsById.TryGetValue(id, out var p) ? p : null)
|
||||
.Where(p => p is not null)
|
||||
.Select(p => p!.Number > 0 ? $"#{p.Number}" : p.Title)
|
||||
.ToList();
|
||||
return parts.Count == 0 ? null : string.Join(", ", parts);
|
||||
}
|
||||
|
||||
// Assigns ShowAsChainMember/ChainStep/ChainAfterLabel for every row in `section`, then
|
||||
@@ -731,7 +749,7 @@ public sealed partial class TasksIslandViewModel : ViewModelBase, IDisposable
|
||||
|
||||
foreach (var r in section)
|
||||
{
|
||||
if (string.IsNullOrEmpty(r.DependsOnTaskId))
|
||||
if (r.DependsOnTaskIds.Count == 0)
|
||||
{
|
||||
r.ShowAsChainMember = false;
|
||||
r.ChainStep = null;
|
||||
@@ -739,6 +757,16 @@ public sealed partial class TasksIslandViewModel : ViewModelBase, IDisposable
|
||||
continue;
|
||||
}
|
||||
|
||||
// Several predecessors aren't a chain — the rail draws one line, so a fan-in row
|
||||
// only ever gets the label listing everything it waits on.
|
||||
if (r.DependsOnTaskId is null)
|
||||
{
|
||||
r.ShowAsChainMember = false;
|
||||
r.ChainStep = null;
|
||||
r.ChainAfterLabel = BuildAfterLabel(r, rowsById);
|
||||
continue;
|
||||
}
|
||||
|
||||
// A planning child keeps its parent indent — chain membership only ever shows as a
|
||||
// label for it, never as a second, nested rail (design: "parent wins").
|
||||
if (r.IsChild)
|
||||
@@ -794,13 +822,16 @@ public sealed partial class TasksIslandViewModel : ViewModelBase, IDisposable
|
||||
var now = DateTime.Now;
|
||||
var open = Items.Count(i => !i.Done);
|
||||
var running = Items.Count(i => i.Status == TaskStatus.Running);
|
||||
var review = Items.Count(i => i.Status == TaskStatus.Done && i.Branch != null);
|
||||
var review = Items.Count(i => i.Status == TaskStatus.WaitingForReview);
|
||||
|
||||
Subtitle = open == 1 ? "1 open task" : $"{open} open tasks";
|
||||
// The notes list holds no tasks — an "0 open tasks" line under its header is just noise.
|
||||
Subtitle = IsNotesList ? ""
|
||||
: open == 1 ? Loc.T("vm.tasksIsland.openTaskOne")
|
||||
: Loc.T("vm.tasksIsland.openTasks", open);
|
||||
|
||||
if (running > 0 || review > 0)
|
||||
{
|
||||
StatusPill = $"{running} running · {review} review";
|
||||
StatusPill = Loc.T("vm.tasksIsland.statusPill", running, review);
|
||||
HasStatusPill = true;
|
||||
}
|
||||
else
|
||||
@@ -1669,6 +1700,7 @@ public sealed partial class TasksIslandViewModel : ViewModelBase, IDisposable
|
||||
entities = await db.Tasks
|
||||
.Include(t => t.List)
|
||||
.Include(t => t.Worktree)
|
||||
.Include(t => t.Dependencies)
|
||||
.Where(t => idSet.Contains(t.Id))
|
||||
.ToListAsync(ct);
|
||||
dbOk = true;
|
||||
@@ -1713,6 +1745,7 @@ public sealed partial class TasksIslandViewModel : ViewModelBase, IDisposable
|
||||
// The slice of a row that Regroup reads: which section it lands in, where it sits inside it,
|
||||
// and what its chain rail/after-chip says. Only fields UpdateFromEntity actually writes —
|
||||
// IsExpanded and HasPlanningChildren are owned elsewhere and would produce false positives.
|
||||
private static (bool, DateTime?, string?, string?, PlanningPhase, int, string) GroupingKey(TaskRowViewModel r) =>
|
||||
(r.Done, r.ScheduledFor, r.ParentTaskId, r.DependsOnTaskId, r.PlanningPhase, r.Number, r.Title);
|
||||
private static (bool, DateTime?, string?, string, PlanningPhase, int, string) GroupingKey(TaskRowViewModel r) =>
|
||||
(r.Done, r.ScheduledFor, r.ParentTaskId, string.Join(",", r.DependsOnTaskIds),
|
||||
r.PlanningPhase, r.Number, r.Title);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ using System.Threading.Tasks;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using ClaudeDo.Data;
|
||||
using ClaudeDo.Data.Git;
|
||||
using ClaudeDo.Data.Models;
|
||||
using ClaudeDo.Ui.Localization;
|
||||
using ClaudeDo.Ui.Services;
|
||||
@@ -52,7 +51,6 @@ public sealed partial class IslandsShellViewModel : ViewModelBase, IDisposable
|
||||
private readonly UpdateCheckService _updateCheck = null!;
|
||||
private readonly InstallerLocator _installerLocator = null!;
|
||||
private readonly WorkerLocator _workerLocator = null!;
|
||||
private readonly GitService? _git;
|
||||
private readonly IDbContextFactory<ClaudeDoDbContext>? _dbFactory;
|
||||
private readonly Func<WorktreesOverviewModalViewModel> _worktreesOverviewVmFactory = () => null!;
|
||||
private readonly Func<WeeklyReportModalViewModel> _weeklyReportVmFactory = () => null!;
|
||||
@@ -121,11 +119,6 @@ public sealed partial class IslandsShellViewModel : ViewModelBase, IDisposable
|
||||
[ObservableProperty] private string? _updateBannerLatestVersion;
|
||||
private bool _bannerDismissedThisSession;
|
||||
|
||||
// Persistent (not auto-clearing) banner: the running worker predates the selected list's
|
||||
// merged HEAD, so "verified" claims made against the current process are stale. ClaudeDo-repo
|
||||
// only — see RefreshStaleWorkerCheckAsync.
|
||||
[ObservableProperty] private bool _isStaleWorkerBannerVisible;
|
||||
|
||||
// planningTaskId -> subtaskId, for unit-merge conflicts an MCP session (not the UI) started.
|
||||
// Kept as a dictionary so a later conflict on the same planning task updates in place instead
|
||||
// of piling up duplicate entries.
|
||||
@@ -145,7 +138,14 @@ public sealed partial class IslandsShellViewModel : ViewModelBase, IDisposable
|
||||
[ObservableProperty]
|
||||
private bool _isWorkerLogVisible;
|
||||
|
||||
public bool ShowDetails => WindowWidth >= 1100;
|
||||
/// <summary>The notes list has nothing to show a detail pane for, so the pane goes away and
|
||||
/// the editor takes the space instead of leaving an empty column beside it.</summary>
|
||||
public bool ShowDetails => WindowWidth >= 1100 && Tasks?.IsNotesList != true;
|
||||
|
||||
/// <summary>Widens the tasks island over the splitter and the details column when that column
|
||||
/// is hidden — a fixed-width ColumnDefinition keeps its space even with an invisible child.</summary>
|
||||
public int TasksColumnSpan => ShowDetails ? 1 : 3;
|
||||
|
||||
public bool ShowLists => WindowWidth >= 780;
|
||||
|
||||
private readonly System.Timers.Timer _clearTimer = new(30_000) { AutoReset = false };
|
||||
@@ -168,10 +168,16 @@ public sealed partial class IslandsShellViewModel : ViewModelBase, IDisposable
|
||||
|
||||
partial void OnWindowWidthChanged(double value)
|
||||
{
|
||||
OnPropertyChanged(nameof(ShowDetails));
|
||||
NotifyDetailsVisibility();
|
||||
OnPropertyChanged(nameof(ShowLists));
|
||||
}
|
||||
|
||||
private void NotifyDetailsVisibility()
|
||||
{
|
||||
OnPropertyChanged(nameof(ShowDetails));
|
||||
OnPropertyChanged(nameof(TasksColumnSpan));
|
||||
}
|
||||
|
||||
public void OnWorkerLogReceived(WorkerLogEntry entry)
|
||||
{
|
||||
var hhmm = entry.TimestampUtc.ToLocalTime().ToString("HH:mm");
|
||||
@@ -315,8 +321,7 @@ public sealed partial class IslandsShellViewModel : ViewModelBase, IDisposable
|
||||
Func<MergeModalViewModel> mergeVmFactory,
|
||||
Func<RepoImportModalViewModel> repoImportVmFactory,
|
||||
MissionControlViewModel missionControl,
|
||||
UsagePillViewModel usagePill,
|
||||
GitService? git = null)
|
||||
UsagePillViewModel usagePill)
|
||||
{
|
||||
Lists = lists; Tasks = tasks; Details = details; Worker = worker;
|
||||
MissionControl = missionControl;
|
||||
@@ -324,6 +329,7 @@ public sealed partial class IslandsShellViewModel : ViewModelBase, IDisposable
|
||||
UsagePill.OpenMonitorRequested += () => _ = OpenUsageMonitor();
|
||||
MissionControl.OpenInApp = id => _ = RevealTaskAsync(id);
|
||||
MissionControl.OpenSettingsRequested = () => Lists.OpenSettingsCommand.Execute(null);
|
||||
MissionControl.OpenRequested = OpenMissionControl;
|
||||
MissionControl.ErrorReported += FlashFooterError;
|
||||
// Keep the task rows' "Interactive" chip in step with Mission Control's open ConPTY panes.
|
||||
MissionControl.ConPtySessions.CollectionChanged += (_, _) => SyncInteractiveSessionChips();
|
||||
@@ -336,12 +342,13 @@ public sealed partial class IslandsShellViewModel : ViewModelBase, IDisposable
|
||||
_usageMonitorVmFactory = usageMonitorVmFactory;
|
||||
_mergeVmFactory = mergeVmFactory;
|
||||
_repoImportVmFactory = repoImportVmFactory;
|
||||
_git = git;
|
||||
Lists.SelectionChanged += (_, _) => Tasks.LoadForList(Lists.SelectedList);
|
||||
Lists.SelectionChanged += (_, _) => _ = RefreshStaleWorkerCheckAsync();
|
||||
Tasks.SelectionChanged += (_, _) => Details.Bind(Tasks.SelectedTask, Tasks.SelectionSource);
|
||||
Tasks.NotesRequested += () => Details.ShowNotes();
|
||||
Tasks.PrepRequested += () => Details.ShowPrep();
|
||||
Tasks.PropertyChanged += (_, e) =>
|
||||
{
|
||||
if (e.PropertyName == nameof(TasksIslandViewModel.IsNotesList)) NotifyDetailsVisibility();
|
||||
};
|
||||
Tasks.ErrorReported += FlashFooterError;
|
||||
Lists.ErrorReported += FlashFooterError;
|
||||
Lists.SuccessReported += FlashFooterSuccess;
|
||||
@@ -402,7 +409,6 @@ public sealed partial class IslandsShellViewModel : ViewModelBase, IDisposable
|
||||
};
|
||||
Worker.OperationProgressEvent += OnOperationProgress;
|
||||
Worker.WorkerLogReceivedEvent += OnWorkerLogReceived;
|
||||
Worker.ConnectionRestoredEvent += () => _ = RefreshStaleWorkerCheckAsync();
|
||||
Worker.PlanningMergeConflictEvent += OnPlanningMergeConflict;
|
||||
Worker.PlanningMergeAbortedEvent += OnPlanningMergeAborted;
|
||||
Worker.PlanningCompletedEvent += OnPlanningMergeCompleted;
|
||||
@@ -455,8 +461,6 @@ public sealed partial class IslandsShellViewModel : ViewModelBase, IDisposable
|
||||
_connectTimer.Dispose();
|
||||
_primeStatusTimer.Stop();
|
||||
_primeStatusTimer.Dispose();
|
||||
_staleWorkerCts?.Cancel();
|
||||
_staleWorkerCts?.Dispose();
|
||||
}
|
||||
|
||||
private void RefreshBannerFromStatus()
|
||||
@@ -476,57 +480,6 @@ public sealed partial class IslandsShellViewModel : ViewModelBase, IDisposable
|
||||
}
|
||||
}
|
||||
|
||||
private CancellationTokenSource? _staleWorkerCts;
|
||||
|
||||
// Re-evaluates the stale-worker banner for the currently selected list. Cheap (one hub call +
|
||||
// up to two git subprocesses) and only ever runs for a git-backed list, so it's fine to fire on
|
||||
// every selection change / reconnect rather than caching.
|
||||
private async Task RefreshStaleWorkerCheckAsync()
|
||||
{
|
||||
_staleWorkerCts?.Cancel();
|
||||
var cts = new CancellationTokenSource();
|
||||
_staleWorkerCts = cts;
|
||||
|
||||
var stale = await ComputeIsStaleWorkerAsync(Lists?.SelectedList?.WorkingDir, cts.Token);
|
||||
if (cts.IsCancellationRequested) return;
|
||||
IsStaleWorkerBannerVisible = stale;
|
||||
}
|
||||
|
||||
private async Task<bool> ComputeIsStaleWorkerAsync(string? workingDir, CancellationToken ct)
|
||||
{
|
||||
if (_git is null || Worker is null || string.IsNullOrWhiteSpace(workingDir)) return false;
|
||||
|
||||
try
|
||||
{
|
||||
var buildInfo = await Worker.GetWorkerBuildInfoAsync();
|
||||
var buildSha = buildInfo?.BuildSha;
|
||||
if (string.IsNullOrWhiteSpace(buildSha)) return false;
|
||||
if (!await _git.IsGitRepoAsync(workingDir, ct)) return false;
|
||||
|
||||
var head = await _git.RevParseHeadAsync(workingDir, ct);
|
||||
var isAncestor = string.Equals(buildSha, head, StringComparison.OrdinalIgnoreCase)
|
||||
? (bool?)false // equal — never "stale" on a match, and no need to ask git
|
||||
: await _git.IsAncestorAsync(workingDir, buildSha, head, ct);
|
||||
return ShouldShowStaleWorkerBanner(buildSha, head, isAncestor);
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Worker offline, dir no longer a repo, etc. — unknown, so stay quiet.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Pure decision extracted for testability. isAncestor is the tri-state result of
|
||||
// `git merge-base --is-ancestor buildSha head`: true = worker predates head (stale), false =
|
||||
// equal or diverged (never claim "stale" on a match or an unrelated history), null = unknown
|
||||
// (e.g. buildSha isn't a commit this repo knows about — never treat "unknown" as "stale").
|
||||
internal static bool ShouldShowStaleWorkerBanner(string? buildSha, string? headSha, bool? isAncestor)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(buildSha) || string.IsNullOrWhiteSpace(headSha)) return false;
|
||||
if (string.Equals(buildSha, headSha, StringComparison.OrdinalIgnoreCase)) return false;
|
||||
return isAncestor == true;
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private void OpenMissionControl()
|
||||
{
|
||||
@@ -562,6 +515,19 @@ public sealed partial class IslandsShellViewModel : ViewModelBase, IDisposable
|
||||
if (Dialogs is not null) await Dialogs.ShowAboutAsync(vm);
|
||||
}
|
||||
|
||||
// One shared VM so the sheets are parsed once and the window keeps its selection/pin
|
||||
// across reopens; the window itself is single-instance in the dialog service.
|
||||
private CheatSheetsViewModel? _cheatSheets;
|
||||
|
||||
[RelayCommand]
|
||||
private void OpenCheatSheet(string? key)
|
||||
{
|
||||
if (Dialogs is null) return;
|
||||
_cheatSheets ??= new CheatSheetsViewModel();
|
||||
if (!string.IsNullOrEmpty(key)) _cheatSheets.Select(key);
|
||||
Dialogs.ShowCheatSheets(_cheatSheets);
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private async Task OpenLogVisualizer()
|
||||
{
|
||||
|
||||
@@ -18,6 +18,12 @@ public sealed partial class ConPtyPaneViewModel : ViewModelBase, IDisposable
|
||||
// Only a task-based pane can be submitted for review (an ad-hoc directory session has no task).
|
||||
public bool IsTaskBased => TaskId is not null;
|
||||
|
||||
/// <summary>Set by the host for a list-handler run ("Let Claude handle it" / "Let Claude merge
|
||||
/// the reviews") pane -- shows the "Abandon run" action. Plain mutable property, not
|
||||
/// <see cref="ObservableProperty"/>: the host sets it once right after construction, before the
|
||||
/// pane is added to the visible collection, so no change notification is needed.</summary>
|
||||
public bool IsListHandler { get; set; }
|
||||
|
||||
[ObservableProperty] private string _displayTitle;
|
||||
|
||||
[ObservableProperty] private InteractiveTerminalViewModel _terminal = new();
|
||||
@@ -26,6 +32,10 @@ public sealed partial class ConPtyPaneViewModel : ViewModelBase, IDisposable
|
||||
/// flight, so a rapid double-click can't race two submissions for the same task.</summary>
|
||||
[ObservableProperty] private bool _isSubmitPending;
|
||||
|
||||
/// <summary>Set by the host while an abandon-run round trip (query open tasks, confirm,
|
||||
/// cancel each, close pane) is in flight, so a rapid double-click can't race two runs.</summary>
|
||||
[ObservableProperty] private bool _isAbandonPending;
|
||||
|
||||
/// <summary>Raised when the terminal failed to start — the host surfaces this via the footer error strip.</summary>
|
||||
public event Action<string>? ErrorReported;
|
||||
|
||||
@@ -36,6 +46,18 @@ public sealed partial class ConPtyPaneViewModel : ViewModelBase, IDisposable
|
||||
/// commits the worktree and moves the task to WaitingForReview.</summary>
|
||||
public event Action<string>? SubmitForReviewRequested;
|
||||
|
||||
/// <summary>Raised when the user abandons a list-handler run (<see cref="IsListHandler"/>
|
||||
/// only): the host looks up this round's still-open tasks, confirms with the user (naming the
|
||||
/// count), cancels them, then closes this pane -- one action instead of closing the tile and
|
||||
/// separately cancelling the queue.</summary>
|
||||
public event Action<string>? AbandonRunRequested;
|
||||
|
||||
/// <summary>Raised with <c>(taskId, exitCode)</c> when a task-based session that had been running
|
||||
/// dies non-zero. The host reports it to the worker, which decides whether this was a list
|
||||
/// handler killed by the usage limit and worth reopening. Ad-hoc panes never raise it — there is
|
||||
/// no task to reopen.</summary>
|
||||
public event Action<string, int>? SessionDiedAfterStartup;
|
||||
|
||||
/// <summary>Task-based pane — dedup'd by <see cref="TaskId"/>. Pass null for an ad-hoc pane
|
||||
/// (no task, never deduped); prefer <see cref="CreateAdHoc"/> at ad-hoc call sites.
|
||||
/// <paramref name="descriptorFactory"/> is resolved by the pane itself (in <see cref="Start"/>)
|
||||
@@ -49,7 +71,34 @@ public sealed partial class ConPtyPaneViewModel : ViewModelBase, IDisposable
|
||||
TaskId = taskId;
|
||||
_displayTitle = displayTitle;
|
||||
_descriptorFactory = descriptorFactory;
|
||||
Terminal.PropertyChanged += OnTerminalPropertyChanged;
|
||||
Subscribe(Terminal);
|
||||
}
|
||||
|
||||
// Terminal is swapped wholesale on Retry, so the handlers follow the property rather than being
|
||||
// wired once at construction. (The initial value comes from the field initializer, which never
|
||||
// runs through the setter -- hence the explicit Subscribe in the constructor.)
|
||||
partial void OnTerminalChanging(InteractiveTerminalViewModel? oldValue, InteractiveTerminalViewModel newValue)
|
||||
{
|
||||
if (oldValue is not null) Unsubscribe(oldValue);
|
||||
}
|
||||
|
||||
partial void OnTerminalChanged(InteractiveTerminalViewModel value) => Subscribe(value);
|
||||
|
||||
private void Subscribe(InteractiveTerminalViewModel terminal)
|
||||
{
|
||||
terminal.PropertyChanged += OnTerminalPropertyChanged;
|
||||
terminal.ExitedAfterStartup += OnTerminalExitedAfterStartup;
|
||||
}
|
||||
|
||||
private void Unsubscribe(InteractiveTerminalViewModel terminal)
|
||||
{
|
||||
terminal.PropertyChanged -= OnTerminalPropertyChanged;
|
||||
terminal.ExitedAfterStartup -= OnTerminalExitedAfterStartup;
|
||||
}
|
||||
|
||||
private void OnTerminalExitedAfterStartup(int exitCode)
|
||||
{
|
||||
if (TaskId is { } id) SessionDiedAfterStartup?.Invoke(id, exitCode);
|
||||
}
|
||||
|
||||
private readonly Func<System.Threading.Tasks.Task<TerminalLaunchDescriptor>> _descriptorFactory;
|
||||
@@ -90,6 +139,10 @@ public sealed partial class ConPtyPaneViewModel : ViewModelBase, IDisposable
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Types a message into this pane's live session and submits it (the worker's
|
||||
/// pre-usage-limit warning). False when the session isn't running.</summary>
|
||||
public System.Threading.Tasks.Task<bool> SendLineAsync(string text) => Terminal.SendLineAsync(text);
|
||||
|
||||
[RelayCommand]
|
||||
private void Close() => CloseRequested?.Invoke(this);
|
||||
|
||||
@@ -104,6 +157,16 @@ public sealed partial class ConPtyPaneViewModel : ViewModelBase, IDisposable
|
||||
|
||||
partial void OnIsSubmitPendingChanged(bool value) => SubmitForReviewCommand.NotifyCanExecuteChanged();
|
||||
|
||||
private bool CanAbandonRun() => IsListHandler && !IsAbandonPending;
|
||||
|
||||
[RelayCommand(CanExecute = nameof(CanAbandonRun))]
|
||||
private void AbandonRun()
|
||||
{
|
||||
if (TaskId is { } id) AbandonRunRequested?.Invoke(id);
|
||||
}
|
||||
|
||||
partial void OnIsAbandonPendingChanged(bool value) => AbandonRunCommand.NotifyCanExecuteChanged();
|
||||
|
||||
// A launch failure permanently occupies the TaskId dedupe slot unless the user can retry —
|
||||
// re-opening the same task would otherwise just re-focus a dead tile.
|
||||
private bool CanRetry() => Terminal.HasExited && Terminal.StartError is not null;
|
||||
@@ -111,16 +174,15 @@ public sealed partial class ConPtyPaneViewModel : ViewModelBase, IDisposable
|
||||
[RelayCommand(CanExecute = nameof(CanRetry))]
|
||||
private void Retry()
|
||||
{
|
||||
Terminal.PropertyChanged -= OnTerminalPropertyChanged;
|
||||
Terminal.Dispose();
|
||||
Terminal = new InteractiveTerminalViewModel();
|
||||
Terminal.PropertyChanged += OnTerminalPropertyChanged;
|
||||
var dead = Terminal;
|
||||
Terminal = new InteractiveTerminalViewModel(); // OnTerminalChanging/Changed move the handlers
|
||||
dead.Dispose();
|
||||
Start();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Terminal.PropertyChanged -= OnTerminalPropertyChanged;
|
||||
Unsubscribe(Terminal);
|
||||
Terminal.Kill();
|
||||
Terminal.Dispose();
|
||||
}
|
||||
|
||||
@@ -21,6 +21,8 @@ public sealed partial class MissionControlViewModel : ViewModelBase, IDisposable
|
||||
private readonly Action<string> _onTaskUpdated;
|
||||
private readonly Action _onConnectionRestored;
|
||||
private readonly Action<string, IReadOnlyList<string>, string> _onHandoffRequested;
|
||||
private readonly Action<string, IReadOnlyList<string>> _onListHandlerStartRequested;
|
||||
private readonly Action<string, string> _onHandlerUsageWarning;
|
||||
|
||||
// Embedded ConPTY sessions (task-based only) — a manual cockpit detached from the
|
||||
// review/merge/status machinery.
|
||||
@@ -56,6 +58,11 @@ public sealed partial class MissionControlViewModel : ViewModelBase, IDisposable
|
||||
// View-layer seam: open the app Settings modal from the Mission Control window.
|
||||
public Action? OpenSettingsRequested { get; set; }
|
||||
|
||||
// Set by the shell: bring Mission Control on screen. A ConPTY pane only launches its process once
|
||||
// its view is attached, so a run started from outside the UI (start_list_handler MCP tool) or a
|
||||
// handoff arriving while Mission Control is closed would otherwise sit there without a process.
|
||||
public Action? OpenRequested { get; set; }
|
||||
|
||||
public bool HasPanes => Panes.Count > 0;
|
||||
|
||||
// Read-only activity strip. Beyond the queue itself (Queued/Running) it also carries the rows
|
||||
@@ -72,6 +79,10 @@ public sealed partial class MissionControlViewModel : ViewModelBase, IDisposable
|
||||
// MissionControlView.OnNewSessionClicked).
|
||||
public Action? BrowseForSessionRequested { get; set; }
|
||||
|
||||
// View-layer seam: confirms the "abandon run" action, naming the open-task count. Wired by the
|
||||
// view the same way TasksIslandViewModel/DetailsIslandViewModel are.
|
||||
public Func<string, System.Threading.Tasks.Task<bool>>? ConfirmAsync { get; set; }
|
||||
|
||||
public UsagePillViewModel UsagePill { get; }
|
||||
|
||||
public MissionControlViewModel(IDbContextFactory<ClaudeDoDbContext> dbFactory, IWorkerClient worker, UsagePillViewModel usagePill)
|
||||
@@ -98,6 +109,11 @@ public sealed partial class MissionControlViewModel : ViewModelBase, IDisposable
|
||||
_onHandoffRequested = (taskId, survivingTaskIds, nextPhase) => { _ = OpenMergeHelperHandoffConPtySessionAsync(taskId, survivingTaskIds, nextPhase); };
|
||||
_worker.HandoffRequestedEvent += _onHandoffRequested;
|
||||
|
||||
_onListHandlerStartRequested = (listId, taskIds) => { OpenRequested?.Invoke(); _ = OpenMergeHelperConPtySessionAsync(listId, taskIds); };
|
||||
_worker.ListHandlerStartRequestedEvent += _onListHandlerStartRequested;
|
||||
_onHandlerUsageWarning = (taskId, message) => { _ = WarnHandlerSessionAsync(taskId, message); };
|
||||
_worker.HandlerUsageWarningEvent += _onHandlerUsageWarning;
|
||||
|
||||
_ = RefreshQueueAsync();
|
||||
_ = RefreshSessionTargetsAsync();
|
||||
}
|
||||
@@ -163,7 +179,14 @@ public sealed partial class MissionControlViewModel : ViewModelBase, IDisposable
|
||||
internal async System.Threading.Tasks.Task RefreshSessionTargetsAsync()
|
||||
{
|
||||
SessionTargets.Clear();
|
||||
// Browse goes in first so the menu stays usable even if the list query below fails.
|
||||
// Home + browse go in first so the menu stays usable even if the list query below fails.
|
||||
// Home is the target for quick general questions that belong to no project.
|
||||
var home = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
|
||||
SessionTargets.Add(new SessionTargetViewModel
|
||||
{
|
||||
Label = Loc.T("missionControl.homeFolder"),
|
||||
StartCommand = new RelayCommand(() => _ = OpenAdHocConPtySessionAsync(home)),
|
||||
});
|
||||
SessionTargets.Add(new SessionTargetViewModel
|
||||
{
|
||||
Label = Loc.T("missionControl.browseForFolder"),
|
||||
@@ -363,7 +386,7 @@ public sealed partial class MissionControlViewModel : ViewModelBase, IDisposable
|
||||
}
|
||||
|
||||
AddConPtyPane(new ConPtyPaneViewModel(taskId, title,
|
||||
() => DescribeAsync(() => launchSpec(taskId))));
|
||||
() => DescribeAsync(() => launchSpec(taskId))) { IsListHandler = true });
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -383,6 +406,7 @@ public sealed partial class MissionControlViewModel : ViewModelBase, IDisposable
|
||||
string taskId, IReadOnlyList<string> survivingTaskIds, string nextPhase)
|
||||
{
|
||||
if (string.IsNullOrEmpty(taskId) || survivingTaskIds is not { Count: > 0 }) return;
|
||||
OpenRequested?.Invoke();
|
||||
|
||||
foreach (var stale in ConPtySessions.Where(s => s.TaskId == taskId).ToList())
|
||||
CloseConPtySession(stale);
|
||||
@@ -403,7 +427,21 @@ public sealed partial class MissionControlViewModel : ViewModelBase, IDisposable
|
||||
catch { /* best-effort title lookup */ }
|
||||
|
||||
AddConPtyPane(new ConPtyPaneViewModel(taskId, title,
|
||||
() => DescribeAsync(() => _worker.GetMergeHelperHandoffLaunchSpecAsync(taskId, survivingTaskIds, nextPhase))));
|
||||
() => DescribeAsync(() => _worker.GetMergeHelperHandoffLaunchSpecAsync(taskId, survivingTaskIds, nextPhase)))
|
||||
{ IsListHandler = true });
|
||||
}
|
||||
|
||||
// The 5h usage window is about to run out under this handler session: type the worker's warning
|
||||
// into its pane so the session can hand off cleanly instead of dying mid-merge. The UI process
|
||||
// owns the terminal, so this is the only place that can reach it at all. No pane (the tile was
|
||||
// closed, or this is a second app instance) = nothing to warn, and that is not an error.
|
||||
internal async System.Threading.Tasks.Task WarnHandlerSessionAsync(string taskId, string message)
|
||||
{
|
||||
if (string.IsNullOrEmpty(taskId) || string.IsNullOrEmpty(message)) return;
|
||||
if (ConPtySessions.FirstOrDefault(s => s.TaskId == taskId) is not { } pane) return;
|
||||
|
||||
if (!await pane.SendLineAsync(message))
|
||||
ErrorReported?.Invoke(Loc.T("missionControl.usageWarningNotDelivered"));
|
||||
}
|
||||
|
||||
// Wires a freshly built pane and shows it immediately — the pane resolves its own launch spec,
|
||||
@@ -413,10 +451,29 @@ public sealed partial class MissionControlViewModel : ViewModelBase, IDisposable
|
||||
pane.ErrorReported += OnConPtyPaneError;
|
||||
pane.CloseRequested += CloseConPtySession;
|
||||
pane.SubmitForReviewRequested += OnPaneSubmitForReview;
|
||||
pane.SessionDiedAfterStartup += OnPaneSessionDied;
|
||||
pane.AbandonRunRequested += OnPaneAbandonRun;
|
||||
ConPtySessions.Add(pane);
|
||||
pane.Start();
|
||||
}
|
||||
|
||||
// A ConPTY session that had been running died. The UI process owns the terminal, so this is the
|
||||
// only place the exit code exists -- report it and let the worker decide whether it was a list
|
||||
// handler killed by the usage limit and worth reopening after the reset
|
||||
// (HandlerRestartCoordinator). Every other pane is just a no-op there, so no filtering here.
|
||||
private async void OnPaneSessionDied(string taskId, int exitCode)
|
||||
{
|
||||
try
|
||||
{
|
||||
await _worker.ReportInteractiveSessionExitedAsync(taskId, exitCode);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// A worker that is down cannot restart anything anyway; the dead tile is already visible.
|
||||
ErrorReported?.Invoke(Loc.T("missionControl.conptyLaunchFailed", ex.Message));
|
||||
}
|
||||
}
|
||||
|
||||
private static async System.Threading.Tasks.Task<TerminalLaunchDescriptor> DescribeAsync(
|
||||
Func<System.Threading.Tasks.Task<LaunchSpec>> fetch)
|
||||
{
|
||||
@@ -451,12 +508,49 @@ public sealed partial class MissionControlViewModel : ViewModelBase, IDisposable
|
||||
}
|
||||
}
|
||||
|
||||
// Handler-run abort ("Not-Aus"): cancels every still-open (Queued/Running) task this handler
|
||||
// round queued or started, then closes the pane -- one action instead of "close tile" + "cancel
|
||||
// the tasks separately", which used to leave orphaned rows nobody merges. No open tasks (or no
|
||||
// round entry at all -- 7-day retention, or a run predating this feature) closes the pane
|
||||
// straight away, no confirmation needed. Guarded by IsAbandonPending like OnPaneSubmitForReview.
|
||||
private async void OnPaneAbandonRun(string taskId)
|
||||
{
|
||||
if (ConPtySessions.FirstOrDefault(s => s.TaskId == taskId) is not { } pane || pane.IsAbandonPending)
|
||||
return;
|
||||
|
||||
pane.IsAbandonPending = true;
|
||||
try
|
||||
{
|
||||
var open = await _worker.GetHandlerOpenTasksAsync(taskId);
|
||||
if (open.Count > 0)
|
||||
{
|
||||
if (ConfirmAsync is null) return;
|
||||
if (!await ConfirmAsync(Loc.T("missionControl.abandonRunConfirm", open.Count))) return;
|
||||
|
||||
foreach (var task in open)
|
||||
await _worker.CancelTaskAsync(task.Id);
|
||||
}
|
||||
|
||||
CloseConPtySession(pane);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ErrorReported?.Invoke(Loc.T("missionControl.abandonRunFailed", ex.Message));
|
||||
}
|
||||
finally
|
||||
{
|
||||
pane.IsAbandonPending = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void CloseConPtySession(ConPtyPaneViewModel pane)
|
||||
{
|
||||
if (!ConPtySessions.Contains(pane)) return;
|
||||
pane.ErrorReported -= OnConPtyPaneError;
|
||||
pane.CloseRequested -= CloseConPtySession;
|
||||
pane.SubmitForReviewRequested -= OnPaneSubmitForReview;
|
||||
pane.SessionDiedAfterStartup -= OnPaneSessionDied;
|
||||
pane.AbandonRunRequested -= OnPaneAbandonRun;
|
||||
ConPtySessions.Remove(pane);
|
||||
pane.Dispose();
|
||||
}
|
||||
@@ -500,6 +594,8 @@ public sealed partial class MissionControlViewModel : ViewModelBase, IDisposable
|
||||
_worker.TaskUpdatedEvent -= _onTaskUpdated;
|
||||
_worker.ConnectionRestoredEvent -= _onConnectionRestored;
|
||||
_worker.HandoffRequestedEvent -= _onHandoffRequested;
|
||||
_worker.ListHandlerStartRequestedEvent -= _onListHandlerStartRequested;
|
||||
_worker.HandlerUsageWarningEvent -= _onHandlerUsageWarning;
|
||||
ConPtySessions.CollectionChanged -= OnConPtySessionsChanged;
|
||||
Panes.CollectionChanged -= OnPanesChanged;
|
||||
foreach (var c in ConPtySessions.ToList())
|
||||
@@ -507,6 +603,8 @@ public sealed partial class MissionControlViewModel : ViewModelBase, IDisposable
|
||||
c.ErrorReported -= OnConPtyPaneError;
|
||||
c.CloseRequested -= CloseConPtySession;
|
||||
c.SubmitForReviewRequested -= OnPaneSubmitForReview;
|
||||
c.SessionDiedAfterStartup -= OnPaneSessionDied;
|
||||
c.AbandonRunRequested -= OnPaneAbandonRun;
|
||||
c.Dispose();
|
||||
}
|
||||
ConPtySessions.Clear();
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using ClaudeDo.Data;
|
||||
@@ -10,8 +12,14 @@ namespace ClaudeDo.Ui.ViewModels.Modals;
|
||||
|
||||
public sealed partial class AboutModalViewModel : ViewModelBase
|
||||
{
|
||||
// MinVer sets AssemblyVersion to {Major}.0.0.0 for binding compat — Assembly.GetName().Version
|
||||
// shows "2.0.0" no matter the release. FileVersion carries the real Major.Minor.Patch.
|
||||
public string AppVersion { get; } =
|
||||
Assembly.GetExecutingAssembly().GetName().Version?.ToString(3) ?? "0.0.0";
|
||||
Version.TryParse(
|
||||
FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).FileVersion,
|
||||
out var version)
|
||||
? version.ToString(3)
|
||||
: "0.0.0";
|
||||
public string DataFolderPath { get; } = Paths.AppDataRoot();
|
||||
public string LogsFolderPath { get; } = Path.Combine(Paths.AppDataRoot(), "logs");
|
||||
public string WorkerConfigPath { get; } = Path.Combine(Paths.AppDataRoot(), "worker.config.json");
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using ClaudeDo.Ui.Localization;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
|
||||
namespace ClaudeDo.Ui.ViewModels.Modals;
|
||||
|
||||
/// <summary>One cheat sheet: title from the file's leading <c># </c> heading, body is the rest.</summary>
|
||||
public sealed record CheatSheet(string Key, string Title, string Body);
|
||||
|
||||
/// <summary>
|
||||
/// Backs the non-modal cheat-sheet window (Help → Cheat Sheets). Content lives as markdown
|
||||
/// under <c>Assets/CheatSheets/*.md</c> (embedded resources) and is rendered by the existing
|
||||
/// <c>MarkdownView</c>,
|
||||
/// so a new sheet is a new file — but the key list here stays explicit to keep the order
|
||||
/// deterministic and a missing resource visible instead of silently absent.
|
||||
/// </summary>
|
||||
public partial class CheatSheetsViewModel : ViewModelBase
|
||||
{
|
||||
private static readonly string[] Keys =
|
||||
["git", "conventional-commits", "claude-cli", "claude-config", "dotnet-cli", "powershell"];
|
||||
|
||||
public ObservableCollection<CheatSheet> Sheets { get; } = [];
|
||||
|
||||
[ObservableProperty]
|
||||
private CheatSheet? _selectedSheet;
|
||||
|
||||
/// <summary>Keeps the window above the shell so it can sit docked at a screen edge.</summary>
|
||||
[ObservableProperty]
|
||||
private bool _isPinned;
|
||||
|
||||
public Action? CloseAction { get; set; }
|
||||
|
||||
public CheatSheetsViewModel()
|
||||
{
|
||||
foreach (var key in Keys) Sheets.Add(Load(key));
|
||||
SelectedSheet = Sheets.FirstOrDefault();
|
||||
}
|
||||
|
||||
/// <summary>Preselects a sheet by key; unknown keys keep the current selection.</summary>
|
||||
public void Select(string key)
|
||||
{
|
||||
var sheet = Sheets.FirstOrDefault(s => s.Key == key);
|
||||
if (sheet is not null) SelectedSheet = sheet;
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private void Close() => CloseAction?.Invoke();
|
||||
|
||||
private static CheatSheet Load(string key)
|
||||
{
|
||||
var assembly = typeof(CheatSheetsViewModel).Assembly;
|
||||
// Match by suffix rather than composing the logical name from RootNamespace — the
|
||||
// prefix is a build detail, and a rename shouldn't silently blank the sheet.
|
||||
var name = assembly.GetManifestResourceNames()
|
||||
.FirstOrDefault(n => n.EndsWith($".CheatSheets.{key}.md", StringComparison.Ordinal));
|
||||
var stream = name is null ? null : assembly.GetManifestResourceStream(name);
|
||||
if (stream is null)
|
||||
return new CheatSheet(key, key, Loc.T("modals.cheatSheets.missing", $"{key}.md"));
|
||||
|
||||
using var reader = new StreamReader(stream);
|
||||
var text = reader.ReadToEnd().Replace("\r\n", "\n");
|
||||
|
||||
// The window shows the title in its own selector, so strip the leading heading
|
||||
// rather than rendering it a second time inside the body.
|
||||
var lines = new List<string>(text.Split('\n'));
|
||||
var title = key;
|
||||
var first = lines.FindIndex(l => !string.IsNullOrWhiteSpace(l));
|
||||
if (first >= 0 && lines[first].StartsWith("# ", StringComparison.Ordinal))
|
||||
{
|
||||
title = lines[first][2..].Trim();
|
||||
lines.RemoveRange(0, first + 1);
|
||||
}
|
||||
return new CheatSheet(key, title, string.Join('\n', lines).Trim());
|
||||
}
|
||||
}
|
||||
@@ -26,10 +26,17 @@ public sealed partial class ListSettingsModalViewModel : ViewModelBase
|
||||
// True after the list was deleted, so the caller reloads the list nav instead of refreshing the row.
|
||||
public bool Deleted { get; private set; }
|
||||
|
||||
// False when the modal closed via Cancel or the window chrome — CreateListAsync uses this to
|
||||
// roll the pre-created row back instead of leaving an untitled empty list behind.
|
||||
public bool Saved { get; private set; }
|
||||
|
||||
// Wired by the view to prompt yes/no before deleting and to surface a blocking-FK error.
|
||||
public Func<string, Task<bool>>? ConfirmAsync { get; set; }
|
||||
public Func<string, Task>? ShowErrorAsync { get; set; }
|
||||
|
||||
// Mirrors UsageMonitorModalViewModel.ErrorReported — the caller wires this into FlashFooterError.
|
||||
public event Action<string>? ErrorReported;
|
||||
|
||||
[ObservableProperty] private string _name = "";
|
||||
[ObservableProperty] private string _workingDir = "";
|
||||
[ObservableProperty] private string _defaultCommitType = CommitTypeRegistry.DefaultType;
|
||||
@@ -41,6 +48,10 @@ public sealed partial class ListSettingsModalViewModel : ViewModelBase
|
||||
// Optional post-merge verification command (build/test), run in WorkingDir after a merge
|
||||
// lands; a non-zero exit keeps the task out of Done instead of silently reporting merged.
|
||||
[ObservableProperty] private string _verifyCommand = "";
|
||||
// Per-list opt-in for PowerUse. A handler run on this list only goes unattended (no questions,
|
||||
// harvests new work, longer handoff chain) when this AND the global switch in Settings →
|
||||
// Execution are both on. Off by default — the global switch alone must never change a list's behaviour.
|
||||
[ObservableProperty] private bool _powerUseAllowed;
|
||||
// Dropdown hidden entirely when no ticket-system base URL is configured (Settings → Files tab).
|
||||
// Icon key into the UI icon library (IconKeyConverter -> "Icon.<key>" StreamGeometry).
|
||||
[ObservableProperty] private string _icon = DefaultIcon;
|
||||
@@ -48,6 +59,25 @@ public sealed partial class ListSettingsModalViewModel : ViewModelBase
|
||||
[ObservableProperty] private TicketProjectOption? _selectedTicketProject;
|
||||
public ObservableCollection<TicketProjectOption> TicketProjects { get; } = new();
|
||||
|
||||
// Gates Save/Delete while the core fields (name/agent/verify command) are still loading, so a
|
||||
// save can't land before they're populated and clobber the list_config row with blanks. Ticket
|
||||
// projects load separately (see LoadTicketProjectsAsync) and are NOT covered by this — Save's
|
||||
// own tri-state handles that case instead.
|
||||
[ObservableProperty]
|
||||
[NotifyCanExecuteChangedFor(nameof(SaveCommand))]
|
||||
[NotifyCanExecuteChangedFor(nameof(DeleteCommand))]
|
||||
private bool _isLoading;
|
||||
|
||||
// Set when the core load (name/agent/verify command) threw — keeps Save gated even after
|
||||
// IsLoading resets to false in LoadAsync's finally, so a failed load can't clobber the
|
||||
// stored config with blank fields.
|
||||
private bool _loadFailed;
|
||||
|
||||
// True once GetTicketProjectsAsync has completed successfully for the current load — Save
|
||||
// only writes an explicit TicketProjectId when this is true, so a slow/unreachable ticket
|
||||
// system leaves the stored link untouched instead of wiping it to "none".
|
||||
private bool _ticketProjectsLoaded;
|
||||
|
||||
public ObservableCollection<string> CommitTypeOptions { get; } = new(CommitTypeRegistry.Types);
|
||||
|
||||
public const string DefaultIcon = "Folder";
|
||||
@@ -83,6 +113,19 @@ public sealed partial class ListSettingsModalViewModel : ViewModelBase
|
||||
Agent = new AgentConfigEditorViewModel(worker, AgentConfigScope.List);
|
||||
}
|
||||
|
||||
// Fires the load without blocking the caller, so the modal window can be shown right away
|
||||
// instead of appearing only after seven serial hub round-trips (one of them a 10s-timeout
|
||||
// ticket-system HTTP call) have finished — same pattern as UsageMonitorModalViewModel.BeginLoad.
|
||||
public void BeginLoad(
|
||||
string listId,
|
||||
string name,
|
||||
string? workingDir,
|
||||
string defaultCommitType,
|
||||
bool isManual = false,
|
||||
bool findingsTracked = false,
|
||||
string? icon = null)
|
||||
=> _ = LoadAsync(listId, name, workingDir, defaultCommitType, isManual, findingsTracked, icon);
|
||||
|
||||
public async Task LoadAsync(
|
||||
string listId,
|
||||
string name,
|
||||
@@ -93,42 +136,81 @@ public sealed partial class ListSettingsModalViewModel : ViewModelBase
|
||||
string? icon = null,
|
||||
CancellationToken ct = default)
|
||||
{
|
||||
ListId = listId;
|
||||
Name = name;
|
||||
IsManual = isManual;
|
||||
FindingsTracked = findingsTracked;
|
||||
// An unknown/legacy key would leave the picker with no selection and silently reset the
|
||||
// icon on the next save — fall back to the default instead.
|
||||
Icon = IconOptions.Contains(icon) ? icon! : DefaultIcon;
|
||||
WorkingDir = workingDir ?? "";
|
||||
DefaultCommitType = string.IsNullOrWhiteSpace(defaultCommitType) ? CommitTypeRegistry.DefaultType : defaultCommitType;
|
||||
|
||||
await Agent.LoadForListAsync(listId, ct);
|
||||
var cfg = await _worker.GetListConfigAsync(listId);
|
||||
VerifyCommand = cfg?.VerifyCommand ?? "";
|
||||
|
||||
var ticketSettings = TicketSettingsTabViewModel.FeatureEnabled
|
||||
? await _worker.GetTicketSettingsAsync()
|
||||
: null;
|
||||
TicketsAvailable = !string.IsNullOrWhiteSpace(ticketSettings?.ApiBaseUrl);
|
||||
TicketProjects.Clear();
|
||||
if (TicketsAvailable)
|
||||
ListConfigDto? cfg = null;
|
||||
IsLoading = true;
|
||||
_loadFailed = false;
|
||||
try
|
||||
{
|
||||
ListId = listId;
|
||||
Name = name;
|
||||
IsManual = isManual;
|
||||
FindingsTracked = findingsTracked;
|
||||
// An unknown/legacy key would leave the picker with no selection and silently reset the
|
||||
// icon on the next save — fall back to the default instead.
|
||||
Icon = IconOptions.Contains(icon) ? icon! : DefaultIcon;
|
||||
WorkingDir = workingDir ?? "";
|
||||
DefaultCommitType = string.IsNullOrWhiteSpace(defaultCommitType) ? CommitTypeRegistry.DefaultType : defaultCommitType;
|
||||
|
||||
await Agent.LoadForListAsync(listId, ct);
|
||||
cfg = Agent.LastLoadedListConfig;
|
||||
VerifyCommand = cfg?.VerifyCommand ?? "";
|
||||
PowerUseAllowed = cfg?.PowerUseAllowed ?? false;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// BeginLoad fires this without awaiting it — catching here (instead of letting it
|
||||
// propagate) turns what would be an unobserved task exception, with the modal stuck
|
||||
// open and every field blank, into a reported error and a locked Save button.
|
||||
_loadFailed = true;
|
||||
ErrorReported?.Invoke(Loc.T("vm.listSettings.loadFailed", ex.Message));
|
||||
}
|
||||
finally { IsLoading = false; }
|
||||
|
||||
if (_loadFailed) return;
|
||||
|
||||
// Deliberately NOT awaited: an unreachable ticket system (10s HTTP timeout) must not hold
|
||||
// up the rest of the modal. The dropdown just stays empty until this finishes.
|
||||
_ = LoadTicketProjectsAsync(cfg?.TicketProjectId);
|
||||
}
|
||||
|
||||
private async Task LoadTicketProjectsAsync(int? existingTicketProjectId)
|
||||
{
|
||||
_ticketProjectsLoaded = false;
|
||||
TicketProjects.Clear();
|
||||
try
|
||||
{
|
||||
var ticketSettings = TicketSettingsTabViewModel.FeatureEnabled
|
||||
? await _worker.GetTicketSettingsAsync()
|
||||
: null;
|
||||
TicketsAvailable = !string.IsNullOrWhiteSpace(ticketSettings?.ApiBaseUrl);
|
||||
if (!TicketsAvailable)
|
||||
{
|
||||
SelectedTicketProject = null;
|
||||
return;
|
||||
}
|
||||
|
||||
TicketProjects.Add(new TicketProjectOption(0, Loc.T("vm.listSettings.ticketProjectNone")));
|
||||
foreach (var p in await _worker.GetTicketProjectsAsync())
|
||||
TicketProjects.Add(new TicketProjectOption(p.Id, $"{p.DepartmentName} / {p.Title}"));
|
||||
|
||||
SelectedTicketProject = cfg?.TicketProjectId is int id
|
||||
SelectedTicketProject = existingTicketProjectId is int id
|
||||
? TicketProjects.FirstOrDefault(t => t.Id == id) ?? TicketProjects[0]
|
||||
: TicketProjects[0];
|
||||
_ticketProjectsLoaded = true;
|
||||
}
|
||||
else
|
||||
catch (Exception ex)
|
||||
{
|
||||
SelectedTicketProject = null;
|
||||
// Ticket system unreachable/slow — leave the dropdown as-is. Save's tri-state (below)
|
||||
// skips writing TicketProjectId when _ticketProjectsLoaded is false, so the stored
|
||||
// link survives instead of being wiped to "none".
|
||||
ErrorReported?.Invoke(Loc.T("vm.listSettings.ticketProjectsLoadFailed", ex.Message));
|
||||
}
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private bool CanSave() => !IsLoading && !_loadFailed;
|
||||
private bool CanDelete() => !IsLoading;
|
||||
|
||||
[RelayCommand(CanExecute = nameof(CanSave))]
|
||||
private async Task SaveAsync()
|
||||
{
|
||||
await _worker.UpdateListAsync(new UpdateListDto(
|
||||
@@ -140,19 +222,24 @@ public sealed partial class ListSettingsModalViewModel : ViewModelBase
|
||||
FindingsTracked,
|
||||
Icon));
|
||||
|
||||
// Tri-state: dropdown never shown (no base URL) -> null, leave the stored link alone.
|
||||
// Dropdown shown -> always an explicit value, 0 for "— none —" to actively clear it.
|
||||
// Never null here, or an explicit unlink would silently fail to reach the worker.
|
||||
var ticketProjectId = TicketsAvailable ? (SelectedTicketProject?.Id ?? 0) : (int?)null;
|
||||
// Tri-state: dropdown never shown (no base URL), or ticket projects failed/never loaded
|
||||
// (e.g. an unreachable ticket system) -> null, leave the stored link alone. Dropdown shown
|
||||
// and loaded -> always an explicit value, 0 for "— none —" to actively clear it. Never
|
||||
// null in that case, or an explicit unlink would silently fail to reach the worker.
|
||||
var ticketProjectId = TicketsAvailable && _ticketProjectsLoaded ? (SelectedTicketProject?.Id ?? 0) : (int?)null;
|
||||
|
||||
// Always explicit (never null) — this modal owns the checkbox, so unchecking it has to reach
|
||||
// the worker as a real false rather than a "leave it alone".
|
||||
await Agent.SaveAsync(
|
||||
string.IsNullOrWhiteSpace(VerifyCommand) ? null : VerifyCommand,
|
||||
ticketProjectId);
|
||||
ticketProjectId,
|
||||
PowerUseAllowed);
|
||||
|
||||
Saved = true;
|
||||
CloseAction?.Invoke();
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
[RelayCommand(CanExecute = nameof(CanDelete))]
|
||||
private async Task DeleteAsync()
|
||||
{
|
||||
var displayName = string.IsNullOrWhiteSpace(Name) ? Loc.T("vm.listSettings.untitled") : Name;
|
||||
|
||||
@@ -30,6 +30,7 @@ public sealed partial class FilesSettingsTabViewModel : ViewModelBase
|
||||
public string RetryPromptPath { get; } = PromptFiles.PathFor(PromptKind.Retry);
|
||||
public string DailyPrepPromptPath { get; } = PromptFiles.PathFor(PromptKind.DailyPrep);
|
||||
public string WeeklyReportPromptPath { get; } = PromptFiles.PathFor(PromptKind.WeeklyReport);
|
||||
public string PowerUsePromptPath { get; } = PromptFiles.PathFor(PromptKind.PowerUseAddendum);
|
||||
|
||||
public ObservableCollection<CustomizedPromptRowViewModel> CustomizedPrompts { get; } = new();
|
||||
|
||||
|
||||
@@ -27,6 +27,18 @@ public sealed partial class GeneralSettingsTabViewModel : ViewModelBase
|
||||
// Off by default: auto-continues a usage-limit-failed task once the 5h window resets, and
|
||||
// wakes a gate-blocked queue exactly at that reset time instead of only the 30s backstop.
|
||||
[ObservableProperty] private bool _autoContinueOnUsageLimit;
|
||||
// Cap on a list-handler run's wait<->merge handoff chain. 4 = two merge rounds (the long-standing
|
||||
// default); raise it for runs meant to keep going for hours. Bounds a runaway chain, so never 0.
|
||||
[ObservableProperty] private int _listHandlerMaxHandoffs = 4;
|
||||
// PowerUse master switch: a handler run spends the rest of the window unattended. On its own it
|
||||
// changes nothing — the run's LIST must also opt in (list settings → PowerUse).
|
||||
[ObservableProperty] private bool _powerUseEnabled;
|
||||
// Optional local-time window (HH:mm) narrowing when PowerUse applies; both blank = round the
|
||||
// clock. Unparseable input is normalized to null on save, same as the worker does.
|
||||
[ObservableProperty] private string? _powerUseWindowStart;
|
||||
[ObservableProperty] private string? _powerUseWindowEnd;
|
||||
// 5h-usage percentage at which a PowerUse handler session hands off. Clamped 50..99.
|
||||
[ObservableProperty] private int _powerUseHandoffPct = 95;
|
||||
// Newline-separated path prefixes excluded from the weekly report.
|
||||
[ObservableProperty] private string _reportExcludedPaths = @"C:\Private";
|
||||
// 0=Sunday..6=Saturday (System.DayOfWeek); default Wednesday.
|
||||
|
||||
@@ -8,20 +8,17 @@ namespace ClaudeDo.Ui.ViewModels.Modals.Settings;
|
||||
public sealed partial class TicketSettingsTabViewModel : ViewModelBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Der Aus-Schalter der gesamten Ticketsystem-Anbindung in der UI — hier auf <c>true</c>
|
||||
/// für die Reaktivierung, wie bei <c>SettingsModalViewModel.ShowOnlineInbox</c>.
|
||||
/// Der Aus-Schalter der gesamten Ticketsystem-Anbindung in der UI, wie bei
|
||||
/// <c>SettingsModalViewModel.ShowOnlineInbox</c>. Er versteckt drei Einstiegspunkte: diesen
|
||||
/// Settings-Tab, das Ticket-Projekt-Dropdown in den Listen-Einstellungen und den
|
||||
/// Kontextmenü-Eintrag zum Importieren.
|
||||
///
|
||||
/// Pausiert am 2026-08-27: die Bandel-API war unter dem eingetragenen Hostnamen nicht
|
||||
/// erreichbar (Verbindung aktiv abgelehnt — vermutlich fehlende IIS-Hostname-Bindung oder
|
||||
/// falscher Port, siehe deploy/deploy-iis-winrm.ps1). Solange das offen ist, würde der Tab
|
||||
/// nur eine Einrichtung anbieten, die nicht funktionieren kann.
|
||||
///
|
||||
/// Der Schalter versteckt drei Einstiegspunkte: diesen Settings-Tab, das Ticket-Projekt-
|
||||
/// Dropdown in den Listen-Einstellungen und den Kontextmenü-Eintrag zum Importieren.
|
||||
/// Gespeicherte Werte (Base-URL, PAT, verknüpfte Projekte) bleiben unangetastet und greifen
|
||||
/// beim Umlegen sofort wieder.
|
||||
/// Pausiert am 2026-08-27 (API unter dem Hostnamen nicht erreichbar), reaktiviert am
|
||||
/// 2026-09-01: die API läuft unter <c>http://192.168.45.161</c> und alle vier Routen sind
|
||||
/// live verifiziert. Base-URL ist deshalb eine IP, kein Hostname — <c>bandelapis.fb-tuning.local</c>
|
||||
/// lehnt die Verbindung weiterhin ab.
|
||||
/// </summary>
|
||||
public const bool FeatureEnabled = false;
|
||||
public const bool FeatureEnabled = true;
|
||||
|
||||
private readonly IWorkerClient _worker;
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Linq;
|
||||
using ClaudeDo.Data;
|
||||
using ClaudeDo.Data.Models;
|
||||
using ClaudeDo.Localization;
|
||||
using ClaudeDo.Ui.Localization;
|
||||
using ClaudeDo.Ui.Services;
|
||||
@@ -147,6 +148,11 @@ public sealed partial class SettingsModalViewModel : ViewModelBase
|
||||
General.UsageGateFiveHourPct = dto.UsageGateFiveHourPct;
|
||||
General.UsageGateSevenDayPct = dto.UsageGateSevenDayPct;
|
||||
General.AutoContinueOnUsageLimit = dto.AutoContinueOnUsageLimit;
|
||||
General.ListHandlerMaxHandoffs = dto.ListHandlerMaxHandoffs;
|
||||
General.PowerUseEnabled = dto.PowerUseEnabled;
|
||||
General.PowerUseWindowStart = dto.PowerUseWindowStart;
|
||||
General.PowerUseWindowEnd = dto.PowerUseWindowEnd;
|
||||
General.PowerUseHandoffPct = dto.PowerUseHandoffPct;
|
||||
_throttleStages = (
|
||||
dto.UsageThrottleFiveHourSoftPct, dto.UsageThrottleFiveHourHardPct,
|
||||
dto.UsageThrottleSevenDaySoftPct, dto.UsageThrottleSevenDayHardPct);
|
||||
@@ -213,7 +219,14 @@ public sealed partial class SettingsModalViewModel : ViewModelBase
|
||||
_throttleStages.FiveHard,
|
||||
_throttleStages.SevenSoft,
|
||||
_throttleStages.SevenHard,
|
||||
General.AutoContinueOnUsageLimit);
|
||||
General.AutoContinueOnUsageLimit,
|
||||
General.PowerUseEnabled,
|
||||
General.ListHandlerMaxHandoffs,
|
||||
// The worker stores an unparseable time as null; normalize here too so the box
|
||||
// shows what was actually saved instead of a typo that looks like a live window.
|
||||
PowerUseWindow.Normalize(General.PowerUseWindowStart),
|
||||
PowerUseWindow.Normalize(General.PowerUseWindowEnd),
|
||||
Math.Clamp(General.PowerUseHandoffPct, 50, 99));
|
||||
await _worker.UpdateAppSettingsAsync(dto);
|
||||
await Prime.SaveAsync();
|
||||
await OnlineInbox.SaveAsync();
|
||||
|
||||
@@ -148,6 +148,7 @@ public sealed partial class UsageMonitorModalViewModel : ViewModelBase
|
||||
Snapshot = snapshot;
|
||||
_worker.UsageUpdatedEvent -= OnUsageUpdated;
|
||||
_worker.UsageUpdatedEvent += OnUsageUpdated;
|
||||
|
||||
ApplyPresetRange(SelectedPresetDays);
|
||||
await LoadUsageDataAsync();
|
||||
}
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
using System;
|
||||
using System.Text.RegularExpressions;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Documents;
|
||||
using Avalonia.Input.Platform;
|
||||
using Avalonia.Layout;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Avalonia.Media;
|
||||
using Avalonia.Threading;
|
||||
using ClaudeDo.Ui.Localization;
|
||||
|
||||
namespace ClaudeDo.Ui.Views.Controls;
|
||||
|
||||
@@ -13,12 +17,27 @@ public partial class MarkdownView : UserControl
|
||||
public static readonly StyledProperty<string?> MarkdownProperty =
|
||||
AvaloniaProperty.Register<MarkdownView, string?>(nameof(Markdown));
|
||||
|
||||
/// <summary>
|
||||
/// Renders a bullet that starts with inline code as a command row: the command as a
|
||||
/// monospace chip with a copy button, the rest as a description below it, and a rule under
|
||||
/// each <c>##</c> section. Opt-in — the prompt-file viewer and the weekly report render
|
||||
/// prose where nearly every bullet carries inline code, and copy buttons there are noise.
|
||||
/// </summary>
|
||||
public static readonly StyledProperty<bool> CommandRowsProperty =
|
||||
AvaloniaProperty.Register<MarkdownView, bool>(nameof(CommandRows));
|
||||
|
||||
public string? Markdown
|
||||
{
|
||||
get => GetValue(MarkdownProperty);
|
||||
set => SetValue(MarkdownProperty, value);
|
||||
}
|
||||
|
||||
public bool CommandRows
|
||||
{
|
||||
get => GetValue(CommandRowsProperty);
|
||||
set => SetValue(CommandRowsProperty, value);
|
||||
}
|
||||
|
||||
private StackPanel? _host;
|
||||
|
||||
public MarkdownView()
|
||||
@@ -34,6 +53,8 @@ public partial class MarkdownView : UserControl
|
||||
base.OnPropertyChanged(change);
|
||||
if (change.Property == MarkdownProperty)
|
||||
Render(change.GetNewValue<string?>());
|
||||
else if (change.Property == CommandRowsProperty)
|
||||
Render(Markdown);
|
||||
}
|
||||
|
||||
private static readonly Regex NumberedItem = new(@"^\s*(\d+)\.\s+(.*)$", RegexOptions.Compiled);
|
||||
@@ -48,6 +69,9 @@ public partial class MarkdownView : UserControl
|
||||
return;
|
||||
|
||||
var lines = md.Replace("\r\n", "\n").Split('\n');
|
||||
// In CommandRows mode every "## " opens a collapsible section and blocks land inside it;
|
||||
// otherwise this stays the host for the whole document.
|
||||
var target = _host;
|
||||
int i = 0;
|
||||
while (i < lines.Length)
|
||||
{
|
||||
@@ -56,19 +80,22 @@ public partial class MarkdownView : UserControl
|
||||
|
||||
if (line.StartsWith("### "))
|
||||
{
|
||||
_host.Children.Add(Heading(line[4..], 13));
|
||||
target.Children.Add(Heading(line[4..], 13));
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
if (line.StartsWith("## "))
|
||||
{
|
||||
_host.Children.Add(Heading(line[3..], 15));
|
||||
if (CommandRows)
|
||||
target = OpenSection(line[3..]);
|
||||
else
|
||||
target.Children.Add(Heading(line[3..], 15));
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
if (line.StartsWith("# "))
|
||||
{
|
||||
_host.Children.Add(Heading(line[2..], 17));
|
||||
target.Children.Add(Heading(line[2..], 17));
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
@@ -77,7 +104,10 @@ public partial class MarkdownView : UserControl
|
||||
{
|
||||
while (i < lines.Length && (lines[i].StartsWith("- ") || lines[i].StartsWith("* ")))
|
||||
{
|
||||
_host.Children.Add(Bullet(lines[i][2..]));
|
||||
var item = lines[i][2..];
|
||||
target.Children.Add(CommandRows && TrySplitCommand(item, out var cmd, out var desc)
|
||||
? CommandRow(cmd, desc)
|
||||
: Bullet(item));
|
||||
i++;
|
||||
}
|
||||
continue;
|
||||
@@ -89,7 +119,7 @@ public partial class MarkdownView : UserControl
|
||||
while (i < lines.Length && NumberedItem.IsMatch(lines[i]))
|
||||
{
|
||||
var m = NumberedItem.Match(lines[i]);
|
||||
_host.Children.Add(Numbered(m.Groups[1].Value, m.Groups[2].Value));
|
||||
target.Children.Add(Numbered(m.Groups[1].Value, m.Groups[2].Value));
|
||||
i++;
|
||||
}
|
||||
continue;
|
||||
@@ -104,7 +134,7 @@ public partial class MarkdownView : UserControl
|
||||
paragraph.Append(lines[i].Trim());
|
||||
i++;
|
||||
}
|
||||
_host.Children.Add(Paragraph(paragraph.ToString()));
|
||||
target.Children.Add(Paragraph(paragraph.ToString()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,6 +156,120 @@ public partial class MarkdownView : UserControl
|
||||
return tb;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a collapsible section for a <c>##</c> heading and returns the panel its blocks go
|
||||
/// into. Native <see cref="Expander"/> — it carries the chevron, keyboard toggle and
|
||||
/// animation, and the app already uses it unstyled in the worktrees overview.
|
||||
/// </summary>
|
||||
private StackPanel OpenSection(string title)
|
||||
{
|
||||
var header = new TextBlock
|
||||
{
|
||||
FontSize = 15,
|
||||
FontWeight = FontWeight.SemiBold,
|
||||
TextWrapping = TextWrapping.Wrap,
|
||||
};
|
||||
AppendInlines(header.Inlines!, title);
|
||||
|
||||
var body = new StackPanel { Spacing = 6 };
|
||||
_host!.Children.Add(new Expander
|
||||
{
|
||||
Header = header,
|
||||
Content = body,
|
||||
IsExpanded = true,
|
||||
HorizontalAlignment = HorizontalAlignment.Stretch,
|
||||
HorizontalContentAlignment = HorizontalAlignment.Stretch,
|
||||
});
|
||||
return body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Splits <c>`command` — description</c> into its two parts. False when the bullet doesn't
|
||||
/// open with inline code, so prose bullets keep the plain renderer.
|
||||
/// </summary>
|
||||
internal static bool TrySplitCommand(string text, out string command, out string description)
|
||||
{
|
||||
command = "";
|
||||
description = "";
|
||||
if (text.Length < 3 || text[0] != '`') return false;
|
||||
var close = text.IndexOf('`', 1);
|
||||
if (close <= 1) return false;
|
||||
command = text[1..close];
|
||||
description = text[(close + 1)..].TrimStart(' ', '—', '–', '-', ':').Trim();
|
||||
return true;
|
||||
}
|
||||
|
||||
private Control CommandRow(string command, string description)
|
||||
{
|
||||
var grid = new Grid
|
||||
{
|
||||
ColumnDefinitions = new ColumnDefinitions("*,Auto"),
|
||||
Margin = new Thickness(0, 2, 0, 2),
|
||||
};
|
||||
|
||||
var text = new SelectableTextBlock { Text = command, TextWrapping = TextWrapping.Wrap };
|
||||
// Bound, not resolved: Render can run while detached, where a resource lookup finds
|
||||
// nothing and would freeze on the fallback.
|
||||
text.Bind(TextBlock.FontFamilyProperty, this.GetResourceObservable("MonoFont"));
|
||||
text.Bind(TextBlock.FontSizeProperty, this.GetResourceObservable("FontSizeMono"));
|
||||
|
||||
var chip = new Border
|
||||
{
|
||||
CornerRadius = new CornerRadius(4),
|
||||
Padding = new Thickness(7, 4),
|
||||
HorizontalAlignment = HorizontalAlignment.Left,
|
||||
Child = text,
|
||||
};
|
||||
chip.Bind(Border.BackgroundProperty, this.GetResourceObservable("Surface2Brush"));
|
||||
|
||||
var stack = new StackPanel { Spacing = 3, Children = { chip } };
|
||||
if (description.Length > 0)
|
||||
{
|
||||
var desc = new TextBlock
|
||||
{
|
||||
Classes = { "body" },
|
||||
TextWrapping = TextWrapping.Wrap,
|
||||
Margin = new Thickness(2, 0, 0, 0),
|
||||
};
|
||||
AppendInlines(desc.Inlines!, description);
|
||||
stack.Children.Add(desc);
|
||||
}
|
||||
Grid.SetColumn(stack, 0);
|
||||
grid.Children.Add(stack);
|
||||
|
||||
var copy = CopyButton(command);
|
||||
Grid.SetColumn(copy, 1);
|
||||
grid.Children.Add(copy);
|
||||
return grid;
|
||||
}
|
||||
|
||||
private Button CopyButton(string command)
|
||||
{
|
||||
var copyIcon = new PathIcon { Width = 11, Height = 11 };
|
||||
copyIcon.Bind(PathIcon.DataProperty, this.GetResourceObservable("Icon.Copy"));
|
||||
var checkIcon = new PathIcon { Width = 11, Height = 11 };
|
||||
checkIcon.Bind(PathIcon.DataProperty, this.GetResourceObservable("Icon.Check"));
|
||||
|
||||
var button = new Button
|
||||
{
|
||||
Classes = { "icon-btn" },
|
||||
Content = copyIcon,
|
||||
VerticalAlignment = VerticalAlignment.Top,
|
||||
Margin = new Thickness(6, 0, 0, 0),
|
||||
};
|
||||
ToolTip.SetTip(button, Loc.T("controls.markdown.copy"));
|
||||
|
||||
button.Click += async (_, _) =>
|
||||
{
|
||||
if (TopLevel.GetTopLevel(this)?.Clipboard is not { } clipboard) return;
|
||||
await clipboard.SetTextAsync(command);
|
||||
// The clipboard gives no feedback of its own; a brief check mark is the confirmation.
|
||||
button.Content = checkIcon;
|
||||
DispatcherTimer.RunOnce(() => button.Content = copyIcon, TimeSpan.FromSeconds(1.5));
|
||||
};
|
||||
return button;
|
||||
}
|
||||
|
||||
private static Control Paragraph(string text)
|
||||
{
|
||||
var tb = new SelectableTextBlock { TextWrapping = TextWrapping.Wrap };
|
||||
|
||||
@@ -14,19 +14,21 @@
|
||||
Background="{DynamicResource DeepBrush}"
|
||||
BorderBrush="{DynamicResource LineBrush}"
|
||||
BorderThickness="0,0,0,1">
|
||||
<Grid ColumnDefinitions="*,Auto,Auto" Margin="14,0">
|
||||
<Grid ColumnDefinitions="*,Auto,Auto,Auto" Margin="14,0">
|
||||
<TextBlock Text="{TemplateBinding Title}"
|
||||
FontFamily="{DynamicResource MonoFont}"
|
||||
FontSize="{DynamicResource FontSizeMono}"
|
||||
LetterSpacing="1.4"
|
||||
Foreground="{DynamicResource TextBrush}"
|
||||
VerticalAlignment="Center"/>
|
||||
<Button Name="PART_MaxButton" Grid.Column="1" Classes="icon-btn"
|
||||
<ContentPresenter Grid.Column="1" Content="{TemplateBinding HeaderActions}"
|
||||
VerticalAlignment="Center" Margin="0,0,8,0"/>
|
||||
<Button Name="PART_MaxButton" Grid.Column="2" Classes="icon-btn"
|
||||
IsVisible="{TemplateBinding ShowMaximizeButton}"
|
||||
VerticalAlignment="Center">
|
||||
<PathIcon Name="PART_MaxIcon" Data="{StaticResource Icon.WinMax}" Width="10" Height="10"/>
|
||||
</Button>
|
||||
<Button Grid.Column="2" Classes="icon-btn" Content="✕"
|
||||
<Button Grid.Column="3" Classes="icon-btn" Content="✕"
|
||||
FontSize="{DynamicResource FontSizeBody}"
|
||||
Command="{TemplateBinding CloseCommand}"
|
||||
VerticalAlignment="Center"/>
|
||||
|
||||
@@ -17,6 +17,11 @@ public class ModalShell : ContentControl
|
||||
public static readonly StyledProperty<object?> FooterProperty =
|
||||
AvaloniaProperty.Register<ModalShell, object?>(nameof(Footer));
|
||||
|
||||
// Window-level actions rendered in the titlebar, left of maximise/close. Keeps a single
|
||||
// always-visible action (e.g. the usage monitor's refresh) out of the body's vertical flow.
|
||||
public static readonly StyledProperty<object?> HeaderActionsProperty =
|
||||
AvaloniaProperty.Register<ModalShell, object?>(nameof(HeaderActions));
|
||||
|
||||
public static readonly StyledProperty<ICommand?> CloseCommandProperty =
|
||||
AvaloniaProperty.Register<ModalShell, ICommand?>(nameof(CloseCommand));
|
||||
|
||||
@@ -27,6 +32,7 @@ public class ModalShell : ContentControl
|
||||
|
||||
public string? Title { get => GetValue(TitleProperty); set => SetValue(TitleProperty, value); }
|
||||
public object? Footer { get => GetValue(FooterProperty); set => SetValue(FooterProperty, value); }
|
||||
public object? HeaderActions { get => GetValue(HeaderActionsProperty); set => SetValue(HeaderActionsProperty, value); }
|
||||
public ICommand? CloseCommand { get => GetValue(CloseCommandProperty); set => SetValue(CloseCommandProperty, value); }
|
||||
public bool ShowMaximizeButton { get => GetValue(ShowMaximizeButtonProperty); set => SetValue(ShowMaximizeButtonProperty, value); }
|
||||
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
xmlns:term="using:Iciclecreek.Terminal"
|
||||
x:Class="ClaudeDo.Ui.Views.InteractiveTerminalView"
|
||||
x:DataType="vm:InteractiveTerminalViewModel"
|
||||
x:Name="Root">
|
||||
x:Name="Root"
|
||||
DragDrop.AllowDrop="True">
|
||||
<!--
|
||||
Process="" suppresses TerminalView.OnLoaded's built-in auto-launch (it otherwise spawns its
|
||||
own cmd.exe/bash the moment this control loads). PtyTerminalSession sets Process/Args/
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Input;
|
||||
using Avalonia.Interactivity;
|
||||
using Avalonia.Platform.Storage;
|
||||
using ClaudeDo.Ui.ViewModels;
|
||||
|
||||
namespace ClaudeDo.Ui.Views;
|
||||
@@ -12,6 +16,12 @@ public partial class InteractiveTerminalView : UserControl
|
||||
InitializeComponent();
|
||||
TerminalHost.Loaded += OnTerminalHostLoaded;
|
||||
DataContextChanged += OnDataContextChanged;
|
||||
|
||||
// Tunnel: TerminalControl handles KeyDown itself and forwards Ctrl+V to the child as a raw
|
||||
// control byte, where nothing acts on it — paste has to be intercepted before it gets there.
|
||||
AddHandler(KeyDownEvent, OnPreviewKeyDown, RoutingStrategies.Tunnel);
|
||||
AddHandler(DragDrop.DragOverEvent, OnDragOver);
|
||||
AddHandler(DragDrop.DropEvent, OnDrop);
|
||||
}
|
||||
|
||||
private void OnDataContextChanged(object? sender, EventArgs e)
|
||||
@@ -25,4 +35,44 @@ public partial class InteractiveTerminalView : UserControl
|
||||
if (DataContext is InteractiveTerminalViewModel vm)
|
||||
vm.AttachControl(TerminalHost);
|
||||
}
|
||||
|
||||
private void OnPreviewKeyDown(object? sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.Key != Key.V || !e.KeyModifiers.HasFlag(KeyModifiers.Control) || e.KeyModifiers.HasFlag(KeyModifiers.Alt))
|
||||
return;
|
||||
if (DataContext is not InteractiveTerminalViewModel vm) return;
|
||||
|
||||
e.Handled = true;
|
||||
_ = vm.PasteAsync();
|
||||
}
|
||||
|
||||
private static bool IsFilesDrop(DragEventArgs e) => e.DataTransfer?.Contains(DataFormat.File) == true;
|
||||
|
||||
private void OnDragOver(object? sender, DragEventArgs e)
|
||||
{
|
||||
e.DragEffects = IsFilesDrop(e) ? DragDropEffects.Copy : DragDropEffects.None;
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
// Dropping files types their paths into the session's composer (no Enter) — the common case is
|
||||
// "look at this file", not "run something".
|
||||
private void OnDrop(object? sender, DragEventArgs e)
|
||||
{
|
||||
if (DataContext is not InteractiveTerminalViewModel vm || !IsFilesDrop(e)) return;
|
||||
e.Handled = true;
|
||||
|
||||
var text = FormatDroppedPaths(e.DataTransfer!.TryGetFiles()?.Select(i => i.TryGetLocalPath()));
|
||||
if (text.Length > 0) _ = vm.SendTextAsync(text);
|
||||
}
|
||||
|
||||
/// <summary>Joins dropped file paths into one insertable chunk: quoted when they contain a
|
||||
/// space, space-separated, with a trailing space so the user can keep typing.</summary>
|
||||
internal static string FormatDroppedPaths(IEnumerable<string?>? paths)
|
||||
{
|
||||
var usable = (paths ?? Enumerable.Empty<string?>())
|
||||
.Where(p => !string.IsNullOrWhiteSpace(p))
|
||||
.Select(p => p!.Contains(' ') ? $"\"{p}\"" : p)
|
||||
.ToList();
|
||||
return usable.Count == 0 ? string.Empty : string.Join(" ", usable) + " ";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,17 +125,12 @@
|
||||
DragCompleted="OnSplitterDragCompleted"/>
|
||||
</Grid>
|
||||
|
||||
<!-- Empty state: no task selected, outside Notes/Prep mode -->
|
||||
<!-- Empty state: no task selected, outside Prep mode -->
|
||||
<TextBlock IsVisible="{Binding IsEmptyStateVisible}"
|
||||
Text="{loc:Tr details.emptyState}"
|
||||
Foreground="{DynamicResource TextMuteBrush}"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
|
||||
<!-- Notes mode -->
|
||||
<Panel IsVisible="{Binding IsNotesMode}">
|
||||
<islands:NotesEditorView DataContext="{Binding Notes}"/>
|
||||
</Panel>
|
||||
|
||||
<!-- Daily-prep mode -->
|
||||
<Panel IsVisible="{Binding IsPrepMode}">
|
||||
<DockPanel>
|
||||
|
||||
@@ -118,8 +118,21 @@
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
|
||||
<!-- MY LISTS section -->
|
||||
<TextBlock Classes="section-label" Text="{loc:Tr lists.myListsLabel}" Margin="10,10,10,4"/>
|
||||
<!-- MY LISTS section — add-list + repo-import sit next to the label -->
|
||||
<Grid ColumnDefinitions="*,Auto,Auto" Margin="10,10,6,4" VerticalAlignment="Center">
|
||||
<TextBlock Grid.Column="0" Classes="section-label"
|
||||
Text="{loc:Tr lists.myListsLabel}" VerticalAlignment="Center"/>
|
||||
<Button Grid.Column="1" Classes="icon-btn"
|
||||
Command="{Binding CreateListCommand}"
|
||||
ToolTip.Tip="{loc:Tr lists.newList}">
|
||||
<PathIcon Data="{StaticResource Icon.Plus}" Width="13" Height="13"/>
|
||||
</Button>
|
||||
<Button Grid.Column="2" Classes="icon-btn"
|
||||
Command="{Binding OpenRepoImportCommand}"
|
||||
ToolTip.Tip="{loc:Tr lists.addReposTip}">
|
||||
<PathIcon Data="{StaticResource Icon.Folder}" Width="14" Height="14"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
<ItemsControl ItemsSource="{Binding UserLists}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate DataType="vm:ListNavItemViewModel">
|
||||
@@ -201,26 +214,6 @@
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
|
||||
<!-- New list + import row -->
|
||||
<Grid ColumnDefinitions="*,Auto" Margin="0,4,0,0">
|
||||
<Button Grid.Column="0" Classes="new-list-btn"
|
||||
Command="{Binding CreateListCommand}">
|
||||
<StackPanel Orientation="Horizontal" Spacing="6">
|
||||
<PathIcon Data="{StaticResource Icon.Plus}"
|
||||
Width="13" Height="13"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBlock Classes="body"
|
||||
Text="{loc:Tr lists.newList}"
|
||||
VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<Button Grid.Column="1" Classes="icon-btn" Margin="6,0,0,0"
|
||||
Command="{Binding OpenRepoImportCommand}"
|
||||
ToolTip.Tip="{loc:Tr lists.addReposTip}">
|
||||
<PathIcon Data="{StaticResource Icon.Folder}" Width="14" Height="14"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</DockPanel>
|
||||
|
||||
@@ -1,38 +1,113 @@
|
||||
<UserControl xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:ClaudeDo.Ui.ViewModels.Islands"
|
||||
xmlns:ctl="using:ClaudeDo.Ui.Views.Controls"
|
||||
xmlns:loc="using:ClaudeDo.Ui.Localization"
|
||||
x:Class="ClaudeDo.Ui.Views.Islands.NotesEditorView"
|
||||
x:DataType="vm:NotesEditorViewModel">
|
||||
<DockPanel Margin="16">
|
||||
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal" Spacing="8">
|
||||
<Button Classes="btn" Content="‹" Command="{Binding PrevDayCommand}"/>
|
||||
<ctl:ThemedDatePicker SelectedDate="{Binding CurrentDate, Mode=TwoWay}"/>
|
||||
<Button Classes="btn" Content="›" Command="{Binding NextDayCommand}"/>
|
||||
<Button Classes="btn" Content="{loc:Tr notes.today}" Command="{Binding TodayCommand}"/>
|
||||
<TextBlock Classes="meta" VerticalAlignment="Center" Text="{Binding CurrentDayLabel}"/>
|
||||
</StackPanel>
|
||||
|
||||
<DockPanel DockPanel.Dock="Top" Margin="0,12,0,8">
|
||||
<Button DockPanel.Dock="Right" Classes="btn" Content="{loc:Tr notes.add}" Margin="8,0,0,0"
|
||||
Command="{Binding AddBulletCommand}"/>
|
||||
<TextBox PlaceholderText="{loc:Tr notes.newNotePlaceholder}" Text="{Binding NewBulletText}">
|
||||
<TextBox.KeyBindings>
|
||||
<KeyBinding Gesture="Enter" Command="{Binding AddBulletCommand}"/>
|
||||
</TextBox.KeyBindings>
|
||||
</TextBox>
|
||||
</DockPanel>
|
||||
<UserControl.Styles>
|
||||
<!-- A note reads as text, not as a form field: the box only shows itself under the pointer
|
||||
and while it has focus. -->
|
||||
<Style Selector="TextBox.note">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="Padding" Value="4,3"/>
|
||||
<Setter Property="MinHeight" Value="0"/>
|
||||
</Style>
|
||||
<Style Selector="TextBox.note /template/ Border#PART_BorderElement">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
</Style>
|
||||
|
||||
<ScrollViewer>
|
||||
<ItemsControl ItemsSource="{Binding Bullets}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate x:DataType="vm:NoteBulletViewModel">
|
||||
<TextBox Text="{Binding Text}" Margin="0,2"
|
||||
LostFocus="OnBulletLostFocus"/>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
<Style Selector="Border.note-row">
|
||||
<Setter Property="CornerRadius" Value="6"/>
|
||||
<Setter Property="Padding" Value="10,1,6,1"/>
|
||||
<Setter Property="Margin" Value="4,1"/>
|
||||
</Style>
|
||||
<Style Selector="Border.note-row:pointerover">
|
||||
<Setter Property="Background" Value="{DynamicResource PeatSoftBrush}"/>
|
||||
</Style>
|
||||
<!-- Row actions stay out of the way until the row is hovered. -->
|
||||
<Style Selector="Border.note-row Button.note-del">
|
||||
<Setter Property="Opacity" Value="0"/>
|
||||
</Style>
|
||||
<Style Selector="Border.note-row:pointerover Button.note-del">
|
||||
<Setter Property="Opacity" Value="1"/>
|
||||
</Style>
|
||||
</UserControl.Styles>
|
||||
|
||||
<DockPanel LastChildFill="True">
|
||||
|
||||
<!-- Today's capture box: Enter files the note and leaves the caret here for the next one. -->
|
||||
<Border DockPanel.Dock="Top" Classes="add-task" Margin="16,14,16,10">
|
||||
<Grid ColumnDefinitions="Auto,*,Auto">
|
||||
<Border Grid.Column="0" Classes="add-task-plus" VerticalAlignment="Center">
|
||||
<PathIcon Width="12" Height="12" Data="{StaticResource Icon.Plus}"
|
||||
Foreground="{DynamicResource TextFaintBrush}"/>
|
||||
</Border>
|
||||
<!-- Enter/Shift+Enter are handled in the code-behind's tunnel handler, same as the note
|
||||
rows: a KeyBinding would never fire, because AcceptsReturn makes TextBox consume
|
||||
Enter first. -->
|
||||
<TextBox Grid.Column="1" x:Name="NewNoteBox" Classes="add-task-input"
|
||||
PlaceholderText="{loc:Tr notes.newNotePlaceholder}"
|
||||
Text="{Binding NewBulletText, Mode=TwoWay}"
|
||||
AcceptsReturn="True" TextWrapping="Wrap"
|
||||
VerticalAlignment="Center" Margin="12,0,0,0"/>
|
||||
<Border Grid.Column="2" Classes="kbd kbd-enter" VerticalAlignment="Center"
|
||||
IsVisible="{Binding #NewNoteBox.IsFocused}">
|
||||
<TextBlock Text="{loc:Tr tasks.enterKey}"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<Panel>
|
||||
<ScrollViewer>
|
||||
<ItemsControl x:Name="RowsHost" ItemsSource="{Binding Rows}" Margin="10,0,10,12">
|
||||
<ItemsControl.DataTemplates>
|
||||
|
||||
<DataTemplate DataType="vm:NoteDayHeaderViewModel">
|
||||
<TextBlock Classes="eyebrow section-label" Margin="14,12,14,4" Text="{Binding Label}"/>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate DataType="vm:NoteBulletViewModel">
|
||||
<Border Classes="note-row">
|
||||
<Grid ColumnDefinitions="Auto,*,Auto,Auto">
|
||||
<Ellipse Grid.Column="0" Width="4" Height="4" Margin="0,0,10,0"
|
||||
VerticalAlignment="Center"
|
||||
Fill="{DynamicResource TextFaintBrush}"/>
|
||||
<!-- AcceptsReturn/TextWrapping are set here, not in the style above: TextBox
|
||||
reads AcceptsReturn in its own OnKeyDown, which runs before any handler a
|
||||
style or the XAML could attach. Enter is intercepted in the tunnel phase
|
||||
(see code-behind) so the split still wins over the newline. -->
|
||||
<TextBox Grid.Column="1" Classes="note" Text="{Binding Text, Mode=TwoWay}"
|
||||
AcceptsReturn="True" TextWrapping="Wrap"
|
||||
LostFocus="OnBulletLostFocus"/>
|
||||
<PathIcon Grid.Column="2" Width="12" Height="12" Margin="6,0"
|
||||
VerticalAlignment="Center"
|
||||
IsVisible="{Binding FromAgent}"
|
||||
ToolTip.Tip="{loc:Tr notes.fromAgentTip}"
|
||||
Data="{StaticResource Icon.AgentSuggested}"
|
||||
Foreground="{DynamicResource TextFaintBrush}"/>
|
||||
<Button Grid.Column="3" Classes="icon-btn note-del"
|
||||
VerticalAlignment="Center"
|
||||
ToolTip.Tip="{loc:Tr notes.deleteTip}"
|
||||
Click="OnDeleteBulletClick">
|
||||
<PathIcon Classes="danger" Data="{StaticResource Icon.Trash}" Width="12" Height="12"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
|
||||
</ItemsControl.DataTemplates>
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
|
||||
<TextBlock IsVisible="{Binding IsEmpty}"
|
||||
Text="{loc:Tr notes.emptyHint}"
|
||||
Foreground="{DynamicResource TextMuteBrush}"
|
||||
MaxWidth="260" TextAlignment="Center" TextWrapping="Wrap"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
IsHitTestVisible="False"/>
|
||||
</Panel>
|
||||
</DockPanel>
|
||||
</UserControl>
|
||||
|
||||
@@ -1,12 +1,74 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Input;
|
||||
using Avalonia.Interactivity;
|
||||
using Avalonia.Threading;
|
||||
using Avalonia.VisualTree;
|
||||
using ClaudeDo.Ui.ViewModels.Islands;
|
||||
|
||||
namespace ClaudeDo.Ui.Views.Islands;
|
||||
|
||||
public partial class NotesEditorView : UserControl
|
||||
{
|
||||
public NotesEditorView() => InitializeComponent();
|
||||
private NotesEditorViewModel? _vm;
|
||||
|
||||
public NotesEditorView()
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContextChanged += OnDataContextChanged;
|
||||
// Tunnel, not bubble: with AcceptsReturn on, TextBox.OnKeyDown consumes Enter (any
|
||||
// modifier) before a bubbling handler ever sees it. Taking Enter in the tunnel phase
|
||||
// keeps the split chain, and letting Shift+Enter through leaves the newline to the box.
|
||||
AddHandler(KeyDownEvent, OnBulletKeyDown, RoutingStrategies.Tunnel);
|
||||
}
|
||||
|
||||
|
||||
private void OnDataContextChanged(object? sender, EventArgs e)
|
||||
{
|
||||
if (_vm is not null) _vm.FocusRequested -= FocusBullet;
|
||||
_vm = DataContext as NotesEditorViewModel;
|
||||
if (_vm is not null) _vm.FocusRequested += FocusBullet;
|
||||
}
|
||||
|
||||
/// <summary>Rows the VM just inserted have no container yet — wait for the layout pass that
|
||||
/// creates it before reaching for the TextBox inside.</summary>
|
||||
private void FocusBullet(NoteBulletViewModel bullet) =>
|
||||
Dispatcher.UIThread.Post(
|
||||
() => RowsHost.ContainerFromItem(bullet)?.FindDescendantOfType<TextBox>()?.Focus(),
|
||||
DispatcherPriority.Loaded);
|
||||
|
||||
private void OnBulletKeyDown(object? sender, KeyEventArgs e)
|
||||
{
|
||||
// Source, not sender: the tunnel handler is attached to the whole view, so it sees the
|
||||
// capture box at the top as well as the note rows. Both need the same Enter/Shift+Enter
|
||||
// split, and neither can get it from a KeyBinding — with AcceptsReturn on, TextBox eats
|
||||
// Enter in its own OnKeyDown before any bubbling handler or binding runs.
|
||||
if (e.Source is not TextBox box || DataContext is not NotesEditorViewModel vm) return;
|
||||
var shift = e.KeyModifiers.HasFlag(KeyModifiers.Shift);
|
||||
|
||||
if (ReferenceEquals(box, NewNoteBox))
|
||||
{
|
||||
if (e.Key == Key.Enter && !shift)
|
||||
{
|
||||
e.Handled = true;
|
||||
vm.AddBulletCommand.Execute(null);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (box.DataContext is not NoteBulletViewModel bullet) return;
|
||||
|
||||
// Shift+Enter falls through to the TextBox and breaks the line — a note can be several.
|
||||
if (e.Key == Key.Enter && !shift)
|
||||
{
|
||||
e.Handled = true;
|
||||
vm.SplitBulletCommand.Execute(bullet);
|
||||
}
|
||||
else if (e.Key == Key.Back && string.IsNullOrEmpty(box.Text))
|
||||
{
|
||||
e.Handled = true;
|
||||
vm.DeleteBulletCommand.Execute(bullet);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnBulletLostFocus(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
@@ -15,4 +77,11 @@ public partial class NotesEditorView : UserControl
|
||||
&& vm.CommitBulletCommand.CanExecute(bullet))
|
||||
vm.CommitBulletCommand.Execute(bullet);
|
||||
}
|
||||
|
||||
private void OnDeleteBulletClick(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is Button { DataContext: NoteBulletViewModel bullet }
|
||||
&& DataContext is NotesEditorViewModel vm)
|
||||
vm.DeleteBulletCommand.Execute(bullet);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ using Avalonia.Interactivity;
|
||||
using Avalonia.VisualTree;
|
||||
using ClaudeDo.Data.Models;
|
||||
using ClaudeDo.Ui.Localization;
|
||||
using ClaudeDo.Ui.ViewModels;
|
||||
using ClaudeDo.Ui.ViewModels.Islands;
|
||||
using TaskStatus = ClaudeDo.Data.Models.TaskStatus;
|
||||
|
||||
@@ -97,6 +98,23 @@ public partial class TaskRowView : UserControl
|
||||
schedule.Items.Add(MakeItem("tasks.ctxRemoveFromMyDay", OnRemoveFromMyDayClick, row.IsMyDay));
|
||||
menu.Items.Add(schedule);
|
||||
|
||||
// "Move to list" — user lists only, current list excluded. Reuses the drag-drop move
|
||||
// (MoveTaskToListAsync), so nothing but ListId changes and the same running/worktree
|
||||
// guards apply. Hidden entirely when there is nowhere to move to.
|
||||
var targets = (TopLevel.GetTopLevel(this)?.DataContext as IslandsShellViewModel)?.Lists?.UserLists
|
||||
.Where(l => l.Id != vm.CurrentListId).ToList() ?? [];
|
||||
if (targets.Count > 0)
|
||||
{
|
||||
var moveTo = new MenuItem { Header = Loc.T("tasks.ctxMoveToList"), DataContext = row };
|
||||
foreach (var target in targets)
|
||||
{
|
||||
var item = new MenuItem { Header = target.Name, DataContext = row, Tag = target };
|
||||
item.Click += OnMoveToListClick;
|
||||
moveTo.Items.Add(item);
|
||||
}
|
||||
menu.Items.Add(moveTo);
|
||||
}
|
||||
|
||||
menu.Items.Add(new Separator());
|
||||
menu.Items.Add(MakeItem("tasks.ctxDeleteTask", OnDeleteTaskClick, reason: row.DeleteDisabledReason));
|
||||
|
||||
@@ -152,6 +170,13 @@ public partial class TaskRowView : UserControl
|
||||
await vm.RemoveFromMyDayCommand.ExecuteAsync(row);
|
||||
}
|
||||
|
||||
private async void OnMoveToListClick(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is not MenuItem { Tag: ListNavItemViewModel target }) return;
|
||||
if (DataContext is TaskRowViewModel row && FindTasksVm() is { } vm)
|
||||
await vm.MoveTaskToListAsync(row, target);
|
||||
}
|
||||
|
||||
private async void OnDeleteTaskClick(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
if (DataContext is TaskRowViewModel row && FindTasksVm() is { } vm)
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
<TextBlock Text="{Binding StatusPill}"/>
|
||||
</Border>
|
||||
<Button Classes="icon-btn" Classes.active="{Binding IsShowingCompleted}"
|
||||
IsVisible="{Binding !IsNotesList}"
|
||||
Command="{Binding ToggleShowCompletedCommand}"
|
||||
ToolTip.Tip="{loc:Tr tasks.showCompletedTip}">
|
||||
<PathIcon Width="15" Height="15" Data="{StaticResource Icon.Eye}"/>
|
||||
@@ -60,7 +61,8 @@
|
||||
<Path Classes="icon-stroke" Data="{StaticResource Icon.PlanDay}"/>
|
||||
</Viewbox>
|
||||
</Button>
|
||||
<Button Classes="icon-btn" Command="{Binding OpenListSettingsCommand}" ToolTip.Tip="{loc:Tr tasks.listSettingsTip}">
|
||||
<Button Classes="icon-btn" IsVisible="{Binding !IsNotesList}"
|
||||
Command="{Binding OpenListSettingsCommand}" ToolTip.Tip="{loc:Tr tasks.listSettingsTip}">
|
||||
<PathIcon Width="15" Height="15" Data="{StaticResource Icon.Settings}"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
@@ -68,7 +70,8 @@
|
||||
</Border>
|
||||
|
||||
<!-- Add-task row -->
|
||||
<Border DockPanel.Dock="Top" Classes="add-task" Margin="16,14,16,8">
|
||||
<Border DockPanel.Dock="Top" Classes="add-task" Margin="16,14,16,8"
|
||||
IsVisible="{Binding !IsNotesList}">
|
||||
<Grid ColumnDefinitions="Auto,*,Auto">
|
||||
<Border Grid.Column="0" Classes="add-task-plus" VerticalAlignment="Center">
|
||||
<PathIcon Width="12" Height="12" Data="{StaticResource Icon.Plus}"
|
||||
@@ -90,14 +93,6 @@
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- Notes pinned row (My Day only) -->
|
||||
<Button DockPanel.Dock="Top"
|
||||
Classes="btn" HorizontalAlignment="Stretch" HorizontalContentAlignment="Left"
|
||||
Margin="16,0,16,8"
|
||||
IsVisible="{Binding ShowNotesRow}"
|
||||
Command="{Binding OpenNotesCommand}"
|
||||
Content="{loc:Tr tasks.notesPinnedRow}"/>
|
||||
|
||||
<!-- Task list: one flat, virtualized ListBox. Rows is HeaderRow | TaskRowViewModel — group
|
||||
headers are regular entries, not a separate ItemsControl per section, so a
|
||||
VirtualizingStackPanel actually bounds the realized container count.
|
||||
@@ -106,6 +101,7 @@
|
||||
unreachable. -->
|
||||
<Panel>
|
||||
<ListBox x:Name="RowsListBox"
|
||||
IsVisible="{Binding !IsNotesList}"
|
||||
ItemsSource="{Binding Rows}"
|
||||
Background="Transparent"
|
||||
BorderThickness="0">
|
||||
@@ -172,6 +168,11 @@
|
||||
Foreground="{DynamicResource TextMuteBrush}"
|
||||
TextAlignment="Center" TextWrapping="Wrap"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- The notes list is not a task list: same island slot, different content. -->
|
||||
<Panel IsVisible="{Binding IsNotesList}">
|
||||
<islands:NotesEditorView DataContext="{Binding Notes}"/>
|
||||
</Panel>
|
||||
</Panel>
|
||||
|
||||
</DockPanel>
|
||||
|
||||
@@ -64,8 +64,6 @@
|
||||
Foreground="{DynamicResource TextDimBrush}">
|
||||
<MenuItem Header="{loc:Tr shell.menu.restartWorker}"
|
||||
Command="{Binding RestartWorkerCommand}"/>
|
||||
<MenuItem Header="{loc:Tr shell.menu.checkForUpdates}"
|
||||
Command="{Binding CheckForUpdatesCommand}"/>
|
||||
<MenuItem Header="{loc:Tr shell.menu.usageMonitor}"
|
||||
Command="{Binding OpenUsageMonitorCommand}"/>
|
||||
</MenuItem>
|
||||
@@ -79,7 +77,23 @@
|
||||
<MenuItem Header="{loc:Tr shell.menu.help}"
|
||||
FontSize="{StaticResource FontSizeMono}"
|
||||
Foreground="{DynamicResource TextDimBrush}">
|
||||
<MenuItem Header="{loc:Tr shell.menu.checkForUpdates}"
|
||||
Command="{Binding CheckForUpdatesCommand}"/>
|
||||
<MenuItem Header="{loc:Tr shell.menu.weeklyReport}" Command="{Binding OpenWeeklyReportCommand}"/>
|
||||
<MenuItem Header="{loc:Tr shell.menu.cheatSheets}">
|
||||
<MenuItem Header="{loc:Tr shell.menu.cheatSheetGit}"
|
||||
Command="{Binding OpenCheatSheetCommand}" CommandParameter="git"/>
|
||||
<MenuItem Header="{loc:Tr shell.menu.cheatSheetCommits}"
|
||||
Command="{Binding OpenCheatSheetCommand}" CommandParameter="conventional-commits"/>
|
||||
<MenuItem Header="{loc:Tr shell.menu.cheatSheetClaude}"
|
||||
Command="{Binding OpenCheatSheetCommand}" CommandParameter="claude-cli"/>
|
||||
<MenuItem Header="{loc:Tr shell.menu.cheatSheetClaudeConfig}"
|
||||
Command="{Binding OpenCheatSheetCommand}" CommandParameter="claude-config"/>
|
||||
<MenuItem Header="{loc:Tr shell.menu.cheatSheetDotnet}"
|
||||
Command="{Binding OpenCheatSheetCommand}" CommandParameter="dotnet-cli"/>
|
||||
<MenuItem Header="{loc:Tr shell.menu.cheatSheetPowershell}"
|
||||
Command="{Binding OpenCheatSheetCommand}" CommandParameter="powershell"/>
|
||||
</MenuItem>
|
||||
<MenuItem Header="{loc:Tr shell.menu.about}" Command="{Binding OpenAboutCommand}"/>
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
@@ -144,7 +158,7 @@
|
||||
ResizeDirection="Columns"
|
||||
ResizeBehavior="PreviousAndNext"/>
|
||||
|
||||
<Border Grid.Column="2" Classes="island" Margin="3">
|
||||
<Border Grid.Column="2" Grid.ColumnSpan="{Binding TasksColumnSpan}" Classes="island" Margin="3">
|
||||
<islands:TasksIslandView DataContext="{Binding Tasks}"/>
|
||||
</Border>
|
||||
|
||||
@@ -259,29 +273,6 @@
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- Stale-worker notice — bottom-right corner, above the update popup. Persistent
|
||||
(no auto-dismiss timer): the running worker predates the selected list's merged
|
||||
HEAD, so a restart is needed before "verified" claims against it are trustworthy. -->
|
||||
<Border Grid.Row="0" Grid.RowSpan="3"
|
||||
VerticalAlignment="Bottom" HorizontalAlignment="Right"
|
||||
Margin="0,0,16,100"
|
||||
ZIndex="100"
|
||||
IsVisible="{Binding IsStaleWorkerBannerVisible}"
|
||||
Background="{DynamicResource DeepBrush}"
|
||||
BorderBrush="{DynamicResource LineBrush}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="6"
|
||||
Padding="14,10">
|
||||
<StackPanel Spacing="8" Width="260">
|
||||
<TextBlock Classes="body" Text="{loc:Tr shell.staleWorker.message}" TextWrapping="Wrap"/>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8" HorizontalAlignment="Right">
|
||||
<Button Classes="btn"
|
||||
Content="{loc:Tr shell.menu.restartWorker}"
|
||||
Command="{Binding RestartWorkerCommand}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- External merge popup card — bottom-left corner, while an MCP session owns an
|
||||
unresolved unit-merge conflict. Does not auto-dismiss; stays until the merge ends. -->
|
||||
<Border Grid.Row="0" Grid.RowSpan="3"
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
Background="{DynamicResource Surface2Brush}"
|
||||
BorderBrush="{DynamicResource LineBrush}"
|
||||
BorderThickness="0,0,0,1" Padding="8,3">
|
||||
<Grid ColumnDefinitions="*,Auto,Auto">
|
||||
<Grid ColumnDefinitions="*,Auto,Auto,Auto">
|
||||
<TextBlock Grid.Column="0" Classes="meta" Text="{Binding DisplayTitle}"
|
||||
TextTrimming="CharacterEllipsis"
|
||||
ToolTip.Tip="{Binding DisplayTitle}"
|
||||
@@ -25,7 +25,12 @@
|
||||
Content="{loc:Tr missionControl.submitForReview}"
|
||||
ToolTip.Tip="{loc:Tr missionControl.submitForReviewTip}"
|
||||
Command="{Binding SubmitForReviewCommand}" />
|
||||
<Button Grid.Column="2" Classes="title-ctrl"
|
||||
<Button Grid.Column="2" Classes="btn" Margin="0,0,6,0"
|
||||
IsVisible="{Binding IsListHandler}"
|
||||
Content="{loc:Tr missionControl.abandonRun}"
|
||||
ToolTip.Tip="{loc:Tr missionControl.abandonRunTip}"
|
||||
Command="{Binding AbandonRunCommand}" />
|
||||
<Button Grid.Column="3" Classes="title-ctrl"
|
||||
Command="{Binding CloseCommand}"
|
||||
ToolTip.Tip="{loc:Tr missionControl.closeSession}">
|
||||
<PathIcon Data="{StaticResource Icon.WinClose}" Width="12" Height="12"/>
|
||||
|
||||
@@ -2,6 +2,7 @@ using System;
|
||||
using System.Collections.Specialized;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Layout;
|
||||
using Avalonia.Media;
|
||||
@@ -55,6 +56,7 @@ public partial class MissionControlView : UserControl
|
||||
_vm.Panes.CollectionChanged -= OnPanesChanged;
|
||||
_vm.PropertyChanged -= OnViewModelPropertyChanged;
|
||||
_vm.BrowseForSessionRequested = null;
|
||||
_vm.ConfirmAsync = null;
|
||||
}
|
||||
|
||||
_vm = DataContext as MissionControlViewModel;
|
||||
@@ -64,12 +66,59 @@ public partial class MissionControlView : UserControl
|
||||
_vm.Panes.CollectionChanged += OnPanesChanged;
|
||||
_vm.PropertyChanged += OnViewModelPropertyChanged;
|
||||
_vm.BrowseForSessionRequested = BrowseForSessionAsync;
|
||||
_vm.ConfirmAsync = ShowConfirmAsync;
|
||||
}
|
||||
|
||||
RebuildOverviewGrid();
|
||||
UpdateQueueColumn();
|
||||
}
|
||||
|
||||
// Abandon-run confirmation -- same TaskCompletionSource-backed plain Window as
|
||||
// TasksIslandView.ShowConfirmAsync (no shared control for this shape yet).
|
||||
private async Task<bool> ShowConfirmAsync(string message)
|
||||
{
|
||||
var owner = TopLevel.GetTopLevel(this) as Window;
|
||||
if (owner is null) return false;
|
||||
|
||||
var tcs = new TaskCompletionSource<bool>();
|
||||
var cancel = new Button { Content = "Cancel", MinWidth = 90 };
|
||||
var confirm = new Button { Content = "Confirm", MinWidth = 90, Classes = { "danger" } };
|
||||
|
||||
var dialog = new Window
|
||||
{
|
||||
Title = "Confirm",
|
||||
Width = 380,
|
||||
SizeToContent = SizeToContent.Height,
|
||||
CanResize = false,
|
||||
WindowStartupLocation = WindowStartupLocation.CenterOwner,
|
||||
ShowInTaskbar = false,
|
||||
Background = this.FindResource("SurfaceBrush") as IBrush,
|
||||
Content = new StackPanel
|
||||
{
|
||||
Margin = new Thickness(20),
|
||||
Spacing = 16,
|
||||
Children =
|
||||
{
|
||||
new TextBlock { Text = message, TextWrapping = TextWrapping.Wrap },
|
||||
new StackPanel
|
||||
{
|
||||
Orientation = Orientation.Horizontal,
|
||||
HorizontalAlignment = HorizontalAlignment.Right,
|
||||
Spacing = 8,
|
||||
Children = { cancel, confirm },
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
cancel.Click += (_, _) => { tcs.TrySetResult(false); dialog.Close(); };
|
||||
confirm.Click += (_, _) => { tcs.TrySetResult(true); dialog.Close(); };
|
||||
dialog.Closed += (_, _) => tcs.TrySetResult(false);
|
||||
|
||||
_ = dialog.ShowDialog(owner);
|
||||
return await tcs.Task;
|
||||
}
|
||||
|
||||
private void OnPanesChanged(object? sender, NotifyCollectionChangedEventArgs e) => RebuildOverviewGrid();
|
||||
|
||||
private void OnViewModelPropertyChanged(object? sender, PropertyChangedEventArgs e)
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
|
||||
<ctl:ModalShell Title="{loc:Tr modals.about.title}" CloseCommand="{Binding CloseCommand}">
|
||||
<!-- Body -->
|
||||
<ScrollViewer Padding="20,16" HorizontalScrollBarVisibility="Disabled">
|
||||
<Grid RowDefinitions="Auto,Auto,Auto,Auto" ColumnDefinitions="90,*,Auto" RowSpacing="10" ColumnSpacing="8">
|
||||
<ScrollViewer HorizontalScrollBarVisibility="Disabled">
|
||||
<Grid Margin="20,16" RowDefinitions="Auto,Auto,Auto,Auto" ColumnDefinitions="90,*,Auto" RowSpacing="10" ColumnSpacing="8">
|
||||
<TextBlock Classes="meta" Grid.Row="0" Grid.Column="0" Text="{loc:Tr modals.about.version}" VerticalAlignment="Center"/>
|
||||
<TextBlock Classes="meta" Grid.Row="0" Grid.Column="1" Text="{Binding AppVersion}" VerticalAlignment="Center"/>
|
||||
<TextBlock Classes="meta" Grid.Row="1" Grid.Column="0" Text="{loc:Tr modals.about.data}" VerticalAlignment="Center"/>
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
<Window xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:ClaudeDo.Ui.ViewModels.Modals"
|
||||
xmlns:ctl="using:ClaudeDo.Ui.Views.Controls"
|
||||
xmlns:loc="using:ClaudeDo.Ui.Localization"
|
||||
x:Class="ClaudeDo.Ui.Views.Modals.CheatSheetsWindow"
|
||||
x:DataType="vm:CheatSheetsViewModel"
|
||||
Title="{loc:Tr modals.cheatSheets.windowTitle}"
|
||||
Width="480" Height="820" MinWidth="320" MinHeight="300"
|
||||
CanResize="True"
|
||||
Topmost="{Binding IsPinned}"
|
||||
WindowDecorations="BorderOnly"
|
||||
ExtendClientAreaToDecorationsHint="True"
|
||||
ExtendClientAreaTitleBarHeightHint="-1"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
Background="{DynamicResource SurfaceBrush}">
|
||||
|
||||
<Window.KeyBindings>
|
||||
<KeyBinding Gesture="Escape" Command="{Binding CloseCommand}"/>
|
||||
</Window.KeyBindings>
|
||||
|
||||
<ctl:ModalShell Title="{loc:Tr modals.cheatSheets.title}" CloseCommand="{Binding CloseCommand}">
|
||||
<DockPanel>
|
||||
<!-- Sheet picker + pin. Pin keeps the window above the shell while it sits at a screen edge. -->
|
||||
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal" Spacing="8" Margin="16,10,16,0">
|
||||
<ComboBox ItemsSource="{Binding Sheets}"
|
||||
SelectedItem="{Binding SelectedSheet}"
|
||||
DisplayMemberBinding="{Binding Title}"
|
||||
MinWidth="180"
|
||||
VerticalAlignment="Center"/>
|
||||
<ToggleButton Content="{loc:Tr modals.cheatSheets.pin}"
|
||||
IsChecked="{Binding IsPinned}"
|
||||
VerticalAlignment="Center"
|
||||
ToolTip.Tip="{loc:Tr modals.cheatSheets.pinTooltip}"/>
|
||||
</StackPanel>
|
||||
|
||||
<ScrollViewer HorizontalScrollBarVisibility="Disabled">
|
||||
<!-- Inset on the content, not the ScrollViewer: Avalonia 12 leaves ScrollViewer.Padding
|
||||
out of the Extent, which clips the last lines at max scroll. -->
|
||||
<ctl:MarkdownView Markdown="{Binding SelectedSheet.Body}" CommandRows="True"
|
||||
Margin="16,12,16,16"/>
|
||||
</ScrollViewer>
|
||||
</DockPanel>
|
||||
</ctl:ModalShell>
|
||||
</Window>
|
||||
@@ -0,0 +1,10 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace ClaudeDo.Ui.Views.Modals;
|
||||
|
||||
public partial class CheatSheetsWindow : Window
|
||||
{
|
||||
public CheatSheetsWindow() => InitializeComponent();
|
||||
private void InitializeComponent() => AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
@@ -103,6 +103,13 @@
|
||||
Opacity="0.6" FontSize="12" TextWrapping="Wrap"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="4">
|
||||
<CheckBox IsChecked="{Binding PowerUseAllowed, Mode=TwoWay}"
|
||||
Content="{loc:Tr modals.listSettings.powerUseAllowed}"/>
|
||||
<TextBlock Text="{loc:Tr modals.listSettings.powerUseAllowedHint}"
|
||||
Opacity="0.6" FontSize="12" TextWrapping="Wrap"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="4" IsVisible="{Binding TicketsAvailable}">
|
||||
<TextBlock Classes="field-label" Text="{loc:Tr modals.listSettings.ticketProject}"/>
|
||||
<ComboBox ItemsSource="{Binding TicketProjects}"
|
||||
|
||||
@@ -44,8 +44,8 @@
|
||||
<TextBlock Grid.Column="3" Classes="eyebrow" Text="{loc:Tr modals.mergeHelper.columnStatus}"/>
|
||||
</Grid>
|
||||
|
||||
<ScrollViewer Padding="20,2,20,8">
|
||||
<StackPanel>
|
||||
<ScrollViewer>
|
||||
<StackPanel Margin="20,2,20,8">
|
||||
<TextBlock Classes="meta" Margin="0,8"
|
||||
Text="{loc:Tr modals.mergeHelper.empty}"
|
||||
IsVisible="{Binding !HasTasks}"/>
|
||||
|
||||
@@ -39,8 +39,8 @@
|
||||
</ctl:ModalShell.Footer>
|
||||
|
||||
<!-- Body -->
|
||||
<ScrollViewer Padding="20,16">
|
||||
<StackPanel Spacing="12">
|
||||
<ScrollViewer>
|
||||
<StackPanel Margin="20,16" Spacing="12">
|
||||
|
||||
<TextBlock Classes="title" Text="{Binding TaskTitle, StringFormat='Merging: {0}'}" />
|
||||
|
||||
|
||||
@@ -43,8 +43,8 @@
|
||||
</StackPanel>
|
||||
|
||||
<!-- Repo checklist -->
|
||||
<ScrollViewer Padding="20,2,20,8">
|
||||
<ItemsControl ItemsSource="{Binding Repos}">
|
||||
<ScrollViewer>
|
||||
<ItemsControl Margin="20,2,20,8" ItemsSource="{Binding Repos}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate DataType="vm:RepoImportItemViewModel">
|
||||
<Grid ColumnDefinitions="Auto,Auto,*,Auto" Margin="0,1"
|
||||
|
||||
@@ -251,6 +251,45 @@
|
||||
Content="{loc:Tr settings.general.autoContinueOnUsageLimit}"/>
|
||||
<TextBlock Text="{loc:Tr settings.general.autoContinueOnUsageLimitHint}"
|
||||
Opacity="0.6" FontSize="12" TextWrapping="Wrap"/>
|
||||
|
||||
<!-- Outside the PowerUse section below on purpose: the handoff budget also bounds
|
||||
a normal (interactive) handler run. -->
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Classes="eyebrow" Text="{loc:Tr settings.general.listHandlerMaxHandoffs}"/>
|
||||
<NumericUpDown Value="{Binding General.ListHandlerMaxHandoffs, Mode=TwoWay, Converter={StaticResource KeepLastNumber}}"
|
||||
Minimum="1" Maximum="200" Increment="2" FormatString="0"
|
||||
HorizontalAlignment="Left" Width="140"/>
|
||||
<TextBlock Text="{loc:Tr settings.general.listHandlerMaxHandoffsHint}"
|
||||
Opacity="0.6" FontSize="12" TextWrapping="Wrap"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
<!-- PowerUse: a master switch plus its time window. Never sufficient on its own —
|
||||
the run's list must also allow PowerUse in its list settings. -->
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Classes="field-label" Text="{loc:Tr settings.general.powerUseHeading}"/>
|
||||
<CheckBox IsChecked="{Binding General.PowerUseEnabled, Mode=TwoWay}"
|
||||
Content="{loc:Tr settings.general.powerUse}"/>
|
||||
<TextBlock Text="{loc:Tr settings.general.powerUseHint}"
|
||||
Opacity="0.6" FontSize="12" TextWrapping="Wrap"/>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8" Margin="0,6,0,0">
|
||||
<TextBlock Classes="eyebrow" VerticalAlignment="Center"
|
||||
Text="{loc:Tr settings.general.powerUseWindow}"/>
|
||||
<TextBox Width="70" FontSize="12" Padding="6,2"
|
||||
Watermark="{loc:Tr settings.general.powerUseWindowPlaceholder}"
|
||||
Text="{Binding General.PowerUseWindowStart, Mode=TwoWay}"/>
|
||||
<TextBlock Classes="meta" VerticalAlignment="Center" Text="–"/>
|
||||
<TextBox Width="70" FontSize="12" Padding="6,2"
|
||||
Watermark="{loc:Tr settings.general.powerUseWindowPlaceholder}"
|
||||
Text="{Binding General.PowerUseWindowEnd, Mode=TwoWay}"/>
|
||||
<TextBlock Classes="eyebrow" VerticalAlignment="Center" Margin="12,0,0,0"
|
||||
Text="{loc:Tr settings.general.powerUseHandoffPct}"/>
|
||||
<NumericUpDown Width="80" FontSize="12" Padding="6,2" ShowButtonSpinner="False"
|
||||
Minimum="50" Maximum="99" Increment="1" FormatString="0"
|
||||
Value="{Binding General.PowerUseHandoffPct, Mode=TwoWay, Converter={StaticResource KeepLastNumber}}"/>
|
||||
</StackPanel>
|
||||
<TextBlock Text="{loc:Tr settings.general.powerUseWindowHint}"
|
||||
Opacity="0.6" FontSize="12" TextWrapping="Wrap"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Throttle stages live on the usage-monitor gauges (drag + spinner per stage);
|
||||
@@ -433,7 +472,7 @@
|
||||
</StackPanel>
|
||||
<StackPanel Spacing="6">
|
||||
<TextBlock Classes="section-label" Text="{loc:Tr settings.files.promptsSection}"/>
|
||||
<Grid RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto" ColumnDefinitions="120,*,Auto" RowSpacing="8">
|
||||
<Grid RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto" ColumnDefinitions="120,*,Auto" RowSpacing="8">
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" Classes="field-label" Text="{loc:Tr settings.files.systemPrompt}" VerticalAlignment="Center"/>
|
||||
<TextBlock Grid.Row="0" Grid.Column="1" Classes="path-mono" Text="{Binding Files.SystemPromptPath}" VerticalAlignment="Center"/>
|
||||
<Button Classes="btn" Grid.Row="0" Grid.Column="2" Content="{loc:Tr settings.files.viewPrompt}"
|
||||
@@ -458,6 +497,10 @@
|
||||
<TextBlock Grid.Row="5" Grid.Column="1" Classes="path-mono" Text="{Binding Files.WeeklyReportPromptPath}" VerticalAlignment="Center"/>
|
||||
<Button Classes="btn" Grid.Row="5" Grid.Column="2" Content="{loc:Tr settings.files.viewPrompt}"
|
||||
Command="{Binding Files.ViewPromptCommand}" CommandParameter="WeeklyReport"/>
|
||||
<TextBlock Grid.Row="6" Grid.Column="0" Classes="field-label" Text="{loc:Tr settings.files.powerUsePrompt}" VerticalAlignment="Center"/>
|
||||
<TextBlock Grid.Row="6" Grid.Column="1" Classes="path-mono" Text="{Binding Files.PowerUsePromptPath}" VerticalAlignment="Center"/>
|
||||
<Button Classes="btn" Grid.Row="6" Grid.Column="2" Content="{loc:Tr settings.files.viewPrompt}"
|
||||
Command="{Binding Files.ViewPromptCommand}" CommandParameter="PowerUseAddendum"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
<StackPanel Spacing="6" IsVisible="{Binding Files.ViewedKindName, Converter={x:Static StringConverters.IsNotNullOrEmpty}}">
|
||||
|
||||
@@ -19,6 +19,18 @@
|
||||
</Window.KeyBindings>
|
||||
|
||||
<ctl:ModalShell Title="{loc:Tr modals.usageMonitor.title}" CloseCommand="{Binding CloseCommand}">
|
||||
<!-- Refresh sits in the titlebar: the worker polls on a slow cadence to avoid the endpoint's
|
||||
429s, so this is the way to get a number now — but it doesn't earn a row in the body. -->
|
||||
<ctl:ModalShell.HeaderActions>
|
||||
<StackPanel Orientation="Horizontal" Spacing="6">
|
||||
<Ellipse Classes="spinner" Width="12" Height="12" VerticalAlignment="Center"
|
||||
IsVisible="{Binding IsRefreshing}"/>
|
||||
<Button Classes="icon-btn" Content="⟳" FontSize="{DynamicResource FontSizeBody}"
|
||||
Command="{Binding RefreshCommand}"
|
||||
IsEnabled="{Binding !IsRefreshing}"
|
||||
ToolTip.Tip="{loc:Tr modals.usageMonitor.refreshHint}"/>
|
||||
</StackPanel>
|
||||
</ctl:ModalShell.HeaderActions>
|
||||
<DockPanel>
|
||||
|
||||
<!-- Stale / gate bands -->
|
||||
@@ -47,18 +59,6 @@
|
||||
</Border>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Refresh: the worker polls on a slow cadence to avoid the endpoint's 429s -->
|
||||
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal" Spacing="8"
|
||||
Margin="20,12,20,0" VerticalAlignment="Center">
|
||||
<Button Classes="btn" Content="{loc:Tr modals.usageMonitor.refresh}"
|
||||
Command="{Binding RefreshCommand}"
|
||||
IsEnabled="{Binding !IsRefreshing}"/>
|
||||
<Ellipse Classes="spinner" Width="14" Height="14" VerticalAlignment="Center"
|
||||
IsVisible="{Binding IsRefreshing}"/>
|
||||
<TextBlock Classes="meta" VerticalAlignment="Center"
|
||||
Text="{loc:Tr modals.usageMonitor.refreshHint}"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Gauges -->
|
||||
<ItemsControl DockPanel.Dock="Top" Margin="20,12,20,0" ItemsSource="{Binding GaugeRows}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
|
||||
@@ -134,8 +134,8 @@
|
||||
</Border>
|
||||
|
||||
<!-- Content -->
|
||||
<ScrollViewer Padding="20,16">
|
||||
<StackPanel>
|
||||
<ScrollViewer>
|
||||
<StackPanel Margin="20,16">
|
||||
<Border IsVisible="{Binding ConflictRows.Count}"
|
||||
Background="{DynamicResource ErrorTintBrush}"
|
||||
BorderBrush="{DynamicResource StatusErrorBrush}"
|
||||
|
||||
@@ -28,6 +28,7 @@ public sealed class WindowDialogService : IDialogService
|
||||
private readonly Window _owner;
|
||||
private MissionControlWindow? _missionControl;
|
||||
private DiffViewerView? _diffViewerWindow;
|
||||
private CheatSheetsWindow? _cheatSheets;
|
||||
|
||||
public WindowDialogService(Window owner) => _owner = owner;
|
||||
|
||||
@@ -182,9 +183,29 @@ public sealed class WindowDialogService : IDialogService
|
||||
_missionControl ??= new MissionControlWindow { DataContext = vm };
|
||||
if (!_missionControl.IsVisible)
|
||||
_missionControl.Show(); // modeless, independent top-level window
|
||||
// Activate() alone does not restore a minimised window — it stays in the taskbar and the
|
||||
// button looks dead. Un-minimise first, then take focus.
|
||||
if (_missionControl.WindowState == WindowState.Minimized)
|
||||
_missionControl.WindowState = WindowState.Normal;
|
||||
_missionControl.Activate(); // bring to front / focus
|
||||
}
|
||||
|
||||
public void ShowCheatSheets(CheatSheetsViewModel vm)
|
||||
{
|
||||
// Modeless and single-instance, like Mission Control: the point is to park it beside the
|
||||
// shell, so a second window (or a modal that blocks the shell) would defeat it.
|
||||
if (_cheatSheets is null)
|
||||
{
|
||||
_cheatSheets = new CheatSheetsWindow { DataContext = vm };
|
||||
vm.CloseAction = () => _cheatSheets?.Close();
|
||||
_cheatSheets.Closed += (_, _) => _cheatSheets = null;
|
||||
_cheatSheets.Show(_owner);
|
||||
}
|
||||
if (_cheatSheets.WindowState == WindowState.Minimized)
|
||||
_cheatSheets.WindowState = WindowState.Normal;
|
||||
_cheatSheets.Activate();
|
||||
}
|
||||
|
||||
public Task<bool> ConfirmAsync(string message)
|
||||
{
|
||||
var tcs = new TaskCompletionSource<bool>();
|
||||
|
||||
@@ -50,8 +50,8 @@ subfolder within their area; the namespace stays the area namespace.
|
||||
## Architecture
|
||||
|
||||
- **Program.cs** — loads config, inits schema, registers DI, configures SignalR on `/hub`, binds to `127.0.0.1:47821`
|
||||
- **TaskStateService** — the **only** component that writes `Status`, `PlanningPhase`, `BlockedByTaskId`, `DependsOnTaskId`. All transitions return a `TransitionResult` (no exceptions on invalid moves). Wakes the queue and advances the planning chain on child terminal transitions. Every transition broadcasts via a private `NotifyAsync(taskId)` — never call `_broadcaster.TaskUpdated` directly from this class, `NotifyAsync` also drives `TicketStatusSync.SyncAsync` (see Tickets below) and a direct call skips that transition's ticket write-back. `SetDependsOnAsync` rejects a self-reference, an unknown dependency id, or a link that would create a cycle (walks the proposed predecessor's own `DependsOnTaskId` chain).
|
||||
- **IQueueWaker / IQueuePicker / QueueService** — waker is a singleton `SemaphoreSlim`; picker performs the atomic `Queued → Running` claim filtered by `BlockedByTaskId IS NULL`, `is_manual = 0`, schedule, and (`DependsOnTaskId IS NULL` OR the dependency's `Status = 'done'`); QueueService is a thin `BackgroundService` looping on the waker, dispatching via `TaskRunner`. Per tick it also applies the usage throttle and gate → [usage-monitoring](../../docs/explore-notes/usage-monitoring.md).
|
||||
- **TaskStateService** — the **only** component that writes `Status`, `PlanningPhase`, `BlockedByTaskId`, and the `task_dependencies` edges. All transitions return a `TransitionResult` (no exceptions on invalid moves). Wakes the queue and advances the planning chain on child terminal transitions. Every transition broadcasts via a private `NotifyAsync(taskId)` — never call `_broadcaster.TaskUpdated` directly from this class, `NotifyAsync` also drives `TicketStatusSync.SyncAsync` (see Tickets below) and a direct call skips that transition's ticket write-back. `SetDependsOnAsync` replaces the task's whole dependency **set** (empty list clears it) and rejects a self-reference, an unknown dependency id, or any link that would create a cycle — a BFS over the whole `task_dependencies` edge set from every proposed predecessor, so a multi-edge loop (A→B→C→A) is caught too, and one bad edge leaves the entire set unwritten.
|
||||
- **IQueueWaker / IQueuePicker / QueueService** — waker is a singleton `SemaphoreSlim`; picker performs the atomic `Queued → Running` claim filtered by `BlockedByTaskId IS NULL`, `is_manual = 0`, schedule, and "no `task_dependencies` edge whose predecessor isn't `done`" (doubly negated on purpose: zero edges stays eligible, all edges must be done, and an edge pointing at a vanished task keeps blocking); QueueService is a thin `BackgroundService` looping on the waker, dispatching via `TaskRunner`. Per tick it also applies the usage throttle and gate → [usage-monitoring](../../docs/explore-notes/usage-monitoring.md).
|
||||
- **RunCancellationRegistry** — taskId → running-run CTS. Lets `TaskStateService.CancelAsync` kill a cancelled task's process without a DI cycle.
|
||||
- **OverrideSlotService** — owns `RunNow` / `ContinueTask`; goes through `TaskStateService.StartRunningAsync` (caller-driven, serialized by slot lock).
|
||||
- **StaleTaskRecovery** — startup-only; calls `TaskStateService.RecoverStaleRunningAsync` to flip orphaned `Running` rows to `Failed`.
|
||||
@@ -67,7 +67,7 @@ not conflated.
|
||||
| `Status` | `Idle`, `Queued`, `Running`, `WaitingForChildren`, `WaitingForReview`, `Done`, `Failed`, `Cancelled` | Lifecycle only. `WaitingForChildren` = parent's own work done, waiting on children. |
|
||||
| `PlanningPhase` | `None`, `Active`, `Finalized` | Parent-only marker. `Active` ≈ legacy `Planning`; `Finalized` ≈ legacy `Planned`. |
|
||||
| `BlockedByTaskId` | nullable FK | Replaces legacy `Waiting`. A queued row with a non-null value is skipped by the picker. Internal to `PlanningChainCoordinator` — resolves (or cascades) on ANY terminal state of the predecessor. Because it self-resolves, `wait_for_task_change` deliberately keeps **waiting** through it instead of reporting `"Blocked"`. |
|
||||
| `DependsOnTaskId` | nullable FK | User/MCP-declared predecessor (`add_task`/`update_task`), separate from `BlockedByTaskId` because the semantics differ: the picker only skips a queued row while the dependency's `Status` isn't `Done` -- a Failed/Cancelled dependency does **not** cascade or auto-resolve, the dependent just stays blocked (see `QueuePicker`, `TaskStateService.SetDependsOnAsync`). `get_task`/`list_tasks`/`batch_get_tasks` surface this as `blocked`/`blockedReason`; `wait_for_task_change` reports `"Blocked"` instead of silently running out its timeout. |
|
||||
| `Dependencies` | 0..n rows in `task_dependencies` | User/MCP-declared predecessors (`add_task`/`update_task`), separate from `BlockedByTaskId` because the semantics differ: the picker skips a queued row until **every** dependency reached `Done` -- a Failed/Cancelled dependency does **not** cascade or auto-resolve, the dependent just stays blocked (see `QueuePicker`, `TaskStateService.SetDependsOnAsync`). `get_task`/`list_tasks`/`batch_get_tasks` surface this as `dependsOnTaskIds` + `blocked`/`blockedReason` (the reason names **all** open predecessors, via `External/TaskBlocking`); `wait_for_task_change` reports `"Blocked"` instead of silently running out its timeout. |
|
||||
| `IsManual` | bool | Reminder only the user can do. `EnqueueAsync`/`StartRunningAsync` refuse it, the picker skips it, `GetDailyPrepCandidates` never offers it. An interactive ConPTY session is still allowed. |
|
||||
| `ReviewFeedback` | nullable string | Reviewer's rejection comment; consumed and cleared by `QueueService` on the next re-run. |
|
||||
|
||||
@@ -275,11 +275,16 @@ refresh token uses, one instance per file, DI markers `OnlineRefreshTokenStore`/
|
||||
distinguish the two singletons). The token never touches `worker.config.json` or the DB.
|
||||
|
||||
- **Import** (`TicketImportService`, hub `ImportTickets`) — per-list, manual only (no polling): pulls
|
||||
the linked project's board (`ListConfigEntity.TicketProjectId`), keeps tickets that are `StatusId
|
||||
== 1` (Offen) *and* assigned to the PAT owner (case-insensitive name match), skips any `TicketRef`
|
||||
the linked project's board (`ListConfigEntity.TicketProjectId`), keeps tickets whose `StatusId` is
|
||||
`1` (Offen) or `2` (InBearbeitung) *and* that are assigned to the PAT owner, skips any `TicketRef`
|
||||
already present on the list, and creates one `Idle` task per remainder via `TaskRepository.AddAsync`
|
||||
(so it gets a `Number` like every other task). Already-imported tickets are never updated — a
|
||||
re-import would overwrite task notes.
|
||||
⚠️ **The assignee lives in `ticketAssignees[]`, never in the flat `assigneeName`** — that field is
|
||||
null on every ticket the live API returns (checked across all 63 in Abteilung Entwicklung,
|
||||
2026-09-01), so the original filter imported nothing, ever. `personInChargeName` is the wrong
|
||||
source too: it holds the login on some rows and the display name ("Mika Kuns") on others, while
|
||||
`ticketAssignees[].assigneeName` matches `/pat/me`'s `userName` format exactly.
|
||||
- **Write-back** (`TicketStatusSync`) hangs off `TaskStateService.NotifyAsync` — the one place every
|
||||
status transition passes through. Mapping: `Running`/`WaitingForReview` → ticket status `2
|
||||
InBearbeitung`, `Done` → `3 Fertig`, everything else writes nothing (`1 Offen` is never written
|
||||
@@ -290,8 +295,13 @@ distinguish the two singletons). The token never touches `worker.config.json` or
|
||||
- `BandelTicketClient` wraps the four REST calls (`GET /api/ticketsystem/pat/me`, `GET
|
||||
/api/Navigation/sidebar`, `GET /api/Board/project/{id}`, `PATCH /api/Ticket/{id}/status`); every
|
||||
response is unwrapped from `BandelEnvelope<T>` and a non-2xx/`success:false` throws
|
||||
`TicketApiException` with a readable message. ⚠️ The endpoint shapes were taken from the
|
||||
`Bandel.APIs` source, never confirmed against a live call — see `docs/open.md`.
|
||||
`TicketApiException` with a readable message. All four are **live-verified (2026-09-01)** against
|
||||
`http://192.168.45.161`.
|
||||
⚠️ `PATCH /api/Ticket/{id}/status` needs **both** `statusId` and `statusName` — omitting the name
|
||||
is a 400 (`"The StatusName field is required."`) and no status is written. The name is *not*
|
||||
validated against the id (`statusId` wins, any non-empty string passes), but it must be there;
|
||||
`TicketStatusMap.NameOf` supplies the canonical name.
|
||||
⚠️ The base URL must be the **IP** — `bandelapis.fb-tuning.local` still refuses the connection.
|
||||
|
||||
## Notes
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user