Skip to content

Improve sidebar validation issue layout, text wrapping, and tag alignment - #24

Open
huzaifaalmesbah wants to merge 2 commits into
WordPress:mainfrom
huzaifaalmesbah:fix/sidebar-validation-issue-wrapping
Open

huzaifaalmesbah wants to merge 2 commits into
WordPress:mainfrom
huzaifaalmesbah:fix/sidebar-validation-issue-wrapping

Conversation

@huzaifaalmesbah

@huzaifaalmesbah huzaifaalmesbah commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

Summary

Relates to #11 (addresses sidebar readability and text truncation).

When validation messages or block tags are lengthy (for example: "Alt text exceeds 125 characters. Consider shortening."), the issue row previously overflowed horizontally or broke awkwardly below the icon due to default button white-space: nowrap and unconstrained flex widths.

This PR introduces minimal CSS adjustments in src/editor/framework/style.scss:

  • Enables multi-line text wrapping for long issue messages and meta tags without using !important.
  • Keeps the severity icon neatly pinned to the top-left of the first line.
  • Indents the block/document badge (margin-left: 32px) and gives it standard tag styling (background: #f0f0f1; border-radius: 2px, 12px text) aligned with the text.
  • Uses high-contrast, readable dark text (color: #1e1e1e) instead of the inherited button link-blue, switching to the admin theme color on hover and keyboard focus so the row still reads as interactive.

Visual Comparison

Before After
validation_editor_before validation_editor_full

Testing Instructions

  1. Check out this branch and run npm run build.
  2. In the block editor, insert an Image block with an alt text longer than 125 characters to trigger a warning.
  3. Open the Validation sidebar panel in the top-right header.
  4. Verify that:
    • The warning message wraps cleanly across multiple lines without overflowing the panel.
    • The severity icon stays aligned with the first line.
    • The core/image badge aligns neatly under the text with tag styling.
    • Hovering an issue, or moving to it with Tab, changes the message text to the admin theme color.

AI Disclosure

This contribution was developed with the assistance of an AI coding tool (Antigravity), with all changes manually reviewed, tested, and verified locally on WordPress 7.1. Review follow-ups (12px badge text, hover/focus color) were made with Claude Code and reviewed before pushing.

Shrinking the tag to 11px monospace reduced readability. Forcing the
message colour also removed the button's hover colour change, so set
the dark text colour on the button and switch to the admin theme
colour on hover and keyboard focus.
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: huzaifaalmesbah <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

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