-
Notifications
You must be signed in to change notification settings - Fork 251
feat(ui): 初始化主界面开发管线; 更换 UI 框架从 Tkinter 到 WebView #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
dongkid
wants to merge
14
commits into
RICHQAQ:main
Choose a base branch
from
dongkid:mainui-dev
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
主要变更如下: - 移除 `app.py` 中原有的 Tkinter 主循环及 UI 任务队列处理逻辑。 - 引入 `pywebview` 库,并实现 `WebViewLauncher` 作为新的应用启动入口。 - 重构托盘菜单功能,将设置和热键配置界面替换为基于 WebView 的网页实现。 - 更新 `AppState` 核心状态类,增加对 WebView 窗口及管理器的引用。 - 在 `requirements.txt` 中添加 `pywebview` 及其在 macOS 下所需的 `pyobjc` 依赖。 BREAKING CHANGE: UI 技术栈从 Tkinter 全面迁移至 WebView,运行环境需安装新增依赖。
Owner
|
这个还有不少问题,以后再合并吧,我在dev分支下还在写别的,感觉这个合并冲突挺大 |
Contributor
Author
|
大部分问题是已知的,所以pr的状态为draft,这个提交发上来就是看看mac上有什么特有的问题。
|
- 多语言切换 - 线程安全
- 将 Tkinter 对话框迁移至 WebView,删除旧版 Tkinter UI 代码 - 在 Container 中实现 WebViewLauncher 延迟初始化 - 在 AppState 中添加统一的 cleanup() 方法用于资源清理 - ConfigLoader 实现原子写入和线程安全的配置保存 - 修复文件对话框 API 兼容性问题,支持新旧版 pywebview - 优化 API 就绪检测,使用事件驱动替代轮询 - 添加 Filter 列表双击编辑功能 - 优化权限轮询,仅在可见时执行 - 修复托盘菜单阻塞问题,使用 Timer 替代 sleep - 完善 quit_event 监听机制 - 改进热键录制器的线程清理 BREAKING CHANGE: 移除所有 Tkinter 相关的设置和热键对话框代码
- 修复了热键翻译的缺失 - 修复了日语翻译的缺失 - 多平台检测和专用设置标签修复 - 删除了不需要的字段映射
重构应用退出机制,解决 WebView 窗口未正确销毁和重复调用 destroy() 的问题。 - 新增统一退出流程:quit_event 作为唯一退出信号源 - TrayMenuManager._on_quit 仅负责设置 quit_event,不再直接销毁 WebView - quit_event 监听器成为主要清理点,负责调用 WebViewManager.destroy() - WebViewManager 添加 _is_quitting 标志防止重复销毁 - AppState.cleanup() 添加兜底逻辑,仅当退出未被正常处理时才调用 destroy() - setting.py职责分离 - 删除过时的代码审查和修复指南文档
添加全面的主题切换功能,支持自动/浅色/深色模式, 包括系统主题检测和窗口背景颜色自适应。 同时增加调试模式选项,用于控制开发者工具和控制台日志。
为设置窗口添加 Windows 11 Mica 材质效果和 macOS Vibrancy 支持, 提供现代化的平台原生视觉体验。 - 新增 Windows Mica 效果支持 (utils/win32/mica.py) - 新增平台效果管理器 (assets/js/platform.js) - 新增平台特定样式 (assets/css/platform.css) - 添加平台能力检测 API (get_platform_capabilities) - 添加 Mica 主题动态切换 API (update_mica_theme) - 优化窗口透明配置,支持深色/浅色模式自动切换 - 增强组件动画效果和现代化样式 - 主题变化时自动同步更新平台效果
- 改进窗口初始化策略,启动时不再自动弹出设置窗口 - 新增 Win32 类型常量模块,提升代码可维护性 - 优化语言变更通知机制,通过 UI 队列确保线程安全 - 增强 API 响应容错处理,自动检测对象和 JSON 格式 - 添加表单脏检查功能,防止未保存修改丢失 - 改进文件对话框初始目录验证,降级到用户目录 - 为加载失败场景添加国际化错误提示 - 优化退出流程,通过 UI 队列执行销毁操作
功能集成: - 可扩展工作流 (extensible_workflows): HTML/MD/LaTeX/File - 粘贴服务 (paste service): 纯文本/富文本/文件粘贴 - Pandoc filters 按转换类型配置 - 版本检查器和 HTML 工具类 架构保留: - WebView UI 架构 (pywebview) - 线程安全状态管理 (RLock) - Mica/毛玻璃视觉效果 待后续实现: - Extensions Tab WebView 前端界面 - 运行应用列表 API 删除: - extensions_tab.py (Tkinter 实现, 将在 WebView 重新实现) Co-Authored-By: Claude <noreply@anthropic.com>
修复 fallback_workflow 中 html 变量可能未定义的问题,为剪贴板表格落地器添加 i18n_prefix 属性以确保错误消息正确本地化,同时扩展 PlacementMethod 类型定义以支持更多剪贴板粘贴方式
新增 ExtensionsApi 和前端扩展管理器,允许用户为特定应用配置 HTML、Markdown、LaTeX 和文件粘贴模式。包含应用选择器、窗口名称匹配规则编辑器以及冲突检测机制,同时优化了 Windows Mica 效果的模态框样式并完善国际化支持。
将原有的顶部选项卡导航重构为左侧侧边栏导航,引入 Fluent Design 设计语言。主要变更包括: - 重构 HTML 结构,新增 sidebar、content-header、content-body、content-footer 等语义化容器 - 全面更新 CSS 样式系统,引入 Fluent Design 令牌(spacing、radius、duration、easing 等) - 使用 Segoe Fluent Icons 字体添加导航图标 - 改进卡片式布局和设置行样式,增强视觉层次 - 重新设计 Toggle 开关、按钮、输入框等组件样式 - 优化 Mica/Vibrancy 透明效果,支持系统浅色模式下的深色主题 - 修复 Mica 效果应用时序问题,确保主题切换正确同步 - 添加窗口非客户区刷新以强制应用 Mica 深色/浅色模式 - 更新 TabManager 以支持侧边栏导航和动态页面标题 HANGE: 设置界面布局从顶部选项卡改为左侧侧边栏,HTML 结构和 CSS 类名发生重大变更
- 将旧的颜色变量映射到新的语义化 Fluent Design 变量 - 新增 Mica 和 Vibrancy 模式的控件填充、悬停和边框变量 - 统一使用 overlay 变量替代硬编码的透明度值 - 优化滚动条、选中文本、模态框等组件的样式变量
- 实现 WCAG 2.2 焦点指示器标准,统一焦点样式 - 新增高对比度模式和增强对比度模式支持 - 完善减弱动效模式的响应处理 - 基于 Fluent UI v9 规范更新 Motion 动效令牌和缓动曲线 - 重新设计阴影系统为双层结构,增强层次感 - 优化组件交互动效,包括导航项、按钮、卡片和开关 - 添加前端开发脚本
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.
后续主界面功能开发奠定的前置基础,完成了早期的技术验证和设计文档编写,目前仍存在诸多问题。
主要变更如下:
app.py中原有的 Tkinter 主循环及 UI 任务队列处理逻辑。pywebview库,并实现WebViewLauncher作为新的应用启动入口。AppState核心状态类,增加对 WebView 窗口及管理器的引用。requirements.txt中添加pywebview及其在 macOS 下所需的pyobjc依赖。BREAKING CHANGE: UI 技术栈从 Tkinter 全面迁移至 WebView,运行环境需安装新增依赖。