add chat component and claude ui-max-pro skill - #53
Open
maks5554371 wants to merge 2 commits into
Open
Conversation
solilin
self-requested a review
June 22, 2026 20:36
solilin
reviewed
Jun 26, 2026
| @@ -0,0 +1,27 @@ | |||
| class Ui::Chat::Component < ApplicationComponent | |||
| def initialize(stream: nil, **options) | |||
Member
There was a problem hiding this comment.
Let's rename it ro streams, and it should be an Array [] by default
|
|
||
| def attrs | ||
| data_attributes = ({ controller: "chat" }).deep_merge(@options.fetch(:data, {})) | ||
| @options.merge(data: data_attributes) |
Member
There was a problem hiding this comment.
data_attributes is for data, but there could be other attributes also, for example, class, id, ...
Let's merge data attributes separately.
| @apply flex items-end gap-2 max-w-[85%]; | ||
| } | ||
|
|
||
| .chat__message--start { |
Member
There was a problem hiding this comment.
.block_name {}
.block_name__element_name {}
.block_name__element_name-mod {}
| } | ||
| } | ||
|
|
||
| scrollToBottom() { |
Member
There was a problem hiding this comment.
Seems, that is should be a private - #scrollToBottom
- Rename `stream:` to `streams:` with an empty Array default - Extract data attributes merging into a separate `data_attributes` method - Follow the BEM modifier convention (`block__element-mod`) - Make `scrollToBottom` private in the Stimulus controller - Format the controller with StandardJS - Stop tracking local AI assistant tooling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduces a composable
Ui::Chatcomponent to the UI library. The component covers a message feed with bubbles, avatars, author/timestamp, a typing indicator, and an input footer - plus auto-scroll and a Turbo Streams integration point for realtime updates.Component API
Subcomponents
chat,chat_messages,chat_message (position: :start/:end),chat_bubble (variant: :default/:primary/:muted),chat_author,chat_time,chat_typing,chat_footer.Interactivity (
chat_controller.js)Auto-scroll to the latest message via MutationObserver, respecting manual scroll-up (only auto-scrolls when the user is pinned to the bottom).
Enter to send (Shift+Enter for a newline) via the send action on the message form.
Textarea auto-grow is wired through the existing textarea-autogrow controller.
Realtime
The stream: option renders turbo_stream_from, and chat_messages exposes a stable DOM id as the broadcast target - so a model can broadcast_append_to new messages and they appear live (with auto-scroll). No backend/ActionCable is added here; the component only provides the integration points, documented in the component docs.
Documentation
Full docs at /ui/components/chat via component.yml (props, slots, examples), a docs view, route, breadcrumb, sidebar link, and a controller action
Tooling: ui-ux-pro-max Claude skill
Also bundles a Claude Code skill under .claude/skills/ui-ux-pro-max/ - a UI/UX design knowledge base (styles, palettes, font pairings, stack-specific guidelines) with helper scripts, used to assist component design and review within the repo.