Repository navigation
fix(gpui): open the startup window at config.window.dimensions - #313
Conversation
The default shell had no reader for `config.window.*`, so `pebrel config check` accepted a window size the GUI then ignored: every start used the built-in 116x30 canvas regardless of the user's file. Read the grid once during shell init through the same discovery and parse entry points `pebrel config check` uses, so Lua, TOML and YAML all work and precedence matches the rest of the app. It stays a grid rather than pixels: the existing sizing path multiplies it by the cell it measures in the window's own scale domain, which keeps 155x43 correct at 125% scaling. `config.window.position` is deliberately not wired here. gpui accepts placement only at window creation, in logical pixels, and exposes no app-level scale factor, while the legacy shell hands winit a physical position; passing the raw numbers through would place the window a fifth of the screen off at exactly the scaling the report uses. Refs Kuddev#312
CI evidence (commit
|
Kuddev
left a comment
There was a problem hiding this comment.
Review 状态:已检查配置发现/解析、默认值与最小网格语义;当前主线集成尚未通过,暂不批准合并。#251 已把 prepare_initial_grid 移到 workspace/windowing/startup_geometry.rs,并增加显示窗口前的 preferred_size。因此本 PR 与当前 main 有真实冲突,解决时需要让 preflight 和 post-creation 两条路径都使用同一个配置网格计算,保留基准字体/终端缩放区分、DPI 量化、屏幕上限和最小窗口规则,而不是只保留任意一侧。新增完整配置读取和可能的 Lua 求值位于首次开窗前的主线程;性能优先下也需要明确这条新增启动路径的成本。已在隔离 worktree 验证冲突存在,随后撤销该临时 merge;没有修改或推送本 PR 的生产代码,也未触碰主工作区。
Kuddev
left a comment
There was a problem hiding this comment.
更新后的复审(5788e0f):此前与 #251 的尺寸计算冲突已经解决,不再将旧冲突作为阻塞理由。已核对当前 effective diff:startup_geometry 的 preferred_size/preflight 和 prepare_initial_grid 都把 config::startup_grid 传入同一个 default_size,保留字体度量、DPI、屏幕上限与首帧路径。
仍暂不批准合并:
- 当前精确 head 的必需 lint 检查失败,其他平台显示跳过不等同于验证通过。
- 性能/内存优先级下,gpui_shell::init 新增的 StartupWindow::load 在首次开窗前同步调用完整 config::load_source;Lua 路径执行 load_lua_file 的 eval,而非仅读取两个网格整数。临时 Lua/config 对象随后释放,未看到新增逐帧处理或常驻服务;但现有新增测试只覆盖解析和网格值,尚未证明新增同步路径的启动耗时与峰值内存成本。请给出同一构建配置下代表性配置的基线/修复后对照,再决定是否接受这项启动路径变化。
本次只更新 review,没有修改或推送 PR 的生产代码,也没有改动本地主工作区。
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Propagate the selected --config-file source into GPUI startup configuration loading.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
This PR makes GPUI startup sizing honor config.window.dimensions with scale-aware sizing, defaults, clamping, tests, and architectural documentation.
Changes:
- Loads dimensions from Lua, TOML, or YAML during shell initialization.
- Applies configured grid dimensions to the initial window size.
- Preserves default sizing and minimum/display clamping.
- Documents design decisions and limitations.
The explicit --config-file path is not currently propagated to GPUI startup configuration loading, so the window may use a different configuration source.
| File | Summary |
|---|---|
nebula_app/src/gpui_shell/workspace/windowing/startup_geometry.rs |
Uses configured grid dimensions for startup window sizing. |
nebula_app/src/gpui_shell/mod.rs |
Registers startup configuration during initialization. |
nebula_app/src/gpui_shell/config.rs |
Loads and exposes startup dimensions; must honor the selected explicit configuration file. |
architecture/notes/nebula_app/gpui_shell/2026-09-27-config-window-startup-size.md |
Documents the design and tradeoffs. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Kuddev
left a comment
There was a problem hiding this comment.
[P2] Honor the explicitly selected configuration source. StartupWindow::load calls discover(None), while the GPUI entry path returns before config::load(&mut options) and does not pass --config-file into this initializer. With a selected file containing window.dimensions and a different discovered/default file, startup geometry comes from the wrong source. The current tests directly call load_lua_file/from_config and therefore do not exercise this public CLI path. Please thread the selected source into bootstrap and add a focused explicit-config regression.
Performance review: the separate StartupWindow lifetime correctly avoids reevaluating Lua on every settings save. It still evaluates the full selected config synchronously before the first window; that cold-path cost should stay one-time. All current source checks are green, but this source-selection problem remains. Excluded from the batch.

Refs #312.
config.window.dimensionswas validated bypebrel config checkand then ignored by the running app: the default GPUI shell had no reader forconfig.window.*at all, and its startup geometry came from a hard-coded 116x30 built-in canvas. A user who wrotecolumns = 155, lines = 43inpebrel.luaalways got the same window.Changes
gpui_shell::config::StartupWindowreads the grid once during shell init throughconfig::source::discover+config::load_source— the same entry pointspebrel config checkuses. Lua, TOML and YAML therefore work through one path, with the precedence the rest of the app already applies.prepare_initial_gridmultiplies that grid by the cell it measures in the window's own scale domain. Keeping the configured value a grid rather than pixels is what makes 155x43 land correctly at 125% scaling without the shell ever knowing the scale factor. Unset config keeps the 116x30 canvas; an oversized grid keeps the existing 95%-of-display clamp, which shrinks the grid instead of pushing the window off screen.Settings: that global reloads on every settings-page write, and user Lua should not be re-evaluated on that path.architecture/notes/nebula_app/gpui_shell/2026-09-27-config-window-startup-size.md.Not covered
config.window.positionstill does nothing in the GPUI shell. gpui accepts placement only at window creation and only in logical pixels, and exposes no app-level scale factor, whereas the legacy shell hands winit a physical position. Forwarding the raw numbers would place the window about a fifth of the screen away from the requested spot at exactly the scaling in the report, so it is left unwired rather than shipped wrong.startup_mode,decorationsanddynamic_titleremain legacy-only for the same reason.Validation
mainat360613ain merge commit57329fb; the branch retains its earlier77e6470merge.0aea9b1failed to compile because two GPUI test setup callers omitted the new startup-config argument;f4ef373fixed both by passingNone.57329fb, PR size run36451857204succeeded. Full native tests run36451857529failed:Tests (macos-26-intel)job109028517735ended with failure whileTest complete workspace and native harnessremainedin_progress; its log download returnedBlobNotFound, so no test-level failure text was available. The twoRelease workspacejobs (109067603489,109067603477) reported onlyNative validation did not succeed: failure. GitHub rejected--failedrerun withcannot be rerun; its workflow file may be broken. No PR-specific root cause is established from the available evidence. Full native run · macOS Intel job.f40938aadds only an empty commit to retrigger required CI. PR size run36464855985, Architecture contracts run36464856182, and Full native tests run36464856992are queued; post-retrigger validation is pending.cff2334: median 185.8 ms (153.4–1611.6), median 154.2 MiB (153.4–192.7). Head0aea9b1: median 154.0 ms (153.3–157.1), median 155.0 MiB (154.2–156.0). This comparison predates the 77e and 360 syncs and does not validate the current head.77e6470: personal-fork Actions run 36434634226 succeeded on Ubuntu 24.04 / Rust 1.97.1 using the same locked Release build and Lua config. Base77e6470: median 191.5 ms (189.9–2218.9), median 167.3 MiB (153.5–168.7). Headae578b0: median 189.5 ms (189.0–190.3), median 160.6 MiB (155.9–165.6). The 360613 font-registration change affects pre-window startup work, so these values are not current-head evidence; the base run's first sample was a large outlier.360613a: median 191.9 ms (191.8–1803.1), median 167.6 MiB (154.1–168.0). PR head57329fb: median 191.3 ms (190.7–193.4), median 164.0 MiB (155.8–166.5). The first base sample (1803.1 ms) is a clear outlier; three samples on one Ubuntu runner do not resolve small differences or establish a universal performance guarantee. This is supporting evidence from the personal fork, not upstream PR CI or Windows 11 at 125% acceptance.Test plan
config.window.dimensions = { columns = 155, lines = 43 }opens the window at that grid instead of 116x30.columns = 1, lines = 1, the window clamps to the terminal minimum rather than failing to open.AI assistance: GPT-6 Luna (max).