new summary

This commit is contained in:
Ian Gulliver
2026-10-19 19:00:52 -07:00
parent 2bb527aca0
commit 6d9abc8585
6 changed files with 16 additions and 60 deletions
-12
View File
@@ -245,18 +245,6 @@ final class ChatModel {
}
let rows = builder.root.rows
switch j.target {
case .summary(let seq):
guard let i = rows.firstIndex(where: { $0.summarySeq == seq }) else {
return
}
store.jump = nil
stuck = false
switch i > 0 ? rows[i - 1].kind : nil {
case .agent, .subagentMessage:
requestScroll(rows[i - 1].id, .top)
default:
requestScroll(rows[i].id, .bottom)
}
case .question(let id):
guard let row = rows.first(where: { $0.question?.id == id }) else {
return
+7 -10
View File
@@ -169,11 +169,7 @@ private struct TaskRow: View {
let color = taskPalette[task.color]
let count = store.inbox.filter { $0.taskId == task.id }.count
HoverRow(selected: task.id == store.selectedTaskId, indent: task.parentTaskId != nil ? 20 * CGFloat(depth - 1) : 0) {
if store.unreadSummary(task) {
store.openSummary(task)
} else {
store.focusTask(task.id)
}
store.focusTask(task.id)
} content: {
if let parent = task.parentTaskId {
Text("↳")
@@ -189,17 +185,18 @@ private struct TaskRow: View {
if count > 0 {
Badge(count: count).help("open questions")
}
if store.unreadSummary(task) {
if ts.kind == .idle && store.unreadSummary(task) {
Text("new summary")
.font(Fonts.font(11, weight: 700))
.foregroundStyle(Palette.accent)
.help("A turn summary you haven't read")
.accessibilityLabel("New summary from \(task.title), unread")
} else {
Text(ts.label)
.font(Fonts.font(11))
.foregroundStyle(ts.needsYou ? Palette.warn : Palette.muted)
.help(ts.title)
}
Text(ts.label)
.font(Fonts.font(11))
.foregroundStyle(ts.needsYou ? Palette.warn : Palette.muted)
.help(ts.title)
}
}
}
-27
View File
@@ -5,7 +5,6 @@ import SwiftData
let taskTabs: [TaskTab] = [.transcript, .board, .changes, .files, .terminal, .workflow, .project]
enum JumpTarget: Equatable {
case summary(Int64)
case question(String)
case review(Int)
}
@@ -543,32 +542,6 @@ final class Store {
}
}
func openSummary(_ task: ByreTask) {
let seq = task.summarySeq
if let ev = taskFeeds[task.id]?.events.first(where: { $0.seq == seq }) {
pickMember(task.id, ev)
jumpTo(task.id, .summary(seq))
return
}
Task {
do {
let evs = try await api.client.listTaskEvents(path: .init(taskId: task.id), query: .init(after: seq - 1, limit: 1)).ok.body.json
if let ev = evs.first(where: { $0.seq == seq }) {
pickMember(task.id, ev)
}
} catch {
log.error("load summary event: \(errorText(error), privacy: .public)")
}
jumpTo(task.id, .summary(seq))
}
}
private func pickMember(_ taskId: String, _ ev: ByreEvent) {
if let member = str(ev.payload.value, "member"), !member.isEmpty {
pickedMembers[taskId] = member
}
}
func selectTask(_ taskId: String?) {
markVisited(selectedTaskId)
markVisited(taskId)
+6 -8
View File
@@ -263,9 +263,6 @@ final class SwitcherModel {
close()
if store.inbox.contains(where: { $0.taskId == taskId }) {
store.showQuestion(taskId)
} else if let task = store.findTask(taskId), store.unreadSummary(task) {
store.composerFocus = taskId
store.openSummary(task)
} else {
store.composerFocus = taskId
store.focusTask(taskId, .transcript)
@@ -418,17 +415,18 @@ private struct SwitcherRowView: View {
if count > 0 {
Badge(count: count).help("open questions")
}
if store.unreadSummary(task) {
if ts.kind == .idle && store.unreadSummary(task) {
Text("new summary")
.font(Fonts.font(11, weight: 700))
.foregroundStyle(Palette.accent)
.help("A turn summary you haven't read")
.accessibilityLabel("New summary from \(task.title), unread")
} else {
Text(ts.label)
.font(Fonts.font(11))
.foregroundStyle(ts.needsYou ? Palette.warn : Palette.muted)
.help(ts.title)
}
Text(ts.label)
.font(Fonts.font(11))
.foregroundStyle(ts.needsYou ? Palette.warn : Palette.muted)
.help(ts.title)
case .project(let p):
StateDot(filled: nil)
Text(p.name)