diff --git a/AGENTS.md b/AGENTS.md index bd803054..373c92a1 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -611,15 +611,16 @@ Location: `/sessions/-- chars.txt <<'EOF' -import sys -chars = set() -for hi in range(0xA1, 0xF8): - for lo in range(0xA1, 0xFF): - try: - chars.add(bytes([hi, lo]).decode("gb2312")) - except UnicodeDecodeError: - pass -for a, b in [(0x3000, 0x303F), (0x3040, 0x30FF), (0xFF00, 0xFFEF)]: - chars.update(chr(c) for c in range(a, b + 1)) -sys.stdout.write("".join(sorted(chars))) -EOF -fonttools varLib.instancer NotoSerifSC-VF.otf wght=600:700 -o NotoSerifSC-600-700.otf -pyftsubset NotoSerifSC-600-700.otf --text-file=chars.txt --layout-features='*' \ - --flavor=woff2 --output-file=NotoSerifSC-Subset.woff2 -``` diff --git a/app/fonts/NotoSerifSC-Subset.woff2 b/app/fonts/NotoSerifSC-Subset.woff2 deleted file mode 100644 index 49cc922f..00000000 Binary files a/app/fonts/NotoSerifSC-Subset.woff2 and /dev/null differ diff --git a/app/fonts/SourceSerif4-OFL.txt b/app/fonts/SourceSerif4-OFL.txt deleted file mode 100644 index 046fc664..00000000 --- a/app/fonts/SourceSerif4-OFL.txt +++ /dev/null @@ -1,93 +0,0 @@ -Google Inc. - -This Font Software is licensed under the SIL Open Font License, Version 1.1. -This license is copied below, and is also available with a FAQ at: -http://scripts.sil.org/OFL - - ------------------------------------------------------------ -SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 ------------------------------------------------------------ - -PREAMBLE -The goals of the Open Font License (OFL) are to stimulate worldwide -development of collaborative font projects, to support the font creation -efforts of academic and linguistic communities, and to provide a free and -open framework in which fonts may be shared and improved in partnership -with others. - -The OFL allows the licensed fonts to be used, studied, modified and -redistributed freely as long as they are not sold by themselves. The -fonts, including any derivative works, can be bundled, embedded, -redistributed and/or sold with any software provided that any reserved -names are not used by derivative works. The fonts and derivatives, -however, cannot be released under any other type of license. The -requirement for fonts to remain under this license does not apply -to any document created using the fonts or their derivatives. - -DEFINITIONS -"Font Software" refers to the set of files released by the Copyright -Holder(s) under this license and clearly marked as such. This may -include source files, build scripts and documentation. - -"Reserved Font Name" refers to any names specified as such after the -copyright statement(s). - -"Original Version" refers to the collection of Font Software components as -distributed by the Copyright Holder(s). - -"Modified Version" refers to any derivative made by adding to, deleting, -or substituting -- in part or in whole -- any of the components of the -Original Version, by changing formats or by porting the Font Software to a -new environment. - -"Author" refers to any designer, engineer, programmer, technical -writer or other person who contributed to the Font Software. - -PERMISSION & CONDITIONS -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Font Software, to use, study, copy, merge, embed, modify, -redistribute, and sell modified and unmodified copies of the Font -Software, subject to the following conditions: - -1) Neither the Font Software nor any of its individual components, -in Original or Modified Versions, may be sold by itself. - -2) Original or Modified Versions of the Font Software may be bundled, -redistributed and/or sold with any software, provided that each copy -contains the above copyright notice and this license. These can be -included either as stand-alone text files, human-readable headers or -in the appropriate machine-readable metadata fields within text or -binary files as long as those fields can be easily viewed by the user. - -3) No Modified Version of the Font Software may use the Reserved Font -Name(s) unless explicit written permission is granted by the corresponding -Copyright Holder. This restriction only applies to the primary font name as -presented to the users. - -4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font -Software shall not be used to promote, endorse or advertise any -Modified Version, except to acknowledge the contribution(s) of the -Copyright Holder(s) and the Author(s) or with their explicit written -permission. - -5) The Font Software, modified or unmodified, in part or in whole, -must be distributed entirely under this license, and must not be -distributed under any other license. The requirement for fonts to -remain under this license does not apply to any document created -using the Font Software. - -TERMINATION -This license becomes null and void if any of the above conditions are -not met. - -DISCLAIMER -THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE -COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL -DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM -OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/app/fonts/geist-latin-wght-normal.woff2 b/app/fonts/geist-latin-wght-normal.woff2 deleted file mode 100644 index 991445d7..00000000 Binary files a/app/fonts/geist-latin-wght-normal.woff2 and /dev/null differ diff --git a/app/fonts/jetbrains-mono-latin-wght-normal.woff2 b/app/fonts/jetbrains-mono-latin-wght-normal.woff2 deleted file mode 100644 index cd5102a4..00000000 Binary files a/app/fonts/jetbrains-mono-latin-wght-normal.woff2 and /dev/null differ diff --git a/app/fonts/source-serif-4-latin-wght-normal.woff2 b/app/fonts/source-serif-4-latin-wght-normal.woff2 deleted file mode 100644 index 4c3e6b90..00000000 Binary files a/app/fonts/source-serif-4-latin-wght-normal.woff2 and /dev/null differ diff --git a/app/globals.css b/app/globals.css index cbedad35..6485bf15 100644 --- a/app/globals.css +++ b/app/globals.css @@ -69,36 +69,9 @@ font-display: swap; unicode-range: U+E000-F8FF, U+F0000-FFFFD; } -/* CJK display serif for headings, bundled instead of fetched from Google - Fonts (whose extensionless /l/font?kit= URLs crashed the font build). - A GB2312 + kana subset of Noto Serif SC, weights 600-700; unicode-range - keeps Latin-only pages from downloading it. See fonts/NotoSerifSC-README.md. */ -@font-face { - font-family: "Noto Serif SC"; - src: url("./fonts/NotoSerifSC-Subset.woff2") format("woff2"); - font-weight: 600 700; - font-display: swap; - unicode-range: U+3000-30FF, U+4E00-9FFF, U+FF00-FFEF; -} -/* Variable UI faces from @fontsource-variable (SIL OFL 1.1; licenses in fonts/*-OFL.txt), - latin subsets (plus cyrillic for Noto Sans Mono) as before. unicode-range keeps +/* The code face, Noto Sans Mono from @fontsource-variable (SIL OFL 1.1; license in + fonts/NotoSansMono-OFL.txt), latin and cyrillic subsets. unicode-range keeps cyrillic from downloading until needed. */ -@font-face { - font-family: 'Geist Variable'; - font-style: normal; - font-display: swap; - font-weight: 100 900; - src: url("./fonts/geist-latin-wght-normal.woff2") format('woff2-variations'); - unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; -} -@font-face { - font-family: 'JetBrains Mono Variable'; - font-style: normal; - font-display: swap; - font-weight: 100 800; - src: url("./fonts/jetbrains-mono-latin-wght-normal.woff2") format('woff2-variations'); - unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; -} @font-face { font-family: 'Noto Sans Mono Variable'; font-style: normal; @@ -115,32 +88,8 @@ src: url("./fonts/noto-sans-mono-latin-wght-normal.woff2") format('woff2-variations'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; } -@font-face { - font-family: 'Source Serif 4 Variable'; - font-style: normal; - font-display: swap; - font-weight: 200 900; - src: url("./fonts/source-serif-4-latin-wght-normal.woff2") format('woff2-variations'); - unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; -} /* Metric-adjusted local fallbacks, the values next/font (adjustFontFallback) generated: until a webfont swaps in, text set in the fallback takes the same space, so the swap reflows less. */ -@font-face { - font-family: "Geist Fallback"; - src: local("Arial"); - ascent-override: 95.94%; - descent-override: 28.16%; - line-gap-override: 0.00%; - size-adjust: 104.76%; -} -@font-face { - font-family: "JetBrains Mono Fallback"; - src: local("Arial"); - ascent-override: 75.79%; - descent-override: 22.29%; - line-gap-override: 0.00%; - size-adjust: 134.59%; -} @font-face { font-family: "Noto Sans Mono Fallback"; src: local("Arial"); @@ -149,19 +98,8 @@ line-gap-override: 0.00%; size-adjust: 134.59%; } -@font-face { - font-family: "Source Serif 4 Fallback"; - src: local("Times New Roman"); - ascent-override: 87.87%; - descent-override: 28.41%; - line-gap-override: 0.00%; - size-adjust: 117.91%; -} :root { - --font-geist: "Geist Variable", "Geist Fallback"; - --font-jb-mono: "JetBrains Mono Variable", "JetBrains Mono Fallback"; --font-noto-mono: "Noto Sans Mono Variable", "Noto Sans Mono Fallback"; - --font-source-serif: "Source Serif 4 Variable", "Source Serif 4 Fallback"; } @theme { --color-bg: var(--bg); @@ -182,490 +120,71 @@ --font-serif-display: var(--font-serif); } -/* Neutral palette (light): grey surfaces, blue accent. All text/background pairs verified - WCAG AA (≥4.5:1 for small text) — measured values noted per token. */ +/* Light palette, modelled on Pendant's: warm paper surfaces, a muted blue accent. All text/background + pairs verified WCAG AA (≥4.5:1 for small text) — measured values noted per token. */ :root { - --bg: #FBFBFB; - --bg-panel: #F1F1F2; - --bg-hover: #E8E8EA; - --bg-selected: #E1E3E8; - --border: #DCDDE1; - /* 15.74:1 on --bg, 14.43:1 on --bg-panel, 12.69:1 on --bg-selected */ - --text: #1F2023; - /* 6.36:1 on --bg, 5.83:1 on --bg-panel, 5.13:1 on --bg-selected */ - --text-muted: #5B5D63; - /* 5.98:1 on --bg, 5.48:1 on --bg-panel, 4.82:1 on --bg-selected */ - --text-dim: #5F6167; - /* Blue. 5.62:1 as link on --bg, 5.15:1 on --bg-panel, 4.95:1 on --user-bg, 4.53:1 on --bg-selected */ - --accent: #2B5FCC; - /* White-on-fill button: 5.81:1 (passes AA for small text) */ - --accent-strong: #2B5FCC; - --accent-hover: #234FAD; - --user-bg: #E8EDF5; - --tool-bg: #F4F4F5; - --bg-subtle: rgba(20,22,28,0.04); + --bg: #F8F5EF; + --bg-panel: #F1F0EA; + --bg-hover: #E8E7E0; + --bg-selected: #DFDED7; + --border: #D9D7CF; + /* The desktop frame the panels sit on as cards (no text on it), a shade lighter than they are. */ + --bg-frame: #FCFBF8; + /* 15.83:1 on --bg, 15.08:1 on --bg-panel, 12.77:1 on --bg-selected */ + --text: #1C1B18; + /* 6.05:1 on --bg, 5.77:1 on --bg-panel, 4.88:1 on --bg-selected */ + --text-muted: #5F5D57; + /* 5.69:1 on --bg, 5.42:1 on --bg-panel, 4.59:1 on --bg-selected */ + --text-dim: #63615B; + /* Muted blue. 6.25:1 as link on --bg, 5.95:1 on --bg-panel, 5.83:1 on --user-bg, 5.04:1 on --bg-selected */ + --accent: #3A5C8C; + /* White-on-fill button: 6.80:1 (passes AA for small text) */ + --accent-strong: #3A5C8C; + --accent-hover: #2F4C75; + --user-bg: #E9EEF4; + --tool-bg: #F3F1EC; + --bg-subtle: rgba(40,36,28,0.045); --status-error: #B42318; - --status-success: #18794E; - --status-warning: #8A5A00; - --status-modified: #A87B1F; - --status-renamed: #2563EB; + /* Status text sits on selected and hovered rows too: each is ≥4.6:1 on --bg-selected. */ + --status-success: #156B45; + --status-warning: #7A5000; + --status-modified: #80591A; + --status-renamed: #1F52C4; --on-accent: #FFFFFF; --overlay-backdrop: color-mix(in srgb, var(--text) 24%, transparent); } -/* The desktop frame the panels sit on as cards (no text on it): only the neutral light theme sets - it here, so the other themes, which inherit :root, fall back to their --bg-panel. */ -html.theme-light, html[data-theme="light"] { --bg-frame: #E4E5E8; } - -/* Midnight theme (dark). Pure-black terminal look with a magenta/cyan - dual accent, ported from https://omp.sh. Text/background pairs verified - WCAG AA (≥4.5:1 for small text) — measured values noted per token. - --text-dim is deliberately lighter than the original's faint gray (which fails - on panels) to hold AA. */ -html.midnight { - color-scheme: dark; - --bg: #000000; - --bg-panel: #0A0A0C; - --bg-hover: #141417; - --bg-selected: #1C1C21; - --border: #232329; - /* 19.26:1 on --bg, 18.14:1 on --bg-panel */ - --text: #F5F5F5; - /* 12.76:1 on --bg, 12.02:1 on --bg-panel */ - --text-muted: #C9C9D1; - /* 6.46:1 on --bg, 6.08:1 on --bg-panel */ - --text-dim: #8E8E96; - /* Magenta link accent. 6.65:1 on --bg, 6.26:1 on --bg-panel */ - --accent: #EC5BAB; - /* Deep-magenta fill. White-on-fill: 6.35:1 (passes AA for small text) */ - --accent-strong: #AD2674; - /* Link hover. 8.81:1 on --bg */ - --accent-hover: #F483BB; - /* Cyan secondary accent (focus rings, highlights). 12.76:1 on --bg */ - --accent-2: #7DD7E8; - --user-bg: #171217; - --tool-bg: #101014; - --bg-subtle: rgba(255,255,255,0.04); - --status-error: #FF9B92; - --status-success: #7DD8A8; - --status-warning: #F0C36A; - --status-modified: #E0B24D; - --status-renamed: #7CA8FF; - --on-accent: #FFFFFF; - --overlay-backdrop: color-mix(in srgb, var(--text) 24%, transparent); - --shadow-card: 0 1px 2px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.05); - --shadow-pop: 0 2px 8px rgba(0,0,0,0.65), 0 0 0 1px rgba(255,255,255,0.06); - --shadow-modal: 0 8px 32px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.07); -} - -/* Midnight dotted-grid canvas + magenta selection + cyan focus ring. */ -html.midnight body { - background: conic-gradient(rgba(255,255,255,0.03) 90deg, transparent 90deg 180deg, rgba(255,255,255,0.03) 180deg 270deg, transparent 270deg) 0 0 / 2px 2px, #000000; -} -html.midnight ::selection { - background: rgba(236,91,171,0.32); - color: var(--text); -} -html.midnight :focus-visible { - outline-color: var(--accent-2); -} - -/* Midnight type voice: Geist for UI text, JetBrains Mono for code. Scoped to - the midnight theme so the warm themes keep their system/serif identity. */ -html.midnight, -html.midnight body { - font-family: "Symbols Nerd Font Mono", var(--font-geist), ui-sans-serif, system-ui, sans-serif; -} -html.midnight { - --font-mono: "Symbols Nerd Font Mono", var(--font-jb-mono), "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace; - --font-serif: "Symbols Nerd Font Mono", var(--font-geist), ui-sans-serif, system-ui, sans-serif; -} - -/* Midnight link sweep: underline draws itself left-to-right on hover/focus. */ -html.midnight .markdown-body a { - text-decoration: none; - position: relative; -} -html.midnight .markdown-body a::after { - content: ""; - position: absolute; - left: 0; - bottom: -2px; - width: 100%; - height: 1px; - background: currentColor; - transform: scaleX(0); - transform-origin: 0; - transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1); -} -html.midnight .markdown-body a:hover::after, -html.midnight .markdown-body a:focus-visible::after { - transform: scaleX(1); -} - -/* Midnight sunray signature for the empty-state wordmark: a cyan→white sheen - that sweeps across every 9s. Static gradient text when reduced motion. */ -html.midnight .tau-wordmark { - background: linear-gradient(105deg, var(--accent-2) 38%, var(--text) 50%, var(--accent-2) 62%); - background-position: 100% 0; - background-size: 320% 100%; - -webkit-background-clip: text; - background-clip: text; - color: transparent; -} -@media (prefers-reduced-motion: no-preference) { - html.midnight .tau-wordmark { - animation: tau-sunray-sweep 9s cubic-bezier(0.4, 0, 0.2, 1) infinite; - } -} -@keyframes tau-sunray-sweep { - 0% { text-shadow: none; background-position: 100% 0; } - 8% { text-shadow: 0 0 16px color-mix(in srgb, var(--accent-2) 65%, transparent); } - 18%, to { text-shadow: none; background-position: 0 0; } -} - -/* Neutral palette (dark). Same AA verification as light. */ -html.dark:not([data-theme]):not(.midnight), +/* Dark palette, modelled on Pendant's. Same AA verification as light. */ +html.dark:not([data-theme]), html[data-theme="dark"], html.theme-dark { color-scheme: dark; - --bg: #1C1D20; - --bg-panel: #232427; - --bg-hover: #2B2D31; - --bg-selected: #33363B; - --border: #36383D; - /* 13.63:1 on --bg, 12.55:1 on --bg-panel, 9.81:1 on --bg-selected */ - --text: #E6E7EA; - /* 7.16:1 on --bg, 6.59:1 on --bg-panel, 5.15:1 on --bg-selected */ - --text-muted: #A6A9B0; - /* 6.51:1 on --bg, 6.00:1 on --bg-panel, 4.69:1 on --bg-selected */ - --text-dim: #9EA1A8; - /* Lifted blue for dark surfaces: 7.04:1 as link on --bg, 5.07:1 on --bg-selected. + --bg: #1A1C1E; + --bg-panel: #232526; + --bg-hover: #2C2E30; + --bg-selected: #363738; + --border: #38393B; + --bg-frame: #2B2D2E; + /* 14.66:1 on --bg, 13.21:1 on --bg-panel, 10.16:1 on --user-bg */ + --text: #ECEEED; + /* 7.50:1 on --bg, 6.76:1 on --bg-panel, 5.20:1 on --user-bg */ + --text-muted: #AAACAE; + /* 6.8:1 on --bg, 4.7:1 on --user-bg and --bg-selected */ + --text-dim: #A2A4A7; + /* Lifted blue for dark surfaces: 7.13:1 as link on --bg, 4.94:1 on --user-bg. As a white-text button fill it would fail AA, so filled buttons use --accent-strong. */ - --accent: #7AA8F7; - /* White-on-fill: 5.36:1 (passes AA) */ - --accent-strong: #2F64D6; - --accent-hover: #99BCF9; - --user-bg: #2A2F38; - --tool-bg: #25272B; - --bg-subtle: rgba(230,232,240,0.05); - --bg-frame: #141518; + --accent: #8EA8DA; + /* White-on-fill: 5.99:1 (passes AA) */ + --accent-strong: #41639E; + --accent-hover: #A8BDE5; + --user-bg: #32383F; + --tool-bg: #212325; + --bg-subtle: rgba(236,238,237,0.05); --status-error: #FF8A80; --status-success: #69D5A5; --status-warning: #F0C36A; --status-modified: #E0B24D; --status-renamed: #7CA8FF; - --on-accent: #FFFFFF; - --overlay-backdrop: color-mix(in srgb, var(--text) 24%, transparent); -} - -/* One Light palette. */ -html[data-theme="one-light"], html.theme-one-light { - color-scheme: light; - --bg: #FAFAFA; - --bg-panel: #F0F0F0; - --bg-hover: #E5E5E6; - --bg-selected: #DBDBDC; - --border: #DCDCDC; - --text: #383A42; - --text-muted: #696C77; - --text-dim: #63666F; - --accent: #2F65D9; - --accent-strong: #2F65D9; - --accent-hover: #1E4FB8; - --user-bg: #EEF3FE; - --tool-bg: #F2F4F8; - --bg-subtle: rgba(56,58,66,0.04); - --status-error: #E45649; - --status-success: #50A14F; - --status-warning: #C18401; - --status-modified: #986801; - --status-renamed: #4078F2; - --on-accent: #FFFFFF; - --overlay-backdrop: color-mix(in srgb, var(--text) 24%, transparent); -} - -/* Catppuccin Latte palette. */ -html[data-theme="catppuccin-latte"], html.theme-catppuccin-latte { - color-scheme: light; - --bg: #EFF1F5; - --bg-panel: #E6E9EF; - --bg-hover: #DCE0E8; - --bg-selected: #CCD0DA; - --border: #BCC0CC; - --text: #4C4F69; - --text-muted: #65687E; - --text-dim: #5B5F72; - --accent: #1E66F5; - --accent-hover: #04A5E5; - --user-bg: #E4E8F8; - --tool-bg: #E6E9EF; - --bg-subtle: rgba(76,79,105,0.05); - --status-error: #D20F39; - --status-success: #40A02B; - --status-warning: #DF8E1D; - --status-modified: #FE640B; - --status-renamed: #1E66F5; - --on-accent: #FFFFFF; - --overlay-backdrop: color-mix(in srgb, var(--text) 24%, transparent); -} - -/* Rosé Pine Dawn palette. */ -html[data-theme="rose-pine-dawn"], html.theme-rose-pine-dawn { - color-scheme: light; - --bg: #FAF4ED; - --bg-panel: #FFFAF3; - --bg-hover: #F2E9E1; - --bg-selected: #DFDAD9; - --border: #CECACD; - --text: #575279; - --text-muted: #6E6A86; - --text-dim: #645F78; - --accent: #286983; - --accent-strong: #286983; - --accent-hover: #1F5469; - --user-bg: #F5EDE8; - --tool-bg: #FFFBF5; - --bg-subtle: rgba(87,82,121,0.05); - --status-error: #B4637A; - --status-success: #286983; - --status-warning: #EA9D34; - --status-modified: #D7827E; - --status-renamed: #907AA9; - --on-accent: #FFFFFF; - --overlay-backdrop: color-mix(in srgb, var(--text) 24%, transparent); -} - -/* Dracula palette. */ -html[data-theme="dracula"], html.theme-dracula { - color-scheme: dark; - --bg: #282A36; - --bg-panel: #21222C; - --bg-hover: #343746; - --bg-selected: #44475A; - --border: #44475A; - --text: #F8F8F2; - --text-muted: #B4B8D0; - --text-dim: #AEB5D0; - --accent: #FF79C6; - --accent-strong: #BD93F9; - --accent-hover: #FFA2D8; - --user-bg: #2E303E; - --tool-bg: #21222C; - --bg-subtle: rgba(248,248,242,0.05); - --status-error: #FF5555; - --status-success: #50FA7B; - --status-warning: #FFB86C; - --status-modified: #F1FA8C; - --status-renamed: #8BE9FD; - --on-accent: #282A36; - --overlay-backdrop: color-mix(in srgb, var(--text) 24%, transparent); - --shadow-card: 0 1px 2px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05); - --shadow-pop: 0 2px 8px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.06); - --shadow-modal: 0 8px 32px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.08); -} - -/* Harbor palette. */ -html[data-theme="harbor"], html.theme-harbor { - color-scheme: dark; - --bg: #1B1B1B; - --bg-panel: #242424; - --bg-hover: #2E2E2E; - --bg-selected: #383838; - --border: #3D3D3D; - --text: #EFEBDC; - --text-muted: #C0B8A0; - --text-dim: #817F68; - --accent: #E75A50; - --accent-strong: #D2483E; - --accent-hover: #F0736A; - --user-bg: #262120; - --tool-bg: #202020; - --bg-subtle: rgba(239,235,220,0.05); - --status-error: #F44336; - --status-success: #77838A; - --status-warning: #E1CE98; - --status-modified: #DC8164; - --status-renamed: #E58980; - --on-accent: #FFFFFF; - --overlay-backdrop: color-mix(in srgb, var(--text) 24%, transparent); - --shadow-card: 0 1px 2px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05); - --shadow-pop: 0 2px 8px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.06); - --shadow-modal: 0 8px 32px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.08); -} - -/* One Dark Pro palette. */ -html[data-theme="one-dark-pro"], html.theme-one-dark-pro { - color-scheme: dark; - --bg: #282C34; - --bg-panel: #21252B; - --bg-hover: #2C313C; - --bg-selected: #3E4451; - --border: #3A3F4B; - --text: #ABB2BF; - --text-muted: #8B94A5; - --text-dim: #AAB2C0; - --accent: #61AFEF; - --accent-strong: #4D8CD6; - --accent-hover: #7EC7FF; - --user-bg: #232731; - --tool-bg: #1E2227; - --bg-subtle: rgba(171,178,191,0.05); - --status-error: #E06C75; - --status-success: #98C379; - --status-warning: #E5C07B; - --status-modified: #D19A66; - --status-renamed: #61AFEF; - --on-accent: #FFFFFF; - --overlay-backdrop: color-mix(in srgb, var(--text) 24%, transparent); - --shadow-card: 0 1px 2px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.04); - --shadow-pop: 0 2px 8px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.05); - --shadow-modal: 0 8px 32px rgba(0,0,0,0.65), 0 0 0 1px rgba(255,255,255,0.07); -} - -/* Rosé Pine palette. */ -html[data-theme="rose-pine"], html.theme-rose-pine { - color-scheme: dark; - --bg: #191724; - --bg-panel: #1F1D2E; - --bg-hover: #26233A; - --bg-selected: #403D52; - --border: #393552; - --text: #E0DEF4; - --text-muted: #908CAA; - --text-dim: #6E6A86; - --accent: #EBBCBA; - --accent-strong: #C4A7E7; - --accent-hover: #F2CECC; - --user-bg: #232033; - --tool-bg: #1D1A2B; - --bg-subtle: rgba(224,222,244,0.05); - --status-error: #EB6F92; - --status-success: #9CCFD8; - --status-warning: #F6C177; - --status-modified: #EBBCBA; - --status-renamed: #C4A7E7; - --on-accent: #191724; - --overlay-backdrop: color-mix(in srgb, var(--text) 24%, transparent); - --shadow-card: 0 1px 2px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04); - --shadow-pop: 0 2px 8px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.05); - --shadow-modal: 0 8px 32px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.07); -} - -/* Catppuccin Mocha palette. */ -html[data-theme="catppuccin-mocha"], html.theme-catppuccin-mocha { - color-scheme: dark; - --bg: #1E1E2E; - --bg-panel: #181825; - --bg-hover: #262638; - --bg-selected: #313244; - --border: #45475A; - --text: #CDD6F4; - --text-muted: #A6ADC8; - --text-dim: #AAB2D0; - --accent: #CBA6F7; - --accent-strong: #B4BEFE; - --accent-hover: #D8BCF9; - --user-bg: #252438; - --tool-bg: #181825; - --bg-subtle: rgba(205,214,244,0.05); - --status-error: #F38BA8; - --status-success: #A6E3A1; - --status-warning: #F9E2AF; - --status-modified: #FAB387; - --status-renamed: #89B4FA; - --on-accent: #11111B; - --overlay-backdrop: color-mix(in srgb, var(--text) 24%, transparent); - --shadow-card: 0 1px 2px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04); - --shadow-pop: 0 2px 8px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.05); - --shadow-modal: 0 8px 32px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.07); -} - -/* Gruvbox Dark palette. */ -html[data-theme="gruvbox-dark"], html.theme-gruvbox-dark { - color-scheme: dark; - --bg: #282828; - --bg-panel: #1D2021; - --bg-hover: #32302F; - --bg-selected: #3C3836; - --border: #504945; - --text: #EBDBB2; - --text-muted: #BDAE93; - --text-dim: #928374; - --accent: #FE8019; - --accent-strong: #D65D0E; - --accent-hover: #FF9C42; - --user-bg: #322D29; - --tool-bg: #202020; - --bg-subtle: rgba(235,219,178,0.05); - --status-error: #FB4934; - --status-success: #B8BB26; - --status-warning: #FABD2F; - --status-modified: #D3869B; - --status-renamed: #83A598; - --on-accent: #FFFFFF; - --overlay-backdrop: color-mix(in srgb, var(--text) 24%, transparent); - --shadow-card: 0 1px 2px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04); - --shadow-pop: 0 2px 8px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.05); - --shadow-modal: 0 8px 32px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.07); -} - -/* Nord palette. */ -html[data-theme="nord"], html.theme-nord { - color-scheme: dark; - --bg: #2E3440; - --bg-panel: #272C36; - --bg-hover: #3B4252; - --bg-selected: #434C5E; - --border: #4C566A; - --text: #ECEFF4; - --text-muted: #D8DEE9; - --text-dim: #8892B0; - --accent: #88C0D0; - --accent-strong: #5E81AC; - --accent-hover: #9BD6E6; - --user-bg: #343B4A; - --tool-bg: #262B35; - --bg-subtle: rgba(236,239,244,0.05); - --status-error: #BF616A; - --status-success: #A3BE8C; - --status-warning: #EBCB8B; - --status-modified: #D08770; - --status-renamed: #81A1C1; - --on-accent: #2E3440; - --overlay-backdrop: color-mix(in srgb, var(--text) 24%, transparent); - --shadow-card: 0 1px 2px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.04); - --shadow-pop: 0 2px 8px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.05); - --shadow-modal: 0 8px 32px rgba(0,0,0,0.65), 0 0 0 1px rgba(255,255,255,0.07); -} - -/* Tokyo Night palette. */ -html[data-theme="tokyo-night"], html.theme-tokyo-night { - color-scheme: dark; - --bg: #1A1B26; - --bg-panel: #16161E; - --bg-hover: #24283B; - --bg-selected: #283457; - --border: #2F354D; - --text: #C0CAF5; - --text-muted: #9AA5CE; - --text-dim: #AAB6E6; - --accent: #7AA2F7; - --accent-strong: #567ECC; - --accent-hover: #8DB4FF; - --user-bg: #222538; - --tool-bg: #161620; - --bg-subtle: rgba(192,202,245,0.05); - --status-error: #F7768E; - --status-success: #9ECE6A; - --status-warning: #E0AF68; - --status-modified: #FF9E64; - --status-renamed: #7DCFFF; - --on-accent: #FFFFFF; - --overlay-backdrop: color-mix(in srgb, var(--text) 24%, transparent); - --shadow-card: 0 1px 2px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04); - --shadow-pop: 0 2px 8px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.05); - --shadow-modal: 0 8px 32px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.07); } /* Shape / elevation / motion tokens (warm-humanistic system). */ @@ -3262,9 +2781,9 @@ html.dark .dropdown-surface :is(select, option) { } .providers-segmented-btn.active .providers-count-badge { - background: var(--accent); - color: #fff; - border-color: var(--accent); + background: var(--accent-strong); + color: var(--on-accent); + border-color: var(--accent-strong); } .provider-grid { @@ -3339,6 +2858,8 @@ button.provider-grid-card:hover { .settings-toggle.on .settings-toggle-knob, .settings-toggle[aria-checked="true"] .settings-toggle-knob { transform: translateX(18px); + /* The page colour keeps the knob clear of the bright dark-theme accent (7:1), where white is 2.4:1. */ + background: var(--bg); } .settings-badge { @@ -5004,7 +4525,6 @@ html[data-touch-targets="accessible"] .extension-dialog-footer > button { } /* The Other row's text box has no frame of its own, so the row shows its focus. */ .extension-choice:has(textarea:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; } -html.midnight .extension-choice:has(textarea:focus-visible) { outline-color: var(--accent-2); } .extension-choice:disabled { cursor: default; opacity: 0.6; } /* The ask's trailing "Done selecting" row is an action, not one more answer. */ .extension-choice-action { justify-content: center; border-style: dashed; background: transparent; color: var(--text-muted); font-weight: 600; } @@ -5015,7 +4535,7 @@ html.midnight .extension-choice:has(textarea:focus-visible) { outline-color: var min-width: 0; min-height: 36px; padding: 7px 12px; - /* At least 3:1 against the fill on the darkest themes (midnight, warm dark). */ + /* At least 3:1 against the fill on the dark theme. */ border: 1px solid color-mix(in srgb, var(--text-muted) 55%, var(--border)); border-radius: 8px; background: var(--bg-panel); @@ -5115,7 +4635,7 @@ html[data-touch-targets="accessible"] :is(.extension-choice, .extension-field) { } /* Desktop workbench frame: the sidebar, the chat and the docked right panel are rounded cards - on a darker frame. Phones keep the full-bleed layout (the sidebar is a drawer there), and the + on a frame of their own (--bg-frame). Phones keep the full-bleed layout (the sidebar is a drawer there), and the compact right panel is an overlay dialog, never a card. */ .app-frame > .sidebar-container { border-right: 1px solid var(--border); } .right-panel-container { border-left: 1px solid var(--border); } @@ -5124,7 +4644,7 @@ html[data-touch-targets="accessible"] :is(.extension-choice, .extension-field) { } @media (min-width: 641px) { .app-frame { - background: var(--bg-frame, var(--bg-panel)) !important; + background: var(--bg-frame) !important; padding: 6px; } /* The gap and border change with the width, not before it (resizing stays instant). */ diff --git a/app/index.html b/app/index.html index 0fd2ad97..10439397 100644 --- a/app/index.html +++ b/app/index.html @@ -12,8 +12,8 @@ - - + + diff --git a/components/ChatInput.tsx b/components/ChatInput.tsx index 436a3a6f..0416e1b9 100644 --- a/components/ChatInput.tsx +++ b/components/ChatInput.tsx @@ -3669,9 +3669,9 @@ export const ChatInput = memo(forwardRef(function ChatIn : isRecording || isPaused || isReviewing ? t("chatInput.sendDictation") : t("chatInput.send")} style={{ display: "flex", alignItems: "center", gap: 6, - background: (isRecording || isPaused || isReviewing || isTranscribing || value.trim() || hasAttachments) ? "var(--accent-strong)" : "var(--bg-panel)", + background: (isRecording || isPaused || isReviewing || isTranscribing || value.trim() || hasAttachments) ? "var(--text)" : "var(--bg-panel)", border: "none", - color: (isRecording || isPaused || isReviewing || isTranscribing || value.trim() || hasAttachments) ? "var(--on-accent)" : "var(--text-dim)", + color: (isRecording || isPaused || isReviewing || isTranscribing || value.trim() || hasAttachments) ? "var(--bg)" : "var(--text-dim)", cursor: submissionBlocked || (!btwMode && uploadsBlockSend) ? "not-allowed" : isTranscribing ? "wait" : (isRecording || isPaused || isReviewing || value.trim() || hasAttachments) ? "pointer" : "not-allowed", fontSize: 12, fontWeight: 600, diff --git a/components/CommandPalette.tsx b/components/CommandPalette.tsx index 9ea1b059..44dc7895 100644 --- a/components/CommandPalette.tsx +++ b/components/CommandPalette.tsx @@ -3,10 +3,11 @@ import { memo, useCallback, useEffect, useRef, useState } from "react"; import { createPortal } from "react-dom"; import { Command } from "cmdk"; -import { Check, MessageSquare, Monitor, Moon, Plus, Sparkles, Sun } from "lucide-react"; +import { Check, MessageSquare, Moon, Plus, Sun } from "lucide-react"; import type { SessionInfo } from "@/lib/types"; import { useI18n } from "@/lib/i18n"; -import { ALL_THEMES, useTheme } from "@/hooks/useTheme"; +import { useTheme } from "@/hooks/useTheme"; +import { THEME_OPTIONS } from "@/components/ThemeSwitcher"; import { useModalDialog } from "@/hooks/useModalDialog"; type Props = { onSelectSession: (session: SessionInfo) => void; @@ -104,61 +105,18 @@ export const CommandPalette = memo(function CommandPalette({ onSelectSession, on choose(toggleTheme)} style={{ display: "flex", gap: 10, padding: "9px 10px", borderRadius: "var(--radius-control)", color: "var(--text)", cursor: "pointer" }}>{isDark ? : }{t("commandPalette.toggleTheme")} - {ALL_THEMES.map((theme) => ( + {THEME_OPTIONS.map(({ value, label, fallback, Icon }) => ( choose(() => setTheme(theme.id))} - style={{ - display: "flex", - alignItems: "center", - gap: 10, - padding: "9px 10px", - borderRadius: "var(--radius-control)", - color: "var(--text)", - cursor: "pointer", - }} + key={value} + value={`${t("commandPalette.themes") || "Theme"}: ${t(label) || fallback}`} + onSelect={() => choose(() => setTheme(value))} + style={{ display: "flex", alignItems: "center", gap: 10, padding: "9px 10px", borderRadius: "var(--radius-control)", color: "var(--text)", cursor: "pointer" }} > - - - - - {theme.name} - {theme.id === "midnight" && } - - {preference === theme.id && } + + {t(label) || fallback} + {preference === value && } ))} - choose(() => setTheme("system"))} - style={{ - display: "flex", - alignItems: "center", - gap: 10, - padding: "9px 10px", - borderRadius: "var(--radius-control)", - color: "var(--text)", - cursor: "pointer", - }} - > - - {t("appShell.themeSystem") || "System (Auto)"} - {preference === "system" && } - {t("commandPalette.currentModel")}: {currentModel ?? t("commandPalette.notAvailable")} diff --git a/components/MessageView.tsx b/components/MessageView.tsx index dbaf2b24..8d2daf0a 100644 --- a/components/MessageView.tsx +++ b/components/MessageView.tsx @@ -68,21 +68,21 @@ function ToolCategoryIcon({ case "read": return ; case "search": - return ; + return ; case "edit": return ; case "terminal": return ; case "todo": - return ; + return ; case "task": - return ; + return ; case "hub": - return ; + return ; case "code": - return ; + return ; case "web": - return ; + return ; default: return ; } diff --git a/components/ThemeSwitcher.tsx b/components/ThemeSwitcher.tsx index b7bee1b5..85f11ae0 100644 --- a/components/ThemeSwitcher.tsx +++ b/components/ThemeSwitcher.tsx @@ -1,33 +1,20 @@ "use client"; import { useEffect, useId, useRef, useState } from "react"; -import { Check, ChevronDown, Monitor, Moon, Sparkles, Sun } from "lucide-react"; +import { Check, ChevronDown, Monitor, Moon, Sun } from "lucide-react"; import { useIsMobile } from "@/hooks/useIsMobile"; import { useFixedMenuPosition } from "@/hooks/useFixedMenuPosition"; -import { - DARK_THEMES, - LIGHT_THEMES, - type ThemePreference, - useTheme, -} from "@/hooks/useTheme"; +import { type ThemePreference, useTheme } from "@/hooks/useTheme"; import { useI18n } from "@/lib/i18n"; -type ThemeOption = { - value: ThemePreference; - name: string; - bg: string; - accent: string; - category: "light" | "dark" | "system"; -}; - -const ALL_OPTIONS: ReadonlyArray = [ - ...LIGHT_THEMES.map((t) => ({ value: t.id, name: t.name, bg: t.bg, accent: t.accent, category: "light" as const })), - ...DARK_THEMES.map((t) => ({ value: t.id, name: t.name, bg: t.bg, accent: t.accent, category: "dark" as const })), - { value: "system", name: "System", bg: "transparent", accent: "var(--accent)", category: "system" as const }, +export const THEME_OPTIONS: ReadonlyArray<{ value: ThemePreference; label: string; fallback: string; Icon: typeof Sun }> = [ + { value: "light", label: "appShell.lightThemes", fallback: "Light", Icon: Sun }, + { value: "dark", label: "appShell.darkThemes", fallback: "Dark", Icon: Moon }, + { value: "system", label: "appShell.themeSystem", fallback: "System", Icon: Monitor }, ]; /** Theme picker for the top bar. Shows the current mode icon and opens a - * small menu to pick light / dark / midnight / system directly, with + * small menu to pick light / dark / system directly, with * full keyboard support: * - Enter / Space / ↓ : open * - Arrow Up / Down : move selection @@ -46,7 +33,7 @@ export function ThemeSwitcher() { const baseId = useId(); const menuId = `${baseId}-menu`; - const index = Math.max(0, ALL_OPTIONS.findIndex((o) => o.value === preference)); + const index = Math.max(0, THEME_OPTIONS.findIndex((o) => o.value === preference)); // Keep the highlighted item in sync with the chosen theme when closed. useEffect(() => { if (!open) setActiveIndex(index); @@ -54,7 +41,7 @@ export function ThemeSwitcher() { // Fixed positioning escapes the compact top-bar overflow strip, whose // horizontal scroller would otherwise clip the menu to its 48px height. - const menuPos = useFixedMenuPosition(open, triggerRef, isMobile ? 220 : 350); + const menuPos = useFixedMenuPosition(open, triggerRef, 200); const menuShown = menuPos !== null; // Focus the active item once the positioned menu mounts, or when the highlight moves. @@ -81,7 +68,7 @@ export function ThemeSwitcher() { if (e.key === "ArrowDown" || e.key === "Enter" || e.key === " " || e.key === "ArrowUp") { e.preventDefault(); setOpen(true); - setActiveIndex(e.key === "ArrowUp" ? ALL_OPTIONS.length - 1 : index); + setActiveIndex(e.key === "ArrowUp" ? THEME_OPTIONS.length - 1 : index); } }; @@ -89,25 +76,11 @@ export function ThemeSwitcher() { switch (e.key) { case "ArrowDown": e.preventDefault(); - setActiveIndex((i + 1) % ALL_OPTIONS.length); + setActiveIndex((i + 1) % THEME_OPTIONS.length); break; case "ArrowUp": e.preventDefault(); - setActiveIndex((i - 1 + ALL_OPTIONS.length) % ALL_OPTIONS.length); - break; - case "ArrowRight": - e.preventDefault(); - // If in light column (0..3), jump to dark column - if (i < LIGHT_THEMES.length) { - setActiveIndex(Math.min(ALL_OPTIONS.length - 2, i + LIGHT_THEMES.length)); - } - break; - case "ArrowLeft": - e.preventDefault(); - // If in dark column (4..13), jump to light column - if (i >= LIGHT_THEMES.length && i < ALL_OPTIONS.length - 1) { - setActiveIndex(Math.min(LIGHT_THEMES.length - 1, i - LIGHT_THEMES.length)); - } + setActiveIndex((i - 1 + THEME_OPTIONS.length) % THEME_OPTIONS.length); break; case "Home": e.preventDefault(); @@ -115,12 +88,12 @@ export function ThemeSwitcher() { break; case "End": e.preventDefault(); - setActiveIndex(ALL_OPTIONS.length - 1); + setActiveIndex(THEME_OPTIONS.length - 1); break; case "Enter": case " ": e.preventDefault(); - choose(ALL_OPTIONS[i].value); + choose(THEME_OPTIONS[i].value); break; case "Escape": e.preventDefault(); @@ -164,8 +137,6 @@ export function ThemeSwitcher() { > {preference === "system" ? (