Skip to content

TT-7316 make sure bold workflow steps crecored correctly#311

Merged
gtryus merged 1 commit into
developfrom
feature/TT-7316-simple-bold
May 18, 2026
Merged

TT-7316 make sure bold workflow steps crecored correctly#311
gtryus merged 1 commit into
developfrom
feature/TT-7316-simple-bold

Conversation

@gtryus
Copy link
Copy Markdown
Contributor

@gtryus gtryus commented May 18, 2026

  • update sql to fix issues
  • update AddRecord dates by one millisecond

@gtryus gtryus force-pushed the feature/TT-7316-simple-bold branch from f761486 to 78b31a5 Compare May 18, 2026 02:43
@gtryus gtryus requested a review from Copilot May 18, 2026 02:45
- update sql to fix issues
- update AddRecord dates by one millisecond

Signed-off-by: Greg Trihus <gtryus@gmail.com>
@gtryus gtryus force-pushed the feature/TT-7316-simple-bold branch from 78b31a5 to 18a87e8 Compare May 18, 2026 02:46
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

Fixes how Bold workflow steps are recorded by aligning the SQL seed/migration with the renderer's expectation that workflowsteps.tool.settings is a stringified JSON blob, and ensures that the dateCreated values of the workflow steps created in the renderer are strictly increasing so step ordering by creation time is stable. It also wires the StepEditor opened from OrgHead to use the team's actual workflow process instead of hard-coding the default.

Changes:

  • SQL: store settings as an escaped JSON string (matching JSON.parse(settings) consumers), cast literals to jsonb, and parameterize the seeded user via :user_email.
  • Renderer: add useNewTime hook and thread per-step monotonically-increasing dateCreated values through AddRecordAddOrgWFToOpsCreateOrgWorkflowSteps; refactor CreateOrgWorkflowSteps to mutate a caller-supplied opArray instead of returning one.
  • UI: OrgHead's StepEditor now uses useTeamWorkflowProcess(orgId) so it edits the team's actual process rather than defaultWorkflow.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
migration/bold-workflow/insert-bold-workflowsteps.sql Quote settings JSON correctly, cast to jsonb, and resolve lastmodifiedby via :user_email.
src/renderer/src/utils/useNewTime.ts New hook producing strictly-incrementing UTC ISO timestamps for batch record creation.
src/renderer/src/model/baseModel.tsx AddRecord now accepts an optional dateCreated override.
src/renderer/src/crud/useOrgWorkflowSteps.tsx Use useNewTime for each org workflow step; change CreateOrgWorkflowSteps to mutate caller's opArray; make AddOrgWFToOps synchronous.
src/renderer/src/crud/useTeamCreate.ts Adapt to the new CreateOrgWorkflowSteps signature.
src/renderer/src/components/App/OrgHead.tsx Pass the team's actual workflow process to StepEditor instead of defaultWorkflow.
.vscode/mcp.json Add chrome-devtools and playwright MCP server entries.
.gitignore Ignore *.lscache files.

};

const setCurrent = () => {
created.current = DateTime.now().toUTC().toMillis();
Comment on lines 112 to 129
@@ -120,10 +123,9 @@ export const useOrgWorkflowSteps = () => {
Boolean(s?.keys?.remoteId) !== offlineOnly
)
.sort((a, b) => a.attributes.sequencenum - b.attributes.sequencenum);
const opArray: RecordOperation[] = [];
setTime();
for (let stepIndex = 0; stepIndex < processSteps.length; stepIndex++)
AddOrgWFToOps(tb, processSteps[stepIndex] as WorkflowStepD, org, opArray);
return opArray;
};
Comment on lines +8 to 9
-- Variable: :user_email - email address of the user to associate with created/modified records

@gtryus gtryus merged commit d84c560 into develop May 18, 2026
2 checks passed
@gtryus gtryus deleted the feature/TT-7316-simple-bold branch May 18, 2026 02:53
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.

2 participants