Skip to content

Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.

feat(macos): add conversation text size preference

Sean Ferguson82718a818933
diff --git a/apps/macos/App/CodyncMacApp.swift b/apps/macos/App/CodyncMacApp.swift
index 48e256c3..32993b4b 100644
--- a/apps/macos/App/CodyncMacApp.swift
+++ b/apps/macos/App/CodyncMacApp.swift
@@ -10,6 +10,8 @@ struct CodyncMacApp: App {
@State private var host: HostController
@State private var account: AccountSession
@Environment(\.openWindow) private var openWindow
+ @AppStorage(ConversationTypography.preferenceKey)
+ private var conversationFontSize = ConversationTypography.defaultSize
init() {
let account = AccountSession()
@@ -29,6 +31,7 @@ struct CodyncMacApp: App {
// First scene: the one SwiftUI opens at launch and when the Dock icon is clicked.
Window("Codync", id: "chat") {
ChatWindow()
+ .environment(\.conversationTypography, ConversationTypography(pointSize: conversationFontSize))
.task { launch() }
.modalHost()
.environment(host)
@@ -83,6 +86,8 @@ struct MenuView: View {
@Environment(\.openWindow) private var openWindow
@AppStorage(SharedStore.usageIconStyleKey, store: UserDefaults(suiteName: SharedStore.appGroup))
private var usageIconStyle = UsageIconStyle.character.rawValue
+ @AppStorage(ConversationTypography.preferenceKey)
+ private var conversationFontSize = ConversationTypography.defaultSize
var body: some View {
Text(status)
@@ -103,6 +108,12 @@ struct MenuView: View {
Text("Character").tag(UsageIconStyle.character.rawValue)
Text("Original").tag(UsageIconStyle.original.rawValue)
}
+ Picker("Text Size", selection: $conversationFontSize) {
+ ForEach(ConversationTypography.sizes, id: \.self) { size in
+ Text(size == ConversationTypography.defaultSize ? "\(Int(size)) pt (Default)" : "\(Int(size)) pt")
+ .tag(size)
+ }
+ }
Toggle("Open at login", isOn: Binding(
get: { host.launchAtLogin },
set: { host.setLaunchAtLogin($0) }
diff --git a/kit/Sources/CodyncUI/Thread/ChatRows.swift b/kit/Sources/CodyncUI/Thread/ChatRows.swift
index 41997740..aaae419d 100644
--- a/kit/Sources/CodyncUI/Thread/ChatRows.swift
+++ b/kit/Sources/CodyncUI/Thread/ChatRows.swift
@@ -128,6 +128,7 @@ struct UserBubble: View {
let botWorking: Bool
var reply: (() -> Void)?
@Environment(BotStore.self) private var model
+ @Environment(\.conversationTypography) private var typography
@State private var hovering = false
var body: some View {
@@ -155,7 +156,7 @@ struct UserBubble: View {
private var text: some View {
Text(entry.data.text ?? "")
- .font(InterfaceMetrics.body)
+ .font(typography.body)
.foregroundStyle(Palette.text)
.textSelection(.enabled)
.padding(.horizontal, InterfaceMetrics.value(mac: 12, mobile: 16))
diff --git a/kit/Sources/CodyncUI/Thread/Composer.swift b/kit/Sources/CodyncUI/Thread/Composer.swift
index 10ce3eef..f5a268e0 100644
--- a/kit/Sources/CodyncUI/Thread/Composer.swift
+++ b/kit/Sources/CodyncUI/Thread/Composer.swift
@@ -15,6 +15,7 @@ struct Composer: View {
var onInterrupt: (() -> Void)?
@Environment(BotStore.self) private var model
@Environment(\.accessibilityReduceMotion) private var reduceMotion
+ @Environment(\.conversationTypography) private var typography
@State private var draft = ""
/// Files going out with the next message.
@State private var files: [OutgoingFile] = []
@@ -96,6 +97,13 @@ struct Composer: View {
private var fieldPadding: CGFloat { InterfaceMetrics.value(mac: 7, mobile: 10) }
private var buttonSize: CGFloat { InterfaceMetrics.value(mac: 28, mobile: 34) }
+ private var textLineHeight: CGFloat {
+ #if os(macOS)
+ ceil(typography.pointSize * 1.25)
+ #else
+ lineHeight
+ #endif
+ }
private var field: some View {
HStack(alignment: .bottom, spacing: 8) {
@@ -154,7 +162,7 @@ struct Composer: View {
HStack(alignment: .bottom, spacing: 8) {
TextField(placeholder, text: $draft, axis: .vertical)
.lineLimit(1...8)
- .font(InterfaceMetrics.body)
+ .font(typography.body)
.textFieldStyle(.plain)
.focused($focused)
.padding(.vertical, fieldPadding)
@@ -212,7 +220,7 @@ struct Composer: View {
}
}
.animation(Motion.layout, value: onInterrupt != nil)
- .padding(.bottom, max(0, (lineHeight + 2 * fieldPadding - buttonSize) / 2))
+ .padding(.bottom, max(0, (textLineHeight + 2 * fieldPadding - buttonSize) / 2))
.animation(Motion.layout, value: isEmpty)
}
.padding(.leading, InterfaceMetrics.value(mac: 14, mobile: 18))
diff --git a/kit/Sources/CodyncUI/Thread/ConversationTypography.swift b/kit/Sources/CodyncUI/Thread/ConversationTypography.swift
new file mode 100644
index 00000000..e333baf3
--- /dev/null
+++ b/kit/Sources/CodyncUI/Thread/ConversationTypography.swift
@@ -0,0 +1,50 @@
+import SwiftUI
+
+/// Conversation text can grow on the Mac without resizing the app's controls.
+public struct ConversationTypography: Sendable {
+ public static let preferenceKey = "conversationFontSize"
+ public static let defaultSize = 12.0
+ public static let sizes: [Double] = [11, 12, 13, 14, 15, 16, 18]
+
+ public let pointSize: Double
+
+ public init(pointSize: Double = ConversationTypography.defaultSize) {
+ self.pointSize = pointSize.isFinite ? min(max(pointSize, 11), 18) : Self.defaultSize
+ }
+
+ var body: Font {
+ #if os(macOS)
+ .system(size: pointSize)
+ #else
+ .body
+ #endif
+ }
+
+ func heading(level: Int) -> Font {
+ #if os(macOS)
+ .system(size: level == 1 ? pointSize + 3 : level == 2 ? pointSize + 1 : pointSize - 1,
+ weight: level == 2 ? .semibold : .bold)
+ #else
+ level == 1 ? .title3.bold() : level == 2 ? .headline : .subheadline.bold()
+ #endif
+ }
+
+ var code: Font {
+ #if os(macOS)
+ .system(size: pointSize - 2, design: .monospaced)
+ #else
+ .system(.footnote, design: .monospaced)
+ #endif
+ }
+}
+
+private struct ConversationTypographyKey: EnvironmentKey {
+ static let defaultValue = ConversationTypography()
+}
+
+public extension EnvironmentValues {
+ var conversationTypography: ConversationTypography {
+ get { self[ConversationTypographyKey.self] }
+ set { self[ConversationTypographyKey.self] = newValue }
+ }
+}
diff --git a/kit/Sources/CodyncUI/Thread/MarkdownText.swift b/kit/Sources/CodyncUI/Thread/MarkdownText.swift
index 58dd9d8f..43edfb2b 100644
--- a/kit/Sources/CodyncUI/Thread/MarkdownText.swift
+++ b/kit/Sources/CodyncUI/Thread/MarkdownText.swift
@@ -7,6 +7,7 @@ public struct MarkdownText: View {
let blocks: [Block]
let streaming: Bool
@Environment(\.accessibilityReduceMotion) private var reduceMotion
+ @Environment(\.conversationTypography) private var typography
private var contentTransition: ContentTransition {
streaming && !reduceMotion ? .interpolate : .identity
@@ -42,13 +43,13 @@ public struct MarkdownText: View {
switch block {
case let .paragraph(t):
Text(Self.inline(t))
- .font(InterfaceMetrics.body)
+ .font(typography.body)
.foregroundStyle(Palette.text)
.contentTransition(contentTransition)
.animation(textAnimation, value: t)
case let .heading(t, level):
Text(Self.inline(t))
- .font(level == 1 ? .title3.bold() : level == 2 ? .headline : .subheadline.bold())
+ .font(typography.heading(level: level))
.foregroundStyle(Palette.text)
.contentTransition(contentTransition)
.animation(textAnimation, value: t)
@@ -60,10 +61,10 @@ public struct MarkdownText: View {
.contentTransition(contentTransition)
.animation(textAnimation, value: t)
}
- .font(InterfaceMetrics.body)
+ .font(typography.body)
case let .quote(t):
Text(Self.inline(t))
- .font(InterfaceMetrics.body)
+ .font(typography.body)
.foregroundStyle(Palette.secondary)
.contentTransition(contentTransition)
.animation(textAnimation, value: t)
@@ -72,7 +73,7 @@ public struct MarkdownText: View {
case let .code(t, _):
ScrollView(.horizontal, showsIndicators: false) {
Text(t)
- .font(.system(.footnote, design: .monospaced))
+ .font(typography.code)
.foregroundStyle(Palette.text)
.padding(10)
}
diff --git a/kit/Sources/CodyncUI/Thread/ThreadView.swift b/kit/Sources/CodyncUI/Thread/ThreadView.swift
index 2be87151..495c6cbe 100644
--- a/kit/Sources/CodyncUI/Thread/ThreadView.swift
+++ b/kit/Sources/CodyncUI/Thread/ThreadView.swift
@@ -33,6 +33,9 @@ public struct ThreadView: View {
@State private var routineRequest = UUID()
@State private var isAtBottom = true
@Environment(\.accessibilityReduceMotion) private var reduceMotion
+ #if os(macOS)
+ @Environment(\.conversationTypography) private var typography
+ #endif
private var bot: Bot? { model.bots[botId] }
@@ -151,6 +154,12 @@ public struct ThreadView: View {
proxy.scrollTo("bottom", anchor: .bottom)
}
}
+ #if os(macOS)
+ .onChange(of: typography.pointSize) { _, _ in
+ guard isAtBottom else { return }
+ proxy.scrollTo("bottom", anchor: .bottom)
+ }
+ #endif
}
.background(Palette.background)
.safeAreaInset(edge: .bottom) {