Nucleic: String Interpolation Update
This commit is contained in:
@@ -460,15 +460,16 @@ struct HostCommandBreakdown: View {
|
||||
private func stepRow(_ inv: HostCommandSummary.Invocation) -> some View {
|
||||
let risky = inv.destructive || inv.elevated
|
||||
let tail = stepTail(inv)
|
||||
let headline = Text(inv.headline)
|
||||
.font(.system(.caption, design: .monospaced).weight(.semibold))
|
||||
.foregroundColor(AppTheme.primaryText)
|
||||
let tailText = Text(tail.isEmpty ? "" : " " + tail)
|
||||
.font(.system(.caption, design: .monospaced))
|
||||
.foregroundColor(.secondary)
|
||||
return HStack(alignment: .firstTextBaseline, spacing: 8) {
|
||||
Image(systemName: stepGlyph(inv))
|
||||
.font(.caption2).foregroundStyle(risky ? palette.danger : accent).frame(width: 14)
|
||||
(Text(inv.headline)
|
||||
.font(.system(.caption, design: .monospaced).weight(.semibold))
|
||||
.foregroundColor(AppTheme.primaryText)
|
||||
+ Text(tail.isEmpty ? "" : " " + tail)
|
||||
.font(.system(.caption, design: .monospaced))
|
||||
.foregroundColor(.secondary))
|
||||
Text("\(headline)\(tailText)")
|
||||
.lineLimit(1).truncationMode(.middle)
|
||||
.textSelection(.enabled)
|
||||
Spacer(minLength: 0)
|
||||
|
||||
@@ -166,8 +166,8 @@ struct MarkdownText: View {
|
||||
let lines = text.components(separatedBy: "\n")
|
||||
var composed = Text(verbatim: "")
|
||||
for (idx, raw) in lines.enumerated() {
|
||||
if idx > 0 { composed = composed + Text(verbatim: "\n") }
|
||||
composed = composed + lineText(raw)
|
||||
if idx > 0 { composed = Text("\(composed)\n") }
|
||||
composed = Text("\(composed)\(lineText(raw))")
|
||||
}
|
||||
return composed
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
@@ -195,7 +195,7 @@ struct MarkdownText: View {
|
||||
} else if let bullet = Self.bulletContent(trimmed) {
|
||||
// Inline the marker into the run (vs. a separate HStack column) so a wrapped
|
||||
// bullet stays part of the one selectable block.
|
||||
return Text("• ").foregroundStyle(.secondary) + inline(bullet)
|
||||
return Text("\(Text("• ").foregroundStyle(.secondary))\(inline(bullet))")
|
||||
} else {
|
||||
return inline(raw)
|
||||
}
|
||||
|
||||
@@ -338,8 +338,7 @@ private struct MeshHostRow: View {
|
||||
if let presence {
|
||||
Text("\(presence.projects.count) project(s)")
|
||||
if presence.updatedAt > .distantPast {
|
||||
(Text("card updated ") + Text(presence.updatedAt, style: .relative)
|
||||
+ Text(" ago"))
|
||||
Text("card updated \(presence.updatedAt, style: .relative) ago")
|
||||
}
|
||||
}
|
||||
if let error = peer?.lastError {
|
||||
@@ -461,7 +460,7 @@ private struct ParkedDispatchSection: View {
|
||||
Text(model).font(.caption).foregroundStyle(.secondary)
|
||||
}
|
||||
Spacer()
|
||||
(Text("parked ") + Text(record.createdAt, style: .relative) + Text(" ago"))
|
||||
Text("parked \(record.createdAt, style: .relative) ago")
|
||||
.font(.caption).foregroundStyle(.secondary)
|
||||
Button {
|
||||
guard removing.insert(record.id).inserted else { return }
|
||||
@@ -508,7 +507,7 @@ private struct ActiveTransfersSection: View {
|
||||
.font(.caption)
|
||||
.padding(.horizontal, 6).padding(.vertical, 2)
|
||||
.background(Color.blue.opacity(0.12), in: Capsule())
|
||||
(Text(lock.updatedAt, style: .relative) + Text(" ago"))
|
||||
Text("\(lock.updatedAt, style: .relative) ago")
|
||||
.font(.caption).foregroundStyle(.secondary)
|
||||
}
|
||||
.font(.callout)
|
||||
|
||||
@@ -2285,9 +2285,9 @@ private struct AgentsSettingsTab: View {
|
||||
Section("New chats") {
|
||||
Picker("Default model", selection: $defaultModel) {
|
||||
ForEach(ModelCatalog.models, id: \.self) { sku in
|
||||
(Text(ModelCatalog.displayName(sku))
|
||||
+ (ModelCatalog.contextBadge(for: sku).map { Text(" \($0)").foregroundColor(.secondary) } ?? Text(""))
|
||||
).tag(sku)
|
||||
let badge = ModelCatalog.contextBadge(for: sku).map { Text(" \($0)").foregroundColor(.secondary) } ?? Text("")
|
||||
Text("\(ModelCatalog.displayName(sku))\(badge)")
|
||||
.tag(sku)
|
||||
}
|
||||
}
|
||||
Picker("Default \(ModelCatalog.effortNoun(for: defaultModel).lowercased())", selection: $defaultEffort) {
|
||||
@@ -2299,16 +2299,16 @@ private struct AgentsSettingsTab: View {
|
||||
Section("Orchestra") {
|
||||
Picker("Supervisor model", selection: $defaultSupervisorModel) {
|
||||
ForEach(ModelCatalog.models, id: \.self) { sku in
|
||||
(Text(ModelCatalog.displayName(sku))
|
||||
+ (ModelCatalog.contextBadge(for: sku).map { Text(" \($0)").foregroundColor(.secondary) } ?? Text(""))
|
||||
).tag(sku)
|
||||
let badge = ModelCatalog.contextBadge(for: sku).map { Text(" \($0)").foregroundColor(.secondary) } ?? Text("")
|
||||
Text("\(ModelCatalog.displayName(sku))\(badge)")
|
||||
.tag(sku)
|
||||
}
|
||||
}
|
||||
Picker("Worker model", selection: $defaultOrchestraWorkerModel) {
|
||||
ForEach(ModelCatalog.models, id: \.self) { sku in
|
||||
(Text(ModelCatalog.displayName(sku))
|
||||
+ (ModelCatalog.contextBadge(for: sku).map { Text(" \($0)").foregroundColor(.secondary) } ?? Text(""))
|
||||
).tag(sku)
|
||||
let badge = ModelCatalog.contextBadge(for: sku).map { Text(" \($0)").foregroundColor(.secondary) } ?? Text("")
|
||||
Text("\(ModelCatalog.displayName(sku))\(badge)")
|
||||
.tag(sku)
|
||||
}
|
||||
}
|
||||
Picker("Max concurrent workers", selection: $defaultOrchestraMaxWorkers) {
|
||||
|
||||
@@ -583,12 +583,10 @@ struct TranscriptRow: View, Equatable {
|
||||
/// secondary. A bare sentinel responder ("always-rule", "system") renders name-only.
|
||||
private func resolvedByLabel(_ decidedBy: String) -> some View {
|
||||
let parts = ResponderLabel.split(decidedBy)
|
||||
var text = Text("Resolved by ").foregroundStyle(.secondary)
|
||||
+ Text(parts.name).foregroundStyle(.secondary)
|
||||
var text = Text("Resolved by \(parts.name)").foregroundStyle(.secondary)
|
||||
if let fingerprint = parts.fingerprint {
|
||||
text = text
|
||||
+ Text(" ").foregroundStyle(.secondary)
|
||||
+ Text(fingerprint).font(.callout.monospaced()).foregroundStyle(.tertiary)
|
||||
let fp = Text(fingerprint).font(.callout.monospaced()).foregroundStyle(.tertiary)
|
||||
text = Text("\(text) \(fp)")
|
||||
}
|
||||
return HStack(alignment: .firstTextBaseline, spacing: 6) {
|
||||
Image(systemName: "arrow.right.circle").font(.caption)
|
||||
|
||||
@@ -175,15 +175,16 @@ struct HostCommandBreakdown: View {
|
||||
private func stepRow(_ inv: HostCommandSummary.Invocation) -> some View {
|
||||
let risky = inv.destructive || inv.elevated
|
||||
let tail = stepTail(inv)
|
||||
let headline = Text(inv.headline)
|
||||
.font(.caption.monospaced().weight(.semibold))
|
||||
.foregroundColor(.primary)
|
||||
let tailText = Text(tail.isEmpty ? "" : " " + tail)
|
||||
.font(.caption.monospaced())
|
||||
.foregroundColor(.secondary)
|
||||
return HStack(alignment: .firstTextBaseline, spacing: 8) {
|
||||
Image(systemName: stepGlyph(inv))
|
||||
.font(.caption2).foregroundStyle(risky ? Palette.danger : accent).frame(width: 14)
|
||||
(Text(inv.headline)
|
||||
.font(.caption.monospaced().weight(.semibold))
|
||||
.foregroundColor(.primary)
|
||||
+ Text(tail.isEmpty ? "" : " " + tail)
|
||||
.font(.caption.monospaced())
|
||||
.foregroundColor(.secondary))
|
||||
Text("\(headline)\(tailText)")
|
||||
.lineLimit(1).truncationMode(.middle)
|
||||
.textSelection(.enabled)
|
||||
Spacer(minLength: 0)
|
||||
|
||||
Reference in New Issue
Block a user