Linux egui 2.0 界面复刻:设计令牌、主题系统、侧栏外壳与设置弹窗 - #1055
Open
appergb wants to merge 6 commits into
Open
Conversation
added 6 commits
September 10, 2026 22:31
- design_tokens.rs:tokens.css 的 Rust 对照表(浅/深双主题、圆角阶梯、 侧栏/弹窗尺寸),跨平台单测锁定与 CSS 字面值一致 - ui/ 模块(仅 Linux 编译):theme.rs(egui Style/Visuals + CJK 字体探测 安装,移植 #997 并修正多候选覆盖)、widgets.rs(卡片/状态胶囊/按钮/ 分段/开关/键值行/页头)、prefs.rs(深浅主题持久化,不进 Core 合同) - main.rs 外壳对齐 FloatingShell:226px 侧栏(版本行 + BETA 徽章 + 扁平 导航 + 工具分组 + 底部设置),<760px 横向胶囊导航 - 设置弹窗对齐 SettingsModal:环境与设置/AI 服务/本地模型/手机输入四分 区收纳进居中 960x680 弹窗(遮罩 + rail),不再占主导航 - 十页全部 2.0 化:概览状态卡、听写状态胶囊、QA 双气泡(#997 布局)、 选区预览卡、Agent 审批卡 + 跨页横幅、历史卡片、模型目录元数据卡 - ci.yml 新增 linux-egui 任务(ubuntu:cargo test + check --all-targets), UI 改动从此有 Linux 编译门禁 - 交接文档:04 页面现状、02 L09、README 起点同步
CI 首轮编译暴露的 API 偏差,全部机械修正: - Rounding(f32) 已弃用 → CornerRadius::same(u8);圆角令牌改存 u8 - Margin 字段/构造改 i8(same/symmetric/结构体字面量) - egui::WidgetVisuals → egui::style::WidgetVisuals(根路径不再重导出) - warn/error_text_color → warn/error_fg_color(0.31 更名) - Palette 补 ink_5 访问器;overlay alpha 标注 f32;Err 胶囊 p.err() 补括号 - 开关关闭轨道色按明暗自适应(暗色用 ink-3 保证可见)
CI 第二轮唯一硬错误:0.31.1 的 WidgetVisuals 字段是 corner_radius; 顺带消除 impl Into<f32> 引发的浮点回退警告。
新增 CI 编译门禁首周即抓到 beta 存量问题(linux-egui 此前无任何编译 CI): - 指纹 match 两臂类型不一致(None 臂返回 Response) - 远程状态测试 fixture 缺 ca_fingerprint_sha256 字段 另:听写状态胶囊补 Completed/Cancelled/Failed;弃用 Frame::rounding → corner_radius
egui Button/Caption 渲染时在 Style::text_styles 里查自己的条目; 整表替换只剩 Heading/Body/Small/Monospace 会让任何按钮渲染直接 panic(headless 测试在 CI 上复现 exit 101)。改为从默认表起步只 覆盖四个核心字号。已在 macOS scratch crate 复现并验证修复。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
接替云端 Linux egui 工作(承接 #997 的 CJK 字体与 QA 双气泡经验,基于 #1019 后的最新 beta 重做),按 Tauri/React 2.0 UI 在 Linux egui 端 1:1 复刻视觉与结构:
linux-egui/src/design_tokens.rs是src/styles/tokens.css的 Rust 对照表(浅/深双主题、圆角阶梯、侧栏 226px、弹窗 960x680),跨平台单测锁定与 CSS 字面值一致;egui/eframe 仍是 Linux 目标依赖,令牌层任何目标可编译。ui/theme.rs令牌 → egui Style/Visuals(白底 zinc、#2563eb 强调、8px 控件圆角);CJK 字体探测安装(移植 feat: replace desktop QA popup with egui #997egui_host/fonts.rs并修正其每轮循环覆盖前一轮字体的问题);深浅主题即时切换,持久化到ui-prefs.json(表现层状态,不进 Core 合同)。FloatingShell;<760px 回落横向胶囊导航。SettingsModal,不再占主导航。ci.yml新增linux-egui任务(ubuntu-22.04,cargo test + check -p openless-linux-egui --all-targets,与 release-linux-egui.yml 同款命令),Linux UI 改动从此有编译门禁。Validation
cargo test --manifest-path linux-egui/Cargo.toml --lib54 通过(含 design_tokens 对照测试);rustfmt 全量干净。linux-eguiCI 任务验证(egui UI 仅 Linux 目标编译)。与 #997 的关系
#997 基于 8 月底旧 beta(早于 #1019 架构整合),其「Tauri 子进程 egui 弹窗」路径与现行「Linux 独立 egui Host」架构不再一致;本 PR 吸收其可迁移资产(CJK 字体安装、QA 布局),架构上按现行合同重做。#997 可在其后关闭或重定向。