Skip to content

[web-console] Cut long tag names to the width of their container - #8157

Queued
Karakatiza666 wants to merge 2 commits into
mainfrom
web-console-long-tags
Queued

Karakatiza666 wants to merge 2 commits into
mainfrom
web-console-long-tags

Conversation

@Karakatiza666

@Karakatiza666 Karakatiza666 commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor
Screenshot From 2026-12-01 20-58-50

Fixes #6862.

Tests

  • Table.svelte.spec.ts: a screenshot test of the Tags column with long tags and the tag popup open. Also tests that a column with a long tag keeps its set width, and that a click on the empty part of a Tags cell reaches the row link.
  • Tags.svelte.spec.ts: tests for the cut first chip, for a cut second chip only, for a hidden chip that shows again when the container grows, for a removed tag, and for the edit button of a long tag in the popup.
  • Each new test failed when the change it covers was reverted.
  • The new reference screenshot is in feldera/playwright-snapshots@d947b94b71d0.

const hit = hitAt(contentRight - 4, box.top + box.height / 2)

expect(hit.closest('a')?.getAttribute('href')).toMatch(/\/pipelines\/alpha\/$/)
roleState.current = undefined

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.

pitfall (medium): This reset runs only when the assertion above passes. If the test fails, roleState stays write for every later test in the file, so one failure causes others. Reset it in the afterEach of this describe, as the Table — tags block does.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 16be7dd: the afterEach of the Table — row link block resets roleState now.

@mythical-fred-oss

Copy link
Copy Markdown
Contributor

LGTM. I found no correctness bugs and no feldera-pr-checks gate fails. The change affects only how the web console looks, so it needs no docs.

What I ran

Check Result
vitest --project client on Table.svelte.spec.ts and Tags.svelte.spec.ts, including the new screenshot 53/53 pass
pre-commit run --files <changed files> pass
4 extra QA tests (diff below) 4/4 pass

missing (low–medium): cases the PR's tests do not cover. They all pass on this branch, so add them only if you want them as regression tests:

  • Two tags where the second does not fit: the row shows "+1", and "+1" stays inside the container.
  • A read-only user: the static <span> "+N" stays inside the container, and the long tag is cut.
  • A long tag replaced by a short one with the same tag count: the row measures again and shows the second chip.
  • A very narrow container (60px): "+N" stays inside.
QA tests (Tags.svelte.spec.ts)
it('QA: with two tags, hides the second in "+1" when it does not fit', async () => {
  const longTag = 'a-very-long-tag-name-that-does-not-fit'
  const { container } = renderTags({ tags: [longTag, 'second'] })
  container.style.width = '200px'
  const showAll = page.getByRole('button', { name: 'Show all tags' })
  await expect.element(showAll).toHaveTextContent('+1')
  const right = container.getBoundingClientRect().right
  expect(showAll.element().getBoundingClientRect().right).toBeLessThanOrEqual(right)
  expect(isTruncated(chipTextOf(container, longTag)!)).toBe(true)
})

it('QA: read-only row cuts a long tag and keeps "+N" inside', async () => {
  roleState.current = 'read'
  const longTag = 'a-very-long-tag-name-that-does-not-fit'
  const { container } = renderTags({ tags: [longTag, 'second', 'third'] })
  container.style.width = '200px'
  await expect.element(page.getByText('+2')).toBeVisible()
  const right = container.getBoundingClientRect().right
  expect(page.getByText('+2').element().getBoundingClientRect().right).toBeLessThanOrEqual(right)
  expect(isTruncated(chipTextOf(container, longTag)!)).toBe(true)
})

it('QA: re-measures when a long tag is replaced by a short one', async () => {
  const longTag = 'a-very-long-tag-name-that-does-not-fit'
  const { container, rerender } = renderTags({ tags: [longTag, 'second', 'third'] })
  container.style.width = '200px'
  const showAll = page.getByRole('button', { name: 'Show all tags' })
  await expect.element(showAll).toHaveTextContent('+2')
  await rerender({ tags: ['short', 'second', 'third'] })
  await expect.element(showAll).toHaveTextContent('+1')
  await expect.element(page.getByRole('button', { name: 'second' })).toBeVisible()
})

it('QA: very narrow container keeps "+N" inside', async () => {
  const { container } = renderTags({ tags: ['production', 'second', 'third'] })
  container.style.width = '60px'
  const showAll = page.getByRole('button', { name: 'Show all tags' })
  await expect.element(showAll).toHaveTextContent('+2')
  const right = container.getBoundingClientRect().right
  expect(showAll.element().getBoundingClientRect().right).toBeLessThanOrEqual(right)
})

@jackgale jackgale left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good to me, we can iterate on the max width and arrive at something less arbitrary with more data. But this is a good place to start.

@Karakatiza666
Karakatiza666 added this pull request to the merge queue Dec 3, 2026
Any commits made after this event will not be merged.
@blp blp added Web Console Related to the browser based UI UX Issues that effect an end-user's experience labels Dec 3, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Dec 3, 2026
@mihaibudiu
mihaibudiu added this pull request to the merge queue Dec 3, 2026
Any commits made after this event will not be merged.
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Dec 4, 2026
Fixes #6862.

- In the pipelines table, only the last tag chip that fits is cut with an
  ellipsis. The tags that do not fit go into the "+N" count.
- The table has a set width, so `table-layout: fixed` applies and a long tag
  no longer makes its column wider than the user set it.
- The default width of the Tags column fits about two and a half tags of 10
  characters.
- In the tag popup, a long tag name is cut, so the edit button stays visible.
A failed assertion skipped the reset and left the write role set for the later tests.
@Karakatiza666
Karakatiza666 added this pull request to the merge queue Dec 5, 2026
Any commits made after this event will not be merged.

This branch has not been deployed

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

Labels

UX Issues that effect an end-user's experience Web Console Related to the browser based UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A long tag name overflows the tag tooltip and hides buttons

3 participants