Skip to content

Fix chat widget text stretching and alignment specificity#92

Merged
amrabed merged 7 commits into
mainfrom
fix/chat-widget-stretching-6900151857955295716
Jun 30, 2026
Merged

Fix chat widget text stretching and alignment specificity#92
amrabed merged 7 commits into
mainfrom
fix/chat-widget-stretching-6900151857955295716

Conversation

@google-labs-jules

Copy link
Copy Markdown
Contributor

This change improves the fix for chat widget text stretching by managing CSS specificity correctly with Tailwind layers. By moving global styles to @layer base and the chat widget override to @layer components with a :where() selector, we ensure that Tailwind utility classes like text-center (used in the chat greeting) can correctly override the component's default left alignment. Additionally, redundant alignment classes were cleaned up from the chat component.


PR created automatically by Jules for task 6900151857955295716 started by @amrabed

- Wrap global `text-align: justify` in `@layer base` to lower priority.
- Move `.chat-widget` alignment overrides to `@layer components` and use `:where()` to allow utility class overrides.
- Remove redundant `text-left` and arbitrary variant classes from `ChatWidgetClient`.
- Fixes issue where `text-center` utility was ignored in chat greeting.
@google-labs-jules

Copy link
Copy Markdown
Contributor Author

👋 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.

@vercel

vercel Bot commented Jun 28, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
amrabed-github-io Ready Ready Preview, Comment Jun 28, 2026 11:34pm

- Move global `text-align: justify` to `@layer base`.
- Add `.chat-widget` alignment override in `@layer components` with `:where()` to allow utility overrides.
- Refactor `ChatWidgetClient` into smaller components (`MessageBubble`, `MessageContent`).
- Extract `selectElementText` helper for text selection logic.
- Add `Tooltip` to chat actions for better UX.
- Remove redundant alignment classes.
- Refactor `Tooltip` to use compound component pattern in `ChatWidgetClient`.
- Ensure type safety and alignment with project standards.
Comment thread src/components/chat/client.tsx Outdated
Comment thread src/components/chat/client.tsx Outdated
- Move `MessageBubble` and related logic to `src/components/chat/message-bubble.tsx`.
- Define semantic CSS classes for chat messages in `src/app/globals.css`.
- Use `:where()` for chat alignment to maintain low specificity.
- Address PR feedback regarding component organization and styling.
Comment thread src/components/chat/message-bubble.tsx Outdated
Comment thread src/components/chat/message-bubble.tsx Outdated
- Use HeroUI `Button` for message actions in `MessageBubble`.
- Define and use CSS classes for the typing indicator and action buttons in `src/app/globals.css`.
- Move `group-hover` logic to the CSS file for cleaner components.
- Address remaining PR feedback on styling and component structure.
Comment thread src/components/chat/client.tsx
- Create `ThinkingIndicator` component in `message-bubble.tsx`.
- Define semantic CSS classes for the thinking indicator in `globals.css`.
- Complete transition from Tailwind classes to CSS classes for chat components.
- Address PR feedback regarding modularity and styling consistency.
- Replace `text-default-500` with `text-slate-500` in `globals.css` and `ChatWidgetClient`.
- Verify fix with `pnpm build`.
@amrabed amrabed marked this pull request as ready for review June 30, 2026 12:26
@amrabed amrabed merged commit b0e3ccc into main Jun 30, 2026
6 checks passed
@amrabed amrabed deleted the fix/chat-widget-stretching-6900151857955295716 branch June 30, 2026 12:28
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