Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(desktop): 灵动岛两位数计数徽标背景随文字完整撑开

Dashfc7951059a77
diff --git a/apps/desktop/native/agent-island/macos-agent-island-helper.swift b/apps/desktop/native/agent-island/macos-agent-island-helper.swift
index fd594bb785..c2e8e20198 100644
--- a/apps/desktop/native/agent-island/macos-agent-island-helper.swift
+++ b/apps/desktop/native/agent-island/macos-agent-island-helper.swift
@@ -3121,13 +3121,14 @@ struct PillBadge: View {
Text(text)
.font(badgeFont)
.foregroundColor(Color.white.opacity(0.92))
- // Multi-digit counts must widen the capsule instead of wrapping into two lines.
.lineLimit(1)
- .fixedSize(horizontal: true, vertical: false)
.padding(.horizontal, Self.contentInset)
.frame(minWidth: metrics.minWidth, minHeight: compact ? 18 : 20)
.background(Color.white.opacity(emphasized ? 0.11 : 0.065))
.clipShape(Capsule())
+ // Fix the whole capsule, not just the text: a squeezed `minWidth` frame would
+ // otherwise shrink the background while multi-digit text overflows it.
+ .fixedSize(horizontal: true, vertical: false)
}
private func activeTotalBadge(active: Int, total: Int, emphasized: Bool) -> some View {
@@ -3140,13 +3141,14 @@ struct PillBadge: View {
.foregroundColor(Color.white.opacity(0.92))
}
.font(badgeFont)
- // Multi-digit counts must widen the capsule instead of wrapping into two lines.
.lineLimit(1)
- .fixedSize(horizontal: true, vertical: false)
.padding(.horizontal, Self.contentInset)
.frame(minWidth: metrics.minWidth, minHeight: compact ? 18 : 20)
.background(Color.white.opacity(emphasized ? 0.11 : 0.065))
.clipShape(Capsule())
+ // Fix the whole capsule, not just the text: a squeezed `minWidth` frame would
+ // otherwise shrink the background while multi-digit text overflows it.
+ .fixedSize(horizontal: true, vertical: false)
}
private var metrics: Metrics {