TT-7316 Bold workflow shows after adding step#310
Conversation
637facd to
4242789
Compare
- update sql to fix issues - Add Bold workflow steps and enhance tool settings handling - Enhance OrgHead and StepEditor components with team workflow process integration - Integrated `useTeamWorkflowProcess` into `OrgHead` to manage workflow steps based on the organization context. - Updated `StepEditor` to utilize the new `getProcessTemplateSteps` and `resolveOrgWorkflowStepPresentation` functions for improved step handling and presentation. - Refactored `useOrgWorkflowSteps` to streamline workflow step retrieval and processing. - Improved error handling in `getTool` and `getToolSettings` functions for better resilience against malformed data. - Adjusted `useTeamCreate` to log created workflow steps for better debugging. - Remove console log statements from useOrgWorkflowSteps, useStepTool, and useTeamCreate for cleaner code and improved performance.
4242789 to
2e1b24d
Compare
There was a problem hiding this comment.
Pull request overview
This PR improves organization workflow step handling so the Step Editor and workflow creation stay aligned for process-specific workflows (notably BOLD), while also making tool/settings parsing more resilient to malformed or legacy data.
Changes:
- Added process-scoped workflow step resolution utilities (
getProcessTemplateSteps,resolveOrgWorkflowStepPresentation) and improved deterministic sorting/normalization inuseOrgWorkflowSteps. - Updated
StepEditorto load steps for the selected process and to correct step presentation when org step data is mis-sequenced or duplicated. - Hardened
getTool/getToolSettingsagainst invalid JSON and legacy settings formats, and added Cypress coverage for BOLD step rendering + legacy settings.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/renderer/src/crud/useStepTool.ts | Adds try/catch around tool JSON parsing and normalizes legacy settings values to a JSON string. |
| src/renderer/src/crud/useOrgWorkflowSteps.tsx | Introduces template-step retrieval and presentation resolution helpers; improves sort stability and normalizes sequence numbers when creating org steps. |
| src/renderer/src/components/StepEditor/StepEditor.tsx | Loads org workflow steps scoped to the current process and uses the new resolution helpers to display correct names/tools/ordering. |
| src/renderer/src/components/StepEditor/StepEditor.cy.tsx | Adds Cypress component tests validating BOLD step loading and legacy embedded-object settings handling. |
| src/renderer/src/components/App/OrgHead.tsx | Uses useTeamWorkflowProcess so “Edit Workflow” opens the Step Editor for the team’s actual workflow process (fallback to default). |
| migration/bold-workflow/insert-bold-workflowsteps.sql | Updates the BOLD workflow seed to use jsonb values and the expected nested-settings string format. |
| .vscode/mcp.json | Adds additional MCP servers (chrome-devtools, playwright) to workspace MCP config. |
| // Scope to the team's workflow when `process` is set (e.g. bold). Using | ||
| // 'ANY' merged every process and sorted only by sequencenum, so Edit Workflow | ||
| // could disagree with the steps CreateOrgWorkflowSteps just added. | ||
| GetOrgWorkflowSteps({ |
There was a problem hiding this comment.
If a team has mixed process workflow steps, I think we want to see them all. Why do your bold teams have mixed workflow steps. I think this is an unnecessary and dangerous change. We send in the defaultworkflow, so there will always be a process, and 'ANY' will never be used. THere are 171 teams on prod with mixed processes. Will only steps from draft show up for them?
There was a problem hiding this comment.
I think "merged every process and sorted only by sequencenum" is exactly what we want to be doing, even if AI doesn't understand it.
|
This logic would not work because it mis-diagnosed the root cause of the problem |
useTeamWorkflowProcessintoOrgHeadto manage workflow steps based on the organization context.StepEditorto utilize the newgetProcessTemplateStepsandresolveOrgWorkflowStepPresentationfunctions for improved step handling and presentation.useOrgWorkflowStepsto streamline workflow step retrieval and processing.getToolandgetToolSettingsfunctions for better resilience against malformed data.useTeamCreateto log created workflow steps for better debugging.These changes enhance the workflow management capabilities and improve the overall robustness of the application.