-
Notifications
You must be signed in to change notification settings - Fork 850
feat(aichat): simplify flow mode edits #6981
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
centdix
wants to merge
125
commits into
main
Choose a base branch
from
fg/flowchat
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
+3,206
−1,709
Conversation
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
Deploying windmill with
|
| Latest commit: |
5590e5c
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://0708c8a7.windmill.pages.dev |
| Branch Preview URL: | https://fg-flowchat.windmill.pages.dev |
Simplify AI chat flow mode to use only YAML-based editing: - Remove all commented-out granular tools (add_step, remove_step, set_code, etc.) - Clean up FlowAIChatHelpers interface to only essential methods - Update system prompts to focus on YAML-only workflow - Remove unused imports and type definitions This is part of a larger refactoring to simplify the flow editing experience to a single YAML editing tool with automatic diff visualization. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Remove singleton export, making it instantiable per FlowGraphV2 - Add afterFlow state tracking for auto-diff computation - Add beforeInputSchema/afterInputSchema for schema change tracking - Add $effect for reactive auto-computation when beforeFlow/afterFlow changes - Add setAfterFlow() and setInputSchemas() methods - Simplify accept/reject methods to just mark pending=false - Add validation to throw error when accepting/rejecting without beforeFlow - Update setSnapshot to accept undefined for clearing 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Import and create diffManager instance per FlowGraphV2 - Remove onAcceptModule and onRejectModule props - Add validation $effect to error if both diffBeforeFlow and moduleActions provided - Add $effect to sync props (diffBeforeFlow or moduleActions) to diffManager - Add $effect to watch current flow changes and update afterFlow - Replace computedDiff with diffManager.moduleActions - Use raw modules instead of merged flow (diffManager handles merging) - Expose getDiffManager() and setBeforeFlow() methods - Pass diffManager to graph context instead of callbacks - Remove $inspect for removed props 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Remove import of flowDiffManager singleton - Update setBeforeFlow to call graph.setBeforeFlow() - Update setModuleActions and getModuleActions to use graph.getDiffManager() - Add getDiffManager() proxy method - Simplify handleAcceptModule and handleRejectModule to use new API - Handle editor state separately from diff operations - Remove diffBeforeFlow, moduleActions, onAcceptModule, onRejectModule props passed to FlowGraphV2 - Remove onAcceptModule and onRejectModule from Props interface and destructured props 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Remove import of flowDiffManager singleton - Update revertToSnapshot to use flowModuleSchemaMap.getDiffManager() - Add null check for diffManager before using 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
FlowGraphDiffViewer already uses the correct prop patterns: - Before graph: moduleActions prop (display-only mode) - After graph: diffBeforeFlow prop (full diff mode with auto-computation) Each FlowGraphV2 instance creates its own diffManager, making the side-by-side view work correctly with independent diff state per graph. No code changes required. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Update graphBuilder.svelte.ts to pass diffManager instead of onAcceptModule/onRejectModule - Update InputNode and ModuleN type definitions with diffManager - Update ModuleNode.svelte to pass diffManager to MapItem - Update MapItem.svelte to pass diffManager to FlowModuleSchemaItem - Update FlowModuleSchemaItem.svelte to use diffManager directly for accept/reject - Replace callback-based accept/reject with direct diffManager calls - Only show accept/reject buttons when beforeFlow exists and action is pending 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Problem: After refactoring, removed modules were no longer appearing in the diff viewer because we changed effectiveModules from using the merged flow (which includes removed modules) to using raw modules. Solution: - Add mergedFlow state to flowDiffManager to store timeline's merged flow - Add markRemovedAsShadowed parameter support for side-by-side view - Store timeline.mergedFlow in auto-computation $effect - Add getter for mergedFlow and setMarkRemovedAsShadowed method - Clear mergedFlow in clearSnapshot() - Update FlowGraphV2 to set markRemovedAsShadowed in diffManager - Update effectiveModules/FailureModule/PreprocessorModule to use mergedFlow The merged flow contains all modules including removed ones, enabling: - Unified view: Removed modules appear in red with "removed" badge - Side-by-side view: Removed modules show as shadowed in After graph 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Use .nullable().optional() instead of .nullish() in Zod schemas - Simplify addModuleToFlow signature to use string | null - Coerce undefined to null when extracting parsed args - Simplify null checks to only check !== null 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Add SPECIAL_MODULE_IDS constant with INPUT, PREPROCESSOR, and FAILURE to avoid magic strings throughout the flow AI chat code. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Prevents potential memory leaks by clearing the diffDrawer reference when the FlowGraphV2 component is destroyed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
structuredClone is more efficient and type-safe for deep cloning objects. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Move getAllModulesMap and getAllModuleIds calls outside the loop to avoid redundant recomputation. Track merged IDs incrementally as modules are added. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
This reverts commit a62ba5b.
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.
No description provided.