Skip to content

fix(ref-node): keep actions inside a readonly ref node with a long name - #1560

Open
iOvergaard wants to merge 1 commit into
mainfrom
v2/fix/ref-node-readonly-overflow
Open

iOvergaard wants to merge 1 commit into
mainfrom
v2/fix/ref-node-readonly-overflow

Conversation

@iOvergaard

Copy link
Copy Markdown
Contributor

Description

uui-ref-node keeps its actions inside the element when it is readonly and its name is long.

A readonly ref node renders #content straight into the host's flex row, without the #open-part wrapper. #1415 gave #open-part and #info min-width: 0, but #content has none. So in the readonly branch its automatic minimum width is its full width (calc(100% - 2 * var(--uui-size-3))) as soon as the name is longer than the space available. That pushes the actions slot past the border. This adds min-width: 0 to #content, so the name truncates with an ellipsis as it already does for a clickable ref node.

  • ref-node.element.ts: #content { min-width: 0; }. The other uui-ref-node-* elements only override renderDetail() and reuse UUIRefNodeElement.styles, so they get the fix too.
  • ref-node.story.ts: new Readonly Long Name story.
  • ref-node.test.ts: a layout test for a clickable and a readonly ref node with a long name in a 340px container. The readonly case fails without the fix (the action ends at 548px in a 340px-wide element).

Related CMS issue: umbraco/Umbraco-CMS#23088 (comment). In the CMS, the link picker dialog shows the picked document read-only when it is opened from the rich text editor or the Markdown editor, so a long page name pushes "Remove" out of view there.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (minor updates related to the tooling or maintenance of the repository, does not impact compiled assets)

Motivation and context

#1415 fixed long names for ref nodes you can click, but the readonly branch never renders #open-part, so it kept the old behaviour. On a readonly ref with a long name, the actions slot overflowed by about 70px in a 420px container.

How to test?

  • npx vitest run src/components/ref-node: the new layout tests cover the clickable and readonly variants.
  • In Storybook, open Displays/References/Node → Readonly Long Name and hover the ref node: Remove sits inside the border and the name truncates.
  • No other ref node story changes. I measured every uui-ref-node* story at 1280px and 360px with and without the rule: only Readonly Long Name moves.

Screenshots (if appropriate)

Before (Readonly Long Name story, 420px):

Readonly ref node before the fix

After:

Readonly ref node after the fix

Checklist

  • If my change requires a change to the documentation, I have updated the documentation in this pull request.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

🤖 Generated with Claude Code

A readonly ref node renders #content straight into the host's flex row,
without the #open-part wrapper that got min-width: 0 in #1415. Its
automatic minimum width then grows with a long name, which pushes the
actions slot past the element's border. Allow #content to shrink so the
name truncates instead.

Adds a ReadonlyLongName story and a layout test for both the clickable
and the readonly variant.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@iOvergaard iOvergaard added the bug Something isn't working label Nov 23, 2026
Copilot AI balanced review requested due to automatic review settings November 23, 2026 09: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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-1560.westeurope.azurestaticapps.net

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants