[201_105] Fix unclear keyboard shortcut keys in dark mode#3130
Open
1sh-repalto wants to merge 2 commits intoMoganLab:mainfrom
Open
[201_105] Fix unclear keyboard shortcut keys in dark mode#31301sh-repalto wants to merge 2 commits intoMoganLab:mainfrom
1sh-repalto wants to merge 2 commits intoMoganLab:mainfrom
Conversation
Contributor
Greptile Summary本 PR 修复了暗黑模式下快捷键图标( Confidence Score: 5/5此 PR 可安全合并,修复逻辑正确,不引入任何运行时错误或数据问题。 所有改动均为样式包中的颜色变量替换,默认值与原硬编码值完全一致,不影响现有亮色主题的表现;深色主题覆盖值合理,唯一发现为 P2 级别的重复定义建议,不阻碍合并。 无需特别关注的文件。 Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["render-key 宏调用"] --> B{当前主题}
B -->|"普通 / 亮色主题"| C["render-key-color = black\nrender-key-bg-color = #e0e0e0\nrender-key-sunny-color = #f0f0f0\nrender-key-shadow-color = #c0c0c0"]
B -->|"dark 主题"| D["render-key-color = white\nrender-key-bg-color = #606060\nrender-key-sunny-color = #808080\nrender-key-shadow-color = #404040"]
C --> E["ornament: 黑色文字 + 浅灰背景(可读)"]
D --> F["ornament: 白色文字 + 中灰背景(可读)"]
style E fill:#e0e0e0,color:#000
style F fill:#606060,color:#fff
Reviews (1): Last reviewed commit: "add developer document" | Re-trigger Greptile |
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.
Fixes #3114
What
Made keyboard shortcut key caps (e.g.
Ctrl+V,Ctrl+Shift+V) clearly visible in dark/night mode by introducing theme-overridable color variables for therender-keymacro.Developer Document:
devel/201_105.mdWhy
In night mode, the
render-keymacro used hardcoded light gray ornament colors (#e0e0e0,#f0f0f0,#c0c0c0) with no explicit text color. The dark theme sets the global text color to white, resulting in white text on a light gray background — making the shortcut keys nearly unreadable in the default startup document and all tmdoc documentation.How
Introduced four theme-overridable variables for the
render-keymacro and added dark mode overrides.Modified
TeXmacs/packages/documentation/standard/tmdoc-gui.tsandTeXmacs/packages/miscellaneous/shortcut-editor.ts:Replaced hardcoded colors in
render-keywith variable references:render-key-color— text color inside key caps (default:black)render-key-bg-color— ornament background (default:#e0e0e0)render-key-sunny-color— ornament highlight (default:#f0f0f0)render-key-shadow-color— ornament shadow (default:#c0c0c0)Modified
TeXmacs/packages/themes/dark/dark.ts:Added dark mode overrides for the key rendering variables:
render-key-color→whiterender-key-bg-color→#606060render-key-sunny-color→#808080render-key-shadow-color→#404040How to test
<key|Ctrl+v>).After the fix