Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
abbc836
fix(startup): 提前确定窗口尺寸并复用相同主题图标
JoyElliot Sep 22, 2026
fc39fdf
fix(startup): 后台准备图标并在首帧呈现后显示窗口
JoyElliot Sep 22, 2026
63cbd37
refactor(startup): 使用任务所有权取消旧图标回填
JoyElliot Sep 22, 2026
ec70b59
Merge upstream main into startup-first-frame
JoyElliot Sep 22, 2026
5382c99
docs(startup): 对齐上游设置页图标归属
JoyElliot Sep 22, 2026
ba71acc
Merge upstream main into startup-first-frame
JoyElliot Sep 24, 2026
60072d9
Merge upstream main into startup-first-frame
JoyElliot Sep 25, 2026
0e4df46
Merge upstream main into startup-first-frame
JoyElliot Sep 26, 2026
fde914b
fix(i18n): localize GPUI workspace controls and confirmations (#133)
thynomex Sep 26, 2026
33e7b1d
ci: speed up full cross-platform PR validation (#296)
Kuddev Sep 26, 2026
83f7246
fix(env): translate PEBREL_HOOK_EXE across the WSL boundary (#290)
AnxForever Sep 26, 2026
acea926
feat(terminal): add tested cursor motion and preference contracts (#293)
Cec1c Sep 26, 2026
976a883
i18n(zh-TW): use Taiwan UI wording (#301)
tavricccc Sep 26, 2026
d30d1c9
fix(terminal): keep color report subscriptions silent (#302)
Kuddev Sep 26, 2026
bdee8d2
fix(terminal): preserve Pi reading position across synchronized redra…
galact-byte Sep 26, 2026
3ad289e
fix(windows): preserve Acrylic blur at edges and on deactivation (#250)
JoyElliot Sep 26, 2026
5f795a7
Merge upstream main into startup-first-frame
JoyElliot Sep 26, 2026
ba31b0d
fix(gpui): restore configurable macOS shortcuts and normal quit (#248)
zhbjerry Sep 26, 2026
f32100e
merge: integrate macOS shortcut fixes before startup validation
Kuddev Sep 26, 2026
7b0cedb
fix: keep update dialog opaque at low terminal opacity (#305)
keys-cherish Sep 26, 2026
c3e6a7a
merge: integrate update-dialog fix before startup validation
Kuddev Sep 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# 这些现有夹具共享真实设置文件;进程内 Mutex 在 nextest 多进程模型下不再互斥。
# 只还原该夹具组的串行合同,其余测试继续使用 runner 的并行度。
[test-groups]
theme-studio = { max-threads = 1 }

[[profile.default.overrides]]
filter = 'test(gpui_shell::settings_pane::theme_studio_tests::)'
test-group = 'theme-studio'
47 changes: 37 additions & 10 deletions .github/actions/rust-cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ inputs:
extra-key:
description: Additional inputs for native build tools stored with this target
default: ""
revision:
description: Snapshot suffix; empty uses the source SHA, dependency snapshots use a fixed generation
default: ""
save-if:
description: Allow publishing caches; PR consumers can restore without competing with the default branch
default: "true"

outputs:
cache-key:
Expand All @@ -25,6 +31,9 @@ outputs:
cache-matched-key:
description: The compiled target cache key actually restored by actions/cache
value: ${{ steps.target.outputs.cache-matched-key }}
save-enabled:
description: Whether the caller permits publishing cache snapshots
value: ${{ inputs.save-if }}
legacy-fallback-invoked:
description: Whether the optional legacy cache fallback action was invoked
value: ${{ steps.cache-summary.outputs.legacy-fallback-invoked }}
Expand All @@ -42,7 +51,7 @@ runs:
CACHE_OS: ${{ runner.os }}
CACHE_ARCH: ${{ runner.arch }}
CACHE_WORKLOAD: ${{ inputs.key }}
CACHE_REVISION: ${{ github.sha }}
CACHE_REVISION: ${{ inputs.revision || github.sha }}
CACHE_MANIFESTS: ${{ hashFiles('Cargo.lock', '**/Cargo.toml', 'rust-toolchain.toml', '**/.cargo/config.toml', '.github/ci-profile.toml') }}${{ inputs.extra-key }}
run: |
python - <<'PY'
Expand All @@ -66,8 +75,8 @@ runs:
("CACHE_OS", "CACHE_ARCH", "CACHE_WORKLOAD"))
prefix += "-" + fingerprint + "-"
with open(os.environ["GITHUB_OUTPUT"], "a", encoding="utf-8") as output:
# Immutable caches need a new entry after a source change, including
# when the prior revision failed before it compiled every profile.
# 发布任务按源码刷新;原生 CI 可固定代次,只在依赖或工具链变化后新建快照。
# 缓存命中只复用编译输入,调用方仍须执行当前提交的全部检查。
output.write("key=" + prefix + os.environ["CACHE_MANIFESTS"] + "-" + os.environ["CACHE_REVISION"] + "\n")
output.write("manifest-key=" + prefix + os.environ["CACHE_MANIFESTS"] + "\n")
output.write("restore-key=" + prefix + "\n")
Expand All @@ -92,8 +101,11 @@ runs:
${{ steps.identity.outputs.cargo-home }}/registry/cache
${{ steps.identity.outputs.cargo-home }}/git/db
${{ steps.identity.outputs.cargo-home }}/git/checkouts
key: cargo-downloads-v2-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('Cargo.lock', '**/Cargo.toml') }}
restore-keys: cargo-downloads-v2-${{ runner.os }}-${{ runner.arch }}-
# 同一 OS 的两种架构共享源码,编译产物仍按架构隔离。
key: cargo-downloads-v3-${{ runner.os }}-${{ hashFiles('Cargo.lock', '**/Cargo.toml') }}
restore-keys: |
cargo-downloads-v3-${{ runner.os }}-
cargo-downloads-v2-${{ runner.os }}-${{ runner.arch }}-
- name: Restore compiled targets
id: target
uses: actions/cache/restore@v4
Expand Down Expand Up @@ -127,6 +139,7 @@ runs:
CACHE_WORKLOAD: ${{ inputs.key }}
RUNNER_OS_VALUE: ${{ runner.os }}
RUNNER_ARCH_VALUE: ${{ runner.arch }}
CACHE_SAVE_ENABLED: ${{ inputs.save-if }}
run: |
set -euo pipefail

Expand All @@ -148,6 +161,7 @@ runs:
echo "- Target cache exact hit: \`$target_cache_hit\`"
echo "- Target cache matched key: \`$target_cache_matched_key\`"
echo "- Save key: \`$save_key\`"
echo "- Cache publishing enabled: \`$CACHE_SAVE_ENABLED\`"
echo "- Legacy fallback configured: \`$legacy_configured\`"
echo "- Legacy fallback invoked: \`$legacy_invoked\`"
echo "- Legacy fallback outcome: \`$legacy_outcome\`"
Expand All @@ -159,14 +173,27 @@ runs:
echo "legacy-fallback-outcome=$legacy_outcome"
} >> "$GITHUB_OUTPUT"
- name: Populate complete downloads before sharing the cache
if: steps.downloads.outputs.cache-hit != 'true'
if: inputs.save-if == 'true' && steps.downloads.outputs.cache-hit != 'true'
shell: bash
env:
CACHE_OS: ${{ runner.os }}
run: |
host_target="$(rustc -vV | sed -n 's/^host: //p')"
test -n "$host_target"
cargo fetch --locked --target "$host_target"
# 缓存由先完成的架构写入,必须预取两者的源码,不能把半份下载标成精确命中。
case "$CACHE_OS" in
Windows)
cargo fetch --locked --target x86_64-pc-windows-msvc --target aarch64-pc-windows-msvc
;;
macOS)
cargo fetch --locked --target x86_64-apple-darwin --target aarch64-apple-darwin
;;
*)
host_target="$(rustc -vV | sed -n 's/^host: //p')"
test -n "$host_target"
cargo fetch --locked --target "$host_target"
;;
esac
- name: Save complete shared Cargo downloads
if: steps.downloads.outputs.cache-hit != 'true'
if: inputs.save-if == 'true' && steps.downloads.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
Expand Down
28 changes: 17 additions & 11 deletions .github/workflows/linux-lua.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ on:
push:
branches: [main]
# Include docs, catalogs, assets and workflow edits: every PR gets test results.
# ready_for_review starts the scarce-runner jobs that draft pushes skip.
# 草稿已跑完整矩阵,转为 Ready 而没有新提交时不重复申请七个原生 runner。
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
types: [opened, synchronize, reopened]
merge_group:

concurrency:
group: native-${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }}
# main 的过期验证也应释放 runner;手动诊断和发布调用不互相取消。
cancel-in-progress: ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' || (github.event_name == 'push' && github.ref == 'refs/heads/main') }}

permissions:
contents: read
Expand Down Expand Up @@ -75,9 +76,7 @@ jobs:
--output "$GITHUB_OUTPUT"

# The required lint job validates the matrix before heavy runners are
# requested. Draft PRs omit deferred platforms entirely; ready PRs and
# release callers require the full matrix. Deferred checks remain missing
# on drafts instead of being reported as successful tests.
# requested. Every PR, including a draft, requires the complete matrix.
native-tests:
needs: lint
if: ${{ inputs.windows_diagnostics_run == '' }}
Expand Down Expand Up @@ -131,6 +130,10 @@ jobs:
if ($LASTEXITCODE -ne 0 -or $compiler -notcontains 'host: aarch64-pc-windows-msvc') {
throw 'The Windows ARM job must compile and run ARM64 tests.'
}
- name: Install the pinned native test runner
uses: taiki-e/install-action@v2
with:
tool: cargo-nextest@0.9.146
- uses: ./.github/actions/rust-cache
id: rust-cache
with:
Expand All @@ -139,7 +142,9 @@ jobs:
target: |
target/ci
${{ runner.os != 'macOS' && 'target/release' || '' }}
legacy-key: ${{ runner.os == 'Windows' && 'windows' || runner.os == 'Linux' && 'linux' || 'macos' }}
# PR merge-ref 缓存不与其他 PR 共享;只由默认分支维护可复用的依赖快照。
revision: dependencies-v1
save-if: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
- name: Prepare pinned Windows console runtime
if: ${{ runner.os == 'Windows' }}
shell: pwsh
Expand All @@ -148,7 +153,7 @@ jobs:
./scripts/prepare-windows-runtime.ps1 -Destination assets/windows/conhost -Architecture $architecture
./scripts/tests/windows-runtime.tests.ps1 -Architecture $architecture
- name: Test complete workspace and native harness
run: python scripts/ci_native_tests.py
run: python scripts/ci_native_tests.py --runner nextest
- name: Check source architecture
if: ${{ !cancelled() && runner.os == 'Linux' }}
run: python scripts/check_architecture.py
Expand All @@ -159,7 +164,7 @@ jobs:
if: ${{ !cancelled() && runner.os != 'macOS' }}
run: cargo check --locked --workspace --release
- name: Save compiled workload
if: ${{ always() && steps.rust-cache.outcome == 'success' && steps.rust-cache.outputs.cache-hit != 'true' }}
if: ${{ success() && steps.rust-cache.outputs.save-enabled == 'true' && steps.rust-cache.outputs.cache-hit != 'true' }}
uses: actions/cache/save@v4
with:
path: |
Expand Down Expand Up @@ -214,11 +219,12 @@ jobs:
with:
key: native-release-check
target: target/release
legacy-key: macos
revision: dependencies-v1
save-if: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
- name: Check the release workspace
run: cargo check --locked --workspace --release --timings
- name: Save compiled workload
if: ${{ always() && steps.rust-cache.outcome == 'success' && steps.rust-cache.outputs.cache-hit != 'true' }}
if: ${{ success() && steps.rust-cache.outputs.save-enabled == 'true' && steps.rust-cache.outputs.cache-hit != 'true' }}
uses: actions/cache/save@v4
with:
path: target/release
Expand Down
21 changes: 13 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,18 @@ compile check into a claim that UI tests or a packaged application were run.
`Tests (<os>)` jobs and both `Release workspace (<os>)` jobs are required checks
on `main`, together with Code Owner approval; see the
[activation checklist](docs/project-constraints.md#server-side-activation).
Open pull requests as drafts while iterating: drafts run Linux, Windows x64 and
Apple Silicon tests plus the Apple Silicon release-profile compile check. The
required lint job validates the event and selects the matrix before requesting
platform runners. Drafts omit Intel Mac and Windows ARM64 jobs entirely, so their
required contexts may be missing until the PR is marked ready. Ready PRs run the
full matrix; every required check must succeed before merging. The ready event
still reruns core validation rather than reusing an earlier check conclusion.
Draft and ready pull requests both run all five native platforms and both macOS
release-profile compile checks. The required lint job validates the event and
selects the matrix before requesting platform runners. Every required check must
succeed before merging. Marking a draft ready without changing its commits does
not repeat the matrix; source updates and reopen events run it again. Native CI
uses pinned `cargo-nextest` for unit and
integration tests, followed by `cargo test --doc` with the same workspace features;
the production feature graph and release workspace are still checked separately.
PRs restore Cargo caches without uploading merge-ref snapshots. The default branch
publishes reusable snapshots per dependency/toolchain configuration; a cache hit
never skips current-commit tests. Downloads are shared between architectures of
the same OS, while compiled targets remain isolated by architecture and SDK.
Local hooks are convenient, but bypassable; they are not the enforcement boundary.
Submitting a workflow or `CODEOWNERS` file does not configure server-side rules.

Expand All @@ -150,7 +155,7 @@ feature work; there is no routine `--skip-architecture` option.

- 先读架构图、工程合同和决策记录;按职责拆分,不按行号切片。
- 一个 PR 只做一件事;改动超过 1500 行源码(不计文档、lockfile、资源)`pr-size` 会失败,请拆分。
- Draft PR 先运行必需的格式检查和矩阵规划,再创建 Linux / Windows x64 / Apple Silicon 测试及 Apple Silicon release 编译检查;不创建 Intel Mac / Windows ARM64 任务。Ready 后运行完整矩阵,十项必需检查全绿才能合并。
- Draft 和 Ready PR 都先运行必需的格式检查和矩阵规划,再执行五平台原生测试及两项 macOS release 编译检查;十项必需检查全绿才能合并。提速使用共享缓存与并行测试,不省略平台或 doctest。
- 2000 行是现有仓库的防灾上限,800 行只提示审查,不是“大厂标准”。
- 普通功能 PR 不得增加存量债务;有问题的规则可以修订,但要有反例、测试和维护者审批。
- 新增核心抽象、依赖方向、持久化或线程模型改变要先说明设计,不强迫每个小修复写 ADR。
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# macOS command-key aliases

## Status

Implemented for issue #238.

## Context

The GPUI shell registered a macOS ⌘ shortcut set that existed nowhere else.
`bind_macos_command_keys` hand-wrote roughly two dozen bindings after
`default_workspace_bindings`, while `display::keymap::default_shortcuts()` — the
table that `clear_action` / `reset_action`, the settings keymap page and the
keybind reload path read — knew nothing about them. Half of those keys also
appear in the config macOS platform table (`config/bindings/defaults.rs`); the
other half only existed in the shell.

Two user-visible consequences followed. Clearing the Shell picker row wrote only
`Ctrl+K:ReceiveChar`, so the static ⌘K binding kept consuming the key and the
panel still opened. `Action::Quit`, declared for macOS as `"q", SUPER`, fell into
the `_ => None` arm of `workspace_binding_in_context`, so ⌘Q did nothing at all
(GPUI installs no application menu). The display layer also rendered the super
modifier as `Win+`, so the settings page and the lines the app wrote into
`pebrel_settings.txt` showed `Ctrl+Win+F` / `Win+F` on macOS.

## Evidence

- Issue #238 reproduction, with the settings file the released build wrote:
`keybind=Ctrl+Win+F:ReceiveChar`, `keybind=Ctrl+K:ReceiveChar`,
`keybind=shift+win+k:ReceiveChar` — the unbind persisted, yet ⌘K still opened
the picker.
- `display::keymap` regressions (`clearing_releases_the_macos_command_alias`,
`macos_command_aliases_round_trip_through_storage`,
`super_modifier_renders_per_platform`) and shell regressions
(`every_macos_command_alias_binds_a_gpui_action`,
`released_cmd_k_is_swallowed_by_no_action`).
- GPUI keymap semantics: a no-action binding for a keystroke suppresses matching
bindings from equal or weaker sources, and a keystroke with no remaining
binding falls through to the view's key handler — that is why a cleared ⌘ key
reaches the terminal instead of being eaten.
- Manual acceptance on macOS 26 (arm64, debug build, window driven through
accessibility): default ⌘K opens the picker; clearing the row writes both
`Ctrl+K:ReceiveChar` and `cmd+k:ReceiveChar` and releases ⌘K and Ctrl+K without
a restart; restoring the row brings ⌘K back; ⌘Q quits with `clean_exit` true.

## Decision

`display::keymap::MACOS_COMMAND_ALIASES` is the single authority for the shell's
⌘ set. `init()` derives the static gpui bindings from it, and
`default_shortcuts()` adds it to the unbind/restore vocabulary on macOS, deduped
against entries the config table already provides for the same action and key.
The alias table writes `cmd+…` into `keybind=` lines. Existing files and shortcut
capture can still use `win+…`, and manually edited files can use `super+…` or a
different modifier order. The GPUI adapter parses and canonicalizes its binding
strings before comparing overrides and restored defaults. Display spelling must
not determine a shortcut's runtime identity.

`Action::Quit` maps to a `QuitApp` action whose handler defers
`windowing::quit_all`, the same path as tray quit, so ⌘Q saves the session and
drafts before stopping PTYs. `mods_prefix` renders the super modifier per
platform, which also corrects the spelling of lines the app writes.

## Rejected alternatives

- Showing the ⌘ aliases on the settings keymap page (reverse-looking-up the
alias table in `effective_combo`) changes about twenty keycaps on macOS, the
shadowing verdicts other rows derive from them, and needs its own visual
acceptance. The page keeps showing the config table's Ctrl key.
- Moving the ⌘ set into the config macOS platform table would feed the legacy
terminal shell UI-only actions and keep the ⌘K collision, which the table
already resolves differently (`Esc("\x0c")` plus `ClearHistory`).
- Comparing raw display/storage spellings fails for equivalent `Win+…`,
`Cmd+…` and `super+…` keys. Display text is not a canonical identity;
`Ctrl++`-style display spellings also do not parse back as storage strings.
- Mapping the removed static ⌘ bindings to `ReceiveChar` from `init()` was not
needed: the user keybind table already injects the no-action binding.

## Consequences

- Cleared actions now also write `keybind=cmd+…:ReceiveChar` lines. Users coming
from an earlier build must clear the row once more, because their existing file
predates the alias vocabulary and holds no line for the ⌘ half.
- The keymap page still shows Ctrl keys for actions whose macOS binding set
includes ⌘. Releasing them works; seeing them does not.
- ⌘K after unbinding does not clear the screen. The GPUI shell has no
clear-screen action (`Action::Esc` and `Action::ClearHistory` are unmapped) and
the terminal encoder ignores pure ⌘ combinations, so the key is released but
inert. Out of scope here; `Ctrl+L` still passes through to the shell.
- ⌘B and ⌘, stay static bindings: they have no editable keymap row, so there is
nothing to clear.

## Validation

`cargo fmt --all -- --check`, `python3 scripts/check_architecture.py --base
f7ca0ec`, `python3 scripts/check_platform_cfg.py` (budget unchanged at 484) and
the `display::keymap` / `keyboard_bindings` unit suites pass; the two new
released-key tests fail without the change. Manual acceptance is listed under
Evidence. The alias table is shared data; runtime registration uses the existing
`Platform::current()` entry and remains macOS-only. The two macOS restore
regressions remain platform-gated. This avoids duplicating platform compile
branches in the UI adapter without increasing the current cfg budget.
A cross-platform GPUI dispatch regression confirms that sharing the table does
not register Command shortcuts on Windows/Linux.

The 2026-09-23 review reproduced two restore failures through GPUI keyboard
dispatch: recording Cmd+K then resetting the row, and resetting the old
`Ctrl+Win+F:ReceiveChar` override from #238. Both failed before canonicalization.
Regression coverage includes those paths and equivalent modifier spellings/order.

## Supersedes

None.

## Revisit when

The keymap page should show platform-native keycaps, or macOS ⌘K should be
assigned to a clear-screen action instead of the Shell picker.
Loading
Loading