Skip to content

VB-277 :fix(VB-277/truncate-handlling):function added to remove and store styles#504

Merged
csAdityaPachauri merged 5 commits into1st-oct-2025from
VB-277/truncate-handlling-develop_v4
Sep 24, 2025
Merged

VB-277 :fix(VB-277/truncate-handlling):function added to remove and store styles#504
csAdityaPachauri merged 5 commits into1st-oct-2025from
VB-277/truncate-handlling-develop_v4

Conversation

@csAdityaPachauri
Copy link
Copy Markdown
Contributor

fix(visual-builder): implement style preservation for truncate handling

Add functions to store and restore element styles during truncation
Ensure visual state consistency when elements are truncated
Update overlay and focus state management for truncated elements

@csAdityaPachauri csAdityaPachauri requested a review from a team as a code owner September 16, 2025 11:05
@csAdityaPachauri csAdityaPachauri changed the title fix(VB-277/truncate-handlling):function added to remove and store styles VB-277 :fix(VB-277/truncate-handlling):function added to remove and store styles Sep 16, 2025
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Sep 16, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 72.22% 9348 / 12942
🔵 Statements 72.22% 9348 / 12942
🔵 Functions 72.16% 337 / 467
🔵 Branches 83.47% 1182 / 1416
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/visualBuilder/generators/generateOverlay.tsx 89.44% 76.92% 100% 89.44% 135-144, 181, 199-202, 227-230, 240-241
src/visualBuilder/listeners/mouseClick.ts 73.18% 64.51% 90.9% 73.18% 93, 103-109, 114-115, 118-123, 136-164, 176-177, 190-191, 236, 256-257, 307-313, 351-357, 375-385
src/visualBuilder/utils/clearStyles.ts 100% 100% 100% 100%
src/visualBuilder/utils/enableInlineEditing.ts 98.57% 91.66% 100% 98.57% 38
src/visualBuilder/utils/handleIndividualFields.ts 98.34% 85.71% 100% 98.34% 95-96
src/visualBuilder/utils/truncateHandler.ts 27.39% 16.66% 50% 27.39% 29, 31-32, 35-36, 40, 42-43, 46-47, 51-62, 70-102, 110-119
src/visualBuilder/utils/updateFocussedState.ts 56.67% 59.64% 100% 56.67% 50, 62-64, 66-68, 70, 213-216, 218-249, 280-281, 340-344, 347-364, 367-377, 380-397, 404-449, 456-478, 484-486
Generated in workflow #560 for commit b225a71 by the Vitest Coverage Report Action

Comment on lines +60 to +62
originalElement.style.visibility = "hidden";
originalElement.style.transition = "none";
originalElement.style.animation = "none";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please make a utility for hiding and showing the original element.

Comment on lines +39 to +41
if (computedStyles.display && computedStyles.display.includes("box")) {
styles.display = computedStyles.display;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we should avoid this. This will turn inline span into block elements.

Base automatically changed from develop_v4 to stage_v4 September 16, 2025 17:58
@KANE-99 KANE-99 requested a review from a team as a code owner September 16, 2025 17:58
Base automatically changed from stage_v4 to main September 18, 2025 12:12
Copy link
Copy Markdown
Contributor

@faraazb faraazb left a comment

Choose a reason for hiding this comment

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

Left some comments

Comment thread src/visualBuilder/utils/clearStyles.ts Outdated
}
>();

export function clearVisibelityStyles(element: HTMLElement) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
export function clearVisibelityStyles(element: HTMLElement) {
export function clearVisibilityStyles(element: HTMLElement) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please add a description for this function

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@faraazb, can you please check once again?
done with the requested changes

Comment thread src/visualBuilder/utils/clearStyles.ts Outdated
@@ -0,0 +1,34 @@
const originalStyles = new WeakMap<
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
const originalStyles = new WeakMap<
const elementStyles = new WeakMap<

Comment thread src/visualBuilder/utils/clearStyles.ts Outdated
element.style.animation = "none";
}

export function restoreVisibelityStyles(element: HTMLElement) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
export function restoreVisibelityStyles(element: HTMLElement) {
export function restoreVisibilityStyles(element: HTMLElement) {

@csAdityaPachauri csAdityaPachauri changed the base branch from main to 1st-oct-2025 September 21, 2025 17:03
Copy link
Copy Markdown
Contributor

@faraazb faraazb left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@csAdityaPachauri csAdityaPachauri merged commit 0619529 into 1st-oct-2025 Sep 24, 2025
10 checks passed
@csAdityaPachauri csAdityaPachauri deleted the VB-277/truncate-handlling-develop_v4 branch September 24, 2025 19:07
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