Skip to content

fix: apply the row truncation Screen Option to snippet names (3.10.2) - #507

Merged
imantsk merged 3 commits into
release/v3.10.2/corefrom
fix/truncate-snippet-names-release/core
Sep 1, 2026
Merged

fix: apply the row truncation Screen Option to snippet names (3.10.2)#507
imantsk merged 3 commits into
release/v3.10.2/corefrom
fix/truncate-snippet-names-release/core

Conversation

@TallblokeUK

Copy link
Copy Markdown
Contributor

Retarget of #495 onto the release branch. Same commit, cherry-picked, so it applies without dragging in unrelated core-beta changes to the test files.

Reported on Discord against 3.10.1: the Truncate long snippet names and descriptions Screen Option only affects the Description column. Snippet names stay truncated whether the option is on or off, which makes long names hard to tell apart. If the Description column is hidden, toggling the option appears to do nothing at all.

The reporter identified the cause themselves, and they were right.

Cause

The option toggles a truncate-row-values class on the list table, but only the description rule was scoped to it:

td.column-name > .snippet-name { … }                                    // unconditional
&.truncate-row-values td.column-desc .snippet-description-content { … } // scoped

So names were always clipped to min(15rem, 30vw) regardless of the setting. The class itself toggles correctly — it simply never governed the Name column.

Fix

Scope the name rule to the same class, so the option governs both values as its label promises.

Testing

Measured on the same row, with a deliberately long (88 character) snippet name:

before after
option on max-inline-size: 240px, clipped max-inline-size: 240px, clipped
option off max-inline-size: 240px, clipped max-inline-size: none, full name shown

With the option off the name now wraps and is fully readable; the row grows by one line, which is the same behaviour the Description column already has. With it on, nothing changes. Verified by toggling the Screen Option through the UI rather than by forcing the class, on a clean WordPress 7.1 install with the plugin installed from a built zip. stylelint clean.

Note

This covers the table view only. The card/grid view never receives the truncate-row-values class, and its truncation is structural — a long name would otherwise push the header icons out of the card. That looks deliberate, so it is left alone here.

The "Truncate long snippet names and descriptions" Screen Option toggles a
truncate-row-values class on the list table, but only the description rule
was scoped to that class. The name rule applied unconditionally, so snippet
names were always clipped to min(15rem, 30vw) whether the option was on or
off, and turning it off appeared to do nothing to the Name column.

Scope the name rule to the same class, so the option governs both values as
its label promises.

(cherry picked from commit f319d66)
@imantsk
imantsk merged commit 419a2fc into release/v3.10.2/core Sep 1, 2026
11 of 12 checks passed
@imantsk
imantsk deleted the fix/truncate-snippet-names-release/core branch September 1, 2026 12:09
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