Fix chat widget text stretching and alignment specificity#92
Conversation
- 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.
|
👋 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. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- 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.
- 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.
- 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.
- 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`.
This change improves the fix for chat widget text stretching by managing CSS specificity correctly with Tailwind layers. By moving global styles to
@layer baseand the chat widget override to@layer componentswith a:where()selector, we ensure that Tailwind utility classes liketext-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