mac app active tool animation
This commit is contained in:
@@ -92,6 +92,14 @@ final class ChatModel {
|
||||
builder.open && session?.state == .running
|
||||
}
|
||||
|
||||
var subagents: Bool {
|
||||
(session?.subagents ?? 0) > 0
|
||||
}
|
||||
|
||||
func working(_ row: Row) -> Bool {
|
||||
row.pending && (running || subagents && row.inActive) || row.active && (running || subagents)
|
||||
}
|
||||
|
||||
var hasOlder: Bool {
|
||||
kind == .lead && store.leadHasOlder()
|
||||
}
|
||||
@@ -609,6 +617,7 @@ struct DetailsBox<Summary: View, Content: View>: View {
|
||||
@ViewBuilder let content: Content
|
||||
@Environment(\.paneAccent) private var accent
|
||||
@ViewState private var open = false
|
||||
@ViewState private var shown = false
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading, spacing: 0) {
|
||||
@@ -637,9 +646,13 @@ struct DetailsBox<Summary: View, Content: View>: View {
|
||||
.background(boxed ? (nested ? Palette.raised : Palette.surface) : .clear, in: RoundedRectangle(cornerRadius: 8))
|
||||
.overlay {
|
||||
if boxed {
|
||||
RoundedRectangle(cornerRadius: 8).stroke(working ? accent : Palette.border)
|
||||
RoundedRectangle(cornerRadius: 8).stroke(working && shown ? accent : Palette.border)
|
||||
.animation(.easeInOut(duration: 0.6), value: working && shown)
|
||||
}
|
||||
}
|
||||
.onAppear {
|
||||
shown = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -747,7 +760,7 @@ struct RowView: View {
|
||||
}
|
||||
|
||||
case .tool(let name, let brief, let input):
|
||||
DetailsBox(nested: nested, working: model.running && row.pending) {
|
||||
DetailsBox(nested: nested, working: model.working(row)) {
|
||||
SubagentTag(show: row.tag)
|
||||
Text(styled([(name, 600, nil), (" ", 400, nil), (brief, 400, Palette.muted)]))
|
||||
} content: {
|
||||
@@ -759,7 +772,7 @@ struct RowView: View {
|
||||
}
|
||||
|
||||
case .subagent(let title, let description, let prompt):
|
||||
DetailsBox(nested: nested, working: model.running && row.pending) {
|
||||
DetailsBox(nested: nested, working: model.working(row)) {
|
||||
SubagentTag(show: row.tag)
|
||||
Text(styled([(title, 600, nil), (" ", 400, nil), (description, 400, Palette.muted)]))
|
||||
Spacer(minLength: 12)
|
||||
@@ -778,7 +791,7 @@ struct RowView: View {
|
||||
}
|
||||
|
||||
case .group:
|
||||
DetailsBox(nested: nested, working: model.running && row.pending) {
|
||||
DetailsBox(nested: nested, working: model.working(row)) {
|
||||
SubagentTag(show: row.tag)
|
||||
RunSummary(calls: row.calls)
|
||||
} content: {
|
||||
|
||||
Reference in New Issue
Block a user