\s*$/.test(text);
+ }
+
+ function hasAgentMessageBoundaryAtStart(text) {
+ return /^\s*(?:---|\*\*\*|___)\s*\n/.test(text)
+ || /^\s*
\s*/.test(text);
+ }
+
function itemKind(item) {
switch (item?.type) {
case 'commandExecution':
@@ -263,8 +283,8 @@ function createCodexAppRuntime(deps = {}) {
if (entry.agentMessageItems?.get(itemId)) return '';
const currentText = entry.fullText || '';
if (!/\S/.test(currentText)) return '';
- const hasVisualBoundary = /\n\s*(?:---|\*\*\*|___)\s*$/.test(currentText) || /^\s*(?:---|\*\*\*|___)\s*\n/.test(String(nextText || ''));
- return hasVisualBoundary ? '' : '\n\n---\n\n';
+ const hasVisualBoundary = hasAgentMessageBoundaryAtEnd(currentText) || hasAgentMessageBoundaryAtStart(String(nextText || ''));
+ return hasVisualBoundary ? '' : `\n\n${createAgentMessageDivider()}\n\n`;
}
function updateToolResult(entry, sessionId, itemId, result, done = false, patch = {}) {
diff --git a/public/app.js b/public/app.js
index 854c372..a3b7d0e 100644
--- a/public/app.js
+++ b/public/app.js
@@ -2,10 +2,11 @@
(function () {
'use strict';
- const ASSET_VERSION = '20260613-codexapp-tools2';
+ const ASSET_VERSION = '20260614-divider-time-selectfix';
const WS_URL = `${location.protocol === 'https:' ? 'wss' : 'ws'}://${location.host}/ws`;
const RENDER_DEBOUNCE = 100;
const COMPOSER_SUGGESTION_DEBOUNCE = 120;
+ const DIVIDER_TIME_STORAGE_KEY = 'cc-web-show-divider-time';
const SLASH_COMMANDS = [
{ cmd: '/clear', desc: '清除当前会话' },
@@ -73,6 +74,42 @@
desc: '更明亮的留白和更克制的棕色强调,像编辑台一样安静。',
swatches: ['#f6f1e8', '#efe8dc', '#8b5e3c', '#2f4b45'],
},
+ {
+ value: 'sage',
+ label: 'Sage Console',
+ desc: '清透鼠尾草绿与石墨文字,适合长时间工作流。',
+ swatches: ['#f5f8f2', '#e6efdf', '#2f6f64', '#557ba3'],
+ },
+ {
+ value: 'ink',
+ label: 'Ink Focus',
+ desc: '浅灰纸面配靛蓝重点,信息密度更高也更冷静。',
+ swatches: ['#f6f7fb', '#e8edf5', '#3f5fb5', '#3f8f73'],
+ },
+ {
+ value: 'dawn',
+ label: 'Dawn Studio',
+ desc: '晨光米白配珊瑚红,保留温度但比暖纸更轻。',
+ swatches: ['#fff7f2', '#f3e8e1', '#b5524d', '#4f8a6b'],
+ },
+ {
+ value: 'carbon',
+ label: 'Carbon Mint',
+ desc: '石墨黑底配薄荷绿重点,夜间使用更稳。',
+ swatches: ['#0f1314', '#202829', '#67d8b2', '#9fb7ff'],
+ },
+ {
+ value: 'nocturne',
+ label: 'Nocturne Teal',
+ desc: '深海青黑配电光蓝,适合高专注会话。',
+ swatches: ['#081417', '#142b31', '#5ecdf5', '#f0c36a'],
+ },
+ {
+ value: 'cinder',
+ label: 'Cinder Rose',
+ desc: '炭黑底配低饱和玫瑰色,暗色里保留一点温度。',
+ swatches: ['#151112', '#2a2022', '#e68193', '#67c587'],
+ },
];
// --- State ---
@@ -98,6 +135,7 @@
let currentModel = 'opus';
let currentAgent = AGENT_LABELS[localStorage.getItem('cc-web-agent')] ? localStorage.getItem('cc-web-agent') : DEFAULT_AGENT;
let currentTheme = (document.documentElement.dataset.theme || localStorage.getItem('cc-web-theme') || 'washi');
+ let showAgentDividerTime = localStorage.getItem(DIVIDER_TIME_STORAGE_KEY) !== '0';
let codexConfigCache = null;
let loadedHistorySessionId = null;
let activeSessionLoad = null;
@@ -123,6 +161,7 @@
let noteDraftSeq = 0;
const pendingNotesByTarget = new Map();
const userMessageIndex = new Map();
+ document.documentElement.dataset.dividerTime = showAgentDividerTime ? 'show' : 'hide';
// --- DOM ---
const $ = (sel) => document.querySelector(sel);
@@ -447,6 +486,26 @@
refreshThemeSummaries();
}
+ function getDividerTimeSummary() {
+ return showAgentDividerTime ? '显示时间' : '不显示时间';
+ }
+
+ function refreshDividerTimeControls(root = document) {
+ root.querySelectorAll('[data-divider-time-summary]').forEach((node) => {
+ node.textContent = getDividerTimeSummary();
+ });
+ root.querySelectorAll('[data-divider-time-toggle]').forEach((node) => {
+ node.checked = showAgentDividerTime;
+ });
+ }
+
+ function applyDividerTimePreference(visible) {
+ showAgentDividerTime = !!visible;
+ document.documentElement.dataset.dividerTime = showAgentDividerTime ? 'show' : 'hide';
+ localStorage.setItem(DIVIDER_TIME_STORAGE_KEY, showAgentDividerTime ? '1' : '0');
+ refreshDividerTimeControls();
+ }
+
function buildThemePickerHtml(options = {}) {
const { showSectionTitle = true } = options;
return `
@@ -476,7 +535,7 @@
});
}
- function buildThemeEntryHtml() {
+ function buildAppearanceSettingsHtml() {
return `
外观
+
`;
}
+ function mountAppearanceSettings(panel) {
+ const themePageBtn = panel.querySelector('[data-open-theme-page]');
+ if (themePageBtn) themePageBtn.addEventListener('click', openThemeSubpage);
+ const dividerTimeToggle = panel.querySelector('[data-divider-time-toggle]');
+ if (dividerTimeToggle) {
+ dividerTimeToggle.checked = showAgentDividerTime;
+ dividerTimeToggle.addEventListener('change', () => {
+ applyDividerTimePreference(dividerTimeToggle.checked);
+ });
+ }
+ refreshDividerTimeControls(panel);
+ }
+
function buildNotifyEntryHtml(config) {
const provider = config?.provider || 'off';
const providerLabel = PROVIDER_OPTIONS.find(o => o.value === provider)?.label || '关闭';
@@ -4319,7 +4403,7 @@
${title}
${escapeHtml(options.message || '')}
-
+
`;
@@ -4355,7 +4439,7 @@
box.innerHTML = `
${escapeHtml(getDeleteConfirmMessage(agent))}
-
+
@@ -4588,7 +4672,7 @@
if (!currentSessionId || chatTitle.contentEditable === 'true') return;
const originalText = chatTitle.textContent;
chatTitle.contentEditable = 'true';
- chatTitle.style.background = '#fff';
+ chatTitle.style.background = 'var(--surface-strong)';
chatTitle.style.outline = '1px solid var(--accent)';
chatTitle.style.borderRadius = '6px';
chatTitle.style.padding = '2px 8px';
@@ -5647,7 +5731,7 @@
- ${buildThemeEntryHtml()}
+ ${buildAppearanceSettingsHtml()}
@@ -5665,8 +5749,7 @@
overlay.appendChild(panel);
document.body.appendChild(overlay);
- const themePageBtn = panel.querySelector('[data-open-theme-page]');
- if (themePageBtn) themePageBtn.addEventListener('click', openThemeSubpage);
+ mountAppearanceSettings(panel);
const notifyPageBtn = panel.querySelector('[data-open-notify-page]');
if (notifyPageBtn) notifyPageBtn.addEventListener('click', openNotifySubpage);
@@ -5934,7 +6017,7 @@
- ${buildThemeEntryHtml()}
+ ${buildAppearanceSettingsHtml()}
@@ -5952,8 +6035,7 @@
overlay.appendChild(panel);
document.body.appendChild(overlay);
- const themePageBtn = panel.querySelector('[data-open-theme-page]');
- if (themePageBtn) themePageBtn.addEventListener('click', openThemeSubpage);
+ mountAppearanceSettings(panel);
const notifyPageBtn2 = panel.querySelector('[data-open-notify-page]');
if (notifyPageBtn2) notifyPageBtn2.addEventListener('click', openNotifySubpage);
diff --git a/public/index.html b/public/index.html
index 307f961..ee8585a 100644
--- a/public/index.html
+++ b/public/index.html
@@ -9,10 +9,12 @@
-
+
@@ -147,6 +149,6 @@
-
+