Skip to content

fix(MWPW-190279): locale-aware line-break rules for DE, BR, RO, JP in prompt-bar#748

Open
dstrong23 wants to merge 1 commit intostagefrom
fix/MWPW-190279-loc-line-break
Open

fix(MWPW-190279): locale-aware line-break rules for DE, BR, RO, JP in prompt-bar#748
dstrong23 wants to merge 1 commit intostagefrom
fix/MWPW-190279-loc-line-break

Conversation

@dstrong23
Copy link
Copy Markdown
Collaborator

Summary

Fixes MWPW-190279 — line breaking issues visible in the prompt-based Unity block on localized pages (de-DE, pt-BR, ro-RO, ja-JP).

Although the affected pages have since been migrated to the new upload marquee experience, the underlying block had no locale-aware line-breaking rules. This fix makes the block robust for future use across both hero-marquee and upload-marquee contexts.

Root Cause

The .inp-wrap .inp-field textarea and heading/body text elements in unity-enabled marquee blocks had no overflow-wrap, word-break, or locale-aware line-breaking rules. Languages like German and Romanian produce long compound words that overflow fixed-width containers without these guards. Japanese requires CJK-specific line-breaking rules (word-break: keep-all, line-break: strict) that differ from the Latin-script approach.

Changes

File: unitylibs/core/widgets/prompt-bar/prompt-bar.css

Base rule (all locales):

  • Adds overflow-wrap: break-word, word-break: break-word, and hyphens: auto to heading and body text elements inside .hero-marquee.unity-enabled and .upload-marquee.unity-enabled interactive areas
  • Adds overflow-wrap: break-word and word-break: break-word to .inp-wrap .inp-field (the prompt textarea)

Japanese override ([lang="ja-JP"]):

  • Applies word-break: keep-all and line-break: strict to follow JIS line-breaking rules
  • Uses overflow-wrap: anywhere (instead of break-word) to handle edge cases like Latin strings or URLs typed into a JA context
  • Clears hyphens: auto (not applicable to CJK)
  • Applies to both heading/body text and the .inp-field prompt input

This follows the existing [lang="ja-JP"] locale override pattern already present in this file.

Testing

  • Verify heading text wraps correctly on de-DE, pt-BR, ro-RO locales (no overflow)
  • Verify Japanese heading text respects JIS line-breaking (no mid-character breaks)
  • Verify prompt input field handles long localized strings without overflow
  • Verify no visual regression on en-US baseline

Jira

MWPW-190279

@aem-code-sync
Copy link
Copy Markdown

aem-code-sync Bot commented Apr 21, 2026

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run PSI checks
  • Re-sync branch
Commits

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.

1 participant