refactor: simplify dashboard ops signals
This commit is contained in:
+6
-9
@@ -23,7 +23,8 @@ import './i18n';
|
||||
|
||||
const { Sider, Content } = Layout;
|
||||
const { useToken } = theme;
|
||||
const DEFAULT_CHAT_FONT_FAMILY = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif';
|
||||
const DEFAULT_FONT_FAMILY = '"Google Sans", "Product Sans", "SF Pro Display", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif';
|
||||
const DEFAULT_CHAT_FONT_FAMILY = DEFAULT_FONT_FAMILY;
|
||||
|
||||
/** Show the main window (it starts hidden to avoid white flash). */
|
||||
async function showWindow() {
|
||||
@@ -241,13 +242,9 @@ function AppRoot() {
|
||||
useEffect(() => {
|
||||
const root = document.documentElement;
|
||||
root.style.setProperty('--font-weight', String(fontWeight));
|
||||
if (fontFamily) {
|
||||
root.style.setProperty('--font-family', fontFamily);
|
||||
document.body.style.fontFamily = fontFamily;
|
||||
} else {
|
||||
root.style.removeProperty('--font-family');
|
||||
document.body.style.removeProperty('font-family');
|
||||
}
|
||||
const resolvedFontFamily = fontFamily || DEFAULT_FONT_FAMILY;
|
||||
root.style.setProperty('--font-family', resolvedFontFamily);
|
||||
document.body.style.fontFamily = resolvedFontFamily;
|
||||
if (codeFontFamily) {
|
||||
root.style.setProperty('--code-font-family', codeFontFamily);
|
||||
} else {
|
||||
@@ -259,7 +256,7 @@ function AppRoot() {
|
||||
root.style.setProperty('--chat-font-weight', String(chatFontWeight ?? 400));
|
||||
}, [fontWeight, fontFamily, codeFontFamily, chatFontSize, chatLineHeight, chatFontFamily, chatFontWeight]);
|
||||
|
||||
const themeConfig = useShadcnTheme(isDark, primaryColor, fontSize, borderRadius, fontFamily || undefined, codeFontFamily || undefined);
|
||||
const themeConfig = useShadcnTheme(isDark, primaryColor, fontSize, borderRadius, fontFamily || DEFAULT_FONT_FAMILY, codeFontFamily || undefined);
|
||||
|
||||
return (
|
||||
<ConfigProvider
|
||||
|
||||
@@ -36,7 +36,7 @@ export const CodeBlockPreviewModal: React.FC<Props> = ({ payload, open, onClose
|
||||
color: ${fg};
|
||||
}
|
||||
body {
|
||||
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text', ui-sans-serif, sans-serif;
|
||||
font-family: var(--font-family, 'Google Sans', 'Product Sans', 'SF Pro Display', 'PingFang SC', 'Noto Sans SC', 'Microsoft YaHei', 'Segoe UI', Roboto, sans-serif);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
--color-primary: #1677ff;
|
||||
--color-fill-alter: rgba(0, 0, 0, 0.02);
|
||||
--font-size-base: 14px;
|
||||
--font-family: 'Google Sans', 'Product Sans', 'SF Pro Display', 'PingFang SC', 'Noto Sans SC', 'Microsoft YaHei', 'Segoe UI', Roboto, sans-serif;
|
||||
--chat-font-family: var(--font-family);
|
||||
}
|
||||
|
||||
html,
|
||||
@@ -24,6 +26,7 @@ body,
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: var(--font-family);
|
||||
font-weight: var(--font-weight, 400);
|
||||
user-select: none;
|
||||
-webkit-user-select: none;
|
||||
|
||||
Reference in New Issue
Block a user