Skip to content

refactor: 💡 filename truncation adapt responsiveness faked#781

Merged
punkbit merged 15 commits intomainfrom
refactor/filename-truncation-adapt-responsiveness-faked
Jan 28, 2026
Merged

refactor: 💡 filename truncation adapt responsiveness faked#781
punkbit merged 15 commits intomainfrom
refactor/filename-truncation-adapt-responsiveness-faked

Conversation

@punkbit
Copy link
Copy Markdown
Contributor

@punkbit punkbit commented Jan 28, 2026

Why?

Adapts file upload filename truncation responsiveness, e.g. shows truncated file name on smaller container sizes, showing the original otherwise. It shows the complete filename on element hover.

This is a variation of 779, which shortens the middle of the text responsively but over breakpoints. Ideally, it should be fluid, but that'd require computation/listener/observables, through container size, it might be hard to justify the time.

As an alternative, we introduce text number of characters responsive fluidity by faking it, e.g. does not introduce listeners/observables, uses native css resulting in a fluid, well-performing responsive truncation.

⚠️ WARNING: Originally proposed as #779, it's solid an performs good, but since we want it to be fluid, where the filename breaks down characters one-by-one responsively, it'd require a container listener or observer, which requires computation. In the context of a file upload, it might be hard to justify the time.

⚠️ WARNING: Depends on #775, which should be merged first.
🤖 Must switch base branch once #775 merged

How?

  • Create a new wrapper component
  • Add styles for responsiveness
  • Use Aria tags to prevent screen readers from reading duplicate filename text
  • Show complete file name on hover (accessibility)

Preview?

Before: Shorten middle + breakpoints

demo-filename-reveal.mov

After: fake shorten middle fluid

demo-fluid-text-characters-fake-shorten-middle.mov

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jan 28, 2026

🦋 Changeset detected

Latest commit: 01e7947

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@clickhouse/click-ui Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
click-ui Ready Ready Preview, Comment Jan 28, 2026 10:16am

Request Review

Copy link
Copy Markdown
Collaborator

@crisalbu crisalbu left a comment

Choose a reason for hiding this comment

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

🙌🏻

@punkbit punkbit merged commit 00211aa into main Jan 28, 2026
6 checks passed
@punkbit punkbit deleted the refactor/filename-truncation-adapt-responsiveness-faked branch January 28, 2026 10:24
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.

2 participants