feat(macos): hover HUD for activity
This commit is contained in:
@@ -25,6 +25,37 @@ struct WorkActivityStoreTests {
|
||||
#expect(store.current == nil)
|
||||
}
|
||||
|
||||
@Test func jobStaysWorkingAfterToolResultGrace() async {
|
||||
let store = WorkActivityStore()
|
||||
|
||||
store.handleJob(sessionKey: "main", state: "started")
|
||||
#expect(store.iconState == .workingMain(.job))
|
||||
|
||||
store.handleTool(
|
||||
sessionKey: "main",
|
||||
phase: "start",
|
||||
name: "read",
|
||||
meta: nil,
|
||||
args: ["path": AnyCodable("/tmp/file.txt")])
|
||||
#expect(store.iconState == .workingMain(.tool(.read)))
|
||||
|
||||
store.handleTool(
|
||||
sessionKey: "main",
|
||||
phase: "result",
|
||||
name: "read",
|
||||
meta: nil,
|
||||
args: ["path": AnyCodable("/tmp/file.txt")])
|
||||
|
||||
for _ in 0..<50 {
|
||||
if store.iconState == .workingMain(.job) { break }
|
||||
try? await Task.sleep(nanoseconds: 100_000_000)
|
||||
}
|
||||
#expect(store.iconState == .workingMain(.job))
|
||||
|
||||
store.handleJob(sessionKey: "main", state: "done")
|
||||
#expect(store.iconState == .idle)
|
||||
}
|
||||
|
||||
@Test func toolLabelExtractsFirstLineAndShortensHome() {
|
||||
let store = WorkActivityStore()
|
||||
let home = NSHomeDirectory()
|
||||
@@ -65,4 +96,3 @@ struct WorkActivityStoreTests {
|
||||
#expect(store.iconState == .overridden(.tool(.edit)))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user