Skip to content

feat(picker): create folders from save dialogs - #304

Closed
OldJobobo wants to merge 1 commit into
thisisgm:mainfrom
OldJobobo:feat/save-picker-new-folder
Closed

OldJobobo wants to merge 1 commit into
thisisgm:mainfrom
OldJobobo:feat/save-picker-new-folder

Conversation

@OldJobobo

@OldJobobo OldJobobo commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add a folder-creation action to Save dialogs, including browser download/save requests handled by Flea.

  • Borderless Nerd Font folder-plus toolbar icon, tooltip and accessible name; Ctrl+Shift+N opens the card.
  • Focused name field, Cancel/Create folder controls, inline errors, and responsive wrapping/scrolling. Card sizing includes focus bleed so neither action's bottom border is clipped.
  • Successful creation enters the new directory, retains the filename and refocuses it. Save remains a separate action. Cancelling the save request afterwards does not remove the directory.
  • Save-only scope; no nested creation or output-file writing. Spaces and Unicode are retained exactly.

The backend reviews and holds the parent directory, validates one name component and creates with mkdirat against that descriptor. It never overwrites existing entries. Request identities, pending ownership and committed outcomes prevent duplicate creation, stale navigation and unsafe retries.

This is independent of font-hinting PR #303 and does not change installed Flea, normal preferences or portal registration.

Isolated native preview

Synthetic files/paths only. Machine device/network rows are omitted in the demo copy; its filesystem status strip is cropped out. Screenshots and the isolated launcher live on a fork-only evidence branch, not in this code diff.

Isolated Save dialog with borderless folder-plus icon and complete New folder action borders

Validation and demo launcher:
https://github.com/OldJobobo/flea/tree/evidence/save-picker-new-folder

Validation

  • cargo build --locked: passed.
  • cargo test --locked: 2548 passed, 1 ignored, including seven new folder-operation tests.
  • tests/picker-folder.sh: 47 checks passed, covering real backend/window behavior and controlled pending/stale/error/layout cases.
  • picker-grid, picker-header, picker-selection (75 checks), picker-stall (six lifecycle scenarios), and picker-save-wrap (16 checks): passed.
  • All 14 static gates, file-budget, shell syntax and whitespace checks: passed. No new unqualified allowances; startup unit list and byte sum unchanged.
  • Actual native keyboard verification: Escape dismissed only the card; Ctrl+Shift+N reopened it; typing a name and pressing Enter created/entered the synthetic directory while retaining sample-download.zip, without submitting Save.

Known limits / review focus

picker-040 has the same two collision-phase failures with baseline UI and candidate UI using the same candidate backend. Six other phases pass. The full private-portal/native browser harness was not run because omarchy-drive is unavailable; the native picker interaction above used wtype instead. The full test matrix and fractional scaling have not been verified. See the evidence validation record for the exact scope and known platform warnings.

Kept draft for isolated user testing and review of the save-only UX and Nerd Font toolbar mark.

--[ Pi :: gpt-6.1-sol ]--
--- on behalf of: @OldJobobo

Summary by CodeRabbit

  • New Features
    • Save dialogs now offer a New folder action and the Ctrl+Shift+N shortcut. Create a folder in the current location, then save the selected file separately.
    • The new folder dialog supports keyboard navigation, error messages, and retrying after a name conflict. Creating a folder does not save the file, and cancelling afterward does not remove the folder.
  • Documentation
    • Added guidance on creating folders from Save dialogs.

@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8718dbd7-79d7-4f98-af61-e88a53b3b613
📥 Commits

Reviewing files that changed from the base of the PR and between 664d803 and f61e4fc.

⛔ Files ignored due to path filters (1)
  • tests/staticgates-unqualified.tsv is excluded by !**/*.tsv
📒 Files selected for processing (16)
  • AGENTS.md
  • README.md
  • src/backend/picker.rs
  • src/backend/picker_folder.rs
  • src/backend/picker_folder_tests.rs
  • tests/picker-folder-state.qml
  • tests/picker-folder.qml
  • tests/picker-folder.sh
  • tests/run-all.sh
  • tools/flea-file-budget
  • ui/PickerChrome.qml
  • ui/PickerFolderDialog.qml
  • ui/PickerNewFolder.qml
  • ui/PickerSave.qml
  • ui/PickerWindow.qml
  • ui/qmldir

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

📝 Walkthrough

The save picker adds a folder-creation dialog and backend operations to prepare a directory review and create one folder. After creation, the picker can open the new folder while retaining the save filename. The change also adds automated tests and documentation.

Changes: Save Picker Folder Creation

Layer / File(s) Summary
Backend folder review
src/backend/picker.rs, src/backend/picker_folder.rs, src/backend/picker_folder_tests.rs
The backend routes prepare, create, and close requests to a draft that holds a reviewed directory. Creation validates the name and review, then creates one directory relative to the held directory. Tests cover invalid names, collisions, cancellation, permissions, and parent changes.
Folder dialog and request state
ui/PickerNewFolder.qml, ui/PickerFolderDialog.qml, tests/picker-folder-state.qml
The QML controller manages preparation, review identity, creation responses, and backend availability. The modal displays the destination, accepts a folder name, and provides Create and Cancel actions. State tests cover request handling, focus, layout, and errors.
Picker integration and user entry points
ui/PickerChrome.qml, ui/PickerWindow.qml, ui/PickerSave.qml, ui/qmldir, tests/picker-folder.qml, tests/picker-folder.sh, tests/run-all.sh, README.md, AGENTS.md, tools/flea-file-budget
The save picker adds a New folder action and Ctrl+Shift+N shortcut. It blocks conflicting picker actions while the dialog is active and opens the created folder without submitting the save. Integration tests cover navigation, filename retention, and cancellation. The documentation and file budgets are updated, and the headless suite list includes heldkey.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant PickerChrome
  participant PickerWindow
  participant PickerNewFolder
  participant BackendDraft
  User->>PickerChrome: Activate New folder
  PickerChrome->>PickerWindow: Emit newFolderRequested
  PickerWindow->>PickerNewFolder: Open folder dialog
  PickerNewFolder->>BackendDraft: folderPrepare
  BackendDraft-->>PickerNewFolder: Return review and folder
  PickerNewFolder->>BackendDraft: folderCreate with review and name
  BackendDraft-->>PickerNewFolder: Return created path
  PickerNewFolder-->>PickerWindow: Emit created path
  PickerWindow->>PickerWindow: Open created folder and focus save-name field
Loading

Suggested reviewers: thisisgm

Merge Risk: 🔵 Low · up to f61e4

The change is mergeable with owner awareness: under request-channel saturation, dismissing the new-folder dialog can retain its reviewed directory until another folder operation or the picker closes.

Pre-merge checks · Passed 4 · Failed 1

Failed Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 53.85% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 5 files. (11 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks (4 passed)
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: adding folder creation to save dialogs.
Full details: Docstring Coverage

Explanation

Docstring coverage is 53.85% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 5 files. (11 skipped: 11 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@OldJobobo

Copy link
Copy Markdown
Contributor Author

@CodeRabbit review

@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@OldJobobo
OldJobobo marked this pull request as ready for review October 13, 2026 14:42
OldJobobo added a commit to OldJobobo/tick that referenced this pull request Oct 15, 2026
@thisisgm

thisisgm commented Nov 3, 2026

Copy link
Copy Markdown
Owner

The Save dialog lacked a New Folder action. A Save dialog can create and enter a folder without leaving the dialog (2c1c8c4d6d, v0.4.0). Further requested work is recorded for a later release: the additional proposed picker controls. Thanks @OldJobobo! Release.

@thisisgm thisisgm closed this Nov 3, 2026
@aizigao

aizigao commented Nov 5, 2026

Copy link
Copy Markdown

In v0.4.0, the Save dialog's New Folder action can only produce a folder called "New Folder"
— there's no way to name it, and no way to rename it from the picker. That makes the feature frustrating to use in practice. I'd like to see this PR merged.

@thisisgm

thisisgm commented Nov 5, 2026

Copy link
Copy Markdown
Owner

getting fixed for 0.4.1!

@thisisgm

thisisgm commented Nov 8, 2026

Copy link
Copy Markdown
Owner

The Save chooser could not name a new folder before making it; your design landed as a co-authored commit with the #417 fix in 4a9fac4, shipped in v0.4.1. Thanks @OldJobobo! https://github.com/thisisgm/flea/releases/tag/v0.4.1

@thisisgm thisisgm closed this Nov 8, 2026
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.

3 participants