fix(shell): one same-sized marker per shell, and space the picker rows - #111
Open
YinBuLiao wants to merge 1 commit into
Open
fix(shell): one same-sized marker per shell, and space the picker rows#111YinBuLiao wants to merge 1 commit into
YinBuLiao wants to merge 1 commit into
Conversation
The settings picker mixed a brand PNG (24 px), a `dev-terminal` glyph (~0.7 em) and a `cod-terminal` glyph (~0.9 em), so icons rendered at three different sizes; the new-tab palette passed no glyph at all, leaving zsh, csh, ksh, sh, dash and tcsh without any icon. Both surfaces now fall back to the shared id-keyed glyph from `shell_detect::icon_for_id`, all at `FALLBACK_ICON_SCALE` so the glyph ink matches the brand artwork's 12% safe margin (roughly 0.77 of the slot). The picker also reserves one fixed icon slot per row, which removes the row overlap, and spaces rows by exactly `SHELL_ROW_GAP` — the component's virtual list has no item `gap_y`, so the measured first row is padded to act as the slot height. A selected row no longer touches the row above it.
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.
Result / 用户结果
dev-terminal字形约 0.7em、cod-terminal字形约 0.9em;选中行还紧贴上一行,没有间隔。现在两个界面都回落到共享的 id-keyed 字形(
shell_detect::icon_for_id),并按FALLBACK_ICON_SCALE配平到与品牌贴图同一视觉尺寸;设置下拉的图标槽固定为同一SHELL_ROW_ICON_SIZE,行间距由SHELL_ROW_GAP提供。无关联 issue:本地实测发现。
Design / 设计边界
nebula_app/src/shell_detect.rs(图标权威,旧壳与命令面板共用);两个消费者gpui_shell/settings_pane/shell_picker.rs、gpui_shell/workspace.rs+gpui_shell/workspace/palette.rs只做适配。icon_for_id的文档本来就声明它 shared by detected shells and the settings row so a savedshell=<id>always draws the same mark;此前 GPUI 的两个界面一个没用它、一个只画品牌贴图。color_icon_png/icon_for_id/ 持久化 id 语义不变。icon_for_id把无品牌资产的 shell 统一到cod-terminal(U+EA85),有品牌资产的(pwsh / cmd)保留各自码位。Evidence / 验证依据
cargo test ... -- shell_row_geometry shell_palette shell_detect::→ 20 passed / 0 failed。shell_row_geometry::every_row_shares_one_icon_slot_height—— 修复前实测[13.0, 24.0, 13.0](品牌行 24px,动作行与字形行 13px,这正是行背景溢出、叠到相邻行的来源)。现在断言 品牌行 == 字形行 ==SHELL_ROW_ICON_SIZE,且动作行恰好高出SHELL_ROW_GAP。shell_palette_falls_back_to_an_id_glyph_when_brand_art_is_absent—— 每个 shell 行恰好一种图标来源;无贴图行必须带 id 字形。fallback_shell_marks_share_one_glyph_so_they_render_at_one_size—— 所有无品牌 shell 共用一个码位。gap_y(crates/ui/src/list/list.rs注释明说)。这是唯一不 fork 组件库的着力点,已在常量文档中写明。python3 scripts/check_architecture.py --base c2deb16(本机 Python 3.9.6,检查器要求 3.11+)。人工确认无文件超预算、无新增依赖边。Required Review / 必须确认
CONTRIBUTING.md、docs/architecture.md、docs/project-constraints.md。scripts/check_architecture.py未能运行(环境缺 Python 3.11+,见上);未抬高任何预算。与另外两个 PR(默认 Shell 解析、通知溢出)无文件冲突:同文件的改动落在不同区域,任意顺序合并均可。