Skip to content

Stage imports before committing - #571

Open
gschier wants to merge 8 commits into
mainfrom
agent/stage-imports-before-commit
Open

Stage imports before committing#571
gschier wants to merge 8 commits into
mainfrom
agent/stage-imports-before-commit

Conversation

@gschier

@gschier gschier commented Aug 17, 2026

Copy link
Copy Markdown
Member

Stages parsed imports as a previewable plan before atomically committing them. Users can import into a new or current workspace while preserving destination configuration and handling environment collisions safely.

image image
  • Adds a plan/commit RPC boundary and carries detected importer metadata through the generic plugin pipeline
  • Re-roots imported folders and requests into the current workspace or selected folder without overwriting workspace settings
  • Shows the importer, destination, resource counts, and concise import details before confirm or cancel
  • Adds focused coverage for non-mutating planning, destination remapping, environment collisions, rollback, and importer compatibility

Feedback: https://feedback.yaak.app/p/update-current-workspace-during-import

@gschier
gschier marked this pull request as ready for review August 17, 2026 05:30
@greptile-apps

greptile-apps Bot commented Aug 17, 2026

Copy link
Copy Markdown

Greptile Summary

The PR separates imports into a non-mutating planning stage and an atomic commit stage, allowing users to preview resources and select a destination before persistence.

  • Adds plan and commit RPCs across desktop, web, CLI, and plugin boundaries.
  • Re-roots imported resources into a new workspace, current workspace, or selected folder.
  • Adds importer metadata, collision warnings, rollback behavior, and a confirmation UI.
  • Prevents the import dialog from being dismissed while planning or committing.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains; the previously reported dismissal race is addressed by blocking implicit dialog closure and disabling explicit cancellation while an import operation is active.

Important Files Changed

Filename Overview
apps/yaak-client/lib/importData.tsx Coordinates planning, explicit cancellation, commit, completion reporting, and navigation; the previous dismissal race is fixed by making the import dialog non-dismissible.
apps/yaak-client/components/ImportDataDialog.tsx Adds destination selection, import previews, warnings, resource counts, and loading-state guards that disable cancellation during active operations.
apps/yaak-client/components/core/Dialog.tsx Introduces a unified close-disable option covering backdrop clicks, Escape, and the built-in close button.
crates/yaak/src/import.rs Implements destination-aware import planning, resource remapping, collision handling, and atomic commit behavior.
crates-tauri/yaak-app-client/src/import.rs Exposes separate planning and commit operations through the native application boundary.
crates-cli/yaak-cli/src/commands/import_export.rs Migrates CLI imports to the same destination-aware plan-and-commit pipeline.
crates/yaak-plugins/src/manager.rs Carries detected importer metadata alongside normalized plugin resources.

Sequence Diagram

sequenceDiagram
  participant U as User
  participant UI as Import dialog
  participant RPC as Import RPC
  participant P as Importer plugin
  participant DB as Model database
  U->>UI: Select source and destination
  UI->>RPC: Plan import
  RPC->>P: Parse source
  P-->>RPC: Importer metadata and resources
  RPC-->>UI: Preview plan and warnings
  U->>UI: Confirm import
  UI->>RPC: Commit plan
  RPC->>DB: Atomic resource upsert
  DB-->>RPC: Imported resources
  RPC-->>UI: Import result
Loading

Reviews (5): Last reviewed commit: "Use model labels in import preview" | Re-trigger Greptile

Comment thread apps/yaak-client/lib/importData.tsx
greptile-apps[bot]
greptile-apps Bot previously approved these changes Aug 17, 2026
@greptile-apps
greptile-apps Bot dismissed their stale review August 17, 2026 15:33

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

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