- SignalDesk2 hr ago
Original Summary
github.com/earendil-works/pi feat(coding-agent,tui): System theme (#10067) 已提交 11:33AM - 26 Sep 26 UTC mitsuhiko +2354 -1191 feat(coding-agent,tui): add system theme derived from terminal colors The new … default system theme builds pi's colors from the terminal's reported foreground, background, and ANSI palette. Tokens take their hue and relative saturation from a palette slot; lightness is placed by OKLab lightness difference and WCAG 2 contrast minimums. Terminals that report only a background get built-in hues, and terminals that report nothing get ANSI indices with faint secondary text. The TUI queries OSC 10, 11, and 4 in one burst ended by DA1, so replies complete in one round trip, and reports replies that arrive after the timeout. Startup never waits: the system theme starts in grayscale and updates when colors arrive. Light/dark detection now uses the reported colors instead of the ?996 query; mode 2031 notifications trigger a new query. fix(coding-agent): wait for terminal colors before building the startup header The header and startup notices bake theme colors into their text. When the color replies arrived after they were built, as in Windows Terminal, they stayed grayscale. Startup now waits for the first color query, which ends at the DA1 reply or after 100 ms. fix(coding-agent): rebuild header and notices on theme changes The startup header, loaded resources, and chat notices baked theme colors into their text, so they kept the old colors after a theme switch or when the system theme received the terminal's colors. They now use ThemedText, which rebuilds its text from a function whenever the UI is invalidated. fix(tui): keep focus on components that forward mouse events to children A component that forwards a mouse event to a child it hosts, such as SettingsList with an open submenu, left keyboard focus on the child. When the host removed the child, focus stayed on a detached component and all keys were lost. The forwarding component now keeps focus, like delegating containers do. feat(coding-agent): describe the system theme in the theme selector feat(coding-agent): list the system theme above automatic in the theme selector refactor(coding-agent,tui): remove leftovers of the light/dark startup detection Theme detection only reports dark or light now; the source and confidence fields only served saving the detected theme. The first-time setup no longer shows the detected appearance. Removes the TUI's unused queryTerminalColorScheme(), queryTerminalBackgroundColor(), queryTerminalForegroundColor(), and parseOsc11BackgroundColor(); queryTerminalColors() covers them. feat(coding-agent): match the reviewed system and light/dark theme design The system theme now follows the reviewed design: color families with OKHSL saturation curves, palette slots per family, contrast rules per token and panel, relaxation for mid-gray backgrounds, and the terminal foreground for body text. Each contrast level is a target-lightness curve fitted to the reviewed output. The built-in dark and light themes use the reviewed Pi dark and light colors. feat(coding-agent): show the pi logo in the startup header A two-line pixel logo replaces the app name. Its first line carries the version, its second line the first line of key hints. feat(tui,coding-agent): support OKHSL colors in themes parseColor() accepts okhsl(H S L), and okhslColor() and colorToOkhsl() construct and read OKHSL colors. OKHSL saturation is relative to the sRGB gamut, so every value is in gamut. Theme files accept okhsl() values; HTML exports convert them to hex. The OKHSL code moves from coding-agent into pi-tui, where colors.ts now shares its Oklab conversion instead of keeping a second copy. refactor(coding-agent): write the built-in themes in OKHSL The built-in dark and light themes use okhsl() values, with variables for colors that several roles share, so they read as color families and serve as editable templates. Near-identical values collapsed into one; no color changes visibly. refactor(coding-agent,tui): simplify terminal color and theme code Share the terminal color query between startup and the theme controller, merge the query's resolve/late-reply state into one callback, keep a single global for terminal colors, use oklab.ts arrays directly in colors.ts, and drop leftover helpers and exports. fix(coding-agent): use one terminal light/dark decision everywhere Theme pairs, the system theme, and Theme.appearance now share getTerminalTheme(): the reported background decides, then the terminal's light/dark report, then COLORFGBG, then dark. COLORFGBG is classified by palette index like Vim (0-6 and 8 dark) and only reads the last field, so rxvt's "default" no longer picks up the foreground index. Simplify the tests added on this branch. fix(ai): use an OpenRouter model that still exists in beta test OpenRouter removed anthropic/claude-3-haiku, which broke type checking in CI after model regeneration. 引入一个新的 system 主题并作为默认主题,无固定色值,根据终端色彩动态生成配色 原来的 dark 和 light 主题也有了很大变化 将 pi logo 放到了启动横幅上 2 个帖子 - 2 位参与者 阅读完整话题
- 情报分类:技术学习与提效
- 分类依据:内容涉及技术、AI、软件工具或工程实践
- 信息来源:服务器 / LINUX DO - 最新话题
- 发布时间:2026/9/26 21:29:27
- No replies yet