Skip to content

feat(visual-builder): normalize multiline value on SYNC_FIELD for on-type canvas save#626

Merged
SahilCs15 merged 1 commit into
ce-auto-draft-lpfrom
feat/canvas-autosave-on-type
Jul 24, 2026
Merged

feat(visual-builder): normalize multiline value on SYNC_FIELD for on-type canvas save#626
SahilCs15 merged 1 commit into
ce-auto-draft-lpfrom
feat/canvas-autosave-on-type

Conversation

@SahilCs15

Copy link
Copy Markdown
Contributor

Title

Normalize multiline value on SYNC_FIELD for on-type canvas save

Description

When Visual Builder saves canvas edits on type, a multiline field now sends a normalized plaintext value on the SYNC_FIELD event, matching what the commit UPDATE_FIELD sends. Previously only the commit path normalized the value, so an on-type save could persist raw editable markup for multiline fields.

The editable DOM is rewritten with the normalized value only on UPDATE_FIELD (the commit), not on SYNC_FIELD. Rewriting on every keystroke would move the caret, so on-type editing stays caret-safe while still sending the correct plaintext.

Base is feat/canvas-field-lock (stacked). Pairs with the Visual Builder change that persists canvas edits on type.

Type of Change

  • Feature

Testing

Unit tests in generateOverlay.test.ts cover both paths: the multiline value is normalized on the on-type SYNC_FIELD without rewriting the editable DOM, and the editable DOM is rewritten with the normalized value on the commit UPDATE_FIELD. Run: npx vitest run src/visualBuilder/generators/__test__/generateOverlay.test.ts. All pass.


🤖 Generated with Claude Code

…type canvas save

On the on-type SYNC_FIELD event, normalize a multiline field's value with
getMultilinePlaintext so the value sent to the editor matches what a commit
would send, without rewriting the editable DOM (which would move the caret).
The editable DOM is rewritten only on the commit UPDATE_FIELD, so inline typing
stays caret-safe while still persisting the correct plaintext on type.

Co-Authored-By: Claude <noreply@anthropic.com>
@SahilCs15
SahilCs15 requested a review from a team as a code owner July 22, 2026 12:53
@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

@github-actions

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 68% 2631 / 3869
🔵 Statements 66.87% 2673 / 3997
🔵 Functions 65.45% 470 / 718
🔵 Branches 62.67% 1619 / 2583
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/visualBuilder/generators/generateOverlay.tsx 93.75% 69.64% 100% 93.75% 132-138, 228-230
Generated in workflow #868 for commit ea7aa5e by the Vitest Coverage Report Action

@faraazb-contentstack faraazb-contentstack left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good!

Base automatically changed from feat/canvas-field-lock to ce-auto-draft-lp July 24, 2026 14:32
@SahilCs15
SahilCs15 merged commit 3f409d7 into ce-auto-draft-lp Jul 24, 2026
7 checks passed
@SahilCs15
SahilCs15 deleted the feat/canvas-autosave-on-type branch July 24, 2026 14:32
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