New release v2.3.9
- Jarvis integration: manage oAI-Web agents and usage from inside the app (/jarvis command, Settings tab 11) - Model category filter: keyword-based categorisation with popover picker in model selector - Categories shown in ModelInfoView with coloured chips; dot indicators on model rows Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -145,6 +145,32 @@ struct ModelInfoView: View {
|
||||
capabilityBadge(icon: "brain", label: "Thinking", active: model.capabilities.thinking)
|
||||
}
|
||||
|
||||
// Categories (if any)
|
||||
if !model.categories.isEmpty {
|
||||
Divider()
|
||||
sectionHeader("Categories")
|
||||
FlowLayout(spacing: 8) {
|
||||
ForEach(model.categories, id: \.rawValue) { cat in
|
||||
HStack(spacing: 5) {
|
||||
Image(systemName: cat.systemImage)
|
||||
.font(.caption2)
|
||||
Text(LocalizedStringKey(cat.rawValue))
|
||||
.font(.caption)
|
||||
}
|
||||
.padding(.horizontal, 10)
|
||||
.padding(.vertical, 6)
|
||||
.background(cat.color.opacity(0.12))
|
||||
.foregroundColor(cat.color)
|
||||
.cornerRadius(6)
|
||||
.overlay(
|
||||
RoundedRectangle(cornerRadius: 6)
|
||||
.strokeBorder(cat.color.opacity(0.35), lineWidth: 1)
|
||||
)
|
||||
}
|
||||
}
|
||||
.padding(.leading, 4)
|
||||
}
|
||||
|
||||
// Architecture (if available)
|
||||
if let arch = model.architecture {
|
||||
Divider()
|
||||
@@ -238,6 +264,50 @@ struct ModelInfoView: View {
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Flow Layout
|
||||
|
||||
struct FlowLayout: Layout {
|
||||
var spacing: CGFloat = 8
|
||||
|
||||
func sizeThatFits(proposal: ProposedViewSize, subviews: Subviews, cache: inout Void) -> CGSize {
|
||||
let rows = rows(for: subviews, width: proposal.width ?? .infinity)
|
||||
let height = rows.map { row in
|
||||
row.map { $0.sizeThatFits(.unspecified).height }.max() ?? 0
|
||||
}.reduce(0, +) + CGFloat(max(0, rows.count - 1)) * spacing
|
||||
return CGSize(width: proposal.width ?? 0, height: height)
|
||||
}
|
||||
|
||||
func placeSubviews(in bounds: CGRect, proposal: ProposedViewSize, subviews: Subviews, cache: inout Void) {
|
||||
let rows = rows(for: subviews, width: bounds.width)
|
||||
var y = bounds.minY
|
||||
for row in rows {
|
||||
var x = bounds.minX
|
||||
let rowH = row.map { $0.sizeThatFits(.unspecified).height }.max() ?? 0
|
||||
for sub in row {
|
||||
let size = sub.sizeThatFits(.unspecified)
|
||||
sub.place(at: CGPoint(x: x, y: y), proposal: ProposedViewSize(size))
|
||||
x += size.width + spacing
|
||||
}
|
||||
y += rowH + spacing
|
||||
}
|
||||
}
|
||||
|
||||
private func rows(for subviews: Subviews, width: CGFloat) -> [[LayoutSubview]] {
|
||||
var rows: [[LayoutSubview]] = [[]]
|
||||
var rowWidth: CGFloat = 0
|
||||
for sub in subviews {
|
||||
let w = sub.sizeThatFits(.unspecified).width
|
||||
if rowWidth + w > width, !rows.last!.isEmpty {
|
||||
rows.append([])
|
||||
rowWidth = 0
|
||||
}
|
||||
rows[rows.count - 1].append(sub)
|
||||
rowWidth += w + spacing
|
||||
}
|
||||
return rows
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
ModelInfoView(model: ModelInfo(
|
||||
id: "anthropic/claude-sonnet-4",
|
||||
|
||||
Reference in New Issue
Block a user