🎨 Palette: Character counter and button tooltip UX improvement#16
🎨 Palette: Character counter and button tooltip UX improvement#16CassieMarie0728 wants to merge 1 commit intomainfrom
Conversation
Implemented a character limit (180 characters) and a visual character counter with `aria-live="polite"` for the fork statement input field. Added a tooltip (title) to the "Open the Other Door" button when it is disabled to explain why the user cannot proceed. - Synchronized frontend input limit with the backend's 180-character truncation to prevent silent data loss. - Enhanced accessibility with proper ARIA attributes for real-time feedback. - Improved UX by providing a clear signal of when a user is nearing the character limit. - Added a helpful tooltip for the initial disabled state of the main action button. Co-authored-by: CassieMarie0728 <66750031+CassieMarie0728@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
|
Review these changes at https://app.gitnotebooks.com/CassieMarie0728/the-fork/pull/16 |
|
Kilo Code Review could not run — your account is out of credits. Add credits at app.kilo.ai to enable reviews on this change. |
There was a problem hiding this comment.
Code Review
This pull request introduces a 180-character limit for the fork statement input, accompanied by a visual counter that changes color as the limit is approached. It also adds a tooltip to the start button to explain why it is disabled. A review comment suggests replacing the hardcoded character limits with constants to enhance maintainability and readability.
| <div | ||
| data-testid="fork-statement-counter" | ||
| aria-live="polite" | ||
| className={`text-[10px] font-medium uppercase tracking-wider ${ | ||
| forkStatement.length >= 170 | ||
| ? "text-crimson" | ||
| : "text-zinc-500" | ||
| }`} | ||
| > | ||
| {forkStatement.length} / 180 | ||
| </div> |
There was a problem hiding this comment.
To improve maintainability and avoid magic numbers, it's a good practice to define 180 and 170 as constants. This makes the code easier to read and update if the character limit changes. You could define them at the top of the component or in a shared constants file. Don't forget to update maxLength={180} on line 75 as well.
For example:
const FORK_STATEMENT_MAX_LENGTH = 180;
const WARNING_THRESHOLD = FORK_STATEMENT_MAX_LENGTH - 10;
// ... then in your component
// ...
maxLength={FORK_STATEMENT_MAX_LENGTH}
// ...
className={`... ${
forkStatement.length >= WARNING_THRESHOLD
? "text-crimson"
: "text-zinc-500"
}`}
>
{forkStatement.length} / {FORK_STATEMENT_MAX_LENGTH}
// ...
🎨 Palette UX Improvement: Fork Setup Feedback Loop
💡 What:
I implemented a character limit and counter for the fork statement input, and added a descriptive tooltip to the main "Open the Other Door" button when it is disabled.
🎯 Why:
titleexplaining why the button is disabled ("Tell me the decision first") makes the next step clear to the user.📸 Visuals:
179 / 180indicator appears below the textarea. It turnstext-crimsonwhen nearing the limit.♿ Accessibility:
aria-live="polite"to the character counter to inform screen reader users of their current input length.🛠️ Verification:
frontend/e2e/fork.spec.js.PR created automatically by Jules for task 3661168831634817018 started by @CassieMarie0728