Skip to content

Conversation

@ibetitsmike
Copy link
Contributor

When users type a non-existent path in the Add Project modal or the remote DirectoryPickerModal, they now see a 'Create Folder' button instead of just an error. Clicking it creates the folder (recursively like mkdir -p) and then either adds the project or navigates to the newly created directory.

Changes

  • Add general.createDirectory API endpoint (recursive mkdir)
  • Detect 'path does not exist' errors in ProjectCreateModal
  • Detect ENOENT errors in DirectoryPickerModal
  • Show inline 'Create Folder' button when path doesn't exist

Testing

  1. Open Add Project modal
  2. Type a non-existent path (e.g., ~/new-project-folder)
  3. Click 'Add Project' - should see 'This folder doesn't exist.' with 'Create Folder' button
  4. Click 'Create Folder' - folder is created and project is added

For remote directory picker:

  1. Connect to mux server in browser
  2. Open Add Project → Browse
  3. Type non-existent path in path input, press Enter
  4. Should see 'Folder doesn't exist.' with 'Create Folder' button
  5. Click it - folder created and navigated to

Generated with mux • Model: claude-sonnet-4-20250514 • Thinking: none

When users type a non-existent path in the Add Project modal or the
remote DirectoryPickerModal, they now see a 'Create Folder' button
instead of just an error. Clicking it creates the folder (recursively
like mkdir -p) and then either adds the project or navigates to the
newly created directory.

Changes:
- Add general.createDirectory API endpoint
- Detect 'path does not exist' errors in ProjectCreateModal
- Detect ENOENT errors in DirectoryPickerModal
- Show inline 'Create Folder' button when path doesn't exist

---
_Generated with `mux` • Model: `anthropic:claude-opus-4-5` • Thinking: `high`_
@chatgpt-codex-connector
Copy link

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

- Use primary button style instead of outline for Create Folder
- Show muted text for 'folder doesn't exist' instead of error red
- Disable Add Project / Open buttons when Create Folder is offered
When the user types a path in the input field that differs from the
currently displayed directory, clicking Open now validates that path
first instead of selecting the old directory. If the typed path doesn't
exist, shows the 'Create Folder' option.
@ibetitsmike ibetitsmike force-pushed the mike/create-folder-prompt branch from 0a5b5be to 4e9561f Compare December 16, 2025 15:29
@ibetitsmike
Copy link
Contributor Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

The void handleSelect() call was not awaited, causing the finally block
to clear isCreating while the add-project request was still in flight.
This re-enabled the button prematurely, allowing duplicate submissions.

Now we await handleSelect() and remove the redundant finally block since
handleSelect manages its own isCreating state.
The component stays mounted with isOpen toggled, so useState only runs
on first mount. When reopening with a different initialPath, we now
sync pathInput so users see their typed path (and get the create folder
prompt if it doesn't exist).
When createDirectory fails, we need to reset isCreating so the UI
doesn't get stuck in 'Adding...' mode. The error is now shown and
the user can try again or cancel.
@ibetitsmike
Copy link
Contributor Author

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Hooray!

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@ibetitsmike ibetitsmike added this pull request to the merge queue Dec 17, 2025
Merged via the queue into main with commit 0efc399 Dec 17, 2025
20 checks passed
@ibetitsmike ibetitsmike deleted the mike/create-folder-prompt branch December 17, 2025 18:32
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.

1 participant