Commit Graph
9 Commits
Author SHA1 Message Date
DumiFlex b7d672396a feat(import-export): add templates bucket to engine exporter + importer 2026-05-28 00:21:51 +03:00
DumiFlex 85cf827d56 chore: pre-pair-badge polish (bundle, cascade, debug, light-theme, cleaner)
Accumulated branch work that was uncommitted alongside the pair-badge feature in the prior commit. Captured as a single sweep commit so the branch can merge cleanly; future work should commit per-feature to avoid this.
2026-05-26 11:24:43 +03:00
DumiFlex 16d6f8f72f refactor: drop legacy import/export + rename v2 to plain
Removes the v1 picker UI that lived side-by-side with the new
7-bucket picker/modal pipeline. Renames every `*V2*` / `*-v2*` symbol
to its plain form now that there is only one path.

Frontend:
- ImportExport.vue 2066 → 757 lines. Drops Mode "export"/"import"
  variants + their state, helpers, panes. Default mode is the picker
  flow.
- Deletes utils/bundleSelection.ts (only legacy consumed it) + its test.
- Deletes __tests__/ImportExport.test.ts (only exercised the legacy
  template).
- Drops api.exportBundle + api.importBundle from client.ts + their
  types (ImportBundle, ImportResult) from types.ts. Their tests in
  api-client.test.ts go with them.
- Renames inside ImportExport.vue: importV2State → importState,
  importV2Selection → importSelection, importV2Committing →
  importCommitting, clearImportV2 → clearImport,
  onImportV2SelectionReady → onImportSelectionReady,
  onImportV2PayloadReady → onImportPayloadReady. Same on CSS classes
  (wp-io-export-v2-pane → wp-io-export-pane, etc.) and data-test ids
  (io-tab-export-v2 → io-tab-export, io-export-v2-pane → io-export-pane,
  ...). Tab labels relabeled to plain "Export" / "Import".
- Same v2 → plain pass on inner components (ExportTab, ImportTab,
  ImportPicker, ConflictModal docstrings + test ids).

Backend:
- wp_api/import_export.py drops export_bundle + import_bundle handlers
  and the GET /wp/api/export + POST /wp/api/import routes.
- tests/wp_api/test_import_export.py deleted (covered the legacy
  endpoints exclusively).
- tests/wp_api/test_export_build.py — the
  test_legacy_export_endpoint_still_returns_legacy_shape regression
  case removed.

Verification:
- pnpm typecheck — clean
- pnpm vitest run src/manager — 997/997 pass + 3 pre-existing skips
- pytest tests/engine tests/wp_api — 522/522 pass
- pnpm build:manager — clean; ImportExport chunk dropped from
  84 KB to 65 KB (gzip 23.6 KB → 18.3 KB)
2026-05-24 00:04:35 +03:00
DumiFlex 19e9b4b3df refactor(wp_api): structural 404 for missing undo entry
Replace the substring-match `"not found" in error` line in
`import_undo` with an explicit `get_undo_entry` existence check
before calling `undo_import`. The handler now returns 404 only
when the undo row is structurally absent, mirroring the typed-
exception pattern (`ModuleNotFound`, `BundleNotFound`,
`CategoryNotFound`) used elsewhere in wp_api. A future engine
wording change can no longer silently degrade the 404 to 400.

Both reads share a single `db_session` so the existence check
and the destructive undo stay in one transaction context.
2026-05-22 22:33:47 +03:00
DumiFlex f3e1749914 feat(wp_api): /wp/api/import/commit + /wp/api/import/undo endpoints
Add two new POST handlers in wp_api/import_export.py wrapping the
engine.importer.commit_import / undo_import functions from Task 13.

- /wp/api/import/commit: body {adds, replaces, renames}; 200 with
  {ok, undo_entry_id, summary} on success; 400 on contract/DB errors.
- /wp/api/import/undo: body {undo_entry_id}; 200 with {ok: True} on
  success; 404 on unknown entry; 400 on shape/other errors.
- Both guard request body via validate_body_size (5 MB cap).
- Engine returns undo_id; handler renames to undo_entry_id at the
  HTTP boundary to keep the locked endpoint contract decoupled from
  the engine field name.
- Legacy export_bundle + import_bundle + new export_build handlers
  remain unchanged.
2026-05-22 22:21:33 +03:00
DumiFlex c3377d8d09 feat(wp_api): post /wp/api/export/build endpoint
Wraps engine.exporter.build_export_payload behind an HTTP route so the
SPA can drive a 7-bucket export with picker-selected UUID sets. Body
shape uses 7 keys (bundle_uuids, wildcard_uuids, fixed_values_uuids,
combine_uuids, derivation_uuids, constraint_uuids, category_uuids);
each key is optional and defaults to []. Mis-typed UUIDs are silently
dropped by the exporter (cross-bucket isolation guarantee). Response
is the exporter payload returned directly, matching the legacy
/wp/api/export shape convention.
2026-05-22 20:16:06 +03:00
DumiFlex 6a0c0bf97b refactor: remove pipelines feature; add unified AllItems library view
Pipelines never paid off as a separate module kind, so peel out:

- Engine: drop pipeline_handler, remove "pipeline" from valid module
  types in repositories + schema parity.
- Manager: delete Pipelines/PipelineEditor views, PipelineSteps +
  PipelineStepPicker components and their tests. Router, sidebar,
  topbar, dashboard, TestRunner, ImportExport, resolver and
  bundleSelection repointed off the removed routes/types.
- wp_api: drop pipeline branch from modules.py + import_export.py
  (and its test).

In its place, add a unified library view:

- src/manager/views/AllItems.vue — modules + bundles in one filter
  panel with kind multi-select (OR across the 6 kinds). Reachable
  via the Dashboard "View all" link.
- ModuleListView grew the slots/props AllItems needs; BundleAddChild
  + Dashboard + ImportExport updated alongside.

Misc polish along the way: kind-icons / theme tokens / display-prefs
touch-ups, ContextWidget + DebugViewer + AssemblerHelper small fixes,
MockModuleCard + ModulePickerModal tweaks, _shared widget cleanup.
2026-05-17 20:50:26 +03:00
DumiFlex 1ff08eed1c fix(api): atomic import + recursion guard + negative pagination + dry now_iso 2026-04-26 17:16:46 +03:00
DumiFlex e51e06f0d4 feat(api): test runner + library import/export endpoints 2026-04-26 16:53:49 +03:00