Skip to content

feat(workflow): browse database steps by model (catalog drill-down)#2616

Open
simlarsen wants to merge 1 commit into
feat/workflow-query-filterfrom
feat/workflow-database-picker
Open

feat(workflow): browse database steps by model (catalog drill-down)#2616
simlarsen wants to merge 1 commit into
feat/workflow-query-filterfrom
feat/workflow-database-picker

Conversation

@simlarsen

Copy link
Copy Markdown
Contributor

Tames the catalog for good — a model → operation drill-down for database steps. The verifiable, zero-morph version of the "block collapse". Stacked on #2615.

What

Every database model that enables workflows adds ~11 near-identical components (Find/Create/Update/Delete + On-Create/Update/Delete). With hundreds of models the picker is an enormous flat list. This adds a "Work with database records" mode: pick a model, then pick the operation.

  • Pure groupComponentsByModel(components, type) groups the real catalog components by their tableName (sorted by model name); filterModelGroups searches them.
  • DatabaseStepPicker is the model → operation drill-down (searchable model grid, back nav, operation cards).
  • ComponentsModal gets a "Work with database records" toggle (shown only when model-backed components exist for the current type); selecting an operation flows into the existing "Add to Workflow" selection — nothing else in the picker changes.

Why this is safe (vs the block-morph collapse)

No id is reconstructed or morphed. The picker hands back the exact component object the engine already knows (grouped by the real tableName those components carry). So there's zero fidelity risk — the failure mode the full block-collapse carried (a morphed id that doesn't resolve → a broken step) simply can't happen here.

Verification

  • DatabaseStepUtils.test.ts: grouping by model, sort by name, static-component exclusion, trigger-vs-component separation, case-insensitive search.
  • DatabaseStepPicker.test.tsx (RTL): lists models, drills into a model, selects an operation (returns the real component), back navigation.
  • 114 workflow tests pass; tsc ✓, eslint ✓.
  • Worth a 30-sec manual smoke-test: the toggle lives inside the existing ComponentsModal (a SideOver), which isn't exercised end-to-end in jsdom; the drill-down + grouping are unit/RTL-tested in isolation.

🤖 Generated with Claude Code

…ge list

Every database model that enables workflows adds ~11 near-identical components
(Find/Create/Update/Delete + On-Create/Update/Delete). With hundreds of models
the component picker becomes an enormous flat list. This adds a "Work with
database records" mode: pick a model, then pick the operation.

- Pure groupComponentsByModel(components, type) groups the REAL catalog
  components by their tableName (sorted by model name), and filterModelGroups
  searches them. No id is reconstructed or morphed — the picker hands back the
  exact component object the engine already knows, so there's zero fidelity
  risk (unlike a block-morph collapse).
- DatabaseStepPicker is the model → operation drill-down (searchable model
  grid, back navigation, operation cards).
- ComponentsModal gets a "Work with database records" toggle (shown only when
  model-backed components exist for the current type); selecting an operation
  flows into the existing "Add to Workflow" selection, so nothing else in the
  picker changes.

Tests: groupComponentsByModel / filterModelGroups (grouping, sort, static
exclusion, trigger vs component, search) + DatabaseStepPicker RTL (lists
models, drills in, selects an operation, goes back). 114 workflow tests pass;
tsc + eslint clean.

Note worth a quick manual smoke-test: the toggle lives inside the existing
ComponentsModal (a SideOver), which isn't exercised end-to-end in jsdom; the
drill-down component and grouping are unit/RTL-tested in isolation.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@simlarsen

Copy link
Copy Markdown
Contributor Author

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

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.

2 participants