Skip to content

VideoPress: truncate long titles and filenames in the dashboard library#49561

Open
vianasw wants to merge 3 commits into
trunkfrom
fix/videopress-library-title-overflow
Open

VideoPress: truncate long titles and filenames in the dashboard library#49561
vianasw wants to merge 3 commits into
trunkfrom
fix/videopress-library-title-overflow

Conversation

@vianasw

@vianasw vianasw commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Fixes VIDP-253 (CFT feedback item VP11, reported in #49485)

Proposed changes

Long video titles and filenames overflowed ungracefully in the modernized VideoPress dashboard: grid cards hard-clipped titles mid-character with no ellipsis, and in the table layout a long title would render over the filename column's text while pushing the Duration/Uploaded/Privacy columns out of the viewport entirely. The video details page rendered the full raw title in the breadcrumb, crowding the Save button.

  • Ellipsis truncation for titles in both layouts. DataViews' own .dataviews-title-field truncation only targets its internal anchor/button markup, so our custom renderers now bring their own: display: block + width: fit-content (keeps the clickable title's hit area at text size) + max-width bound + min-width: 0 (lets the title shrink when it shares a flex row with a status pill, which itself gets flex-shrink: 0).
  • Sane table column caps. Title text capped at 36ch and filename at 30ch in the table layout, sized so the default column set fits a ~1440px admin screen; narrower viewports fall back to the table's horizontal scroll. (DataViews' built-in 80ch cell cap still overflows once two text columns hit it.)
  • Hover affordance. The truncating elements carry title attributes so the full text is reachable on hover.
  • Details-page breadcrumb clamp. The current-item crumb (an h1 rendered by @wordpress/admin-ui's Breadcrumbs) is clamped via a display: contents scoping wrapper — the component's class names are hashed CSS-modules, so the wrapper gives us a stable hook with zero layout impact. The full title remains visible in the Title field directly below.

Related product discussion/links

Does this pull request change what data or activity we track or use?

No.

Testing instructions

Requires the modernized VideoPress dashboard (add_filter( 'rsm_jetpack_ui_modernization_videopress', '__return_true' );) and videos with absurdly long titles/filenames — e.g. rename a video to a 130+ character unbroken string like screen-recording-2026-06-11-at-14-23-55-final-FINAL-v2-revised-EXPORT-1080p60-high-bitrate-DO-NOT-DELETE-master-copy-approved-by-legal.

  • Go to Jetpack → VideoPress → Library (grid layout). Long titles under the cards should truncate with an ellipsis at the card edge instead of being hard-clipped mid-character; hovering the title shows the full text.
  • Switch to the table layout. Long titles and filenames should each truncate with an ellipsis inside their own columns — no text overlapping the next column, and Duration / Uploaded / Privacy / Actions all visible without horizontal scrolling at a typical desktop width.
  • Open the long-titled video's details page. The breadcrumb should show a truncated title with an ellipsis, leaving the Save button untouched; the full title still appears in the Title field.

Screenshots (mocked media responses; 1440×900)

Before After
Grid grid before grid after
Table table before table after
Details details before details after

Unit tests: cd projects/packages/videopress && pnpm test (includes the title-attribute hover affordance on both the clickable and plain title variants).

🤖 Generated with Claude Code

Long titles/filenames overflowed ungracefully (CFT item VP11): grid
cards hard-clipped titles mid-character with no ellipsis, and in the
table layout long titles overlapped the filename column's text and
pushed the duration/uploaded/privacy columns out of the viewport.

- Truncate titles with an ellipsis in both layouts. DataViews' own
  .dataviews-title-field truncation only targets its internal
  anchor/button markup, so our custom renderers bring their own:
  block display, fit-content width, max-width bound, min-width: 0 so
  the title can shrink when it shares a flex row with a status pill.
- Cap the title (36ch) and filename (30ch) columns in the table so
  pathological text can't bloat them past the viewport; narrower
  screens fall back to the table's horizontal scroll.
- Expose the full text via title attributes on the truncating
  elements (hover affordance).
- Clamp the video details breadcrumb's current item so a long title
  can't crowd the header's Save button; targeted through a
  display: contents scoping wrapper since the Breadcrumbs component
  uses hashed CSS-module class names.

Fixes VIDP-253.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vianasw vianasw added the [Status] Needs Review This PR is ready for review. label Jun 11, 2026
@vianasw vianasw self-assigned this Jun 11, 2026
@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack), and enable the fix/videopress-library-title-overflow branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack fix/videopress-library-title-overflow

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!

Split the double-render test (brittle if the button variant ever
gains a span wrapper) and cover the filename Text component — the
one variant whose title attribute depends on third-party prop
forwarding.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jp-launch-control

jp-launch-control Bot commented Jun 11, 2026

Copy link
Copy Markdown

Code Coverage Summary

Coverage changed in 1 file.

File Coverage Δ% Δ Uncovered
projects/packages/videopress/src/dashboard/components/library/fields.tsx 23/42 (54.76%) 2.38% -1 💚

Full summary · PHP report · JS report

- Hoist FilenameRender next to TitleCellRender in the test instead of
  re-deriving it inline.
- Document the upstream Breadcrumbs defect (its own li:last-child
  flex-shrink/min-width truncation never engages) so the clamp can be
  removed when it's fixed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vianasw vianasw requested a review from a team June 11, 2026 17:48
@CGastrell CGastrell requested a review from Copilot June 11, 2026 18:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves the modernized VideoPress dashboard UI by preventing long video titles and filenames from overflowing in the library (grid + table views) and by clamping long titles in the video details breadcrumb.

Changes:

  • Add ellipsis truncation styling for library titles (clickable and plain-text variants) and cap title/filename widths in the table view.
  • Add title attributes to expose full title/filename text on hover (including tests covering the behavior).
  • Clamp the current breadcrumb title on the video details page via a stable wrapper hook.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
projects/packages/videopress/src/dashboard/components/library/test/thumbnail-field.test.tsx Adds assertions that title/filename renderers expose full text via title attributes.
projects/packages/videopress/src/dashboard/components/library/fields.tsx Adds title attributes to title/filename renderers and introduces a span class for styling plain titles.
projects/packages/videopress/routes/video/style.scss Adds breadcrumb title clamping for the video details header (ellipsis + max-width).
projects/packages/videopress/routes/video/stage.tsx Wraps Breadcrumbs with a stable class hook for styling via display: contents.
projects/packages/videopress/routes/library/style.scss Adds truncation styles for titles and table-specific max-width caps for title and filename columns.
projects/packages/videopress/changelog/fix-videopress-library-title-overflow Changelog entry documenting the overflow/truncation fix.

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.

3 participants