style(swift-ios): preserve native formatting

This commit is contained in:
Theo Browne committed 2026-08-09 20:55:47 -07:00
1 parent cf79d65d1a
commit 0f5a1c1049
25 files changed
+281 -280

No files matched your search

@@ -236,7 +236,7 @@ struct PlatformIncomingShareDestinationSheet: View {
.foregroundStyle(.secondary)
.lineLimit(3)
}
.listRowBackground(Color(uiColor: .systemBackground))
.listRowBackground(Color(uiColor: .systemBackground))
}
Section("Choose a project") {
@@ -272,7 +272,7 @@ struct PlatformIncomingShareDestinationSheet: View {
}
.buttonStyle(.plain)
.disabled(isImporting)
.listRowBackground(Color(uiColor: .systemBackground))
.listRowBackground(Color(uiColor: .systemBackground))
}
}
@@ -284,11 +284,11 @@ struct PlatformIncomingShareDestinationSheet: View {
.foregroundStyle(.secondary)
}
}
.listRowBackground(Color(uiColor: .systemBackground))
.listRowBackground(Color(uiColor: .systemBackground))
}
}
.scrollContentBackground(.hidden)
.background(Color(uiColor: .systemBackground))
.background(Color(uiColor: .systemBackground))
.navigationTitle("Start a task")
.navigationBarTitleDisplayMode(.inline)
.toolbar {
@@ -298,7 +298,7 @@ struct PlatformIncomingShareDestinationSheet: View {
}
}
}
.background(Color(uiColor: .systemBackground).ignoresSafeArea())
.background(Color(uiColor: .systemBackground).ignoresSafeArea())
.presentationDetents([.medium, .large])
.presentationDragIndicator(.visible)
.interactiveDismissDisabled(isImporting)
@@ -34,12 +34,12 @@ enum ProviderBrand: String {
return nil
}
var usesTemplateRendering: Bool {
switch self {
case .openAI, .cursor, .grok: true
case .claude, .openCode: false
var usesTemplateRendering: Bool {
switch self {
case .openAI, .cursor, .grok: true
case .claude, .openCode: false
}
}
}
}
/// Displays the same provider artwork used by the web and marketing surfaces.
@@ -59,8 +59,8 @@ struct ProviderIcon: View {
) {
Image(brand.rawValue)
.resizable()
.renderingMode(brand.usesTemplateRendering ? .template : .original)
.foregroundStyle(T3Colors.textSecondary)
.renderingMode(brand.usesTemplateRendering ? .template : .original)
.foregroundStyle(T3Colors.textSecondary)
.scaledToFit()
} else {
Text(fallbackInitial)
+54 -53
View File
@@ -2,65 +2,66 @@ import SwiftUI
import UIKit
enum T3Colors {
// Keep these values aligned with apps/mobile/global.css. UIKit variants
// let recycled collection and terminal surfaces participate in the same
// system appearance changes as SwiftUI views.
static let uiBackground = adaptive(light: rgb(0xF2F2F7), dark: rgb(0x0A0A0A))
static let uiTextPrimary = adaptive(light: rgb(0x262626), dark: rgb(0xF5F5F5))
// Keep these values aligned with apps/mobile/global.css. UIKit variants
// let recycled collection and terminal surfaces participate in the same
// system appearance changes as SwiftUI views.
static let uiBackground = adaptive(light: rgb(0xF2F2F7), dark: rgb(0x0A0A0A))
static let uiTextPrimary = adaptive(light: rgb(0x262626), dark: rgb(0xF5F5F5))
static let background = Color(uiColor: uiBackground)
static let sheet = color(light: rgb(0xF2F2F7, alpha: 0.98), dark: rgb(0x0E0E0E, alpha: 0.98))
static let surface = color(light: rgb(0xFFFFFF), dark: rgb(0x171717))
static let surfaceRaised = color(light: rgb(0xF5F5F5), dark: rgb(0x1C1C1C))
static let input = color(light: rgb(0xFFFFFF), dark: rgb(0x141414))
static let border = color(light: rgb(0x000000, alpha: 0.08), dark: rgb(0xFFFFFF, alpha: 0.06))
static let inputBorder = color(
light: rgb(0x000000, alpha: 0.10), dark: rgb(0xFFFFFF, alpha: 0.08))
static let separator = color(light: rgb(0x000000, alpha: 0.04), dark: rgb(0xFFFFFF, alpha: 0.03))
static let subtle = color(light: rgb(0x000000, alpha: 0.04), dark: rgb(0xFFFFFF, alpha: 0.04))
static let subtleStrong = color(
light: rgb(0x000000, alpha: 0.08), dark: rgb(0xFFFFFF, alpha: 0.08))
static let shadow = color(light: rgb(0x000000, alpha: 0.18), dark: rgb(0x000000, alpha: 0.32))
static let ledgerSurface = surface
static let ledgerSelected = surfaceRaised
static let background = Color(uiColor: uiBackground)
static let sheet = color(light: rgb(0xF2F2F7, alpha: 0.98), dark: rgb(0x0E0E0E, alpha: 0.98))
static let surface = color(light: rgb(0xFFFFFF), dark: rgb(0x171717))
static let surfaceRaised = color(light: rgb(0xF5F5F5), dark: rgb(0x1C1C1C))
static let input = color(light: rgb(0xFFFFFF), dark: rgb(0x141414))
static let border = color(light: rgb(0x000000, alpha: 0.08), dark: rgb(0xFFFFFF, alpha: 0.06))
static let inputBorder = color(
light: rgb(0x000000, alpha: 0.10), dark: rgb(0xFFFFFF, alpha: 0.08))
static let separator = color(
light: rgb(0x000000, alpha: 0.04), dark: rgb(0xFFFFFF, alpha: 0.03))
static let subtle = color(light: rgb(0x000000, alpha: 0.04), dark: rgb(0xFFFFFF, alpha: 0.04))
static let subtleStrong = color(
light: rgb(0x000000, alpha: 0.08), dark: rgb(0xFFFFFF, alpha: 0.08))
static let shadow = color(light: rgb(0x000000, alpha: 0.18), dark: rgb(0x000000, alpha: 0.32))
static let ledgerSurface = surface
static let ledgerSelected = surfaceRaised
static let textPrimary = Color(uiColor: uiTextPrimary)
static let textSecondary = color(light: rgb(0x525252), dark: rgb(0xA3A3A3))
static let textTertiary = color(light: rgb(0x737373), dark: rgb(0x8E8E93))
static let placeholder = color(light: rgb(0xA3A3A3), dark: rgb(0x8E8E93))
static let textPrimary = Color(uiColor: uiTextPrimary)
static let textSecondary = color(light: rgb(0x525252), dark: rgb(0xA3A3A3))
static let textTertiary = color(light: rgb(0x737373), dark: rgb(0x8E8E93))
static let placeholder = color(light: rgb(0xA3A3A3), dark: rgb(0x8E8E93))
static let primaryAction = color(light: rgb(0x262626), dark: rgb(0xF5F5F5))
static let primaryActionForeground = color(light: rgb(0xFFFFFF), dark: rgb(0x0A0A0A))
static let accent = color(light: rgb(0x007AFF), dark: rgb(0x0A84FF))
static let statusRunning = color(light: rgb(0x0284C7), dark: rgb(0x22D3EE))
static let statusInput = color(light: rgb(0x4F46E5), dark: rgb(0xA5B4FC))
static let success = color(light: rgb(0x16A34A), dark: rgb(0x30D158))
static let warning = color(light: rgb(0xD97706), dark: rgb(0xFF9F0A))
static let danger = color(light: rgb(0xDC2626), dark: rgb(0xFF453A))
static let primaryAction = color(light: rgb(0x262626), dark: rgb(0xF5F5F5))
static let primaryActionForeground = color(light: rgb(0xFFFFFF), dark: rgb(0x0A0A0A))
static let accent = color(light: rgb(0x007AFF), dark: rgb(0x0A84FF))
static let statusRunning = color(light: rgb(0x0284C7), dark: rgb(0x22D3EE))
static let statusInput = color(light: rgb(0x4F46E5), dark: rgb(0xA5B4FC))
static let success = color(light: rgb(0x16A34A), dark: rgb(0x30D158))
static let warning = color(light: rgb(0xD97706), dark: rgb(0xFF9F0A))
static let danger = color(light: rgb(0xDC2626), dark: rgb(0xFF453A))
static let syntaxKeyword = color(light: rgb(0x7C3AED), dark: rgb(0xC78EFF))
static let syntaxLiteral = color(light: rgb(0x2563EB), dark: rgb(0x8CC7FF))
static let syntaxNumber = color(light: rgb(0xB45309), dark: rgb(0xEBAA6B))
static let syntaxProperty = color(light: rgb(0x0F766E), dark: rgb(0x6BD1C2))
static let syntaxKeyword = color(light: rgb(0x7C3AED), dark: rgb(0xC78EFF))
static let syntaxLiteral = color(light: rgb(0x2563EB), dark: rgb(0x8CC7FF))
static let syntaxNumber = color(light: rgb(0xB45309), dark: rgb(0xEBAA6B))
static let syntaxProperty = color(light: rgb(0x0F766E), dark: rgb(0x6BD1C2))
private static func color(light: UIColor, dark: UIColor) -> Color {
Color(uiColor: adaptive(light: light, dark: dark))
}
private static func adaptive(light: UIColor, dark: UIColor) -> UIColor {
UIColor { traits in
traits.userInterfaceStyle == .dark ? dark : light
private static func color(light: UIColor, dark: UIColor) -> Color {
Color(uiColor: adaptive(light: light, dark: dark))
}
}
private static func rgb(_ hex: UInt32, alpha: CGFloat = 1) -> UIColor {
UIColor(
red: CGFloat((hex >> 16) & 0xFF) / 255,
green: CGFloat((hex >> 8) & 0xFF) / 255,
blue: CGFloat(hex & 0xFF) / 255,
alpha: alpha
)
}
private static func adaptive(light: UIColor, dark: UIColor) -> UIColor {
UIColor { traits in
traits.userInterfaceStyle == .dark ? dark : light
}
}
private static func rgb(_ hex: UInt32, alpha: CGFloat = 1) -> UIColor {
UIColor(
red: CGFloat((hex >> 16) & 0xFF) / 255,
green: CGFloat((hex >> 8) & 0xFF) / 255,
blue: CGFloat(hex & 0xFF) / 255,
alpha: alpha
)
}
}
/// The native client uses semantic fonts so every surface follows Dynamic Type.
@@ -98,7 +99,7 @@ enum T3Metrics {
extension View {
func t3NavigationChrome() -> some View {
toolbarBackground(T3Colors.sheet, for: .navigationBar)
toolbarBackground(T3Colors.sheet, for: .navigationBar)
.toolbarBackground(.visible, for: .navigationBar)
}
}
@@ -6,7 +6,7 @@ final class T3ShareViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .systemBackground
view.backgroundColor = .systemBackground
let content = T3ShareExtensionView(
save: { [weak self] in
@@ -28,7 +28,7 @@ final class T3ShareViewController: UIViewController {
}
)
let hostingController = UIHostingController(rootView: content)
hostingController.view.backgroundColor = .systemBackground
hostingController.view.backgroundColor = .systemBackground
addChild(hostingController)
hostingController.view.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(hostingController.view)
@@ -66,14 +66,14 @@ struct T3ShareExtensionView: View {
Spacer()
Text("T3 Code")
.font(.system(size: 17, weight: .semibold))
.foregroundStyle(.primary)
.foregroundStyle(.primary)
Spacer()
Color.clear.frame(width: 52, height: 1)
}
.padding(.horizontal, 18)
.padding(.vertical, 15)
Divider()
Divider()
VStack(spacing: 14) {
Image(systemName: phaseSymbol)
@@ -82,7 +82,7 @@ struct T3ShareExtensionView: View {
.accessibilityHidden(true)
Text(title)
.font(.system(size: 22, weight: .bold))
.foregroundStyle(.primary)
.foregroundStyle(.primary)
.multilineTextAlignment(.center)
Text(message)
.font(.system(size: 15, weight: .medium))
@@ -97,10 +97,10 @@ struct T3ShareExtensionView: View {
Button(action: primaryAction) {
Text(primaryTitle)
.font(.system(size: 16, weight: .semibold))
.foregroundStyle(Color(uiColor: .systemBackground))
.foregroundStyle(Color(uiColor: .systemBackground))
.frame(maxWidth: .infinity)
.frame(height: 50)
.background(Color(uiColor: .label), in: RoundedRectangle(cornerRadius: 13))
.background(Color(uiColor: .label), in: RoundedRectangle(cornerRadius: 13))
}
.buttonStyle(.plain)
.disabled(isSaving)
@@ -108,7 +108,7 @@ struct T3ShareExtensionView: View {
.padding(.horizontal, 18)
.padding(.bottom, 18)
}
.background(Color(uiColor: .systemBackground).ignoresSafeArea())
.background(Color(uiColor: .systemBackground).ignoresSafeArea())
}
private var isSaving: Bool {
@@ -150,9 +150,9 @@ struct T3ShareExtensionView: View {
private var phaseTint: Color {
switch phase {
case .saved: Color(uiColor: .systemGreen)
case .failed: Color(uiColor: .systemRed)
default: Color(uiColor: .label)
case .saved: Color(uiColor: .systemGreen)
case .failed: Color(uiColor: .systemRed)
default: Color(uiColor: .label)
}
}
@@ -6,8 +6,8 @@ struct T3TaskLiveActivity: Widget {
var body: some WidgetConfiguration {
ActivityConfiguration(for: LiveActivityAttributes.self) { context in
T3LiveActivityLockScreenView(context: context)
.activityBackgroundTint(Color(uiColor: .systemBackground))
.activitySystemActionForegroundColor(Color(uiColor: .label))
.activityBackgroundTint(Color(uiColor: .systemBackground))
.activitySystemActionForegroundColor(Color(uiColor: .label))
.widgetURL(T3ActivityPresentation(state: context.state).deepLinkURL)
} dynamicIsland: { context in
let presentation = T3ActivityPresentation(state: context.state)
@@ -72,7 +72,7 @@ private struct T3LiveActivityLockScreenView: View {
HStack(spacing: 8) {
Text("T3 Code")
.font(.system(size: 14, weight: .bold))
.foregroundStyle(.primary)
.foregroundStyle(.primary)
Spacer(minLength: 8)
Label(presentation.shortStatus, systemImage: presentation.phase.systemImage)
.font(.system(size: 13, weight: .semibold))
@@ -106,7 +106,7 @@ private struct T3LiveActivityRow: View {
.frame(width: 14)
Text(row.threadTitle)
.font(.system(size: 13, weight: .semibold))
.foregroundStyle(.primary)
.foregroundStyle(.primary)
.lineLimit(1)
Text(row.projectTitle)
.font(.system(size: 11, weight: .medium))
@@ -164,15 +164,15 @@ extension T3AgentActivityPhase {
var tint: Color {
switch self {
case .starting, .running:
Color(uiColor: .systemBlue)
Color(uiColor: .systemBlue)
case .waitingForApproval:
Color(uiColor: .systemOrange)
Color(uiColor: .systemOrange)
case .waitingForInput:
Color(uiColor: .systemIndigo)
Color(uiColor: .systemIndigo)
case .completed:
Color(uiColor: .systemGreen)
Color(uiColor: .systemGreen)
case .failed:
Color(uiColor: .systemRed)
Color(uiColor: .systemRed)
case .stale:
Color.secondary
}
@@ -29,7 +29,7 @@ struct T3RecentTasksWidget: Widget {
var body: some WidgetConfiguration {
StaticConfiguration(kind: kind, provider: T3TaskWidgetProvider()) { entry in
T3TaskWidgetView(entry: entry)
.containerBackground(Color(uiColor: .systemBackground), for: .widget)
.containerBackground(Color(uiColor: .systemBackground), for: .widget)
}
.configurationDisplayName("T3 Code Tasks")
.description("See active and recent T3 Code tasks at a glance.")
@@ -75,7 +75,7 @@ private struct T3TaskWidgetView: View {
.lineLimit(1)
Text(task.threadTitle)
.font(.system(size: 15, weight: .semibold))
.foregroundStyle(.primary)
.foregroundStyle(.primary)
.lineLimit(2)
Text(task.projectTitle)
.font(.system(size: 11, weight: .medium))
@@ -108,7 +108,7 @@ private struct T3TaskWidgetView: View {
VStack(alignment: .leading, spacing: 1) {
Text(task.threadTitle)
.font(.system(size: 13, weight: .semibold))
.foregroundStyle(.primary)
.foregroundStyle(.primary)
.lineLimit(1)
Text(task.projectTitle)
.font(.system(size: 10, weight: .medium))
@@ -123,7 +123,7 @@ private struct T3TaskWidgetView: View {
}
}
if index < min(orderedTasks.count, 3) - 1 {
Divider()
Divider()
}
}
}
@@ -152,7 +152,7 @@ private struct T3TaskWidgetView: View {
HStack(spacing: 6) {
Text("T3")
.font(.system(size: 14, weight: .black, design: .rounded))
.foregroundStyle(.primary)
.foregroundStyle(.primary)
Text("Code")
.font(.system(size: 13, weight: .semibold))
.foregroundStyle(.secondary)
@@ -160,7 +160,7 @@ private struct T3TaskWidgetView: View {
Link(destination: T3WidgetURLs.newTask) {
Image(systemName: "square.and.pencil")
.font(.system(size: 13, weight: .semibold))
.foregroundStyle(.primary)
.foregroundStyle(.primary)
}
.accessibilityLabel("New task")
}
@@ -170,7 +170,7 @@ private struct T3TaskWidgetView: View {
VStack(alignment: .leading, spacing: 4) {
Text("Ready for a task")
.font(.system(size: 14, weight: .semibold))
.foregroundStyle(.primary)
.foregroundStyle(.primary)
Text("Tap to start in T3 Code")
.font(.system(size: 11, weight: .medium))
.foregroundStyle(.secondary)
@@ -52,16 +52,16 @@ struct FeatureComposerApprovalPanel: View {
}
.padding(10)
.frame(maxWidth: .infinity, alignment: .leading)
.background(T3Colors.input, in: RoundedRectangle(cornerRadius: 10))
.background(T3Colors.input, in: RoundedRectangle(cornerRadius: 10))
.overlay {
RoundedRectangle(cornerRadius: 10)
.stroke(T3Colors.border, lineWidth: 1)
.stroke(T3Colors.border, lineWidth: 1)
}
.padding(.top, 9)
}
.padding(.horizontal, 15)
.padding(.vertical, 12)
.background(T3Colors.subtle)
.background(T3Colors.subtle)
Divider().overlay(T3Colors.separator)
@@ -76,8 +76,8 @@ struct FeatureComposerApprovalPanel: View {
approvalButton(
"Always allow",
background: Color.clear,
border: T3Colors.border,
foreground: T3Colors.textPrimary,
border: T3Colors.border,
foreground: T3Colors.textPrimary,
action: { onDecision(.allowForSession) }
)
}
@@ -108,13 +108,13 @@ struct FeatureComposerApprovalPanel: View {
_ title: String,
background: Color,
border: Color = .clear,
foreground: Color = .white,
foreground: Color = .white,
action: @escaping () -> Void
) -> some View {
Button(action: action) {
Text(title)
.font(T3Typography.control.weight(.semibold))
.foregroundStyle(foreground)
.foregroundStyle(foreground)
.frame(maxWidth: .infinity)
.frame(height: T3Metrics.minimumTapTarget)
.background(background, in: RoundedRectangle(cornerRadius: 10))
@@ -182,7 +182,7 @@ struct FeatureComposerUserInputPanel: View {
.padding(.horizontal, 15)
.padding(.vertical, 12)
.frame(maxWidth: .infinity, alignment: .leading)
.background(T3Colors.subtle)
.background(T3Colors.subtle)
Divider().overlay(T3Colors.separator)
@@ -218,12 +218,12 @@ struct FeatureComposerUserInputPanel: View {
.padding(.horizontal, 12)
.frame(minHeight: T3Metrics.minimumTapTarget)
.background(
T3Colors.input,
T3Colors.input,
in: RoundedRectangle(cornerRadius: 11)
)
.overlay {
RoundedRectangle(cornerRadius: 11)
.stroke(T3Colors.inputBorder, lineWidth: 1)
.stroke(T3Colors.inputBorder, lineWidth: 1)
}
.padding(.horizontal, 10)
.padding(.top, 7)
@@ -321,7 +321,7 @@ struct FeatureComposerUserInputPanel: View {
VStack(alignment: .leading, spacing: 2) {
Text(option.label)
.font(T3Typography.control)
.foregroundStyle(T3Colors.textPrimary)
.foregroundStyle(T3Colors.textPrimary)
if !option.detail.isEmpty, option.detail != option.label {
Text(option.detail)
@@ -344,7 +344,7 @@ struct FeatureComposerUserInputPanel: View {
.frame(width: 20, height: 20)
.overlay {
RoundedRectangle(cornerRadius: 5)
.stroke(T3Colors.border, lineWidth: 1)
.stroke(T3Colors.border, lineWidth: 1)
}
}
}
@@ -352,7 +352,7 @@ struct FeatureComposerUserInputPanel: View {
.padding(.vertical, 9)
.frame(maxWidth: .infinity, minHeight: T3Metrics.minimumTapTarget, alignment: .leading)
.background(
isSelected ? T3Colors.accent.opacity(0.12) : T3Colors.subtle,
isSelected ? T3Colors.accent.opacity(0.12) : T3Colors.subtle,
in: RoundedRectangle(cornerRadius: 10)
)
.overlay {
@@ -91,11 +91,11 @@ struct FeatureComposerView: View {
.padding(.bottom, 10)
.background {
LinearGradient(
colors: [
.clear,
T3Colors.background.opacity(0.94),
T3Colors.background,
],
colors: [
.clear,
T3Colors.background.opacity(0.94),
T3Colors.background,
],
startPoint: .top,
endPoint: .bottom
)
@@ -141,10 +141,10 @@ struct FeatureComposerView: View {
collapsedComposer
}
}
.background(T3Colors.input.opacity(0.98), in: composerShape)
.background(T3Colors.input.opacity(0.98), in: composerShape)
.overlay {
composerShape
.stroke(T3Colors.inputBorder, lineWidth: 1)
.stroke(T3Colors.inputBorder, lineWidth: 1)
}
.clipShape(composerShape)
}
@@ -483,7 +483,7 @@ private struct FeatureContextMeter: View {
var body: some View {
ZStack {
Circle()
.stroke(T3Colors.border, lineWidth: 2)
.stroke(T3Colors.border, lineWidth: 2)
Circle()
.trim(from: 0, to: clampedUsage)
.stroke(
@@ -52,7 +52,7 @@ public struct ThreadDetailView: View {
)
}
}
.background(T3Colors.background)
.background(T3Colors.background)
.navigationBarTitleDisplayMode(.inline)
.navigationBarBackButtonHidden(false)
.t3NavigationChrome()
@@ -298,9 +298,9 @@ public struct ThreadDetailView: View {
switch currentThread.homeStatus {
case .working: T3Colors.statusRunning
case .approval: T3Colors.warning
case .input: T3Colors.statusInput
case .input: T3Colors.statusInput
case .failed: T3Colors.danger
case .done: T3Colors.success
case .done: T3Colors.success
case .ready: T3Colors.textTertiary
}
}
@@ -627,7 +627,7 @@ private struct FeatureTranscriptCollectionView: UIViewRepresentable {
frame: .zero,
collectionViewLayout: Self.makeLayout()
)
collectionView.backgroundColor = T3Colors.uiBackground
collectionView.backgroundColor = T3Colors.uiBackground
collectionView.alwaysBounceVertical = true
collectionView.keyboardDismissMode = .onDrag
collectionView.delaysContentTouches = false
@@ -1446,7 +1446,7 @@ struct FeatureMessageView: View {
.padding(.vertical, 11)
.frame(maxWidth: T3Metrics.readingWidth * 0.88, alignment: .leading)
.background(
T3Colors.subtleStrong,
T3Colors.subtleStrong,
in: UnevenRoundedRectangle(
topLeadingRadius: 16,
bottomLeadingRadius: 16,
@@ -58,7 +58,7 @@ public struct ConnectionOnboardingView: View {
}
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(T3Colors.background)
.background(T3Colors.background)
.animation(.snappy(duration: 0.24), value: stage)
}
.toolbar {
@@ -155,7 +155,7 @@ public struct ConnectionOnboardingView: View {
showingScanner = true
}
Divider().overlay(T3Colors.border)
Divider().overlay(T3Colors.border)
connectionAction(
title: "Paste connection link",
@@ -165,7 +165,7 @@ public struct ConnectionOnboardingView: View {
pasteConnectionLink()
}
Divider().overlay(T3Colors.border)
Divider().overlay(T3Colors.border)
connectionAction(
title: "Enter details manually",
@@ -234,7 +234,7 @@ public struct ConnectionOnboardingView: View {
.accessibilityHint("Reconnects to this server")
if environment.id != model.snapshot.environments.last?.id {
Divider().overlay(T3Colors.border)
Divider().overlay(T3Colors.border)
}
}
}
@@ -628,10 +628,10 @@ private extension View {
.font(.body.monospaced())
.padding(.horizontal, 14)
.frame(minHeight: 50)
.background(T3Colors.input)
.background(T3Colors.input)
.overlay(alignment: .bottom) {
Rectangle()
.fill(T3Colors.inputBorder)
.fill(T3Colors.inputBorder)
.frame(height: 1)
}
}
@@ -641,14 +641,14 @@ private struct ConnectionPrimaryButtonStyle: ButtonStyle {
func makeBody(configuration: Configuration) -> some View {
configuration.label
.font(.body.weight(.semibold))
.foregroundStyle(T3Colors.primaryActionForeground)
.foregroundStyle(T3Colors.primaryActionForeground)
.padding(.horizontal, 16)
.frame(minHeight: 52)
.background(
configuration.isPressed
? T3Colors.primaryAction.opacity(0.76)
: T3Colors.primaryAction
)
.background(
configuration.isPressed
? T3Colors.primaryAction.opacity(0.76)
: T3Colors.primaryAction
)
.clipShape(RoundedRectangle(cornerRadius: 12))
}
}
@@ -80,9 +80,9 @@ public struct T3ConnectView: View {
}
} else {
ZStack {
T3Colors.background.ignoresSafeArea()
T3Colors.background.ignoresSafeArea()
ProgressView()
.tint(T3Colors.textPrimary)
.tint(T3Colors.textPrimary)
}
}
}
@@ -95,7 +95,7 @@ public struct T3ConnectView: View {
}
.listStyle(.plain)
.scrollContentBackground(.hidden)
.background(T3Colors.background)
.background(T3Colors.background)
}
@ViewBuilder
@@ -113,9 +113,9 @@ public struct T3ConnectView: View {
.environment(clerk)
} else {
ZStack {
T3Colors.background.ignoresSafeArea()
T3Colors.background.ignoresSafeArea()
ProgressView()
.tint(T3Colors.textPrimary)
.tint(T3Colors.textPrimary)
}
}
}
@@ -148,7 +148,7 @@ public struct T3ConnectView: View {
.foregroundStyle(T3Colors.textTertiary)
}
.padding(.vertical, 8)
.listRowBackground(T3Colors.background)
.listRowBackground(T3Colors.background)
}
}
@@ -167,7 +167,7 @@ public struct T3ConnectView: View {
}
}
.padding(.vertical, 3)
.listRowBackground(T3Colors.background)
.listRowBackground(T3Colors.background)
}
}
@@ -182,12 +182,12 @@ public struct T3ConnectView: View {
.foregroundStyle(T3Colors.textSecondary)
}
.padding(.vertical, 8)
.listRowBackground(T3Colors.background)
.listRowBackground(T3Colors.background)
}
ForEach(controller.environments) { item in
environmentRow(item)
.listRowBackground(T3Colors.background)
.listRowBackground(T3Colors.background)
.swipeActions {
Button(role: .destructive) {
Task { await controller.unlink(item.environment) }
@@ -204,7 +204,7 @@ public struct T3ConnectView: View {
.font(T3Typography.supporting)
.foregroundStyle(T3Colors.textSecondary)
}
.listRowBackground(T3Colors.background)
.listRowBackground(T3Colors.background)
}
}
}
@@ -219,7 +219,7 @@ public struct T3ConnectView: View {
VStack(alignment: .leading, spacing: 3) {
Text(item.environment.label)
.font(T3Typography.homeTitle)
.foregroundStyle(T3Colors.textPrimary)
.foregroundStyle(T3Colors.textPrimary)
.lineLimit(1)
Text(statusText(item))
.font(T3Typography.supporting)
@@ -371,9 +371,9 @@ private struct T3ConnectAuthenticationView: View {
HStack(spacing: 10) {
Text("T3")
.font(.system(size: 14, weight: .heavy, design: .rounded))
.foregroundStyle(T3Colors.primaryActionForeground)
.foregroundStyle(T3Colors.primaryActionForeground)
.frame(width: 32, height: 32)
.background(T3Colors.primaryAction)
.background(T3Colors.primaryAction)
.clipShape(RoundedRectangle(cornerRadius: 8, style: .continuous))
Text("T3 Connect")
@@ -388,7 +388,7 @@ private struct T3ConnectAuthenticationView: View {
if clerk.environment == nil {
HStack(spacing: 10) {
ProgressView()
.tint(T3Colors.textPrimary)
.tint(T3Colors.textPrimary)
Text("Loading sign-in options…")
.font(T3Typography.control)
.foregroundStyle(T3Colors.textSecondary)
@@ -528,7 +528,7 @@ private struct T3ConnectAuthProviderIcon: View {
private enum T3ConnectClerkAppearance {
static let theme = ClerkTheme(
colors: .init(
primary: T3Colors.primaryAction,
primary: T3Colors.primaryAction,
background: T3Colors.background,
input: T3Colors.input,
danger: T3Colors.danger,
@@ -536,12 +536,12 @@ private enum T3ConnectClerkAppearance {
warning: T3Colors.warning,
foreground: T3Colors.textPrimary,
mutedForeground: T3Colors.textSecondary,
primaryForeground: T3Colors.primaryActionForeground,
primaryForeground: T3Colors.primaryActionForeground,
inputForeground: T3Colors.textPrimary,
neutral: T3Colors.textPrimary,
ring: T3Colors.textPrimary,
neutral: T3Colors.textPrimary,
ring: T3Colors.textPrimary,
muted: T3Colors.surfaceRaised,
shadow: T3Colors.border,
shadow: T3Colors.border,
border: T3Colors.border
),
design: .init(borderRadius: 12)
@@ -45,7 +45,7 @@ public struct DevicesView: View {
}
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(T3Colors.background)
.background(T3Colors.background)
.navigationTitle("Devices")
.navigationBarTitleDisplayMode(.inline)
.toolbar {
@@ -143,7 +143,7 @@ public struct DevicesView: View {
}
.listStyle(.plain)
.scrollContentBackground(.hidden)
.background(T3Colors.background)
.background(T3Colors.background)
.refreshable {
await reload()
}
@@ -13,7 +13,7 @@ public struct FeatureFilesView: View {
public var body: some View {
FeatureFileDirectoryView(client: client, threadID: threadID, path: nil, title: "Files")
.background(T3Colors.background)
.background(T3Colors.background)
}
}
@@ -59,7 +59,7 @@ private struct FeatureFileDirectoryView: View {
.refreshable { await load() }
}
}
.background(T3Colors.background)
.background(T3Colors.background)
.navigationTitle(title)
.navigationBarTitleDisplayMode(.inline)
.searchable(text: $searchText, prompt: "Filter files")
@@ -208,7 +208,7 @@ private struct FeatureFilePreviewView: View {
)
}
}
.background(T3Colors.background)
.background(T3Colors.background)
.navigationTitle(entry.name)
.navigationBarTitleDisplayMode(.inline)
.toolbar {
@@ -332,7 +332,7 @@ private struct FeatureSourceTextView: View {
.textSelection(.enabled)
}
}
.background(T3Colors.background)
.background(T3Colors.background)
.accessibilityLabel("Source file")
}
}
@@ -356,10 +356,10 @@ private struct FeatureHighlightedSourceLine: View {
switch kind {
case .plain: T3Colors.textPrimary.opacity(0.92)
case .comment: T3Colors.textTertiary
case .keyword: T3Colors.syntaxKeyword
case .literal: T3Colors.syntaxLiteral
case .number: T3Colors.syntaxNumber
case .property: T3Colors.syntaxProperty
case .keyword: T3Colors.syntaxKeyword
case .literal: T3Colors.syntaxLiteral
case .number: T3Colors.syntaxNumber
case .property: T3Colors.syntaxProperty
}
}
}
@@ -30,7 +30,7 @@ public struct FeatureReviewView: View {
)
}
}
.background(T3Colors.background)
.background(T3Colors.background)
.navigationTitle("Review")
.navigationBarTitleDisplayMode(.inline)
.toolbar {
@@ -239,7 +239,7 @@ private struct FeatureDiffView: View {
}
}
}
.background(T3Colors.background)
.background(T3Colors.background)
.navigationTitle(file.path.split(separator: "/").last.map(String.init) ?? file.path)
.navigationBarTitleDisplayMode(.inline)
.toolbar {
@@ -41,9 +41,9 @@ public struct FeatureRootView: View {
ConnectionOnboardingView(model: model)
}
}
.preferredColorScheme(preferredColorScheme)
.tint(T3Colors.accent)
.background(T3Colors.background.ignoresSafeArea())
.preferredColorScheme(preferredColorScheme)
.tint(T3Colors.accent)
.background(T3Colors.background.ignoresSafeArea())
.task { await model.start() }
.alert(
"Something went wrong",
@@ -70,13 +70,13 @@ public struct FeatureRootView: View {
)
}
private var preferredColorScheme: ColorScheme? {
switch model.snapshot.settings.appearance {
case .system: nil
case .light: .light
case .dark: .dark
private var preferredColorScheme: ColorScheme? {
switch model.snapshot.settings.appearance {
case .system: nil
case .light: .light
case .dark: .dark
}
}
}
}
enum FeatureRootPresentation {
@@ -104,7 +104,7 @@ private struct FeatureLoadingView: View {
.foregroundStyle(T3Colors.textSecondary)
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(T3Colors.background)
.background(T3Colors.background)
.accessibilityElement(children: .combine)
}
}
@@ -25,7 +25,7 @@ public struct SettingsView: View {
aboutSection
}
.scrollContentBackground(.hidden)
.background(T3Colors.background)
.background(T3Colors.background)
.navigationTitle("Settings")
.navigationBarTitleDisplayMode(.inline)
.toolbar {
@@ -229,7 +229,7 @@ public struct SettingsView: View {
Section("Preferences") {
Picker("Theme", selection: $settings.appearance) {
Text("System").tag(FeatureAppearance.system)
Text("Light").tag(FeatureAppearance.light)
Text("Light").tag(FeatureAppearance.light)
Text("Dark").tag(FeatureAppearance.dark)
}
Toggle("Haptics", isOn: $settings.hapticsEnabled)
@@ -701,7 +701,7 @@ public struct FeatureSelection: Sendable, Equatable, Hashable, Codable {
public enum FeatureAppearance: String, CaseIterable, Sendable, Codable {
case system
case light
case light
case dark
}
@@ -713,7 +713,7 @@ public struct FeatureSettings: Sendable, Equatable, Codable {
public var defaultSelection: FeatureSelection?
public init(
appearance: FeatureAppearance = .system,
appearance: FeatureAppearance = .system,
hapticsEnabled: Bool = true,
notificationsEnabled: Bool = true,
liveActivitiesEnabled: Bool = true,
@@ -36,7 +36,7 @@ public struct FeatureSourceControlView: View {
)
}
}
.background(T3Colors.background)
.background(T3Colors.background)
.navigationTitle("Source Control")
.navigationBarTitleDisplayMode(.inline)
.toolbar {
@@ -80,7 +80,7 @@ public struct FeatureTerminalView: View {
public var body: some View {
ZStack {
T3Colors.background
T3Colors.background
GhosttyTerminalSurface(
terminalKey: "\(threadID):\(activeTerminalID)",
@@ -106,15 +106,15 @@ public struct FeatureTerminalView: View {
if isLoading, terminal == nil {
ProgressView("Opening terminal…")
.tint(T3Colors.textPrimary)
.foregroundStyle(T3Colors.textPrimary)
.tint(T3Colors.textPrimary)
.foregroundStyle(T3Colors.textPrimary)
} else if let errorMessage, terminal == nil {
ContentUnavailableView(
"Terminal unavailable",
systemImage: "terminal",
description: Text(errorMessage)
)
.foregroundStyle(T3Colors.textPrimary)
.foregroundStyle(T3Colors.textPrimary)
}
if let errorMessage, terminal != nil {
@@ -133,7 +133,7 @@ public struct FeatureTerminalView: View {
terminalHeader
}
.background(T3Colors.background.ignoresSafeArea())
.background(T3Colors.background.ignoresSafeArea())
.toolbar(.hidden, for: .navigationBar)
.task {
for await updates in client.terminalSessions(threadID: threadID) {
@@ -186,7 +186,7 @@ public struct FeatureTerminalView: View {
ZStack {
Text("Terminal")
.font(T3Typography.navigationTitle)
.foregroundStyle(T3Colors.textPrimary)
.foregroundStyle(T3Colors.textPrimary)
HStack {
Button {
@@ -195,7 +195,7 @@ public struct FeatureTerminalView: View {
Image(systemName: "xmark")
.frame(width: 44, height: 44)
}
.foregroundStyle(T3Colors.textPrimary)
.foregroundStyle(T3Colors.textPrimary)
.accessibilityLabel("Close terminal")
Spacer()
@@ -205,7 +205,7 @@ public struct FeatureTerminalView: View {
}
}
.frame(height: 48)
.background(T3Colors.background)
.background(T3Colors.background)
Spacer(minLength: 0)
}
@@ -4,7 +4,7 @@ import SwiftUI
import UIKit
struct GhosttyTerminalSurface: UIViewRepresentable {
@SwiftUI.Environment(\.colorScheme) private var colorScheme
@SwiftUI.Environment(\.colorScheme) private var colorScheme
let terminalKey: String
let buffer: String
let fontSize: CGFloat
@@ -26,7 +26,7 @@ struct GhosttyTerminalSurface: UIViewRepresentable {
}
private func configure(_ view: GhosttyTerminalView) {
view.isDarkMode = colorScheme == .dark
view.isDarkMode = colorScheme == .dark
view.onInput = onInput
view.onResize = onResize
view.onClear = onClear
@@ -298,13 +298,13 @@ private final class TerminalAccessoryView: UIInputView {
private let stackView = UIStackView()
private let dismissButton = TerminalAccessoryButton(action: .dismiss)
private var actionButtons = [TerminalAccessoryAction: TerminalAccessoryButton]()
private var activeModifier: TerminalAccessoryAction?
private var activeModifier: TerminalAccessoryAction?
var onAction: ((TerminalAccessoryAction) -> Void)?
init() {
super.init(frame: CGRect(x: 0, y: 0, width: 0, height: 50), inputViewStyle: .keyboard)
allowsSelfSizing = true
backgroundColor = T3Colors.uiBackground
backgroundColor = T3Colors.uiBackground
scrollView.showsHorizontalScrollIndicator = false
scrollView.alwaysBounceHorizontal = true
@@ -349,11 +349,11 @@ private final class TerminalAccessoryView: UIInputView {
stackView.bottomAnchor.constraint(equalTo: scrollView.contentLayoutGuide.bottomAnchor),
stackView.heightAnchor.constraint(equalTo: scrollView.frameLayoutGuide.heightAnchor),
])
refreshAppearance()
registerForTraitChanges([UITraitUserInterfaceStyle.self]) {
(self: Self, _: UITraitCollection) in
self.refreshAppearance()
}
refreshAppearance()
registerForTraitChanges([UITraitUserInterfaceStyle.self]) {
(self: Self, _: UITraitCollection) in
self.refreshAppearance()
}
}
@available(*, unavailable)
@@ -366,25 +366,25 @@ private final class TerminalAccessoryView: UIInputView {
}
func setActiveModifier(_ action: TerminalAccessoryAction?) {
activeModifier = action
activeModifier = action
for modifier in [TerminalAccessoryAction.command, .control] {
guard let button = actionButtons[modifier] else { continue }
applyStyle(to: button, active: modifier == action)
}
}
func refreshAppearance() {
backgroundColor = T3Colors.uiBackground
for (action, button) in actionButtons {
applyStyle(to: button, active: action == activeModifier)
}
func refreshAppearance() {
backgroundColor = T3Colors.uiBackground
for (action, button) in actionButtons {
applyStyle(to: button, active: action == activeModifier)
}
var dismissConfiguration = UIButton.Configuration.plain()
dismissConfiguration.image = UIImage(systemName: "keyboard.chevron.compact.down")
dismissConfiguration.baseForegroundColor = .secondaryLabel
dismissConfiguration.contentInsets = .zero
dismissButton.configuration = dismissConfiguration
}
var dismissConfiguration = UIButton.Configuration.plain()
dismissConfiguration.image = UIImage(systemName: "keyboard.chevron.compact.down")
dismissConfiguration.baseForegroundColor = .secondaryLabel
dismissConfiguration.contentInsets = .zero
dismissButton.configuration = dismissConfiguration
}
private func configure(_ button: TerminalAccessoryButton, label: String) {
button.setTitle(label.uppercased(), for: .normal)
@@ -441,7 +441,7 @@ private final class TerminalAccessoryView: UIInputView {
final class GhosttyTerminalView: UIView, UITextFieldDelegate, UIContextMenuInteractionDelegate {
private static let minimumVerticalScrollStepPoints: CGFloat = 18
private static let verticalScrollStepMultiplier: CGFloat = 1.15
private static let darkThemeConfig = """
private static let darkThemeConfig = """
background = #0a0a0a
foreground = #adadb1
cursor-color = #009fff
@@ -464,7 +464,7 @@ final class GhosttyTerminalView: UIView, UITextFieldDelegate, UIContextMenuInter
palette = 14=#08c0ef
palette = 15=#c6c6c8
"""
private static let lightThemeConfig = """
private static let lightThemeConfig = """
background = #f2f2f7
foreground = #6c6c71
cursor-color = #009fff
@@ -493,13 +493,13 @@ final class GhosttyTerminalView: UIView, UITextFieldDelegate, UIContextMenuInter
var onClear: (() -> Void)?
var onFontSizeStep: ((Int) -> Void)?
var isDarkMode = true {
didSet {
guard oldValue != isDarkMode else { return }
applyChromeAppearance()
refreshSurface()
var isDarkMode = true {
didSet {
guard oldValue != isDarkMode else { return }
applyChromeAppearance()
refreshSurface()
}
}
}
var terminalKey = "" {
didSet {
@@ -644,7 +644,7 @@ final class GhosttyTerminalView: UIView, UITextFieldDelegate, UIContextMenuInter
keyboardButton.widthAnchor.constraint(equalToConstant: 48),
keyboardButton.heightAnchor.constraint(equalToConstant: 48),
])
applyChromeAppearance()
applyChromeAppearance()
}
@available(*, unavailable)
@@ -766,12 +766,12 @@ final class GhosttyTerminalView: UIView, UITextFieldDelegate, UIContextMenuInter
app = createdApp
surface = createdSurface
let ghosttyColorScheme =
isDarkMode
? GHOSTTY_COLOR_SCHEME_DARK
: GHOSTTY_COLOR_SCHEME_LIGHT
ghostty_app_set_color_scheme(createdApp, ghosttyColorScheme)
ghostty_surface_set_color_scheme(createdSurface, ghosttyColorScheme)
let ghosttyColorScheme =
isDarkMode
? GHOSTTY_COLOR_SCHEME_DARK
: GHOSTTY_COLOR_SCHEME_LIGHT
ghostty_app_set_color_scheme(createdApp, ghosttyColorScheme)
ghostty_surface_set_color_scheme(createdSurface, ghosttyColorScheme)
setupWriteCallback()
resizeSurface()
feedBuffer(buffer)
@@ -787,29 +787,29 @@ final class GhosttyTerminalView: UIView, UITextFieldDelegate, UIContextMenuInter
setNeedsLayout()
}
private func applyChromeAppearance() {
let background =
isDarkMode
? UIColor(red: 10 / 255, green: 10 / 255, blue: 10 / 255, alpha: 1)
: UIColor(red: 242 / 255, green: 242 / 255, blue: 247 / 255, alpha: 1)
backgroundColor = background
terminalViewport.backgroundColor = background
accessoryView.overrideUserInterfaceStyle = isDarkMode ? .dark : .light
accessoryView.refreshAppearance()
private func applyChromeAppearance() {
let background =
isDarkMode
? UIColor(red: 10 / 255, green: 10 / 255, blue: 10 / 255, alpha: 1)
: UIColor(red: 242 / 255, green: 242 / 255, blue: 247 / 255, alpha: 1)
backgroundColor = background
terminalViewport.backgroundColor = background
accessoryView.overrideUserInterfaceStyle = isDarkMode ? .dark : .light
accessoryView.refreshAppearance()
var keyboardConfiguration = UIButton.Configuration.filled()
keyboardConfiguration.image = UIImage(systemName: "keyboard")
keyboardConfiguration.baseForegroundColor = isDarkMode ? .white : T3Colors.uiTextPrimary
keyboardConfiguration.baseBackgroundColor =
isDarkMode ? UIColor(white: 0.10, alpha: 0.96) : .white
keyboardConfiguration.background.cornerRadius = 24
keyboardConfiguration.background.strokeColor =
isDarkMode
? UIColor(white: 0.25, alpha: 1)
: UIColor(white: 0, alpha: 0.10)
keyboardConfiguration.background.strokeWidth = 1
keyboardButton.configuration = keyboardConfiguration
}
var keyboardConfiguration = UIButton.Configuration.filled()
keyboardConfiguration.image = UIImage(systemName: "keyboard")
keyboardConfiguration.baseForegroundColor = isDarkMode ? .white : T3Colors.uiTextPrimary
keyboardConfiguration.baseBackgroundColor =
isDarkMode ? UIColor(white: 0.10, alpha: 0.96) : .white
keyboardConfiguration.background.cornerRadius = 24
keyboardConfiguration.background.strokeColor =
isDarkMode
? UIColor(white: 0.25, alpha: 1)
: UIColor(white: 0, alpha: 0.10)
keyboardConfiguration.background.strokeWidth = 1
keyboardButton.configuration = keyboardConfiguration
}
private func refreshSurface() {
resetSurface()
@@ -998,9 +998,9 @@ final class GhosttyTerminalView: UIView, UITextFieldDelegate, UIContextMenuInter
let url = FileManager.default.temporaryDirectory
.appendingPathComponent("t3-swiftui-terminal.ghostty")
do {
let themeConfig = isDarkMode ? Self.darkThemeConfig : Self.lightThemeConfig
if (try? String(contentsOf: url, encoding: .utf8)) != themeConfig {
try themeConfig.write(to: url, atomically: true, encoding: .utf8)
let themeConfig = isDarkMode ? Self.darkThemeConfig : Self.lightThemeConfig
if (try? String(contentsOf: url, encoding: .utf8)) != themeConfig {
try themeConfig.write(to: url, atomically: true, encoding: .utf8)
}
url.path.withCString { ghostty_config_load_file(config, $0) }
} catch {
@@ -30,7 +30,7 @@ struct HomeThreadCollectionView: UIViewRepresentable {
func makeUIView(context: Context) -> UICollectionView {
var configuration = UICollectionLayoutListConfiguration(appearance: .plain)
configuration.backgroundColor = T3Colors.uiBackground
configuration.backgroundColor = T3Colors.uiBackground
configuration.showsSeparators = false
configuration.headerMode = .none
configuration.footerMode = .none
@@ -42,7 +42,7 @@ struct HomeThreadCollectionView: UIViewRepresentable {
frame: .zero,
collectionViewLayout: UICollectionViewCompositionalLayout.list(using: configuration)
)
collectionView.backgroundColor = T3Colors.uiBackground
collectionView.backgroundColor = T3Colors.uiBackground
collectionView.alwaysBounceVertical = true
collectionView.keyboardDismissMode = .interactive
collectionView.contentInset = UIEdgeInsets(top: 4, left: 0, bottom: 74, right: 0)
@@ -252,7 +252,7 @@ struct HomeThreadCollectionView: UIViewRepresentable {
cell.backgroundConfiguration = UIBackgroundConfiguration.clear()
cell.accessories = []
cell.tintColor = T3Colors.uiTextPrimary
cell.tintColor = T3Colors.uiTextPrimary
cell.contentView.accessibilityElementsHidden = true
configureAccessibility(cell, item: item)
}
@@ -246,8 +246,8 @@ public struct NewThreadView: View {
}
}
.buttonStyle(.borderedProminent)
.tint(T3Colors.primaryAction)
.foregroundStyle(T3Colors.primaryActionForeground)
.tint(T3Colors.primaryAction)
.foregroundStyle(T3Colors.primaryActionForeground)
.padding(.top, 6)
}
.padding(.horizontal, 28)
@@ -531,16 +531,16 @@ public struct AddProjectView: View {
HStack(spacing: 8) {
if isSubmitting {
ProgressView()
.tint(T3Colors.primaryActionForeground)
.tint(T3Colors.primaryActionForeground)
} else {
Image(systemName: icon)
}
Text(isSubmitting ? "Working…" : label)
}
.font(.body.weight(.semibold))
.foregroundStyle(T3Colors.primaryActionForeground)
.foregroundStyle(T3Colors.primaryActionForeground)
.frame(maxWidth: .infinity, minHeight: 48)
.background(T3Colors.primaryAction, in: RoundedRectangle(cornerRadius: 12))
.background(T3Colors.primaryAction, in: RoundedRectangle(cornerRadius: 12))
}
.buttonStyle(.plain)
.disabled(isSubmitting)
@@ -281,8 +281,8 @@ public struct WorkspaceView: View {
.foregroundStyle(T3Colors.textSecondary)
Button("New task", action: openNewTaskOrProjectCreation)
.buttonStyle(.borderedProminent)
.tint(T3Colors.primaryAction)
.foregroundStyle(T3Colors.primaryActionForeground)
.tint(T3Colors.primaryAction)
.foregroundStyle(T3Colors.primaryActionForeground)
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(T3Colors.background)
@@ -464,10 +464,10 @@ public struct WorkspaceView: View {
} label: {
Image(systemName: "square.and.pencil")
.font(.system(size: 20, weight: .medium))
.foregroundStyle(T3Colors.primaryActionForeground)
.foregroundStyle(T3Colors.primaryActionForeground)
.frame(width: 52, height: 52)
.background(T3Colors.primaryAction, in: Circle())
.shadow(color: T3Colors.shadow, radius: 16, y: 8)
.background(T3Colors.primaryAction, in: Circle())
.shadow(color: T3Colors.shadow, radius: 16, y: 8)
}
.buttonStyle(.plain)
.accessibilityLabel("New task")
@@ -513,7 +513,7 @@ public struct WorkspaceView: View {
.font(.system(size: 8, weight: .bold))
}
.font(T3Typography.homeMetadata.weight(.semibold))
.foregroundStyle(T3Colors.textSecondary)
.foregroundStyle(T3Colors.textSecondary)
.frame(maxWidth: .infinity, minHeight: 40, alignment: .leading)
.contentShape(Rectangle())
}
@@ -905,7 +905,7 @@ struct FeatureThreadRow: View, Equatable {
ProjectBadge(name: context.projectName)
Text(context.projectName)
.lineLimit(1)
.foregroundStyle(T3Colors.textSecondary)
.foregroundStyle(T3Colors.textSecondary)
Spacer(minLength: 8)
status(at: now)
}
@@ -927,7 +927,7 @@ struct FeatureThreadRow: View, Equatable {
if context.providerLooksTerminal {
Text(">_")
.font(.system(size: 9.5, weight: .bold, design: .monospaced))
.foregroundStyle(T3Colors.syntaxProperty)
.foregroundStyle(T3Colors.syntaxProperty)
}
Spacer(minLength: 8)
if let environmentLabel {
@@ -955,7 +955,7 @@ struct FeatureThreadRow: View, Equatable {
.padding(.vertical, 8)
.frame(minHeight: 88)
.background(
isSelected ? T3Colors.subtleStrong : Color.clear,
isSelected ? T3Colors.subtleStrong : Color.clear,
in: RoundedRectangle(cornerRadius: 8)
)
.padding(.horizontal, 8)
@@ -985,7 +985,7 @@ struct FeatureThreadRow: View, Equatable {
.frame(minHeight: 44)
.padding(.horizontal, 8)
.background(
isSelected ? T3Colors.subtleStrong : Color.clear,
isSelected ? T3Colors.subtleStrong : Color.clear,
in: RoundedRectangle(cornerRadius: 7)
)
}
@@ -1021,12 +1021,12 @@ struct FeatureThreadRow: View, Equatable {
private var statusColor: Color {
switch thread.homeStatus {
case .working: T3Colors.statusRunning
case .approval: T3Colors.warning
case .input: T3Colors.statusInput
case .working: T3Colors.statusRunning
case .approval: T3Colors.warning
case .input: T3Colors.statusInput
case .failed: T3Colors.danger
case .done: T3Colors.success
case .ready: T3Colors.textTertiary
case .done: T3Colors.success
case .ready: T3Colors.textTertiary
}
}
@@ -1048,7 +1048,7 @@ struct FeatureThreadRow: View, Equatable {
case .disconnected:
T3Colors.danger.opacity(0.78)
case .connected, nil:
T3Colors.textTertiary
T3Colors.textTertiary
}
}
@@ -4,19 +4,19 @@ import Testing
@Suite("Agent awareness projection")
struct PlatformAgentAwarenessTests {
@Test
func settingsDefaultToSystemAppearanceAndRoundTripLightMode() throws {
#expect(FeatureSettings().appearance == .system)
@Test
func settingsDefaultToSystemAppearanceAndRoundTripLightMode() throws {
#expect(FeatureSettings().appearance == .system)
var settings = FeatureSettings()
settings.appearance = .light
let roundTrip = try JSONDecoder.t3.decode(
FeatureSettings.self,
from: JSONEncoder.t3.encode(settings)
)
var settings = FeatureSettings()
settings.appearance = .light
let roundTrip = try JSONDecoder.t3.decode(
FeatureSettings.self,
from: JSONEncoder.t3.encode(settings)
)
#expect(roundTrip.appearance == .light)
}
#expect(roundTrip.appearance == .light)
}
@Test
func legacySettingsEnableLiveActivitiesWithoutResettingOtherPreferences() throws {