Skip to content

refactor(app): use in-app directory dialog for desktop project open/new - #1140

Open
Spin-Particle wants to merge 1 commit into
Science-Discovery:devfrom
Spin-Particle:feat/unify-project-dialog
Open

refactor(app): use in-app directory dialog for desktop project open/new#1140
Spin-Particle wants to merge 1 commit into
Science-Discovery:devfrom
Spin-Particle:feat/unify-project-dialog

Conversation

@Spin-Particle

Copy link
Copy Markdown
Collaborator

Issue for this PR

Closes #1139

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Desktop (Electron) diverged from web for project selection: "打开项目" went straight to the native OS directory picker (platform.openDirectoryPickerDialog branch in home.tsx and layout.tsx), and "新建项目" opened a separate DialogNewProject whose browse button spawned the same native picker via the server /file/pick-folder route. Users on desktop therefore never saw the web dialog's recent-projects list, search, or create-missing-folder flow.

This change removes the native-picker branches in chooseProject (home page and layout sidebar/command palette) and points newProject at the same DialogSelectDirectory used by web (single-select, titled "新建项目"), so desktop and web now share one consistent dialog. The native OS picker stays available as auxiliary input through the dialog's existing "浏览" button, identical to web behavior. The now-unused dialog-new-project.tsx is deleted; its i18n dialog.newProject.* keys remain because dialog-select-directory.tsx reuses them for group headers.

How did you verify your code works?

  • bun typecheck in packages/app passes.
  • bun run test in packages/app: 29 passed, 2 skipped (incl. sidebar-shell.vitest.tsx).
  • Built a macOS arm64 Electron package (Aether Desktop Dev dmg) with the rebuilt sidecar CLI; confirmed the renderer bundle contains the dialog-select-directory flow for home and no longer references the removed component.

Screenshots / recordings

Not attached here; the target UI is identical to the existing web dialog shown in the issue discussion (browse + search + confirm row, "已有项目" / "新建项目" sections).

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Desktop launched the native OS picker for open project and a separate
new-project dialog whose browse button also spawned the native picker.
Both entries now open the same in-app directory dialog as the web client
(existing projects list, search, confirm, create missing folder), and the
unused dialog-new-project component is removed. The native picker remains
available via the browse button inside the dialog, same as web.
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]: Unify desktop project open/new dialogs with the web in-app directory dialog

1 participant