Watch: waiting-count complication and multi-select questions
A WidgetKit extension (accessoryCircular, Rectangular, Inline, Corner) shows GET /v1/summary. The device token moves to the App Group's Keychain access group on launch so the extension can read it without re-pairing; the app reloads the timeline when its feed counts change and on notifications. Multi-select questions toggle options and send an array of values. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
d4d67295c6
commit
0994fd7d5a
18 files changed
+800
-23
No files matched your search
@@ -29,6 +29,10 @@ actor DemoGateway: GatewayAPI {
|
||||
return Feed(needsYou: needsYou, working: working, recent: Array(recent.prefix(10)), hosts: hosts)
|
||||
}
|
||||
|
||||
func summary() async throws -> Summary {
|
||||
Summary(try await feed())
|
||||
}
|
||||
|
||||
func thread(hostId: String, threadId: String) async throws -> ThreadDetail {
|
||||
guard let item = item(hostId, threadId) else { throw GatewayError.http(status: 404, message: "Unknown thread.") }
|
||||
return ThreadDetail(item: item, messages: messages[item.id] ?? [], canStop: item.phase.isWorking)
|
||||
@@ -154,6 +158,24 @@ struct DemoFixtures {
|
||||
allowCustomAnswer: true),
|
||||
]))
|
||||
|
||||
let release = FeedItem(
|
||||
hostId: "mac-mini", hostLabel: "Mac mini", threadId: "t-release", projectId: "p-wc-mac",
|
||||
projectTitle: "wristcode", title: "Release checklist", phase: .waitingForInput,
|
||||
updatedAt: ago(6), lastMessage: "The build is ready. Which checks should run first?",
|
||||
request: PendingRequest(
|
||||
id: "r-release", kind: "user_input", prompt: nil, reason: nil, options: [],
|
||||
questions: [
|
||||
.init(
|
||||
id: "checks", header: "Checks", question: "Which checks should run before upload?",
|
||||
options: [
|
||||
.init(label: "Unit tests", value: "unit"),
|
||||
.init(label: "UI tests", value: "ui"),
|
||||
.init(label: "Lint", value: "lint"),
|
||||
.init(label: "Archive", value: "archive"),
|
||||
],
|
||||
allowCustomAnswer: true, multiSelect: true),
|
||||
]))
|
||||
|
||||
let scaffold = FeedItem(
|
||||
hostId: "mac-mini", hostLabel: "Mac mini", threadId: "t-scaffold", projectId: "p-wc-mac",
|
||||
projectTitle: "wristcode", title: "Watch app scaffold", phase: .running, updatedAt: ago(0.5),
|
||||
@@ -174,7 +196,7 @@ struct DemoFixtures {
|
||||
projectTitle: "cdn", title: "Fix CDN headers", phase: .failed, updatedAt: ago(140),
|
||||
lastMessage: "cargo test failed: 2 tests in headers.rs", request: nil)
|
||||
|
||||
items = [approval, question, scaffold, containerfile, nextjs, cdn]
|
||||
items = [approval, question, release, scaffold, containerfile, nextjs, cdn]
|
||||
|
||||
func m(_ id: String, _ role: Message.Role, _ minutes: Double, _ text: String) -> Message {
|
||||
Message(id: id, role: role, text: text, createdAt: ago(minutes))
|
||||
@@ -190,6 +212,10 @@ struct DemoFixtures {
|
||||
m("b1", .user, 10, "Add pairing codes to the gateway."),
|
||||
m("b2", .assistant, 1, "Two ways to store pairing codes. Hashing is safer, plain is simpler to debug."),
|
||||
],
|
||||
release.id: [
|
||||
m("r1", .user, 25, "Get the watch app ready for TestFlight."),
|
||||
m("r2", .assistant, 6, "The build is ready. Which checks should run first?"),
|
||||
],
|
||||
scaffold.id: [
|
||||
m("c1", .user, 4, "Scaffold the watch app with XcodeGen."),
|
||||
m("c2", .assistant, 0.5, "Writing ThreadListView.swift"),
|
||||
|
||||
Reference in new issue
Block a user