oficina / base Public

Paused jobs in the Mac and iPhone app: clock mark, Carry on now, square for stopped

Human

Prompt

Native: Pill.swift, Marks, the job view, the client and AskModel get the paused state and Carry on now (idempotency key kept until a valid answer); stopped gets a distinct mark; snapshots light, dark and AX size.

From this commit's own message. The prompt ledger has no entries for it — which is what a squashed, rebased or amended commit looks like, and what every commit looks like in a repo without a ledger.

Summary

JobState.paused with BaseIcon.paused (clock) on Palette .stPause (mirrors app.css --st-pause); stopped is now a rounded square. AskCard decodes carry_on (offersCarryOn only when paused). BaseClient.carryOn posts /ask/cards/{id}/carry_on; AskModel.carryOn keeps its key per revision until an answer settles it, reloads /ask/state on a 409 and never resends. JobView shows Carry on now (assistant.job.carry_on) and its note (assistant.job.carry_on_note), both copy-reviewed 2026-11-24. New snapshots paused and job-view-paused (Mac, iPhone, light/dark, AX3); marks baselines re-recorded.
Agent notes
Paused jobs are not counted as waiting (sidebar badge, panel's WaitingJobs): they carry on by themselves.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 64742a1d785d0e2387a7fab0ba6ccaeeb8c21617 parent 02e4f8d
27 files changed, +218 −15
  • native/apple/Sources/BaseKit/API/Client.swift +5 −0
  • native/apple/Sources/BaseKit/API/Models.swift +20 −3
  • native/apple/Sources/BaseKit/Ask/AskModel.swift +29 −1
  • native/apple/Sources/BaseKit/Ask/Pill.swift +26 −5
  • native/apple/Sources/BaseKit/Ask/Thread.swift +1 −1
  • native/apple/Sources/BaseKit/Look/Marks.swift +10 −4
  • native/apple/Sources/BaseKit/Look/Palette.swift +3 −0
  • native/apple/Sources/BaseKit/Resources/Localizable.xcstrings +24 −0
  • native/apple/Tests/BaseKitTests/AskModelTests.swift +67 −0
  • native/apple/Tests/BaseKitTests/LookTests.swift +7 −1
  • native/apple/Tests/BaseSnapshots/AskSnapshots.swift +26 −0
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/iphone/job-view-paused-dark-ax3.png binary
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/iphone/job-view-paused-dark-default.png binary
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/iphone/job-view-paused-light-ax3.png binary
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/iphone/job-view-paused-light-default.png binary
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/iphone/paused-dark-ax3.png binary
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/iphone/paused-dark-default.png binary
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/iphone/paused-light-ax3.png binary
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/iphone/paused-light-default.png binary
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/mac/job-view-paused-dark-default.png binary
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/mac/job-view-paused-light-default.png binary
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/mac/paused-dark-default.png binary
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/mac/paused-light-default.png binary
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-look/iphone/marks-dark-default.png binary
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-look/iphone/marks-light-default.png binary
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-look/mac/marks-dark-default.png binary
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-look/mac/marks-light-default.png binary

CI passed — run details

CI log
=== build ===
CGO_ENABLED=0 go build ./...
=== vet ===
go vet ./...
=== fmt-check ===
=== staticcheck ===
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 ./...
=== govulncheck ===
go run golang.org/x/vuln/cmd/govulncheck@v1.8.0 ./...
No vulnerabilities found.
=== gitleaks ===
1:28PM INF Unknown SCM platform. Use --platform to include links in findings. host=amadan.net
1:28PM INF 1 commits scanned.
1:28PM INF scanned ~2357144 bytes (2.36 MB) in 205ms
1:28PM INF no leaks found
=== budget ===
go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget size
budget size: 22 directories within budget
=== script-test ===
scripts/prepare-apps_test.sh
ok   releases lookup failure stops before ship
ok   app owned elsewhere stops the script
ok   apps listing failure stops before create
ok   ambiguous release dir is refused
ok   explicit version resolves the ambiguity
ok   releases match is exact, not substring
ok   shipped version is only promoted, existing app not created
ok   fresh account creates, ships, promotes to edge, enables
ok   failing promote stops the script
ok   ship is retried while uploads are rate limited
all passed
hack/fonts_test.sh
fonts_test: ok
=== test ===
go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -count=1 ./...

receipt: test step 5.362s against a 60s target (the gate's other steps are not in this figure)
receipt: 16 packages ran, 0 cached, 6 without tests, 0 failed
receipt: slow package 4.387s amadan.net/oficina/base/internal/webtest
receipt: slow package 1.022s amadan.net/oficina/base/internal/issuer
receipt: slow package 572ms amadan.net/oficina/base/internal/operations
receipt: slow package 191ms amadan.net/oficina/base/internal/consumer
receipt: slow package 118ms amadan.net/oficina/base/internal/equipo
receipt: slow test 1.52s amadan.net/oficina/base/internal/webtest TestHomeDoesNotWaitOnAStalledSnapshot
receipt: slow test 780ms amadan.net/oficina/base/internal/issuer TestAuthorizeSignsForInstalledApp
receipt: slow test 510ms amadan.net/oficina/base/internal/operations TestOperationsRefusals
receipt: slow test 210ms amadan.net/oficina/base/internal/issuer TestAuthorizeRefusals
receipt: slow test 120ms amadan.net/oficina/base/internal/webtest TestOficinaDoneSendsNothing
=== native ===
strings: copy review's strings.json is not here (git-ignored); its comparison skipped
strings: 119 in the catalog, 116 used
worktree-lib_test: ok
diff --git a/native/apple/Sources/BaseKit/API/Client.swift b/native/apple/Sources/BaseKit/API/Client.swift
index f0b733d..777699a 100644
--- a/native/apple/Sources/BaseKit/API/Client.swift
+++ b/native/apple/Sources/BaseKit/API/Client.swift
@@ -61,6 +61,11 @@ public struct BaseClient: Sendable {
try await post("/ask/cards/\(Self.segment(id))/answer", form: [("revision", String(revision)), ("choice", choice), ("key", key)])
}
+ /// A paused job's "Carry on now", at the revision the person saw.
+ public func carryOn(card id: String, revision: Int64, key: String) async throws(BaseAPIError) -> AskCarriedOn {
+ try await post("/ask/cards/\(Self.segment(id))/carry_on", form: [("revision", String(revision)), ("key", key)])
+ }
+
/// `POST /api/v1/ask/oficina` (Task 7): connects Ask with an Oficina ID
/// assertion addressed to Equipo. `auto`: the app set Ask up by itself
/// (at sign-in, a renewal, a reconnect), which Base refuses with
diff --git a/native/apple/Sources/BaseKit/API/Models.swift b/native/apple/Sources/BaseKit/API/Models.swift
index 4592766..ce7cb20 100644
--- a/native/apple/Sources/BaseKit/API/Models.swift
+++ b/native/apple/Sources/BaseKit/API/Models.swift
@@ -236,16 +236,20 @@ public struct AskCard: Decodable, Sendable, Equatable, Identifiable {
public var detail: String
public var startedAt: Date?
public var turnID: String
+ /// A paused job offers "Carry on now" (`carry_on`; Base sends it on a
+ /// paused job card only).
+ public var carryOn: Bool
public init(id: String, revision: Int64 = 1, kind: String, state: String, question: String = "", options: [Option] = [],
- links: [Link] = [], result: String = "", job: String = "", detail: String = "", startedAt: Date? = nil, turnID: String = "") {
+ links: [Link] = [], result: String = "", job: String = "", detail: String = "", startedAt: Date? = nil, turnID: String = "",
+ carryOn: Bool = false) {
self.id = id; self.revision = revision; self.kind = kind; self.state = state; self.question = question
self.options = options; self.links = links; self.result = result; self.job = job; self.detail = detail
- self.startedAt = startedAt; self.turnID = turnID
+ self.startedAt = startedAt; self.turnID = turnID; self.carryOn = carryOn
}
enum CodingKeys: String, CodingKey {
case id, revision, kind, state, question, options, links, result, job, detail
- case startedAt = "started_at", turnID = "turn_id"
+ case startedAt = "started_at", turnID = "turn_id", carryOn = "carry_on"
}
public init(from decoder: Decoder) throws {
let c = try decoder.container(keyedBy: CodingKeys.self)
@@ -253,11 +257,14 @@ public struct AskCard: Decodable, Sendable, Equatable, Identifiable {
question = c.value(.question, ""); options = c.value(.options, []).filter { !$0.value.isEmpty }
links = c.value(.links, []).filter { $0.url != nil }; result = c.value(.result, "")
job = c.value(.job, ""); detail = c.value(.detail, ""); startedAt = c.date(.startedAt); turnID = c.value(.turnID, "")
+ carryOn = c.value(.carryOn, false)
}
public var isOpen: Bool { state == "open" }
public var isJob: Bool { kind == "job" }
public var jobState: JobState? { isJob ? JobState(rawValue: state) : nil }
+ /// A paused job that offers "Carry on now".
+ public var offersCarryOn: Bool { jobState == .paused && carryOn }
/// The kinds drawn as cards (ask.js `kinds`).
public static let drawnKinds: Set<String> = ["question", "confirm", "outcome", "connect"]
/// Where to see a job's work once there is something to see (ready,
@@ -343,6 +350,16 @@ public struct AskAnswered: Decodable, Sendable, Equatable {
}
}
+/// `POST /ask/cards/{id}/carry_on`'s answer: the job card as it is now.
+public struct AskCarriedOn: Decodable, Sendable, Equatable {
+ public var card: AskCard?
+ enum CodingKeys: String, CodingKey { case card }
+ public init(from decoder: Decoder) throws {
+ let c = try decoder.container(keyedBy: CodingKeys.self)
+ card = c.optional(.card).flatMap { (k: AskCard) in k.id.isEmpty ? nil : k }
+ }
+}
+
/// `POST /api/v1/ask/oficina`'s answer (Task 7): `ready` with when to renew,
/// or `not_linked`.
public struct AskSetupAnswer: Decodable, Sendable, Equatable {
diff --git a/native/apple/Sources/BaseKit/Ask/AskModel.swift b/native/apple/Sources/BaseKit/Ask/AskModel.swift
index a8658f5..86f15d4 100644
--- a/native/apple/Sources/BaseKit/Ask/AskModel.swift
+++ b/native/apple/Sources/BaseKit/Ask/AskModel.swift
@@ -91,7 +91,8 @@ import Observation
/// The composer's text.
public var text = ""
public private(set) var sending = false
- /// Cards with an answer on its way: their buttons are disabled.
+ /// Cards with an answer on its way, or a paused job's Carry on now:
+ /// their buttons are disabled.
public private(set) var answering: Set<String> = []
/// Jobs waiting on the person (asking or stopped): the sidebar's badge.
@@ -133,6 +134,7 @@ import Observation
/// The message in flight or of unknown outcome, and its key.
private var pendingSend: (text: String, key: String)?
private var answerKeys: [String: (signature: String, key: String)] = [:]
+ private var carryOnKeys: [String: (revision: Int64, key: String)] = [:]
private var cancelKey: (turn: String, key: String)?
private var stream: Task<Void, Never>?
private var generation = 0
@@ -329,6 +331,32 @@ import Observation
}
}
+ /// A paused job's "Carry on now", bound to the revision the person
+ /// saw (ask.js `carryOnNow`). Its key is kept until an answer settles
+ /// the outcome, so pressing it again after a lost answer is the same
+ /// request. A 409 (the job moved on, is no longer paused, or no longer
+ /// offers it) reads the conversation afresh; it is never resent.
+ public func carryOn(_ job: AskCard) async {
+ guard job.offersCarryOn, !answering.contains(job.id) else { return }
+ let key = carryOnKeys[job.id]?.revision == job.revision ? carryOnKeys[job.id]!.key : BaseClient.newKey()
+ carryOnKeys[job.id] = (job.revision, key)
+ answering.insert(job.id)
+ defer { answering.remove(job.id) }
+ do {
+ let out = try await client.carryOn(card: job.id, revision: job.revision, key: key)
+ carryOnKeys[job.id] = nil
+ if phase != .ready { phase = .ready }
+ if let c = out.card { add(c) }
+ } catch {
+ if case .server(409, _, let state) = error, state != "norunner", state != "oldrunner" {
+ carryOnKeys[job.id] = nil
+ await load()
+ return
+ }
+ refusedWrite(error, keepsKey: { carryOnKeys[job.id] = nil })
+ }
+ }
+
/// What a refused write shows (ask.js `post`): Ask's own states stand in
/// for the conversation, or add their note; a 409 is stale (the next
/// events show how things are); anything else asks to try again. The
diff --git a/native/apple/Sources/BaseKit/Ask/Pill.swift b/native/apple/Sources/BaseKit/Ask/Pill.swift
index 0fa3254..0a87e4c 100644
--- a/native/apple/Sources/BaseKit/Ask/Pill.swift
+++ b/native/apple/Sources/BaseKit/Ask/Pill.swift
@@ -30,6 +30,8 @@ struct JobPill: View {
let job: AskModel.Job
let busy: Set<String>
let timeZone: TimeZone?
+ /// A paused job's "Carry on now", from its view.
+ var carryOn: (AskCard) -> Void = { _ in }
let answer: (AskCard, AskCard.Option) -> Void
@State private var viewing = false
@Environment(\.colorScheme) private var scheme
@@ -96,7 +98,8 @@ struct JobPill: View {
.buttonStyle(.plain)
.accessibilityLabel(Text(verbatim: label))
.accessibilityAddTraits(.isButton)
- .modifier(JobViewPresentation(isPresented: $viewing, job: job, timeZone: timeZone))
+ .modifier(JobViewPresentation(isPresented: $viewing, job: job, timeZone: timeZone,
+ carrying: busy.contains(job.card.id), carryOn: { carryOn(job.card) }))
let link = job.card.go.flatMap { go in go.url.map { (go.label, $0) } }.map { label, url in
Button { openURL(url) } label: {
@@ -164,16 +167,18 @@ struct JobViewPresentation: ViewModifier {
@Binding var isPresented: Bool
let job: AskModel.Job
let timeZone: TimeZone?
+ let carrying: Bool
+ let carryOn: () -> Void
func body(content: Content) -> some View {
#if os(macOS)
content.popover(isPresented: $isPresented, arrowEdge: .top) {
- JobView(job: job, timeZone: timeZone, close: { isPresented = false })
+ JobView(job: job, timeZone: timeZone, close: { isPresented = false }, carrying: carrying, carryOn: carryOn)
.frame(width: 320)
.frame(maxHeight: 520)
}
#else
content.sheet(isPresented: $isPresented) {
- JobView(job: job, timeZone: timeZone, close: { isPresented = false })
+ JobView(job: job, timeZone: timeZone, close: { isPresented = false }, carrying: carrying, carryOn: carryOn)
.presentationDetents([.medium, .large])
.presentationDragIndicator(.visible)
}
@@ -182,7 +187,8 @@ struct JobViewPresentation: ViewModifier {
}
/// What the job view shows (chat.html `ask-jobview`): the title, linked to
-/// the job's own page in Equipo; the status; one sentence more; the cards
+/// the job's own page in Equipo; the status; one sentence more; for a
+/// paused job that offers it, "Carry on now" and the line under it; the cards
/// that have ended, each its question and how it ended; when it started;
/// and the link to the work once there is something to see. The jobs
/// design (11-20) adds its decisions here later.
@@ -191,11 +197,16 @@ public struct JobView: View {
let timeZone: TimeZone?
let close: () -> Void
var now: Date = .now
+ /// Carry on now is on its way: its button is disabled.
+ let carrying: Bool
+ let carryOn: () -> Void
@Environment(\.colorScheme) private var scheme
@Environment(\.openURL) private var openURL
- public init(job: AskModel.Job, timeZone: TimeZone?, close: @escaping () -> Void, now: Date = .now) {
+ public init(job: AskModel.Job, timeZone: TimeZone?, close: @escaping () -> Void, now: Date = .now,
+ carrying: Bool = false, carryOn: @escaping () -> Void = {}) {
self.job = job; self.timeZone = timeZone; self.close = close; self.now = now
+ self.carrying = carrying; self.carryOn = carryOn
}
public var body: some View {
@@ -231,6 +242,16 @@ public struct JobView: View {
VStack(alignment: .leading, spacing: 2) {
if !job.card.result.isEmpty { Text(verbatim: job.card.result).font(BaseFont.body(14, .medium)) }
if !job.card.detail.isEmpty { Text(verbatim: job.card.detail).font(BaseFont.body(14)).foregroundStyle(p[.haze]) }
+ if job.card.offersCarryOn {
+ VStack(alignment: .leading, spacing: 6) {
+ Button(action: carryOn) { Text(BaseText.text("assistant.job.carry_on")) }
+ .buttonStyle(BaseButtonStyle(.ghost))
+ .disabled(carrying)
+ Text(BaseText.text("assistant.job.carry_on_note"))
+ .font(BaseFont.body(13, relativeTo: .footnote)).foregroundStyle(p[.haze])
+ }
+ .padding(.top, 12)
+ }
if !job.ended.isEmpty {
VStack(alignment: .leading, spacing: 6) {
ForEach(job.ended) { card in
diff --git a/native/apple/Sources/BaseKit/Ask/Thread.swift b/native/apple/Sources/BaseKit/Ask/Thread.swift
index 42d5185..6c95294 100644
--- a/native/apple/Sources/BaseKit/Ask/Thread.swift
+++ b/native/apple/Sources/BaseKit/Ask/Thread.swift
@@ -106,7 +106,7 @@ struct AskThread: View {
case .job(let job) where layout == .panel && (job.state == .asking || job.state == .stopped):
EmptyView() // the panel shows them at its top (WaitingJobs)
case .job(let job):
- JobPill(job: job, busy: model.answering, timeZone: timeZone) { card, option in
+ JobPill(job: job, busy: model.answering, timeZone: timeZone, carryOn: { card in Task { await model.carryOn(card) } }) { card, option in
Task { await model.answer(card, option) }
}
case .card(let card):
diff --git a/native/apple/Sources/BaseKit/Look/Marks.swift b/native/apple/Sources/BaseKit/Look/Marks.swift
index ee50c28..f63e5f8 100644
--- a/native/apple/Sources/BaseKit/Look/Marks.swift
+++ b/native/apple/Sources/BaseKit/Look/Marks.swift
@@ -21,20 +21,23 @@ public struct BaseMark: View {
/// A job's state, as the web names them (ask.js `jobStates`).
public enum JobState: String, Sendable, CaseIterable, Codable {
- case working, asking, ready, done, stopped
+ case working, asking, ready, done, paused, stopped
}
/// The 24-unit drawings Base's web uses (ask.js `marks`, the templates'
/// `ask-mark`, and the job view's and composer's icons), as paths.
public enum BaseIcon: Sendable {
- case asking, ready, done, stopped, arrowOut, close, send
+ case asking, ready, done, paused, stopped, arrowOut, close, send
var svg: String {
switch self {
case .asking: "M9.2 9.2a2.9 2.9 0 0 1 5.6 1c0 2-2.8 2.4-2.8 4.3M12 18.2h.01"
case .ready: "M8 16L16 8M9.5 8H16v6.5"
case .done: "M6 12.5l4 4 8-9"
- case .stopped: "M9.5 7.5v9M14.5 7.5v9"
+ // A clock: it carries on by itself.
+ case .paused: "M19.2 12a7.2 7.2 0 1 1-14.4 0a7.2 7.2 0 1 1 14.4 0zM12 8.6V12l2.4 1.6"
+ // A square: stopped until the person acts (never paused's clock).
+ case .stopped: "M9 7.5h6a1.5 1.5 0 0 1 1.5 1.5v6a1.5 1.5 0 0 1-1.5 1.5H9a1.5 1.5 0 0 1-1.5-1.5V9A1.5 1.5 0 0 1 9 7.5z"
case .arrowOut: "M9 6h9v9M18 6L7 17"
case .close: "M6 6l12 12M18 6L6 18"
case .send: "M12 19V5M6 11l6-6 6 6"
@@ -73,7 +76,8 @@ public struct Icon: View {
/// A job state's mark (`.state-mark`): a disc. Working is a slow arc
/// turning round a breathing dot, on the accent's tint; the rest are
/// still icons on the state's colour (working, ready and done the accent,
-/// asking warm, stopped rose). With Reduce Motion, working holds still: a
+/// asking warm, paused a calm indigo with a clock, stopped rose with a
+/// square). With Reduce Motion, working holds still: a
/// quarter arc and a steady dot.
public struct StateMark: View {
let state: JobState
@@ -88,6 +92,7 @@ public struct StateMark: View {
switch state {
case .working, .ready, .done: p[.signal]
case .asking: p[.stAsk]
+ case .paused: p[.stPause]
case .stopped: p[.stStop]
}
}
@@ -131,6 +136,7 @@ public struct StateMark: View {
case .asking: .asking
case .ready: .ready
case .done: .done
+ case .paused: .paused
case .stopped, .working: .stopped
}
}
diff --git a/native/apple/Sources/BaseKit/Look/Palette.swift b/native/apple/Sources/BaseKit/Look/Palette.swift
index 51f6bb3..53b5155 100644
--- a/native/apple/Sources/BaseKit/Look/Palette.swift
+++ b/native/apple/Sources/BaseKit/Look/Palette.swift
@@ -123,6 +123,7 @@ public struct Palette: Sendable {
case pillLift = "pill-lift"
case stAsk = "st-ask"
case stStop = "st-stop"
+ case stPause = "st-pause"
case edgeA = "edge-a"
case edgeB = "edge-b"
case edgeHi = "edge-hi"
@@ -227,6 +228,7 @@ public struct Palette: Sendable {
.pillLift: RGBA(6, 8, 22, 0.55),
.stAsk: RGBA(255, 176, 102, 1),
.stStop: RGBA(249, 168, 212, 1),
+ .stPause: RGBA(174, 184, 255, 1),
.edgeA: RGBA(110, 231, 220, 1),
.edgeB: RGBA(180, 156, 252, 1),
.edgeHi: RGBA(230, 255, 251, 1),
@@ -331,6 +333,7 @@ public struct Palette: Sendable {
.pillLift: RGBA(40, 46, 90, 0.28),
.stAsk: RGBA(192, 101, 26, 1),
.stStop: RGBA(194, 54, 111, 1),
+ .stPause: RGBA(75, 85, 201, 1),
.edgeA: RGBA(11, 122, 114, 1),
.edgeB: RGBA(106, 60, 214, 1),
.edgeHi: RGBA(43, 88, 200, 1),
diff --git a/native/apple/Sources/BaseKit/Resources/Localizable.xcstrings b/native/apple/Sources/BaseKit/Resources/Localizable.xcstrings
index f605b65..1292fa6 100644
--- a/native/apple/Sources/BaseKit/Resources/Localizable.xcstrings
+++ b/native/apple/Sources/BaseKit/Resources/Localizable.xcstrings
@@ -373,6 +373,30 @@
}
}
},
+ "assistant.job.carry_on": {
+ "comment": "Copy review 2026-11-24 (paused work), COPY ACCEPTED BY DELEGATION (Luna). Button in the paused job view, when another plan has room at no extra cost (chat.html ask-jobview).",
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Carry on now"
+ }
+ }
+ }
+ },
+ "assistant.job.carry_on_note": {
+ "comment": "Copy review 2026-11-24 (paused work), COPY ACCEPTED BY DELEGATION (Luna). Small line under 'Carry on now' (chat.html ask-jobview).",
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Uses your other plan, at no extra cost."
+ }
+ }
+ }
+ },
"chat.paste.command": {
"comment": "Equipo's approved label (EquipoKit, 00d09aa7) over a shell code block in a reply.",
"extractionState": "manual",
diff --git a/native/apple/Tests/BaseKitTests/AskModelTests.swift b/native/apple/Tests/BaseKitTests/AskModelTests.swift
index 6097552..f8d7eab 100644
--- a/native/apple/Tests/BaseKitTests/AskModelTests.swift
+++ b/native/apple/Tests/BaseKitTests/AskModelTests.swift
@@ -221,6 +221,73 @@ import XCTest
XCTAssertTrue(m.answering.isEmpty)
}
+ // MARK: Paused jobs (clearer paused work, 2026-11-24)
+
+ static let pausedJob = AskCard(id: "jp", revision: 3, kind: "job", state: "paused", question: "Bakery website",
+ result: "Paused until 21:00", detail: "It will carry on by itself at 21:00 (in 9 hours).", carryOn: true)
+
+ /// A paused job's card decodes with carry_on; Equipo's paused job is
+ /// not waiting on the person. An older Equipo's job (no carry_on) never
+ /// offers it.
+ func testAPausedJobDrawsAndOffersCarryOnOnlyWhenPaused() throws {
+ let raw = #"{"id":"jp","revision":3,"kind":"job","state":"paused","question":"Bakery website","result":"Paused until 21:00","detail":"It will carry on.","carry_on":true}"#
+ let card = try JSONDecoder().decode(AskCard.self, from: Data(raw.utf8))
+ XCTAssertEqual(card.jobState, .paused)
+ XCTAssertTrue(card.offersCarryOn)
+ let old = try JSONDecoder().decode(AskCard.self, from: Data(raw.replacingOccurrences(of: #","carry_on":true"#, with: "").utf8))
+ XCTAssertFalse(old.offersCarryOn)
+ let working = try JSONDecoder().decode(AskCard.self, from: Data(raw.replacingOccurrences(of: "paused", with: "working").utf8))
+ XCTAssertFalse(working.offersCarryOn, "carry_on means nothing outside paused")
+ let (m, _) = model()
+ m.apply(.card(card))
+ guard case .job(let j) = m.entries.last else { return XCTFail() }
+ XCTAssertEqual(j.state, .paused)
+ XCTAssertEqual(m.waitingJobs, 0, "a paused job carries on by itself: nothing waits on the person")
+ }
+
+ /// Carry on now posts the revision seen, once, and keeps its key until
+ /// an answer settles it: after a lost answer the same key goes again.
+ /// The answer's card redraws the job in place.
+ func testCarryOnPostsOnceWithAKeptKey() async {
+ let carried = #"{"card":{"id":"jp","revision":4,"kind":"job","state":"working","question":"Bakery website","result":"Carrying on","options":[],"links":[]}}"#
+ let (m, t) = model([.offline(), .commitThenLoseResponse(), json(200, carried)])
+ m.apply(.card(Self.pausedJob))
+ await m.carryOn(Self.pausedJob)
+ XCTAssertEqual(m.status, BaseText.text("ask.not_sent"))
+ await m.carryOn(Self.pausedJob)
+ await m.carryOn(Self.pausedJob)
+ XCTAssertEqual(t.calls.count, 3)
+ XCTAssertEqual(t.calls[0].path, "/ask/cards/jp/carry_on")
+ XCTAssertEqual(fields(t.calls[0])["revision"], "3")
+ XCTAssertEqual(Set(t.calls.map { fields($0)["key"]! }).count, 1, "one Carry on now, one key")
+ guard case .job(let j) = m.entries.last else { return XCTFail() }
+ XCTAssertEqual(j.state, .working)
+ XCTAssertEqual(j.card.revision, 4)
+ XCTAssertTrue(m.answering.isEmpty)
+ // It no longer offers it: pressing again sends nothing.
+ await m.carryOn(j.card)
+ XCTAssertEqual(t.calls.count, 3)
+ }
+
+ /// A 409 (the job moved on, is no longer paused, or no longer offers
+ /// it) reads the conversation afresh and never resends; the next press
+ /// is a new request with a new key. Without a runner nothing happened,
+ /// and the job stays offering it.
+ func testCarryOnStaleRedrawsAndNeverResends() async throws {
+ let (m, t) = model([json(409, #"{"state":"ready"}"#), .respond(status: 200, body: Fixture.data("state-ready.json")), .hang,
+ json(409, #"{"state":"norunner"}"#)])
+ m.apply(.card(Self.pausedJob))
+ await m.carryOn(Self.pausedJob)
+ XCTAssertEqual(t.calls[1].path, "/ask/state", "a stale job reads the conversation afresh")
+ try await waitUntil { t.calls.count == 3 }
+ m.pause()
+ XCTAssertFalse(m.entries.contains { $0.id == "j:jp" }, "drawn from the fresh state")
+ await m.carryOn(Self.pausedJob)
+ XCTAssertEqual(t.calls[3].path, "/ask/cards/jp/carry_on")
+ XCTAssertNotEqual(fields(t.calls[3])["key"], fields(t.calls[0])["key"])
+ XCTAssertEqual(m.phase, .norunner)
+ }
+
func testStopCancelsTheTurn() async {
let (m, t) = model([json(200, #"{"state":"ready"}"#)])
m.apply(.turn(AskTurn(id: "t8", kind: "chat", state: "running")))
diff --git a/native/apple/Tests/BaseKitTests/LookTests.swift b/native/apple/Tests/BaseKitTests/LookTests.swift
index 10e0272..6d4df7a 100644
--- a/native/apple/Tests/BaseKitTests/LookTests.swift
+++ b/native/apple/Tests/BaseKitTests/LookTests.swift
@@ -42,7 +42,7 @@ final class LookTests: XCTestCase {
}
func testIconsParse() {
- for icon in [BaseIcon.asking, .ready, .done, .stopped, .arrowOut, .close, .send] {
+ for icon in [BaseIcon.asking, .ready, .done, .paused, .stopped, .arrowOut, .close, .send] {
let bounds = icon.path(in: CGRect(x: 0, y: 0, width: 24, height: 24)).boundingRect
XCTAssertFalse(bounds.isEmpty && bounds.width == 0 && bounds.height == 0, "\(icon) drew nothing")
XCTAssertTrue(CGRect(x: 0, y: 0, width: 24, height: 24).insetBy(dx: -1, dy: -1).contains(bounds), "\(icon) leaves its box: \(bounds)")
@@ -51,6 +51,12 @@ final class LookTests: XCTestCase {
let asking = BaseIcon.asking.path(in: CGRect(x: 0, y: 0, width: 24, height: 24)).boundingRect
XCTAssertEqual(asking.minX, 9.2, accuracy: 0.05)
XCTAssertEqual(asking.maxX, 14.8, accuracy: 0.6)
+ // Paused's clock is a whole circle of radius 7.2 round the middle.
+ let paused = BaseIcon.paused.path(in: CGRect(x: 0, y: 0, width: 24, height: 24)).boundingRect
+ XCTAssertEqual(paused.minX, 4.8, accuracy: 0.05)
+ XCTAssertEqual(paused.maxX, 19.2, accuracy: 0.05)
+ XCTAssertEqual(paused.minY, 4.8, accuracy: 0.05)
+ XCTAssertEqual(paused.maxY, 19.2, accuracy: 0.05)
}
func testAppearanceFromTheServer() {
diff --git a/native/apple/Tests/BaseSnapshots/AskSnapshots.swift b/native/apple/Tests/BaseSnapshots/AskSnapshots.swift
index 5ce7eea..cfddc74 100644
--- a/native/apple/Tests/BaseSnapshots/AskSnapshots.swift
+++ b/native/apple/Tests/BaseSnapshots/AskSnapshots.swift
@@ -32,6 +32,16 @@ final class AskSnapshots: XCTestCase {
SnapshotScreen("job-view-long", mac: .fixed(width: 320, height: 520), iphone: .fixed(width: 402, height: 437)) {
JobView(job: AskFixtures.longJob, timeZone: AskFixtures.zone, close: {}, now: SnapshotSettings.now)
},
+ // Clearer paused work (2026-11-24): a paused job's pill (the
+ // clock on indigo, "Paused until 21:00") beside a stopped one
+ // (its square) and one working; and the paused job's view with
+ // its sentence and Carry on now.
+ SnapshotScreen("paused", mac: .fixed(width: 640, height: 360), iphone: .fixed(width: 402, height: 420)) {
+ AskFrame { AskView(model: AskFixtures.paused(), layout: frameLayout, timeZone: AskFixtures.zone, actions: AskActions {}) }
+ },
+ SnapshotScreen("job-view-paused", mac: .width(320), iphone: .width(402)) {
+ JobView(job: AskFixtures.pausedJob, timeZone: AskFixtures.zone, close: {}, now: SnapshotSettings.now)
+ },
SnapshotScreen("norunner", mac: .fixed(width: 640, height: 420), iphone: .fixed(width: 402, height: 520)) {
AskFrame { AskView(model: AskFixtures.model(state: "norunner", extra: AskFixtures.shortThread), layout: frameLayout, timeZone: AskFixtures.zone, actions: AskActions {}) }
},
@@ -134,6 +144,22 @@ struct AskFrame<Content: View>: View {
return m
}
+ /// A paused job that offers Carry on now, a stopped one and one working.
+ static func paused() -> AskModel {
+ let m = model(state: "ready", extra: #"{"id":"m1","role":"person","text":"Can you put together a simple website for the bakery?","turn_id":"t1"}"#)
+ m.apply(.card(pausedJob.card))
+ m.apply(.card(AskCard(id: "j5", revision: 2, kind: "job", state: "stopped", question: "Invoice reminders", result: "Stopped: needs you")))
+ m.apply(.card(AskCard(id: "j6", revision: 1, kind: "job", state: "working", question: "Christmas menu", result: "Building a first look")))
+ return m
+ }
+
+ static let pausedJob = AskModel.Job(
+ card: AskCard(id: "j4", revision: 3, kind: "job", state: "paused", question: "Bakery website",
+ links: [.init(label: "Open in Equipo", url: URL(string: "https://equipo.fennel.example/tasks/tk4"), rel: "equipo")],
+ result: "Paused until 21:00",
+ detail: "It has reached the limit on its plan for now. It will carry on by itself at 21:00 (in 9 hours).",
+ startedAt: SnapshotSettings.now.addingTimeInterval(-2 * 3600), carryOn: true))
+
static let longJob = AskModel.Job(card: job.card, open: [], ended: (1...6).map { n in
AskCard(id: "e\(n)", kind: "confirm", state: "answered", question: "Decision \(n): use the autumn menu's prices for the Christmas boxes?",
result: n % 2 == 0 ? "You said yes" : "You said no", job: "j2")
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/iphone/job-view-paused-dark-ax3.png b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/iphone/job-view-paused-dark-ax3.png
new file mode 100644
index 0000000..c971fbc
Binary files /dev/null and b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/iphone/job-view-paused-dark-ax3.png differ
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/iphone/job-view-paused-dark-default.png b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/iphone/job-view-paused-dark-default.png
new file mode 100644
index 0000000..7ca7240
Binary files /dev/null and b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/iphone/job-view-paused-dark-default.png differ
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/iphone/job-view-paused-light-ax3.png b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/iphone/job-view-paused-light-ax3.png
new file mode 100644
index 0000000..ec2ae7c
Binary files /dev/null and b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/iphone/job-view-paused-light-ax3.png differ
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/iphone/job-view-paused-light-default.png b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/iphone/job-view-paused-light-default.png
new file mode 100644
index 0000000..2917ae9
Binary files /dev/null and b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/iphone/job-view-paused-light-default.png differ
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/iphone/paused-dark-ax3.png b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/iphone/paused-dark-ax3.png
new file mode 100644
index 0000000..2b71c50
Binary files /dev/null and b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/iphone/paused-dark-ax3.png differ
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/iphone/paused-dark-default.png b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/iphone/paused-dark-default.png
new file mode 100644
index 0000000..f93648f
Binary files /dev/null and b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/iphone/paused-dark-default.png differ
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/iphone/paused-light-ax3.png b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/iphone/paused-light-ax3.png
new file mode 100644
index 0000000..1e35710
Binary files /dev/null and b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/iphone/paused-light-ax3.png differ
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/iphone/paused-light-default.png b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/iphone/paused-light-default.png
new file mode 100644
index 0000000..d300428
Binary files /dev/null and b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/iphone/paused-light-default.png differ
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/mac/job-view-paused-dark-default.png b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/mac/job-view-paused-dark-default.png
new file mode 100644
index 0000000..3eccfb8
Binary files /dev/null and b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/mac/job-view-paused-dark-default.png differ
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/mac/job-view-paused-light-default.png b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/mac/job-view-paused-light-default.png
new file mode 100644
index 0000000..e2c1817
Binary files /dev/null and b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/mac/job-view-paused-light-default.png differ
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/mac/paused-dark-default.png b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/mac/paused-dark-default.png
new file mode 100644
index 0000000..e48b092
Binary files /dev/null and b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/mac/paused-dark-default.png differ
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/mac/paused-light-default.png b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/mac/paused-light-default.png
new file mode 100644
index 0000000..06bfa53
Binary files /dev/null and b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-ask/mac/paused-light-default.png differ
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-look/iphone/marks-dark-default.png b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-look/iphone/marks-dark-default.png
index 1a2cba6..95e0c10 100644
Binary files a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-look/iphone/marks-dark-default.png and b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-look/iphone/marks-dark-default.png differ
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-look/iphone/marks-light-default.png b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-look/iphone/marks-light-default.png
index 8a21610..e8059db 100644
Binary files a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-look/iphone/marks-light-default.png and b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-look/iphone/marks-light-default.png differ
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-look/mac/marks-dark-default.png b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-look/mac/marks-dark-default.png
index caad3da..a53fa93 100644
Binary files a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-look/mac/marks-dark-default.png and b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-look/mac/marks-dark-default.png differ
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-look/mac/marks-light-default.png b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-look/mac/marks-light-default.png
index 0846e76..306d4a3 100644
Binary files a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-look/mac/marks-light-default.png and b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-look/mac/marks-light-default.png differ