-
Notifications
You must be signed in to change notification settings - Fork 15
fix: 🐛 handle long filenames #754
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
punkbit
wants to merge
16
commits into
main
Choose a base branch
from
fix/handle-long-filenames
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
+380
−48
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why?
Bucky asked to complete a project assignment fixing a ClickHouse UI issue on the FileUpload component.
The assignment requires showing as much of the filename as possible with good UX across various screen widths.
Must submit the solution, including documentation of thought process and experimentation, which I've decided to keep it here in the PR description for easy access.
How?
Demo?
Before:
clickhouse-current-version-broken-examples-walkthrough.mov
default-flyout-width-transition-causes-component-shifting.mp4
💡 Since the success state doesn't display a text label like 'File uploaded,' it would be more consistent to use an error icon instead of text for failures. If the 'Failed upload' text is required, can consider relocating it to avoid lengthening the already long filename line. Alternatively, the icon alone would likely be sufficient for most users without the accompanying text. Thus, the icon must be a inline element to prevent detachment and keeping context, e.g. see gap.
After:
PR file upload version proposes the following changes:
clickhouse-pr-fix-walkthrough.mov
👌 Reveal the complete filename on hover in large containers. Skip smaller container/viewports for the moment. This pattern can be found in OS such as macOS, e.g. hover a long filename in the file explorer, or in the hash strings found in blockchain-like UIs.
clickhouse-upload-success-hover-reveal.mp4
It can be useful when errors are found, providing context to the user
clickhouse-upload-failure-reveal-retry.mp4
👌 Shows the file uploader in different container sizes. It uses the viewport switch for a quick demo, styles are not based in media queries viewports, but declared over container width breakpoints.
clickhouse-container-breakpoints-resize.mp4
Here's demonstrated with free width flow:
clickhouse-responsive.mp4
👌 Here's demonstrated that the default flyout "width transition" causes element position shifting. While this might be expected or a personal preference, a quick demo shows a very similar transition approach that handles it more gracefully without causing position shifting.
default-flyout-width-transition-causes-component-shifting.mp4
💡 Truncate filenames by shortening the middle revealing critical parts
Assume you have:
In the current faulty version you'd get something like:
Notice that the first two filenames, when presented truncated, have the same shortened name, making it hard to differentiate.
In the PR proposed version you'd find easier to identify files if these are named in a maintainable way:
Notice that the first and last digits help identify the file more concisely, allowing for a shorter length.
Find two new stories in the storybook playground as follows: