fix(workflows): exclude block locked from diff detection#4631
Conversation
Toggling a block's locked state is UI metadata and should not register as a workflow drift/diff. Strip locked from hasBlockChanged, computeFieldDiff, the compare.ts blockFields list, and from extractBlockFieldsForComparison so it's also excluded from the normalized stringify-based block equality check used by drift detection and hashing. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview This removes Reviewed by Cursor Bugbot for commit 261dda2. Configure here. |
Greptile SummaryThis PR excludes the block
Confidence Score: 5/5Safe to merge — the change is a targeted, consistent exclusion of a UI-only field across every comparison entry point, with no risk to real-field change detection. The exclusion of No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Block locked toggle] --> B{Diff detection path}
B --> C[hasBlockChanged\ndiff-engine.ts]
B --> D[extractBlockFieldsForComparison\nnormalize.ts]
C -->|locked check removed| E[Block NOT in editedBlocks]
D -->|locked stripped from blockRest| G[normalizedStringify comparison]
G -->|outer guard does not fire| I[locked NOT in diff summary]
D --> J[normalizeWorkflowState hashing]
J -->|locked excluded from hash| K[Drift hash unchanged for locked-only toggle]
Reviews (1): Last reviewed commit: "fix(workflows): exclude block locked fro..." | Re-trigger Greptile |
Summary
lockedstate is UI metadata and should not register as a workflow drift/difflockedfromhasBlockChanged,computeFieldDiff, thecompare.tsblockFields list, and fromextractBlockFieldsForComparisonso it's also excluded from the normalized-stringify block equality check used by drift detection and hashingsetBlockLocked→updateLastSavedand full-state serialization) — only the diff/comparison path ignores itType of Change
Testing
diff-engine.test.tsandcompare.test.tsto assert locked toggles do NOT produce a diffextractBlockFieldsForComparisontests innormalize.test.tsprovinglockedis stripped and two blocks differing only bylockednormalize identicallylockedabsent fromchanged_fieldsChecklist