feat(mac): compact context session rows
This commit is contained in:
@@ -271,7 +271,7 @@ struct MenuContent: View {
|
|||||||
|
|
||||||
@ViewBuilder
|
@ViewBuilder
|
||||||
private var contextCardView: some View {
|
private var contextCardView: some View {
|
||||||
VStack(alignment: .leading, spacing: 10) {
|
VStack(alignment: .leading, spacing: 8) {
|
||||||
HStack(alignment: .firstTextBaseline) {
|
HStack(alignment: .firstTextBaseline) {
|
||||||
Text("Context")
|
Text("Context")
|
||||||
.font(.caption.weight(.semibold))
|
.font(.caption.weight(.semibold))
|
||||||
@@ -287,7 +287,7 @@ struct MenuContent: View {
|
|||||||
.font(.caption)
|
.font(.caption)
|
||||||
.foregroundStyle(.secondary)
|
.foregroundStyle(.secondary)
|
||||||
} else {
|
} else {
|
||||||
VStack(alignment: .leading, spacing: 10) {
|
VStack(alignment: .leading, spacing: 8) {
|
||||||
ForEach(self.contextSessions) { row in
|
ForEach(self.contextSessions) { row in
|
||||||
self.contextSessionRow(row)
|
self.contextSessionRow(row)
|
||||||
}
|
}
|
||||||
@@ -316,22 +316,27 @@ struct MenuContent: View {
|
|||||||
private func contextSessionRow(_ row: SessionRow) -> some View {
|
private func contextSessionRow(_ row: SessionRow) -> some View {
|
||||||
let width = self.contextPillWidth
|
let width = self.contextPillWidth
|
||||||
VStack(alignment: .leading, spacing: 4) {
|
VStack(alignment: .leading, spacing: 4) {
|
||||||
ContextUsageBar(
|
HStack(alignment: .firstTextBaseline, spacing: 8) {
|
||||||
usedTokens: row.tokens.total,
|
|
||||||
contextTokens: row.tokens.contextTokens,
|
|
||||||
width: width,
|
|
||||||
height: self.contextBarHeight)
|
|
||||||
HStack(spacing: 8) {
|
|
||||||
Text(row.key)
|
Text(row.key)
|
||||||
.font(.caption2.weight(row.key == "main" ? .semibold : .regular))
|
.font(.caption.weight(row.key == "main" ? .semibold : .regular))
|
||||||
.lineLimit(1)
|
.lineLimit(1)
|
||||||
.truncationMode(.middle)
|
.truncationMode(.middle)
|
||||||
.layoutPriority(1)
|
.layoutPriority(1)
|
||||||
Spacer(minLength: 8)
|
Spacer(minLength: 8)
|
||||||
Text(row.tokens.contextSummaryShort)
|
Text(row.tokens.contextSummaryShort)
|
||||||
.font(.caption2.monospacedDigit())
|
.font(.caption.monospacedDigit())
|
||||||
.foregroundStyle(.secondary)
|
.foregroundStyle(.secondary)
|
||||||
|
.lineLimit(1)
|
||||||
|
.fixedSize(horizontal: true, vertical: false)
|
||||||
|
.layoutPriority(2)
|
||||||
}
|
}
|
||||||
|
.frame(width: width)
|
||||||
|
|
||||||
|
ContextUsageBar(
|
||||||
|
usedTokens: row.tokens.total,
|
||||||
|
contextTokens: row.tokens.contextTokens,
|
||||||
|
width: width,
|
||||||
|
height: self.contextBarHeight)
|
||||||
}
|
}
|
||||||
.frame(width: width)
|
.frame(width: width)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user