Skip to content

fix(view): improve edit-mode empty state and accessibility#1

Open
pvollenweider wants to merge 1 commit into
mainfrom
fix/edit-mode-empty-state-accessibility
Open

fix(view): improve edit-mode empty state and accessibility#1
pvollenweider wants to merge 1 commit into
mainfrom
fix/edit-mode-empty-state-accessibility

Conversation

@pvollenweider

Copy link
Copy Markdown
Member

Summary

  • Escape node name via <c:out> to prevent XSS in edit mode
  • Show placeholder notice when html is empty even if css/js are populated — CSS/JS-only blocks are now selectable in the editor
  • Use cached ${html} var instead of re-reading JCR property on render
  • Collapse nested <c:if> into single compound condition
  • Short-circuit removeHtmlTags when html is already empty
  • Add styled placeholder visible only in edit mode (WCAG AA contrast: #595959 on #fff8e1)
  • Clarify CSS field tooltip (EN + FR)

Test plan

  • Block with HTML content → no notice in edit mode, no notice in live
  • Block with CSS/JS only, no HTML → notice "CSS/JS only" visible in edit mode, not in live
  • Block fully empty → notice "Empty custom code block" visible in edit mode, not in live
  • Node name with special chars (<, >) → escaped correctly in notice
  • Multiple empty blocks on same page → each shows correct notice
  • mvn test passes

- Escape node name via <c:out> to prevent XSS in edit mode
- Show notice when html is empty, even if css/js are populated,
  so CSS/JS-only blocks remain selectable in the editor
- Use cached ${html} var instead of re-reading JCR property
- Collapse nested c:if into single compound condition
- Short-circuit removeHtmlTags when html is already empty
- Add styled placeholder visible only in edit mode (WCAG AA contrast)
- Clarify css field tooltip (EN + FR)
@pvollenweider pvollenweider force-pushed the fix/edit-mode-empty-state-accessibility branch from e8c7c12 to dbeb94d Compare May 27, 2026 12:03
@pvollenweider pvollenweider self-assigned this May 27, 2026
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