Skip to content

fix: apply the row truncation Screen Option to snippet names - #495

Closed
TallblokeUK wants to merge 1 commit into
core-betafrom
fix/truncate-snippet-names/core
Closed

fix: apply the row truncation Screen Option to snippet names#495
TallblokeUK wants to merge 1 commit into
core-betafrom
fix/truncate-snippet-names/core

Conversation

@TallblokeUK

Copy link
Copy Markdown
Contributor

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. 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; happy to revisit separately if the option should govern cards too.

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.
@TallblokeUK

Copy link
Copy Markdown
Contributor Author

Superseded by #507, which targets release/v3.10.2/core so it can ship in 3.10.2. Same commit, cherry-picked onto the release branch; retargeting this one directly would have pulled in unrelated core-beta changes to the test files.

@TallblokeUK TallblokeUK closed this Sep 1, 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