-
Notifications
You must be signed in to change notification settings - Fork 96
feat(DesignerV2): Added global change count selector, isDraft designer option
#8546
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
🤖 AI PR Validation ReportPR Review ResultsThank you for your submission! Here's detailed feedback on your PR title and body compliance:✅ PR Title
✅ Commit Type
✅ Risk Level
✅ What & Why
✅ Impact of Change
✅ Test Plan
|
| Section | Status | Recommendation |
|---|---|---|
| Title | ✅ | |
| Commit Type | ✅ | |
| Risk Level | ✅ | |
| What & Why | ✅ | |
| Impact of Change | ✅ | |
| Test Plan | ✅ | |
| Contributors | Credit collaborators if relevant (optional) | |
| Screenshots/Videos | ✅ |
PR passes template and content review checks, and the advised risk matches your assignment (Low). No changes required. You may merge after code review. Thank you for helping maintain high-quality documentation and process!
Last updated: Fri, 07 Nov 2025 17:25:40 GMT
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 adds a changeCount tracking mechanism across the designer state to monitor the number of modifications made to workflows, workflow parameters, and notes. This provides a counter that increments with each user action, complementing the existing isDirty boolean flag.
Key changes:
- Added
changeCountstate property and increment logic to workflow, workflow parameters, and notes slices - Created selector hooks to access individual and combined change counts
- Exported a consolidated
useChangeCounthook that aggregates counts from all three state slices
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| libs/designer-v2/src/lib/core/state/workflow/workflowInterfaces.ts | Added changeCount property to WorkflowState interface |
| libs/designer-v2/src/lib/core/state/workflow/workflowSlice.ts | Initialized changeCount to 0 and incremented it in reducers that set isDirty |
| libs/designer-v2/src/lib/core/state/workflow/workflowSelectors.ts | Added useWorkflowChangeCount selector hook |
| libs/designer-v2/src/lib/core/state/workflowparameters/workflowparametersSlice.ts | Added changeCount state and increment logic for parameter operations |
| libs/designer-v2/src/lib/core/state/workflowparameters/workflowparametersselector.ts | Added useWorkflowParametersChangeCount selector hook |
| libs/designer-v2/src/lib/core/state/notes/notesSlice.ts | Added changeCount state and increment logic for note operations |
| libs/designer-v2/src/lib/core/state/notes/notesSelectors.ts | Added useNotesChangeCount selector hook |
| libs/designer-v2/src/lib/core/state/global.ts | Created useChangeCount hook that aggregates all three change counts |
| libs/designer-v2/src/lib/core/index.ts | Exported useChangeCount hook in public API |
Comments suppressed due to low confidence (1)
libs/designer-v2/src/lib/core/state/workflowparameters/workflowparametersSlice.ts:92
- The
initializeParametersaction replaces the entire definitions object but doesn't resetchangeCountto 0. This could lead to an incorrect count if parameters are reinitialized (e.g., when loading a different workflow). Consider whetherchangeCountshould be reset during initialization to maintain accurate tracking.
initializeParameters: (state, action: PayloadAction<Record<string, WorkflowParameterDefinition>>) => {
state.definitions = action.payload;
},
libs/designer-v2/src/lib/core/state/workflowparameters/workflowparametersSlice.ts
Show resolved
Hide resolved
isDraft designer option
…ner option (#8546) * Added global change count selector * Added "isDraft" flag
Commit Type
Risk Level
What & Why
Added global change count selector, this is incremented each time the dirty flag would be set.
Added
isDraftdesigner option.Impact of Change
Test Plan
Contributors
@rllyy97
Screenshots/Videos
N/A