mirror of
https://github.com/awizemann/scarf.git
synced 2026-05-10 10:36:35 +00:00
adcc984091
Lifts Scarf's Kanban surface from the v2.6 read-only list to a drag-and-drop board with the complete Hermes v0.12 mutation surface wired up, plus per-project boards bound to a Scarf-minted tenant slug and a read-only board on iOS. Why now: the v2.6 list was a placeholder shipped while upstream Kanban collab was still mid-rework. v0.12 stabilized the 27-verb CLI; this release makes Scarf a real GUI client for it. Driving real tasks end-to-end exposed and closed a connected bug pattern (claim vs dispatch, silent skipped_unassigned, integer-vs-ISO timestamps, parser-leaked "(no" sentinel) that would have shipped as latent UX papercuts otherwise. ScarfCore: KanbanService actor (Sendable, pure I/O) wrapping every verb; KanbanTenantReader cross-platform manifest projection; eight new model types (TaskDetail, Comment, Event, Run, Stats, Assignee, CreateRequest, Filters); KanbanError; pure transition planner that maps drag-drop column changes to verb sequences, tested against canonical Hermes JSON fixtures. Mac: KanbanBoardView orchestrator with five-column drag-drop layout, optimistic-merge state, KanbanInspectorPane side-pane (Comments / Events / Runs / Log tabs, Log streams worker stdout every 2s while running), inline assignee picker, health banner for unassigned and last-failed-run states. New Task sheet defaults to active profile and auto-fires kanban dispatch on submit. Sidebar moved Kanban from Manage to Monitor. Read-only KanbanListView preserved as Board|List toggle for narrow windows / accessibility. Per-project: DashboardTab.kanban tab on every project gated on hasKanban; KanbanTenantResolver mints scarf:<slug> tenants on first interaction and persists to .scarf/manifest.json (immutable across rename); ProjectAgentContextService surfaces the tenant in the AGENTS.md scarf-managed block so agents pass --tenant <slug> on kanban create. New kanban_summary dashboard widget; vocabulary mirrored in tools/widget-schema.json and site/widgets.js. iOS: read-only board on the project tab via paged single-column Picker, modal detail sheet with Comments / Events / Runs. Mutations + drag-drop deferred to v2.8. Tests: 19 new pure-logic tests covering decoding, planner verb mapping, argv assembly, glance string formatting, and parser rejection of the kanban assignees empty-state sentinel. All 348 ScarfCore tests pass. Constraints documented in CLAUDE.md: no within-column reorder (Hermes has no update --priority verb); no live watch streaming yet (5s polling for board, 2s for log); no bulk re-tag for legacy NULL-tenant tasks. Pre-v0.12 Hermes hosts gracefully hide the surface end-to-end. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
57 lines
1.9 KiB
Swift
57 lines
1.9 KiB
Swift
import SwiftUI
|
|
import ScarfCore
|
|
import ScarfDesign
|
|
|
|
/// Modal sheet that prompts for an optional "result summary" before
|
|
/// firing `kanban complete`. Optional — leaving it blank still
|
|
/// completes the task; the field captures the most useful Hermes
|
|
/// flag for downstream child tasks.
|
|
struct KanbanCompleteResultSheet: View {
|
|
@Environment(\.dismiss) private var dismiss
|
|
|
|
let taskTitle: String
|
|
let onSubmit: (String?) -> Void
|
|
|
|
@State private var result: String = ""
|
|
@FocusState private var fieldFocused: Bool
|
|
|
|
var body: some View {
|
|
VStack(alignment: .leading, spacing: ScarfSpace.s3) {
|
|
VStack(alignment: .leading, spacing: 4) {
|
|
Text("Complete task")
|
|
.scarfStyle(.title3)
|
|
.foregroundStyle(ScarfColor.foregroundPrimary)
|
|
Text(taskTitle)
|
|
.scarfStyle(.caption)
|
|
.foregroundStyle(ScarfColor.foregroundMuted)
|
|
.lineLimit(2)
|
|
}
|
|
|
|
ScarfTextField("Result summary (optional)", text: $result)
|
|
.focused($fieldFocused)
|
|
|
|
Text("If this task has child tasks, the result is handed to them as upstream context. Leave blank for a quiet completion.")
|
|
.scarfStyle(.footnote)
|
|
.foregroundStyle(ScarfColor.foregroundFaint)
|
|
|
|
HStack {
|
|
Spacer()
|
|
Button("Cancel") {
|
|
dismiss()
|
|
}
|
|
.keyboardShortcut(.cancelAction)
|
|
.buttonStyle(ScarfSecondaryButton())
|
|
Button("Complete") {
|
|
onSubmit(result.trimmingCharacters(in: .whitespacesAndNewlines))
|
|
dismiss()
|
|
}
|
|
.keyboardShortcut(.defaultAction)
|
|
.buttonStyle(ScarfPrimaryButton())
|
|
}
|
|
}
|
|
.padding(ScarfSpace.s5)
|
|
.frame(width: 460)
|
|
.onAppear { fieldFocused = true }
|
|
}
|
|
}
|