Skip to content

feat(workspace): open project folders in new terminal tabs - #130

Open
Aschenbath wants to merge 1 commit into
Kuddev:mainfrom
Aschenbath:feat/open-project-folder
Open

Aschenbath wants to merge 1 commit into
Kuddev:mainfrom
Aschenbath:feat/open-project-folder

Conversation

@Aschenbath

@Aschenbath Aschenbath commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Result / 用户结果

Fixes #124.

  • Add Open project folder… to the upper-left toolbar in both sidebar and top-tab layouts.
  • The native single-directory picker opens a new terminal tab in the selected folder using the configured default shell.
  • Existing terminals receive no commands. A saved profile's startup directory is overridden only in the new tab's launch snapshot; the saved profile itself is unchanged.
  • Canceling is a no-op. Invalid or unavailable folders show a localized warning and can be retried.

Design / 设计边界

  • Folder selection, validation and launch adaptation live in a focused workspace module. Existing tab/session creation remains the authority for terminal startup.
  • Use GPUI's existing path picker; filesystem validation runs on the background executor. A workspace-owned task prevents duplicate pickers and ends with its workspace.
  • Reuse the titlebar's drag-safe control wrapper. The entry has a 32×32 logical-pixel hit box, an accessible label, a visible focus outline, and local Tab/Enter/Space access; no global shortcut is added.
  • Account for the entry in the top-tab strip's width budget. Move the existing titlebar-control helper into the titlebar module without changing its behavior; no architecture budget is raised.
  • No new dependency, persistent setting, alternate terminal-launch implementation, or shell-command interpolation.

Evidence / 验证依据

Local checks on this branch:

Check Actual result
cargo +1.97.1 test --offline --locked -p nebula --bin pebrel --features gpui-test-support -- --test-threads=1 1396 passed, 0 failed, 10 ignored
cargo +1.97.1 check --offline --locked -p nebula --bin pebrel --features gpui-shell --tests Passed
cargo +1.97.1 test --offline --locked --manifest-path tools/i18n-contract/Cargo.toml 14 passed, 0 failed, 1 ignored
python -B scripts/check_architecture.py --base ce068600b2382d71301070535dcdb4e038156b56 Passed; 576 source files, 9 crates
python -B -m unittest scripts.tests.test_architecture_budgets scripts.tests.test_architecture_dependencies scripts.tests.test_architecture_governance 51 passed
Changed Rust files: rustfmt --edition 2024 --config skip_children=true --check; git diff --check Passed

Eight focused regressions cover both actual toolbar layouts, full padded hit area, duplicate clicks, the single-directory picker contract, cancel/retry, real Tab/Enter routing, invalid/file selections, picker failure, workspace closure, failed shell startup, profile snapshot isolation, and Unicode/space-containing paths.

The opt-in Windows native acceptance test was also run successfully in Nord/sidebar (1080 logical pixels wide) and MintLight/top tabs (760 logical pixels wide) at 192 DPI / 200% scaling. It creates isolated test terminals, checks the new shell's actual working directory, and verifies that the original tab/entity and cwd remain unchanged. Screenshots below show the real toolbar's keyboard focus in both layouts; fixture paths and terminal contents are excluded.

Project folder entry in dark/sidebar and light/top-tab layouts

Limits: the native acceptance test injects the selected directory at the picker-result boundary so it does not open a modal dialog over other work. The picker/button/cancel/keyboard route is exercised separately with GPUI test support; manual Windows picker interaction, Linux/macOS native behavior, WSL/UNC directories and other DPI values are not verified here. Full-workspace cargo fmt --all -- --check still reports unrelated existing formatting differences; only changed Rust files were formatted. These are local results, not a claim about CI or a released build.

No render hot loop is changed; filesystem work only occurs after an explicit folder selection. The installed application was not replaced or restarted for this PR.

Required Review / 必须确认

  • I followed CONTRIBUTING.md, docs/architecture.md, and docs/project-constraints.md.
  • I split responsibilities, not arbitrary line ranges; no duplicate behavior authority was added.
  • python3 scripts/check_architecture.py --base <PR-base-commit> passes; budgets were not inflated to fit the change.
  • Tests cover success and failure; platform/feature coverage limitations are stated.
  • New messages use typed i18n IDs and matching placeholders; untranslated content has an explicit fallback.
  • Governance changes include a counterexample, corrected contract, tests, and a maintainer-reviewed decision. N/A: no governance changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] 支持打开文件管理器选取项目位置

1 participant