Skip to content

TT-7316 Bold workflow shows after adding step#310

Closed
gtryus wants to merge 2 commits into
developfrom
TT-7316-bold-wf-ed
Closed

TT-7316 Bold workflow shows after adding step#310
gtryus wants to merge 2 commits into
developfrom
TT-7316-bold-wf-ed

Conversation

@gtryus
Copy link
Copy Markdown
Contributor

@gtryus gtryus commented May 14, 2026

  • 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.

These changes enhance the workflow management capabilities and improve the overall robustness of the application.

@gtryus gtryus force-pushed the TT-7316-bold-wf-ed branch from 637facd to 4242789 Compare May 14, 2026 21:15
@gtryus gtryus changed the title TT-7316-bold-wf-ed TT-7316 Bold workflow shows after adding step May 14, 2026
- 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.
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 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 in useOrgWorkflowSteps.
  • Updated StepEditor to load steps for the selected process and to correct step presentation when org step data is mis-sequenced or duplicated.
  • Hardened getTool / getToolSettings against 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.

Comment thread src/renderer/src/crud/useStepTool.ts Outdated
Comment thread src/renderer/src/crud/useStepTool.ts Outdated
Comment thread src/renderer/src/components/StepEditor/StepEditor.tsx Outdated
// 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({
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@gtryus
Copy link
Copy Markdown
Contributor Author

gtryus commented May 18, 2026

This logic would not work because it mis-diagnosed the root cause of the problem

@gtryus gtryus closed this May 18, 2026
@gtryus gtryus deleted the TT-7316-bold-wf-ed branch May 18, 2026 02:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants