Skip to content

AutoSize blocks on custom page when field or lang changes (BL-15996)#7748

Merged
hatton merged 2 commits intomasterfrom
autosizeOnFieldLang
Mar 26, 2026
Merged

AutoSize blocks on custom page when field or lang changes (BL-15996)#7748
hatton merged 2 commits intomasterfrom
autosizeOnFieldLang

Conversation

@JohnThomson
Copy link
Contributor

@JohnThomson JohnThomson commented Mar 16, 2026


Open with Devin

This change is Reviewable

devin-ai-integration[bot]

This comment was marked as resolved.

Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 2 new potential issues.

View 3 additional findings in Devin Review.

Open in Devin Review

@JohnThomson JohnThomson force-pushed the autosizeOnFieldLang branch from b927817 to ac0e951 Compare March 17, 2026 19:22
Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

View 5 additional findings in Devin Review.

Open in Devin Review

Comment on lines 1307 to 1311
)) {
editable.removeAttribute("data-book");
}
adjustAutoSizeForVisibleEditableInTranslationGroup(tg);
setMenuOpen(false);

Choose a reason for hiding this comment

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

🚩 Appearance classes not cleaned up when switching field type to 'None'

The new applyAppearanceClassForEditable function (line 998-1011) adds bloom-contentFirst/bloom-contentSecond/bloom-contentThird classes when switching TO a field type controlled by the appearance system (e.g., bookTitle). However, when switching FROM such a field type to 'None' (lines 1303-1311), clearFieldTypeClasses() does not remove these appearance classes — it only removes the classes explicitly listed in fieldTypeData. This means bloom-contentFirst etc. could persist as stale classes. The practical impact is likely minimal since these classes control language-role-based styling that may still be appropriate regardless of field type, but it's an asymmetry in the new code: appearance classes are added by applyAppearanceClassForEditable but never explicitly removed when no longer relevant.

(Refers to lines 1303-1311)

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Cleaning up unwanted -style classes, fetching content when setting language of an element that already has a field type, using wrapper for async DOM changes
@JohnThomson JohnThomson force-pushed the autosizeOnFieldLang branch from ac0e951 to 4f6f250 Compare March 17, 2026 22:23
Copy link
Contributor

@StephenMcConnel StephenMcConnel left a comment

Choose a reason for hiding this comment

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

@StephenMcConnel reviewed 1 file and all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on JohnThomson).

Copy link
Contributor Author

@JohnThomson JohnThomson left a comment

Choose a reason for hiding this comment

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

@JohnThomson made 2 comments.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on JohnThomson).

Comment on lines 1307 to 1311
)) {
editable.removeAttribute("data-book");
}
adjustAutoSizeForVisibleEditableInTranslationGroup(tg);
setMenuOpen(false);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Copy link
Contributor

@StephenMcConnel StephenMcConnel left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on JohnThomson).

Copy link
Contributor

@StephenMcConnel StephenMcConnel left a comment

Choose a reason for hiding this comment

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

:lgtm:

@StephenMcConnel made 1 comment.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on JohnThomson).

@hatton hatton merged commit 9e70ba4 into master Mar 26, 2026
1 of 2 checks passed
@hatton hatton deleted the autosizeOnFieldLang branch March 26, 2026 22:13
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