refactor: split rename and reorganize files and functions#3191
Open
Iru89 wants to merge 1 commit intoBLT-2254-plugin-flow-builder-allow-go-to-flow-to-aia-gent-as-a-follow-upfrom
Open
Conversation
| Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Pure structural refactor of
botonic-plugin-flow-builder: splits, renames, and relocates files and functions to reduce coupling and improve module boundaries. No logic changes — only file organisation and import updates.Context
The
action/index.tsxfile was doing too much: it definedFlowBuilderContext, thegetContextfactory, and thefilterContentshelper alongside the React component. This forced all action modules (fallback.ts,knowledge-bases.ts,payload.ts, etc.) to import shared types fromindex.tsx, creating unnecessary coupling to the entry-point file.Similarly,
structured-output/flow-builder-content.tswas buried insideaction/ai-agent/, making it hard to discover and reuse.Approach taken / Explain the design
Files moved / renamed
action/ai-agent/index.tsaction/ai-agent-from-user-input.tsaction/ai-agent/structured-output/flow-builder-content.tsstructured-output/flow-builder-content.tsNew file:
action/context.tsExtracted from
action/index.tsx. Contains theFlowBuilderContextinterface and thegetFlowBuilderActionContextfactory (formerlygetContext):All action modules now import
FlowBuilderContextfrom./contextinstead of from./index.filterContentsmoved tofilters/index.tsThe standalone
filterContentsfunction was extracted fromaction/index.tsxand added tofilters/index.ts, next toContentFilterExecutorwhere it logically belongs.Rename:
getContentsByAiAgent→getContentsByAiAgentFromUserInputThe function was renamed to make its specific scope explicit (it only handles the user-input path, not all AI agent invocations).
Import updates
All affected files were updated to point to the new locations:
action/fallback.ts→ importsFlowBuilderContextfrom./contextaction/first-interaction.ts→ imports from./contextand./ai-agent-from-user-inputaction/knowledge-bases.ts→ importsFlowBuilderContextfrom./contextaction/payload.ts→ importsFlowBuilderContextfrom./contextaction/index.tsx→ importsfilterContentsfrom../filters,getFlowBuilderActionContextfrom./context, andgetContentsByAiAgentFromUserInputfrom./ai-agent-from-user-inputcontent-fields/flow-ai-agent.tsx→ importsFlowBuilderContentSchemafrom../structured-output/flow-builder-contenttypes.ts→ importsFlowBuilderContentMessagefrom./structured-output/flow-builder-contentTo document / Usage example
No public API changes. This is an internal refactor only.
Testing
The pull request...