mirror of
https://github.com/awizemann/scarf.git
synced 2026-05-10 18:44:45 +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>
51 lines
1.6 KiB
Swift
51 lines
1.6 KiB
Swift
import SwiftUI
|
|
import ScarfCore
|
|
import ScarfDesign
|
|
|
|
/// Top-level Mac Kanban surface — toggles between the v2.7.5 board view
|
|
/// (drag-and-drop, full read/write) and the legacy v2.6 read-only list.
|
|
/// Kept as a single AppCoordinator route so users can switch between
|
|
/// presentations without leaving the route, and so accessibility users
|
|
/// (or anyone with a narrow window) keep a usable list fallback.
|
|
///
|
|
/// Capability-gated upstream: `SidebarView` only lists this route when
|
|
/// `HermesCapabilities.hasKanban` is true.
|
|
struct KanbanView: View {
|
|
let context: ServerContext
|
|
|
|
@AppStorage("kanban.viewMode") private var rawMode: String = ViewMode.board.rawValue
|
|
|
|
enum ViewMode: String {
|
|
case board
|
|
case list
|
|
}
|
|
|
|
var body: some View {
|
|
VStack(spacing: 0) {
|
|
modeBar
|
|
ScarfDivider()
|
|
switch ViewMode(rawValue: rawMode) ?? .board {
|
|
case .board:
|
|
KanbanBoardView(context: context)
|
|
case .list:
|
|
KanbanListView(context: context)
|
|
}
|
|
}
|
|
.background(ScarfColor.backgroundPrimary)
|
|
}
|
|
|
|
private var modeBar: some View {
|
|
HStack(spacing: ScarfSpace.s2) {
|
|
Spacer()
|
|
Picker("View", selection: $rawMode) {
|
|
Text("Board").tag(ViewMode.board.rawValue)
|
|
Text("List").tag(ViewMode.list.rawValue)
|
|
}
|
|
.pickerStyle(.segmented)
|
|
.frame(width: 160)
|
|
}
|
|
.padding(.horizontal, ScarfSpace.s3)
|
|
.padding(.vertical, ScarfSpace.s2)
|
|
}
|
|
}
|