Skip to content

fix(template-switching): allow current-template description to wrap#1128

Merged
superdav42 merged 1 commit intomainfrom
feature/auto-20260505-223618
May 6, 2026
Merged

fix(template-switching): allow current-template description to wrap#1128
superdav42 merged 1 commit intomainfrom
feature/auto-20260505-223618

Conversation

@superdav42
Copy link
Copy Markdown
Collaborator

Summary

  • Drop wu-truncate from the description <p> on the customer-panel template-switching "Current Template" card so long template descriptions wrap onto multiple lines instead of being clipped to a single-line ellipsis.
  • Add inline overflow-wrap: anywhere so unbreakable strings (long URLs, no-space tokens) cannot overflow the flex column horizontally.
  • Title <h3> keeps wu-truncate — template titles are expected to be short and a single-line title is a stronger visual anchor for the card; only the description needed to wrap.

Why

Customers on the template-switching page (/wp-admin/admin.php?page=wu-template-switching) saw the description of their current template clipped after roughly 80 characters with . The grid cards below already wrapped correctly; only the "Current Template" summary card at the top truncated. Customers could not read past the first line of their template's description without removing the wu-truncate class.

Verification

Tested in the local dev environment with three templates seeded with ~270-character descriptions:

  1. Logged in as customer kpcust1 (site 6, current template = Pink, 267-char description).
  2. Navigated to /wp-admin/admin.php?page=wu-template-switching.
  3. Confirmed the description on the "Current Template" card wraps onto 3 lines, fully visible, with no horizontal overflow.
  4. Confirmed the 120px thumbnail (left) and Reset Current Template button (right) stay vertically centred against the wrapped text — wu-items-center on the parent flex row handles this.
  5. Confirmed the grid cards below remain unchanged (they were never affected — descriptions there always wrapped).

PHPCS clean. PHPStan clean.

Files changed

  • views/ui/template-switching-current.php

The 'Current Template' card on the customer-panel template-switching
page was applying `wu-truncate` (white-space: nowrap; overflow: hidden;
text-overflow: ellipsis) to the description, forcing the full template
description onto a single line and clipping with an ellipsis. Customers
could not read past the first ~80 characters of the description.

Drop `wu-truncate` from the description `<p>` so the text wraps
naturally onto multiple lines. Add inline `overflow-wrap: anywhere`
to guard against unbreakable strings (long URLs, no-space tokens)
overflowing the flex column; the compiled framework.css has no
break-words utility, so the inline style follows the same pattern as
other inline styles in this file. The parent flex row uses
`wu-items-center`, so the 120px image and 'Reset' button stay
vertically centred against the now-multi-line description.

The title `<h3>` keeps `wu-truncate` because template titles are
expected to be short and a single-line title is a stronger visual
anchor for the card; only the description needed to wrap.

Verified in browser at the customer-panel template-switching page
with seeded ~270-character descriptions on three test templates.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 6, 2026

Warning

Rate limit exceeded

@superdav42 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 21 minutes and 35 seconds before requesting another review.

To continue reviewing without waiting, purchase usage credits in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5699a49c-3039-4f90-8e64-70941668e142

📥 Commits

Reviewing files that changed from the base of the PR and between d804737 and 674c54c.

📒 Files selected for processing (1)
  • views/ui/template-switching-current.php
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/auto-20260505-223618

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

🔨 Build Complete - Ready for Testing!

📦 Download Build Artifact (Recommended)

Download the zip build, upload to WordPress and test:

🌐 Test in WordPress Playground (Very Experimental)

Click the link below to instantly test this PR in your browser - no installation needed!
Playground support for multisite is very limitied, hopefully it will get better in the future.

🚀 Launch in Playground

Login credentials: admin / password

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

Performance Test Results

Performance test results for ead678a are in 🛎️!

Note: the numbers in parentheses show the difference to the previous (baseline) test run. Differences below 2% or 0.5 in absolute values are not shown.

URL: /

Run DB Queries Memory Before Template Template WP Total LCP TTFB LCP - TTFB
0 41 37.79 MB 819.00 ms (-22.00 ms / -3% ) 153.50 ms (-7.00 ms / -5% ) 1018.00 ms (-70.00 ms / -7% ) 1946.00 ms (-72.00 ms / -4% ) 1843.05 ms (-90.15 ms / -5% ) 89.90 ms (+1.85 ms / +2% )
1 56 49.11 MB 943.50 ms (-22.00 ms / -2% ) 145.00 ms 1089.50 ms (-22.50 ms / -2% ) 2078.00 ms (-50.00 ms / -2% ) 1997.55 ms (-49.40 ms / -2% ) 79.95 ms

@superdav42 superdav42 merged commit e9448e1 into main May 6, 2026
11 checks passed
@superdav42
Copy link
Copy Markdown
Collaborator Author

Summary

  • Drop wu-truncate from the description <p> on the customer-panel template-switching "Current Template" card so long template descriptions wrap onto multiple lines instead of being clipped to a single-line ellipsis.
  • Add inline overflow-wrap: anywhere so unbreakable strings (long URLs, no-space tokens) cannot overflow the flex column horizontally.
  • Title <h3> keeps wu-truncate — template titles are expected to be short and a single-line title is a stronger visual anchor for the card; only the description needed to wrap.

Why

Customers on the template-switching page (/wp-admin/admin.php?page=wu-template-switching) saw the description of their current template clipped after roughly 80 characters with . The grid cards below already wrapped correctly; only the "Current Template" summary card at the top truncated. Customers could not read past the first line of their template's description without removing the wu-truncate class.

Verification

Tested in the local dev environment with three templates seeded with ~270-character descriptions:

  1. Logged in as customer kpcust1 (site 6, current template = Pink, 267-char description).
  2. Navigated to /wp-admin/admin.php?page=wu-template-switching.
  3. Confirmed the description on the "Current Template" card wraps onto 3 lines, fully visible, with no horizontal overflow.
  4. Confirmed the 120px thumbnail (left) and Reset Current Template button (right) stay vertically centred against the wrapped text — wu-items-center on the parent flex row handles this.
  5. Confirmed the grid cards below remain unchanged (they were never affected — descriptions there always wrapped).
    PHPCS clean. PHPStan clean.

Files changed

  • views/ui/template-switching-current.php


Merged via PR #1128 to main.
Merged by deterministic merge pass (pulse-wrapper.sh).


aidevops.sh v3.14.75 spent 30s on this as a headless bash routine.

@superdav42
Copy link
Copy Markdown
Collaborator Author

Permission check failed for this PR (HTTP unknown from collaborator permission API). Unable to determine if @superdav42 is a maintainer or external contributor. A maintainer must review and merge this PR manually. This is a fail-closed safety measure — the pulse will not auto-merge until the permission API succeeds.


aidevops.sh v3.14.75 plugin for OpenCode v1.14.33 with gpt-5.5 spent 1m and 27,267 tokens on this as a headless worker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant