Skip to content

Bulk add workspaces (multi-select folder picker) #383

@amanthanvi

Description

@amanthanvi

Problem

Adding many projects is currently tedious: the picker only allows selecting a single folder, so users must repeat "Add Workspace…" for every project.

Drag/drop can add multiple, but it loops adds without awaiting, which can cause focus/active-workspace bouncing and inconsistent results when many paths are dropped.

Proposal

Enable multi-select folder picking for workspaces and centralize bulk-add behavior so picker and drag/drop share the same pipeline.

UX

  • "Add Workspace…" opens a directory picker that supports selecting multiple folders.
  • After selection: add all valid, unique folders.
  • Activation semantics: activate only the first newly-added workspace (predictable; avoids focus bouncing).
  • Summary: show a single summary dialog only when something was skipped or failed (avoid noisy popups).

Edge cases

  • Skip folders that are already present (path normalized; avoid duplicates).
  • Skip non-directories (relevant for drag/drop, and defensive for picker).
  • Partial failure: continue adding remaining selections; include failures in the summary (and/or Debug panel).

Implementation notes (suggested)

  • Frontend
    • Add pickWorkspacePaths() helper (uses @tauri-apps/plugin-dialog open({ directory: true, multiple: true })).
    • Keep existing single-select helper for other flows (clone copies folder / git root pickers).
    • Add a bulk add function in useWorkspaces that:
      • normalizes + dedupes selected paths
      • skips existing workspace paths
      • adds sequentially via existing add_workspace IPC
      • activates only the first successful add
      • aggregates skipped/failed counts and shows one summary message when needed
    • Route drag/drop additions through the same bulk pipeline.
  • Backend
    • No backend changes required (call existing add_workspace N times; should work in local + remote-backend modes).

Acceptance criteria

  • Multi-select folder picker adds multiple workspaces in one operation.
  • Only the first newly-added workspace becomes active.
  • Existing workspaces are not duplicated; they are skipped.
  • Drag/drop uses the same logic and does not bounce focus.
  • A single summary dialog appears only when some selections were skipped/failed.
  • Tests cover the new picker wrapper and bulk-add behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions