Skip to content

feat: corpus-back Handle, Background, Controls, MiniMap, useReactFlow#83

Merged
KailasMahavarkar merged 5 commits intomainfrom
feat/corpus-reactflow-apis
Apr 21, 2026
Merged

feat: corpus-back Handle, Background, Controls, MiniMap, useReactFlow#83
KailasMahavarkar merged 5 commits intomainfrom
feat/corpus-reactflow-apis

Conversation

@KailasMahavarkar
Copy link
Copy Markdown
Collaborator

Summary

  • Refactors src/plugins/reactflow/tools/get-api.ts corpus loader from a hardcoded ReactFlow-only lookup to a generic per-API lookup keyed by normalized API name. New slices can be added by dropping YAML into corpus/frontend/reactflow/ and registering in the namespace index
  • Adds 5 corpus-backed API slices: Handle, Background, Controls, MiniMap, useReactFlow
  • Each slice is registered in corpus/frontend/reactflow/index.yaml
  • tests/reactflow-corpus-backed-tools-behaviour.test.ts asserts Corpus Source: frontend.reactflow for each new slice; fallback check rotates to the next un-migrated API (NodeResizer)

Test plan

  • bun test tests/reactflow-corpus-backed-tools-behaviour.test.ts - 7 pass
  • bun run build - typecheck exit 0
  • Full regression across 19 test files - no failures

KailasMahavarkar and others added 5 commits April 22, 2026 02:12
Refactors the reactflow get-api corpus loader from a hardcoded ReactFlow-only lookup to a generic per-API lookup keyed by normalized API name. The loader now reads `apis[<name>].file` from the namespace index, caches per-API, and supports arbitrary API slices without further code changes.

Adds corpus/frontend/reactflow/handle.yaml with the Handle component contract (props, usage, multi-handle example, tips).
Test asserts corpus source for Handle; fallback check moves to Background.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds corpus/frontend/reactflow/background.yaml with Background component contract (variants, gap, size, cross pattern example).
Registers background in namespace index.
Test asserts corpus source for Background; fallback check moves to Controls.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds corpus/frontend/reactflow/controls.yaml with the viewport controls panel contract and custom ControlButton example.
Registers controls in namespace index.
Test asserts corpus source for Controls; fallback check moves to MiniMap.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds corpus/frontend/reactflow/minimap.yaml with the minimap overview component contract and pannable/zoomable usage.
Registers minimap in namespace index.
Test asserts corpus source for MiniMap; fallback check moves to useReactFlow.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds corpus/frontend/reactflow/usereactflow.yaml with the ReactFlowInstance hook contract, destructure example, addNodes/deleteElements examples, and non-reactivity tips.
Registers usereactflow in namespace index.
Test asserts corpus source for useReactFlow; fallback check moves to NodeResizer.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@KailasMahavarkar KailasMahavarkar merged commit fc61806 into main Apr 21, 2026
4 checks passed
@KailasMahavarkar KailasMahavarkar deleted the feat/corpus-reactflow-apis branch April 21, 2026 20:46
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