-
Notifications
You must be signed in to change notification settings - Fork 54
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
fix: Limit title length to 50 characters in cellUpdate function #212
fix: Limit title length to 50 characters in cellUpdate function #212
Conversation
e4425b9
to
cabde73
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this PR!! I have a couple notes:
I know #207 says 50 characters, but we already have one area of validation in the code base for this that uses 44 characters. I prefer 44 for now because that was chosen for a reason previously, though in either case the validation will need to be consistent.
Why not just allow long names and CSS truncate the text to |
@versecafe we could, and we do this in other places. But given that there's no where in the UI where we render a long title in its entirety, there seems to be no point in allowing one in the first place. IMO, not needing to truncate at all is better than truncating |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be easy to reuse the zod schema in all the places where we do validation? If so, can we make that change? That'll make it easier on our future selves when maintaining this.
handled edge cases
including import existing zod function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This allows users to type in a long heading but then it disappears on blur with a clipped version of the text. I think the better UX here would be to prevent them from typing in the long text.
I'm going to merge this for now and can address UX improvement in follow up.
Thank you for this 🙏🏻 |
The issue where users can type a long heading but it gets clipped on blur is occurring because the latest changes to the TitleCellUpdateAttrsSchema weren’t reflected due to the shared package not being built. In our monorepo setup, the changes only take effect after the package has been properly built. But I saw you did a great job on ux wise so this doesn't matter |
Yes I noticed that as well. I thought we had fixed this in #201 but it looks like we still need to build. FWIW you can run |
This branch was behind the turbo branch. I think running |
Fixed #207
I have replaced
<h1>
to<textarea>
because thecontentEditable
approach in<h1>
did not handle text wrapping efficiently, which leads to an overflow of text like below