Skip to content

🎨 Palette: Character counter and button tooltip UX improvement#16

Open
CassieMarie0728 wants to merge 1 commit intomainfrom
palette/character-counter-and-tooltip-ux-fix-3661168831634817018
Open

🎨 Palette: Character counter and button tooltip UX improvement#16
CassieMarie0728 wants to merge 1 commit intomainfrom
palette/character-counter-and-tooltip-ux-fix-3661168831634817018

Conversation

@CassieMarie0728
Copy link
Copy Markdown
Owner

🎨 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:

  • Prevent Data Loss: The backend silently truncates the fork statement to 180 characters. Enforcing this in the UI prevents users from writing long statements only for the AI to ignore most of them.
  • Immediate Feedback: A real-time character counter shows users exactly how much space they have left, changing to a red color when they are within 10 characters of the limit.
  • Actionability: Icon-only or disabled buttons can be frustrating. Adding a title explaining why the button is disabled ("Tell me the decision first") makes the next step clear to the user.

📸 Visuals:

  • Counter: A discrete 179 / 180 indicator appears below the textarea. It turns text-crimson when nearing the limit.
  • Button: Hovering over the disabled "Open the Other Door" button now reveals the instruction to provide a decision first.

♿ Accessibility:

  • Added aria-live="polite" to the character counter to inform screen reader users of their current input length.
  • Associated the counter and textarea visually and semantically with proper spacing and color contrast.

🛠️ Verification:

  • Ran full E2E test suite in frontend/e2e/fork.spec.js.
  • Created and ran a targeted verification script for the counter and tooltip.
  • Visually confirmed changes via screenshots.
  • Verified that all changes are under the 50-line micro-UX limit.

PR created automatically by Jules for task 3661168831634817018 started by @CassieMarie0728

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>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@codesandbox
Copy link
Copy Markdown

codesandbox Bot commented Mar 26, 2026

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@gitnotebooks
Copy link
Copy Markdown

gitnotebooks Bot commented Mar 26, 2026

@kilo-code-bot
Copy link
Copy Markdown

kilo-code-bot Bot commented Mar 26, 2026

Kilo Code Review could not run — your account is out of credits.

Add credits at app.kilo.ai to enable reviews on this change.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

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.

Comment on lines +88 to +98
<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>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

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}
// ...

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.

1 participant