Skip to content

feat: add new directory option to file tree menu#12057

Open
oz-for-oss[bot] wants to merge 4 commits into
masterfrom
oz-agent/implement-issue-12056
Open

feat: add new directory option to file tree menu#12057
oz-for-oss[bot] wants to merge 4 commits into
masterfrom
oz-agent/implement-issue-12056

Conversation

@oz-for-oss
Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot commented Jun 2, 2026

Closes #12056

Summary

  • Added a New directory item next to New file in the local Project Explorer directory context menu.
  • Implemented the inline pending-edit flow for creating directories, including placeholder rendering, editor focus, filesystem creation, immediate tree insertion, and cancellation cleanup.
  • Added unit coverage for the context-menu action and directory creation behavior.

Validation

  • ./script/format
  • cargo test -p warp new_directory
  • cargo clippy -p warp --lib --tests -- -D warnings

Notes

  • Attempted cargo clippy --workspace --all-targets --all-features --tests -- -D warnings, but it could not complete in this environment because the private warp-channel-config generator was unavailable over SSH, leaving release-bundle stable_config.json / preview_config.json files ungenerated.

UI verification evidence

  • Environment: Oz cloud environment JJruPDJq2Y2vWIxA8pvAYX, checkout /workspace/warp.
  • Validated pushed commit a52b2247f5db8184d340d0be17d076bf96f91c87 on branch oz-agent/implement-issue-12056.
  • cargo test -p warp new_directory passed after installing missing sandbox protoc dependency: 3 passed, 0 failed, 4842 filtered out.
  • cargo build -p warp --bin warp passed.
  • Launched Warp with software rendering from /tmp/warp-pr12057-ui-recheck using the staging API key environment variable.
  • Context menu for parent showed New file and New directory at the top, followed by cd to directory, Open in new tab, Reveal in file manager, Rename, Delete, Attach as context, Copy path, and Copy relative path.
  • Selecting New directory opened a focused inline child row under parent; entering ui_created_dir and pressing Enter created the directory and refreshed the tree.
  • Starting New directory again, entering existing duplicate_dir, and pressing Enter removed the inline placeholder; the original duplicate_dir remained unchanged and no stale duplicate row remained.
  • Starting New directory again and pressing Escape with an empty editor removed the placeholder with no ghost row.
pr12057_project_explorer_context_menu pr12057_project_explorer_new_directory

Co-Authored-By: Oz <oz-agent@warp.dev>

Co-Authored-By: oz-for-x[bot] <284697482+oz-for-x[bot]@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

petradonka commented Jun 2, 2026

Oz UI verification for PR 12057 (feat: add new directory option to file tree menu) completed.

Environment/commit:

  • Oz environment: JJruPDJq2Y2vWIxA8pvAYX
  • Checkout: /workspace/warp
  • Commit tested: 8c9337324fc5e721003d04d5a88fcf9bcd9c9411

Validation:

  • cargo test -p warp new_directory passed (2 tests).
  • cargo build -p warp --bin warp passed.
  • Launched with cargo run -- --api-key $STAGING_USER_WARP_API_KEY; software rendering was used in the cloud environment.

UI behavior observed:

  • In Project Explorer for /tmp/warp-pr12057-ui, right-clicking existing_parent showed menu items in order: New file, New directory, cd to directory, Open in new tab, Reveal in file manager, Rename, Delete, Attach as context, Copy path, Copy relative path.
  • Selecting New directory opened a focused inline child row under existing_parent; the parent was expanded, the row showed folder affordances, and typing ui_created_dir then pressing Enter committed it.
  • The tree then showed ui_created_dir as a child of existing_parent, and filesystem verification printed directory_exists=yes.

Screenshots captured:

  • Context menu: /tmp/pr12057_project_explorer_context_menu.png (also attached to the Oz run artifact set, artifact UID 019e8786-bcc8-78e7-a301-9a3fb3b48c9c).
  • Final tree after creation: /tmp/pr12057_project_explorer_new_directory.png (also attached to the Oz run artifact set, artifact UID 019e8786-bac9-7b00-9c85-d56a26e1d6dd).
pr12057_project_explorer_context_menu pr12057_project_explorer_new_directory

@petradonka petradonka marked this pull request as ready for review June 2, 2026 09:32
@oz-for-oss
Copy link
Copy Markdown
Contributor Author

oz-for-oss Bot commented Jun 2, 2026

@petradonka

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor Author

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

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

Overview

This PR adds a New directory action to the local Project Explorer directory context menu and wires it into the existing pending-edit create flow with unit coverage.

Concerns

  • A failed directory creation can leave the dummy directory row in the tree after the pending edit has already been cleared.
  • This is a user-facing context-menu and file-tree behavior change, but the PR description does not include screenshots or a screen recording demonstrating the flow end to end. Please attach visual evidence for the menu item, inline edit state, successful creation, and cancellation/error behavior.

Verdict

Found: 0 critical, 2 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread app/src/code/file_tree/view/editing.rs
petradonka and others added 2 commits June 2, 2026 13:42
Remove transient create placeholders when file or directory creation fails so the Project Explorer tree does not retain stale rows after filesystem errors. Add regression coverage for duplicate-directory creation failures.

Co-Authored-By: Oz <oz-agent@warp.dev>
Move create-result blocks out of match scrutinees so the failed placeholder cleanup path satisfies clippy::blocks_in_conditions.

Co-Authored-By: Oz <oz-agent@warp.dev>
@petradonka
Copy link
Copy Markdown
Contributor

/oz-review

@oz-for-oss
Copy link
Copy Markdown
Contributor Author

oz-for-oss Bot commented Jun 2, 2026

@petradonka

I'm re-reviewing this pull request in response to a review request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor Author

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

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

Overview

This PR adds a Project Explorer directory context-menu action, inline pending-edit handling for directory creation, and unit coverage for the new action and failure cleanup.

Concerns

  • The successful directory-create path clones the placeholder directory state instead of updating the selected placeholder item before rebuilding, so selection preservation can look up the stale new_directory path and leave selected_item pointing at the wrong row.
  • The successful directory-create path rebuilds the flattened item list without notifying the view, which can delay repainting the newly created directory until another event occurs.

Verdict

Found: 0 critical, 2 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread app/src/code/file_tree/view/editing.rs Outdated
Comment thread app/src/code/file_tree/view/editing.rs
Update create placeholders in-place after successful filesystem creation so selection preservation and immediate repaint use the final path. Add coverage for selection after creating a directory.

Co-Authored-By: Oz <oz-agent@warp.dev>
@petradonka
Copy link
Copy Markdown
Contributor

/oz-review

@oz-for-oss
Copy link
Copy Markdown
Contributor Author

oz-for-oss Bot commented Jun 2, 2026

@petradonka

I'm re-reviewing this pull request in response to a review request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor Author

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

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

Overview

This PR adds a New directory action to the local Project Explorer directory context menu, wires it through the pending inline-edit flow, creates the directory on disk, updates the in-memory file tree, and adds focused unit coverage. The PR description includes screenshots and manual UI verification for the user-facing behavior.

Concerns

None. I did not find material correctness, security, or spec-drift issues in the annotated diff. spec_context.md reports that no approved or repository spec context was found for this PR.

Verdict

Found: 0 critical, 0 important, 0 suggestions

Approve

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add 'New directory' option to file tree context menu

2 participants