-
Notifications
You must be signed in to change notification settings - Fork 57
Simplify AppEntryInputDialog to accept only node prop #2429
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
Conversation
Remove support for passing `app` prop directly and the associated type unions and type guards. Always fetch the app via useSWR when the node is configured. This reduces complexity and makes the component's data flow more straightforward.
|
|
Finished running flow.
|
||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR simplifies the AppEntryInputDialog component by removing the ability to pass an app prop directly, requiring all callers to provide only a node prop. The component now always fetches the app data via useSWR when the node is configured, eliminating the need for complex type unions and type guards.
Key Changes:
- Removed
Apptype import and complex prop type unions (AppEntryInputDialogFromAppEntryNodeandAppEntryInputDialogFromApp) - Eliminated type guard functions (
isFromAppEntryNodeandisFromApp) that were used to differentiate between the two prop patterns - Simplified the component to accept only
node: AppEntryNodeas a prop, making the data flow more straightforward
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
WalkthroughThe AppEntryInputDialog component was refactored to remove discriminated union-based props, replacing them with a single explicit Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
internal-packages/workflow-designer-ui/src/app/app-entry-input-dialog/dialog.tsx (1)
15-35: Props simplification and SWR usage look good; confirm behavior for unconfigured/error statesThe move to a single
node: AppEntryNodeprop and always resolvingappviauseSWRkeeps this component’s contract much simpler and matches the PR goal.Two things to double‑check:
- When
node.content.status !== "configured"(or whengetAppfails and leavesappundefined), the component ends up returningnull, so the dialog silently renders nothing. If callers can open this dialog for such nodes or hit transient network errors, consider an explicit “not configured” / “failed to load” UI instead of returningnull.- Now that the
appprop path is gone, this code always fetches viagetApp(modulo whatever cachinguseGiselle/SWR provide). If there are call sites that already have the app object in memory, you might want to reuse that via SWR’sfallbackDataor a shared cache key pattern, otherwise this behavior is fine.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
internal-packages/workflow-designer-ui/src/app/app-entry-input-dialog/dialog.tsx(1 hunks)
🧰 Additional context used
📓 Path-based instructions (8)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx,js,jsx}: Favor clear, descriptive names and type annotations over clever tricks
If you need a multi-paragraph comment, refactor until intent is obvious
**/*.{ts,tsx,js,jsx}: Use async/await and proper error handling
Variables and functions should use camelCase naming
Booleans and functions should useis,has,can,shouldprefixes
Function names should clearly indicate purpose
Files:
internal-packages/workflow-designer-ui/src/app/app-entry-input-dialog/dialog.tsx
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development-guide.mdc)
**/*.{ts,tsx}: MUST runpnpm biome check --write [filename]after EVERY code modification
All code changes must be formatted using Biome before being committed
Use Biome for formatting with tab indentation and double quotes
Follow organized imports pattern (enabled in biome.json)
Use TypeScript for type safety; avoidanytypes
Use Next.js patterns for web applications
Use async/await for asynchronous code rather than promises
Error handling: use try/catch blocks and propagate errors appropriately
Use kebab-case for all filenames
Use PascalCase for React components and classes
Use camelCase for variables, functions, and methods
Use prefixes likeis,has,can,shouldfor boolean variables (e.g.,isEnabled,hasPermission)
Use prefixes likeis,has,can,shouldfor boolean functions (e.g.,isTriggerRequiringCallsign(),hasActiveSubscription()) instead of imperative verbs
Use verbs or verb phrases for function naming that clearly indicate purpose (e.g.,calculateTotalPrice(), notprocess())Use PascalCase for React component and class names
Use TypeScript and avoid
any
Files:
internal-packages/workflow-designer-ui/src/app/app-entry-input-dialog/dialog.tsx
**/*.tsx
📄 CodeRabbit inference engine (.cursor/rules/development-guide.mdc)
Use functional components with React hooks
Files:
internal-packages/workflow-designer-ui/src/app/app-entry-input-dialog/dialog.tsx
**/*.{js,ts,tsx,jsx,py,java,cs,cpp,c,go,rb,php,swift,kt,scala,rs,dart}
📄 CodeRabbit inference engine (.cursor/rules/language-support.mdc)
Write all code comments in English
Files:
internal-packages/workflow-designer-ui/src/app/app-entry-input-dialog/dialog.tsx
**/*
📄 CodeRabbit inference engine (.cursor/rules/naming-guide.mdc)
Use kebab-case for file names (e.g.,
user-profile.ts,api-client.tsx)
Files:
internal-packages/workflow-designer-ui/src/app/app-entry-input-dialog/dialog.tsx
**/*.{js,ts,jsx,tsx}
📄 CodeRabbit inference engine (.cursor/rules/naming-guide.mdc)
**/*.{js,ts,jsx,tsx}: Use camelCase for variable names, functions, and methods
Use verbs or verb phrases for function names to clearly indicate what the function does (e.g.,calculateTotalPrice(),validateUserInput())
Use nouns or noun phrases for variable names to describe what the variable represents
Use boolean prefixes (is,has,can,should) for boolean variables and functions returning boolean values (e.g.,isEnabled,hasPermission,isTriggerRequiringCallsign())
**/*.{js,ts,jsx,tsx}: Runpnpm biome check --write [filename]after every code change
All code must be formatted with Biome before commit
Files:
internal-packages/workflow-designer-ui/src/app/app-entry-input-dialog/dialog.tsx
**/*.{ts,tsx,js,jsx,css}
📄 CodeRabbit inference engine (AGENTS.md)
Files should use kebab-case naming
Files:
internal-packages/workflow-designer-ui/src/app/app-entry-input-dialog/dialog.tsx
**/*.{tsx,ts}
📄 CodeRabbit inference engine (AGENTS.md)
Components should use PascalCase naming
Files:
internal-packages/workflow-designer-ui/src/app/app-entry-input-dialog/dialog.tsx
🧠 Learnings (11)
📓 Common learnings
Learnt from: CR
Repo: giselles-ai/giselle PR: 0
File: internal-packages/workflow-designer-ui/src/new-editor/AGENTS.md:0-0
Timestamp: 2025-11-25T03:07:19.740Z
Learning: Applies to internal-packages/workflow-designer-ui/src/new-editor/**/*.{ts,tsx} : Lift actions into the store (e.g., `updateNode`) and call them from components needing mutations instead of passing mutation callbacks as props
Learnt from: CR
Repo: giselles-ai/giselle PR: 0
File: internal-packages/workflow-designer-ui/src/new-editor/AGENTS.md:0-0
Timestamp: 2025-11-25T03:07:19.740Z
Learning: Applies to internal-packages/workflow-designer-ui/src/new-editor/components/node/**/*.{ts,tsx} : In Node component, select exactly the node data, derived connection ids, and UI flags needed, providing a custom equality function that combines strict equality for references with `shallow` for arrays
📚 Learning: 2025-11-25T03:07:19.740Z
Learnt from: CR
Repo: giselles-ai/giselle PR: 0
File: internal-packages/workflow-designer-ui/src/new-editor/AGENTS.md:0-0
Timestamp: 2025-11-25T03:07:19.740Z
Learning: Applies to internal-packages/workflow-designer-ui/src/new-editor/**/*.{ts,tsx} : Lift actions into the store (e.g., `updateNode`) and call them from components needing mutations instead of passing mutation callbacks as props
Applied to files:
internal-packages/workflow-designer-ui/src/app/app-entry-input-dialog/dialog.tsx
📚 Learning: 2025-11-25T03:07:19.740Z
Learnt from: CR
Repo: giselles-ai/giselle PR: 0
File: internal-packages/workflow-designer-ui/src/new-editor/AGENTS.md:0-0
Timestamp: 2025-11-25T03:07:19.740Z
Learning: Applies to internal-packages/workflow-designer-ui/src/new-editor/**/*.{ts,tsx} : Replace context-wide reads from `src/editor/v2` with fine-grained selectors against the Zustand store
Applied to files:
internal-packages/workflow-designer-ui/src/app/app-entry-input-dialog/dialog.tsx
📚 Learning: 2025-11-25T03:07:19.740Z
Learnt from: CR
Repo: giselles-ai/giselle PR: 0
File: internal-packages/workflow-designer-ui/src/new-editor/AGENTS.md:0-0
Timestamp: 2025-11-25T03:07:19.740Z
Learning: Applies to internal-packages/workflow-designer-ui/src/new-editor/components/node/**/*.{ts,tsx} : In Node component, select exactly the node data, derived connection ids, and UI flags needed, providing a custom equality function that combines strict equality for references with `shallow` for arrays
Applied to files:
internal-packages/workflow-designer-ui/src/app/app-entry-input-dialog/dialog.tsx
📚 Learning: 2025-11-25T03:07:19.740Z
Learnt from: CR
Repo: giselles-ai/giselle PR: 0
File: internal-packages/workflow-designer-ui/src/new-editor/AGENTS.md:0-0
Timestamp: 2025-11-25T03:07:19.740Z
Learning: Applies to internal-packages/workflow-designer-ui/src/new-editor/**/*.{ts,tsx} : In selectors, avoid selecting full state; select by id (e.g., `s.nodesById[id]`) and derive small, stable shapes
Applied to files:
internal-packages/workflow-designer-ui/src/app/app-entry-input-dialog/dialog.tsx
📚 Learning: 2025-11-25T03:07:19.740Z
Learnt from: CR
Repo: giselles-ai/giselle PR: 0
File: internal-packages/workflow-designer-ui/src/new-editor/AGENTS.md:0-0
Timestamp: 2025-11-25T03:07:19.740Z
Learning: Applies to internal-packages/workflow-designer-ui/src/new-editor/**/*.{ts,tsx} : Keep derivations simple and stable in selectors; maintain ordering when mapping to arrays so equality checks can short-circuit
Applied to files:
internal-packages/workflow-designer-ui/src/app/app-entry-input-dialog/dialog.tsx
📚 Learning: 2025-11-25T03:07:19.740Z
Learnt from: CR
Repo: giselles-ai/giselle PR: 0
File: internal-packages/workflow-designer-ui/src/new-editor/AGENTS.md:0-0
Timestamp: 2025-11-25T03:07:19.740Z
Learning: Applies to internal-packages/workflow-designer-ui/src/new-editor/components/**/*.{ts,tsx} : Do not subscribe to `ui` or `nodesById` wholesale; always pick the narrow fields by id that your component needs
Applied to files:
internal-packages/workflow-designer-ui/src/app/app-entry-input-dialog/dialog.tsx
📚 Learning: 2025-11-25T03:07:19.740Z
Learnt from: CR
Repo: giselles-ai/giselle PR: 0
File: internal-packages/workflow-designer-ui/src/new-editor/AGENTS.md:0-0
Timestamp: 2025-11-25T03:07:19.740Z
Learning: Applies to internal-packages/workflow-designer-ui/src/new-editor/**/*.{ts,tsx} : Use `updateNode(id, patch)` to patch a single node in `nodesById` without touching other nodes
Applied to files:
internal-packages/workflow-designer-ui/src/app/app-entry-input-dialog/dialog.tsx
📚 Learning: 2025-11-25T03:05:31.051Z
Learnt from: CR
Repo: giselles-ai/giselle PR: 0
File: .cursor/rules/edit-workspace-tour.mdc:0-0
Timestamp: 2025-11-25T03:05:31.051Z
Learning: Applies to internal-packages/workflow-designer-ui/src/editor/workspace-tour/workspace-tour.tsx : Update the `TourGlobalStyles` component in `workspace-tour.tsx` for animation changes
Applied to files:
internal-packages/workflow-designer-ui/src/app/app-entry-input-dialog/dialog.tsx
📚 Learning: 2025-11-25T03:07:07.498Z
Learnt from: CR
Repo: giselles-ai/giselle PR: 0
File: internal-packages/workflow-designer-ui/src/editor/properties-panel/trigger-node-properties-panel/providers/github-trigger/AGENTS.md:0-0
Timestamp: 2025-11-25T03:07:07.498Z
Learning: Applies to internal-packages/workflow-designer-ui/src/editor/properties-panel/trigger-node-properties-panel/providers/github-trigger/**/*.tsx : Wrap all state updates in `startTransition` for consistent UI behavior during configuration and reconfiguration flows.
Applied to files:
internal-packages/workflow-designer-ui/src/app/app-entry-input-dialog/dialog.tsx
📚 Learning: 2025-11-25T03:07:19.740Z
Learnt from: CR
Repo: giselles-ai/giselle PR: 0
File: internal-packages/workflow-designer-ui/src/new-editor/AGENTS.md:0-0
Timestamp: 2025-11-25T03:07:19.740Z
Learning: Applies to internal-packages/workflow-designer-ui/src/new-editor/**/*.{ts,tsx} : Use shallow equality for arrays and objects in selectors to avoid false-positive updates
Applied to files:
internal-packages/workflow-designer-ui/src/app/app-entry-input-dialog/dialog.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: codeql / languages (javascript) / Perform CodeQL for javascript
- GitHub Check: Cursor Bugbot
- GitHub Check: check
🔍 QA Testing Assistant by Giselle📋 Manual QA ChecklistBased on the changes in this PR, here are the key areas to test manually:
✨ Prompt for AI AgentsUse the following prompts with Cursor or Claude Code to automate E2E testing: 📝 E2E Test Generation Prompt |
shige
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! 👍
User description
Remove support for passing
appprop directly and the associated type unions and type guards. Always fetch the app via useSWR when the node is configured. This reduces complexity and makes the component's data flow more straightforward.PR Type
Enhancement
Description
Removes union type and type guard functions for props
Simplifies component to accept only
nodepropAlways fetches app data via useSWR when configured
Eliminates unnecessary useMemo logic for app resolution
Diagram Walkthrough
File Walkthrough
dialog.tsx
Remove app prop support and type guardsinternal-packages/workflow-designer-ui/src/app/app-entry-input-dialog/dialog.tsx
Apptype import and union type definitions(
AppEntryInputDialogFromAppEntryNode,AppEntryInputDialogFromApp)isFromAppEntryNode()andisFromApp()node: AppEntryNodeparameternode configuration status
useMemoimportNote
Simplifies
AppEntryInputDialogto accept onlynodeand always fetch the app via SWR, removing theappprop and related unions/guards.internal-packages/workflow-designer-ui/src/app/app-entry-input-dialog/dialog.tsxnode; remove support forappprop and associated union types/type guards.appwithuseSWRwhennode.content.status === "configured".useMemoand unused imports; simplifyisLoading/apphandling.Written by Cursor Bugbot for commit fc3fc27. This will update automatically on new commits. Configure here.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.