Skip to content

Add path autocomplete + folder picker to add-project flow#29

Merged
Ed-Barnes937 merged 1 commit into
mainfrom
add-project-path-autocomplete
Jun 28, 2026
Merged

Add path autocomplete + folder picker to add-project flow#29
Ed-Barnes937 merged 1 commit into
mainfrom
add-project-path-autocomplete

Conversation

@Ed-Barnes937

Copy link
Copy Markdown
Collaborator

What

The add-project / scan-directory path input was a blind free-text field. This makes it a live path autocomplete with a native folder picker, seeded with ~/ as the base directory.

  • Type to filter — directories matching what you've typed appear in a dropdown, updating as you go (debounced).
  • Tab completes to the longest common prefix.
  • ↑/↓ highlight a match; Enter on a highlight drills into that directory, Enter on free text commits the project.
  • Browse… opens the OS folder picker as a fallback.

How

Backend (src-tauri/)

  • projects.rs — new stateless complete_path(partial) -> Vec<String> command, with directory-listing logic ported from claude-commander's (private) tui/path_completer.rs. Unified tilde handling into one expand_tilde/unexpand_tilde helper (removed the old shellexpand_tilde) and applied it to add_project. Added 5 unit tests.
  • main.rs — registered complete_path; added tauri_plugin_dialog::init().
  • Cargo.toml / capabilities/default.jsontauri-plugin-dialog + dialog:allow-open; tempfile dev-dep.

Frontend (src/)

  • main.ts renderTopInput — dropdown, debounced complete_path, keyboard handling, and the Browse button.
  • style.css — dropdown + button styling (existing theme tokens).
  • help.ts + README.md — documented the new keys.

Tests

  • TauriSimulatorcomplete_path/add_project/scan_directory/dialog fakes driven by a seeded dirs list (no real filesystem).
  • SidebarPageObject — path-input POM helpers.
  • New addProject.iwft.ts — 5 scenarios (filter, Tab, drill-in, commit, Browse).

Verification

typecheck ✓ · cargo fmt/clippy clean ✓ · 5 backend tests ✓ · 49 Vitest ✓ · 68 iwft ✓ (incl. 5 new)

Notes

  • complete_path is synchronous — one read_dir at a 100ms debounce is negligible on the main thread.
  • Completions preserve the ~ form when typed (matches the TUI).
  • Not manually eyeballed in the running app yet; iwft can't judge visuals.

🤖 Generated with Claude Code

The add-project / scan-directory path input was a blind free-text field.
Replace it with a live directory-completion dropdown (Tab → common prefix,
↑/↓ to pick, Enter drills in or commits) plus a native "Browse…" folder
picker, seeded with ~/ as the base directory.

Backend: port the directory-listing logic from claude-commander's
path_completer.rs into a stateless complete_path command; unify tilde
expansion into one helper and apply it to add_project too. Add the
tauri-plugin-dialog plugin for the native picker.

Frontend: rework renderTopInput with the dropdown, debounced completion,
keyboard handling, and the Browse button. Add fakes + an iwft scenario.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Ed-Barnes937 Ed-Barnes937 merged commit c8acbd5 into main Jun 28, 2026
4 checks passed
@Ed-Barnes937 Ed-Barnes937 deleted the add-project-path-autocomplete branch June 28, 2026 12:25
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