Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.
Python agentagent-osaiai-agentsai-partnerchatopsclaudeclaude-codecodexdevtoolsdiscord-botlark-botllmlocal-firstlong-term-memoryopencodeslack-botvibe-codingvibeywechat
fix(ui): add chat message font size setting
cyhccf31da7eb2a
diff --git a/config/v2_config.py b/config/v2_config.pyindex 8d5cafdd4..99cc55118 100644--- a/config/v2_config.py+++ b/config/v2_config.py@@ -25,6 +25,9 @@ CONFIG_LOCK = threading.RLock()DEFAULT_AGENT_IDLE_TIMEOUT_SECONDS = 600DEFAULT_OPENCODE_ERROR_RETRY_LIMIT = 1+DEFAULT_CHAT_MESSAGE_FONT_SIZE_PX = 14+MIN_CHAT_MESSAGE_FONT_SIZE_PX = 12+MAX_CHAT_MESSAGE_FONT_SIZE_PX = 20def _filter_dataclass_fields(dc_class, payload: dict) -> dict:@@ -238,6 +241,7 @@ class UiConfig:setup_host: str = "127.0.0.1"setup_port: int = 5123open_browser: bool = True+ chat_message_font_size: int = DEFAULT_CHAT_MESSAGE_FONT_SIZE_PX@dataclass@@ -454,6 +458,13 @@ class V2Config:if not isinstance(ui_payload, dict):raise ValueError("Config 'ui' must be an object")ui = UiConfig(**_filter_dataclass_fields(UiConfig, ui_payload))+ try:+ ui.chat_message_font_size = max(+ MIN_CHAT_MESSAGE_FONT_SIZE_PX,+ min(MAX_CHAT_MESSAGE_FONT_SIZE_PX, int(ui.chat_message_font_size)),+ )+ except (TypeError, ValueError):+ ui.chat_message_font_size = DEFAULT_CHAT_MESSAGE_FONT_SIZE_PXremote_access_payload = payload.get("remote_access") or {}if not isinstance(remote_access_payload, dict):diff --git a/tests/test_v2_config_platform_registry.py b/tests/test_v2_config_platform_registry.pyindex 3ec425372..a2cbca50f 100644--- a/tests/test_v2_config_platform_registry.py+++ b/tests/test_v2_config_platform_registry.py@@ -88,6 +88,21 @@ def test_config_payload_includes_platform_catalog_and_setup_state() -> None:]assert payload["setup_state"]["configured_platforms"] == ["slack", "discord", "telegram", "lark", "wechat"]assert payload["setup_state"]["needs_setup"] is False+ assert payload["ui"]["chat_message_font_size"] == 14+++def test_chat_message_font_size_is_clamped() -> None:+ payload = api.config_to_payload(_base_config())+ payload["ui"]["chat_message_font_size"] = 99++ config = V2Config.from_payload(payload)++ assert config.ui.chat_message_font_size == 20++ payload["ui"]["chat_message_font_size"] = "bad"+ config = V2Config.from_payload(payload)++ assert config.ui.chat_message_font_size == 14def test_config_payload_includes_vibe_cloud_remote_access() -> None:diff --git a/ui/src/components/settings/SettingsMessagingPage.tsx b/ui/src/components/settings/SettingsMessagingPage.tsxindex fd525beb1..ad99ef5c3 100644--- a/ui/src/components/settings/SettingsMessagingPage.tsx+++ b/ui/src/components/settings/SettingsMessagingPage.tsx@@ -1,5 +1,5 @@import React, { useEffect, useMemo, useState } from 'react';-import { ArrowRight, Bot, HelpCircle, MessageSquare, Radio, Send, Sparkles } from 'lucide-react';+import { ArrowRight, Bot, HelpCircle, MessageSquare, Radio, Send, Sparkles, Type } from 'lucide-react';import { Link } from 'react-router-dom';import { useTranslation } from 'react-i18next';import clsx from 'clsx';@@ -18,6 +18,12 @@ import {SettingsRow,ToggleSwitch,} from './SettingsPrimitives';+import {+ DEFAULT_CHAT_MESSAGE_FONT_SIZE,+ MAX_CHAT_MESSAGE_FONT_SIZE,+ MIN_CHAT_MESSAGE_FONT_SIZE,+ normalizeChatMessageFontSize,+} from '@/lib/chatDisplay';const SAVE_KEYS = ['platforms',@@ -34,6 +40,7 @@ const SAVE_KEYS = ['lark','wechat','agents',+ 'ui',] as const;function buildMessagePatch(config: any) {@@ -65,11 +72,17 @@ export const SettingsMessagingPage: React.FC = () => {const [config, setConfig] = useState<any>(null);const [saveError, setSaveError] = useState<string | null>(null);const [savedAt, setSavedAt] = useState<number | null>(null);+ const [chatFontDraft, setChatFontDraft] = useState('');useEffect(() => {api.getConfig().then(setConfig).catch(() => {});}, [api]);+ useEffect(() => {+ if (!config) return;+ setChatFontDraft(String(normalizeChatMessageFontSize(config.ui?.chat_message_font_size)));+ }, [config?.ui?.chat_message_font_size]);+const enabledPlatforms = useMemo(() => getEnabledPlatforms(config), [config]);const slackSupportsLinkUnfurl = enabledPlatforms.includes('slack');const reactionSupported = enabledPlatforms.some((platform) =>@@ -113,6 +126,50 @@ export const SettingsMessagingPage: React.FC = () => {const vibeCloud = config.remote_access?.vibe_cloud || {};const vibeCloudPaired = Boolean(vibeCloud.enabled && vibeCloud.instance_id);const audioAsrEnabled = vibeCloudPaired && audioAsr.enabled !== false;+ const chatMessageFontSize = normalizeChatMessageFontSize(config.ui?.chat_message_font_size);+ const saveChatMessageFontSize = (fontSize: number) => {+ void persist({+ ...config,+ ui: {+ ...(config.ui || {}),+ chat_message_font_size: fontSize,+ },+ });+ };+ const updateChatFontDraft = (rawValue: string) => {+ setChatFontDraft(rawValue);++ const numericValue = Number(rawValue);+ if (+ !rawValue.trim() ||+ !Number.isFinite(numericValue) ||+ numericValue < MIN_CHAT_MESSAGE_FONT_SIZE ||+ numericValue > MAX_CHAT_MESSAGE_FONT_SIZE+ ) {+ return;+ }++ const nextFontSize = normalizeChatMessageFontSize(numericValue);+ if (nextFontSize !== chatMessageFontSize) {+ saveChatMessageFontSize(nextFontSize);+ }+ };+ const commitChatFontDraft = () => {+ const rawValue = chatFontDraft.trim();+ if (!rawValue) {+ setChatFontDraft(String(DEFAULT_CHAT_MESSAGE_FONT_SIZE));+ if (chatMessageFontSize !== DEFAULT_CHAT_MESSAGE_FONT_SIZE) {+ saveChatMessageFontSize(DEFAULT_CHAT_MESSAGE_FONT_SIZE);+ }+ return;+ }++ const nextFontSize = normalizeChatMessageFontSize(rawValue);+ setChatFontDraft(String(nextFontSize));+ if (nextFontSize !== chatMessageFontSize) {+ saveChatMessageFontSize(nextFontSize);+ }+ };return (<SettingsPageShell@@ -366,6 +423,42 @@ export const SettingsMessagingPage: React.FC = () => {)}</SettingsPanel>+ <SettingsPanel+ title={+ <span className="inline-flex items-center gap-2">+ <Type className="size-3.5 text-mint" />+ {t('settings.messagingDisplayTitle')}+ </span>+ }+ description={t('settings.messagingDisplayDescription')}+ >+ <SettingsRow+ title={t('dashboard.chatMessageFontSize')}+ description={t('dashboard.chatMessageFontSizeHint')}+ control={+ <div className="flex items-center gap-2">+ <CompactField+ type="number"+ min={MIN_CHAT_MESSAGE_FONT_SIZE}+ max={MAX_CHAT_MESSAGE_FONT_SIZE}+ step={1}+ inputMode="numeric"+ value={chatFontDraft}+ onChange={(event) => updateChatFontDraft(event.target.value)}+ onBlur={commitChatFontDraft}+ onKeyDown={(event) => {+ if (event.key === 'Enter') {+ event.currentTarget.blur();+ }+ }}+ className="w-20 text-center font-mono"+ />+ <span className="font-mono text-[11px] text-muted">px</span>+ </div>+ }+ />+ </SettingsPanel>+<SettingsPaneltitle={<span className="inline-flex items-center gap-2">diff --git a/ui/src/components/workbench/ChatPage.tsx b/ui/src/components/workbench/ChatPage.tsxindex 0162bb6cc..52bcb4b66 100644--- a/ui/src/components/workbench/ChatPage.tsx+++ b/ui/src/components/workbench/ChatPage.tsx@@ -8,6 +8,7 @@ import { useApi } from '../../context/ApiContext';import { useWorkbenchInbox } from '../../context/WorkbenchInboxContext';import type { VibeAgentBrief, WorkbenchMessage, WorkbenchSession } from '../../context/ApiContext';import { apiFetch } from '../../lib/apiFetch';+import { normalizeChatMessageFontSize } from '../../lib/chatDisplay';import { useIosKeyboardInset } from '../../lib/useIosKeyboardInset';import { isProxyMediaUrl } from '../../lib/mediaProxy';import { formatLocalDateTime } from '../../lib/relativeTime';@@ -106,6 +107,7 @@ export const ChatPage: React.FC = () => {const [agents, setAgents] = useState<VibeAgentBrief[]>([]);const [defaultAgentName, setDefaultAgentName] = useState<string | null>(null);const [messages, setMessages] = useState<WorkbenchMessage[]>([]);+ const [messageFontSize, setMessageFontSize] = useState(() => normalizeChatMessageFontSize(undefined));const [loading, setLoading] = useState(true);const [error, setError] = useState<string | null>(null);@@ -292,9 +294,10 @@ export const ChatPage: React.FC = () => {setLoading(true);setError(null);try {- const [fetched, agentList, msgs, queued, draft, turnState] = await Promise.all([+ const [fetched, agentList, config, msgs, queued, draft, turnState] = await Promise.all([api.getSession(sessionId),api.listVibeAgents({ includeDisabled: false }),+ api.getConfig().catch(() => null),// Recent window (tail), so opening a long chat shows the latest// conversation, not its oldest page (Codex P2).api.listSessionMessages(sessionId, { limit: 50, tail: true }),@@ -307,6 +310,7 @@ export const ChatPage: React.FC = () => {setSession(fetched);setAgents(agentList.agents);setDefaultAgentName(agentList.default_agent_name);+ setMessageFontSize(normalizeChatMessageFontSize(config?.ui?.chat_message_font_size));// Merge (not replace) so a row that arrived over the stream during the// load isn't clobbered; the session-change reset keeps prior sessions out.setMessages((prev) => mergeById(msgs.messages, prev));@@ -773,7 +777,13 @@ export const ChatPage: React.FC = () => {</div>)}- <Transcript messages={messages} session={session} working={working} onQuickReply={handleQuickReply} />+ <Transcript+ messages={messages}+ session={session}+ working={working}+ messageFontSize={messageFontSize}+ onQuickReply={handleQuickReply}+ /><QueueStrip queue={queue} onRemove={removeQueued} onSendNow={sendQueueNow} />{/* key by session so the composer remounts per session — its draft-seeding+ local value reset, instead of carrying across sessions (Codex P2). */}@@ -997,10 +1007,11 @@ interface TranscriptProps {messages: WorkbenchMessage[];session: WorkbenchSession;working: boolean;+ messageFontSize: number;onQuickReply: (messageId: string, choice: string) => boolean | void | Promise<boolean | void>;}-const Transcript: React.FC<TranscriptProps> = ({ messages, session, working, onQuickReply }) => {+const Transcript: React.FC<TranscriptProps> = ({ messages, session, working, messageFontSize, onQuickReply }) => {const { t } = useTranslation();const scrollRef = useRef<HTMLDivElement | null>(null);const contentRef = useRef<HTMLDivElement | null>(null);@@ -1137,7 +1148,13 @@ const Transcript: React.FC<TranscriptProps> = ({ messages, session, working, onQ<div ref={scrollRef} onScroll={handleScroll} className="min-h-0 flex-1 overflow-y-auto px-4 py-5 [overflow-anchor:none] md:px-8"><div ref={contentRef} className="mx-auto flex w-full max-w-[1080px] flex-col gap-3">{messages.map((message) => (- <MessageRow key={message.id} message={message} session={session} onQuickReply={onQuickReply} />+ <MessageRow+ key={message.id}+ message={message}+ session={session}+ messageFontSize={messageFontSize}+ onQuickReply={onQuickReply}+ />))}{showThinking && <ThinkingBubble session={session} />}</div>@@ -1221,8 +1238,9 @@ const harnessLabel = (kind: string | null | undefined, t: (k: string) => string)const MessageRow: React.FC<{message: WorkbenchMessage;session: WorkbenchSession;+ messageFontSize: number;onQuickReply?: (messageId: string, choice: string) => boolean | void | Promise<boolean | void>;-}> = ({ message, session, onQuickReply }) => {+}> = ({ message, session, messageFontSize, onQuickReply }) => {const { t } = useTranslation();// Harness rows are collapsed by default; this tracks the per-row expand state.const [expanded, setExpanded] = useState(false);@@ -1236,6 +1254,7 @@ const MessageRow: React.FC<{// task / watch / webhook); collapsed by default so it doesn't dominate.const isHarness = !isNotify && !isAgent && !isSystem && message.source === 'harness';const isUser = !isNotify && !isAgent && !isSystem && !isHarness;+ const messageFontStyle = { fontSize: `${normalizeChatMessageFontSize(messageFontSize)}px` };// User-uploaded attachments ride in ``content.attachments`` (agent-reply media// is rewritten inline into the text instead, handled by the Markdown renderer).@@ -1296,7 +1315,7 @@ const MessageRow: React.FC<{) : (// Keep the user's own newlines visible (soft-break → <br>); agent/system// replies are authored markdown and must not get stray hard breaks.- <Markdown content={message.text} softBreaks={isUser} />+ <Markdown content={message.text} softBreaks={isUser} className="vr-markdown--inherit-size" />)) : messageAttachments.length === 0 ? (<div className="text-[13px] text-muted">—</div>@@ -1329,7 +1348,10 @@ const MessageRow: React.FC<{return (<div className="flex w-full justify-end"><div className="flex max-w-[min(92%,860px)] flex-col items-end gap-1">- <div className="w-fit min-w-0 max-w-full rounded-2xl rounded-tr-md border border-border-strong bg-foreground/[0.06] px-3.5 py-2.5 text-[13px] leading-relaxed [&_pre]:max-w-full [&_pre]:overflow-x-auto [&_table]:w-full">+ <div+ className="w-fit min-w-0 max-w-full rounded-2xl rounded-tr-md border border-border-strong bg-foreground/[0.06] px-3.5 py-2.5 leading-relaxed [&_pre]:max-w-full [&_pre]:overflow-x-auto [&_table]:w-full"+ style={messageFontStyle}+ >{bodyNode}{attachmentsNode}</div>@@ -1384,9 +1406,10 @@ const MessageRow: React.FC<{</div><divclassName={clsx(- 'w-fit min-w-0 max-w-full rounded-2xl rounded-tl-md border px-3.5 py-2.5 text-[13px] leading-relaxed [&_pre]:max-w-full [&_pre]:overflow-x-auto [&_table]:w-full',+ 'w-fit min-w-0 max-w-full rounded-2xl rounded-tl-md border px-3.5 py-2.5 leading-relaxed [&_pre]:max-w-full [&_pre]:overflow-x-auto [&_table]:w-full',isAgent ? 'border-mint/25 bg-mint/[0.09]' : 'border-border bg-foreground/[0.03]',)}+ style={messageFontStyle}>{bodyNode}{attachmentsNode}diff --git a/ui/src/components/workbench/InboxPage.tsx b/ui/src/components/workbench/InboxPage.tsxindex f08e8c779..cca522bb0 100644--- a/ui/src/components/workbench/InboxPage.tsx+++ b/ui/src/components/workbench/InboxPage.tsx@@ -210,23 +210,23 @@ export const InboxPage: React.FC = () => {onClick={() => openSession(s)}className="inline-flex items-center gap-1.5 rounded-md border border-mint/30 bg-mint/[0.06] px-3 py-1.5 text-[11px] font-semibold text-mint transition hover:bg-mint/[0.12]">+ {unread > 0 && (+ <span className="inline-flex min-w-[1.1rem] items-center justify-center rounded-full bg-mint px-1.5 font-mono text-[9px] font-bold text-[#080812]">+ {unread > 99 ? '99+' : unread}+ </span>+ )}{t('workbench.inbox.openSession')}<ArrowRight className="size-3" /></button>{unread > 0 && (- <>- <span className="inline-flex min-w-[1.1rem] items-center justify-center rounded-full bg-mint px-1.5 font-mono text-[9px] font-bold text-[#080812]">- {unread > 99 ? '99+' : unread}- </span>- <button- type="button"- onClick={() => markRead(s.session_id)}- className="inline-flex items-center gap-1.5 rounded-md border border-border-strong px-3 py-1.5 text-[11px] font-medium text-foreground transition hover:bg-foreground/[0.04]"- >- <CheckCheck className="size-3" />- {t('workbench.inbox.markRead')}- </button>- </>+ <button+ type="button"+ onClick={() => markRead(s.session_id)}+ className="inline-flex items-center gap-1.5 rounded-md border border-border-strong px-3 py-1.5 text-[11px] font-medium text-foreground transition hover:bg-foreground/[0.04]"+ >+ <CheckCheck className="size-3" />+ {t('workbench.inbox.markRead')}+ </button>)}</div></article>diff --git a/ui/src/i18n/en.json b/ui/src/i18n/en.jsonindex 61311ef9b..aa1c9b4dd 100644--- a/ui/src/i18n/en.json+++ b/ui/src/i18n/en.json@@ -412,6 +412,8 @@"messagingWorkFeedbackDescription": "How Vibe Remote acknowledges, retries, and reports running work.","messagingReplyExperienceTitle": "Reply experience","messagingReplyExperienceDescription": "Controls for messages Vibe Remote sends back into chat.",+ "messagingDisplayTitle": "Chat display",+ "messagingDisplayDescription": "Tune how conversations are rendered in the Web UI.","messagingGroupsTitle": "Groups and routing","messagingGroupsDescription": "Jump to group allow-list and per-group backend routing.","messagingGroupsHint": "Manage which groups are allowed and how each one routes to an agent backend.",@@ -1201,6 +1203,8 @@"replyEnhancementsHint": "Allow agents to add clickable quick-reply buttons at the end of result messages","showPagesPrompt": "Show Page Guidance","showPagesPromptHint": "Tell agents when and how to use visual Show Pages. The vibe show CLI remains available when this is off.",+ "chatMessageFontSize": "Chat Message Font Size",+ "chatMessageFontSizeHint": "Font size for user and agent message bubbles in the Web UI chat","slackLinkPreviews": "Suppress Slack Link Previews","slackLinkPreviewsHint": "Disable Slack URL and media preview cards for messages sent by Vibe Remote","allowedChannels": "Allowed Groups",diff --git a/ui/src/i18n/zh.json b/ui/src/i18n/zh.jsonindex db61ed7ac..98d878609 100644--- a/ui/src/i18n/zh.json+++ b/ui/src/i18n/zh.json@@ -412,6 +412,8 @@"messagingWorkFeedbackDescription": "配置 Vibe Remote 如何确认、重试和展示运行中的工作。","messagingReplyExperienceTitle": "回复体验","messagingReplyExperienceDescription": "控制 Vibe Remote 发回聊天里的消息体验。",+ "messagingDisplayTitle": "聊天显示",+ "messagingDisplayDescription": "调整 Web UI 中对话内容的显示方式。","messagingGroupsTitle": "群组与路由","messagingGroupsDescription": "进入群组允许列表和按群组 backend 路由配置。","messagingGroupsHint": "前往群组页,管理允许工作的群组以及每个群组分别路由到哪个 agent backend。",@@ -1201,6 +1203,8 @@"replyEnhancementsHint": "允许 Agent 在结果消息末尾添加可点击的快捷回复按钮","showPagesPrompt": "Show Page 引导","showPagesPromptHint": "提示 Agent 何时以及如何使用可视化 Show Page。关闭后 vibe show CLI 仍然可用。",+ "chatMessageFontSize": "聊天消息字号",+ "chatMessageFontSizeHint": "Web UI 聊天页里用户和 Agent 消息气泡的文字大小","slackLinkPreviews": "关闭 Slack 链接预览","slackLinkPreviewsHint": "关闭 Vibe Remote 发送到 Slack 的 URL 和媒体预览卡片","allowedChannels": "允许的群组",diff --git a/ui/src/index.css b/ui/src/index.cssindex f5204e442..43a6bd1cb 100644--- a/ui/src/index.css+++ b/ui/src/index.css@@ -450,6 +450,7 @@ pre,color: var(--foreground);word-break: break-word;}+.vr-markdown--inherit-size { font-size: inherit; }.vr-markdown > :first-child { margin-top: 0; }.vr-markdown > :last-child { margin-bottom: 0; }.vr-markdown p { margin: 0 0 0.6em; }diff --git a/ui/src/lib/chatDisplay.ts b/ui/src/lib/chatDisplay.tsnew file mode 100644index 000000000..db19cf704--- /dev/null+++ b/ui/src/lib/chatDisplay.ts@@ -0,0 +1,12 @@+export const DEFAULT_CHAT_MESSAGE_FONT_SIZE = 14;+export const MIN_CHAT_MESSAGE_FONT_SIZE = 12;+export const MAX_CHAT_MESSAGE_FONT_SIZE = 20;++export function normalizeChatMessageFontSize(value: unknown): number {+ const numeric = typeof value === 'number' ? value : Number(value);+ if (!Number.isFinite(numeric)) return DEFAULT_CHAT_MESSAGE_FONT_SIZE;+ return Math.max(+ MIN_CHAT_MESSAGE_FONT_SIZE,+ Math.min(MAX_CHAT_MESSAGE_FONT_SIZE, Math.round(numeric)),+ );+}