-
Notifications
You must be signed in to change notification settings - Fork 73
[LG-5645] feat(chat-layout): implement ChatMain component #3252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
6948c53 to
d1812aa
Compare
|
Size Change: +250 B (+0.02%) Total Size: 1.62 MB
ℹ️ View Unchanged
|
663fa6c to
ae7a9f9
Compare
d1812aa to
b7d4136
Compare
b7d4136 to
5e4db61
Compare
| expect(screen.getByText('Main Content')).toBeInTheDocument(); | ||
| }); | ||
|
|
||
| test('forwards HTML attributes to the div element', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to test this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'm planning to include these in tests from now on to test if HTML attributes are settable. In some cases, our components intentionally don't offer this. It felt worth testing to more explicitly document that ComponentPropsWith*Ref is part of the type interface, and it's a low effort inclusion
| expect(ref.current?.tagName).toBe('DIV'); | ||
| }); | ||
|
|
||
| test('applies custom className', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for this test. Do we need to test this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'm planning to test this moving forward as well. It helps document to make sure className is properly passed through to the root node, and it's also a low effort inclusion
|
|
||
| export type ChatMainProps = ComponentPropsWithRef<'div'> & | ||
| DarkModeProps & | ||
| PropsWithChildren<{}>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we'll also need to omit children from ComponentPropsWithRef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dropped this in ChatLayout and ChatMain. For some reason, google + the imported type shows that ComponentProps* doesn't include children, but I guess it actually does
shaneeza
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! 🌻 Just a few nits
|
Coverage after merging steph/chat-layout-main into LG-5439/chat-layout will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
* feat(chat-layout): implement ChatMain component * refactor(chat-layout): remove PropsWithChildren
* feat(chat-layout): implement ChatMain component * refactor(chat-layout): remove PropsWithChildren
* feat(chat-layout): implement ChatMain component * refactor(chat-layout): remove PropsWithChildren
* feat(chat-layout): new @lg-chat/chat-layout package with ChatLayout and ChatLayoutContext (#3251) * [LG-5645] feat(chat-layout): implement ChatMain component (#3252) * feat(chat-layout): implement ChatMain component * refactor(chat-layout): remove PropsWithChildren * [LG-5646] feat(chat-layout): implement ChatSideNav component with Header and Content subcomponents (#3271) * chore(chat-layout): add deps for ChatSideNav * feat(chat-layout): implement ChatSideNav and subcomponents * test(chat-layout): update stories * docs(chat-layout): README * fix(chat-layout): apply focus styles on :focus-visible * refactor(chat-layout): PR feedback * refactor(chat-layout): ChatSideNav only renders header and content * [LG-5649] feat(chat-layout): add SideNavItem subcomponent (#3273) * chore(chat-layout): add LG palette dep * feat(chat-layout): implement ChatSideNavItem subcomponent * test(chat-layout): update stories * docs(chat-layout): README * fix(chat-layout): add missing polymorphic dep * fix(chat-layout): ChatSideNavItem default is div * style(chat-layout): use constant for side nav item height * [LG-5650] feat(chat-layout): add hover expand and collapse functionality (#3278) * feat(chat-layout): add header to ChatSideNavContent * fix(input-bar): rm redundant z-index and increase disclaimer text spacing * chore(input-bar): changeset * chore(chat-layout): rm icon-button dependency * feat(chat-layout): enhance ChatLayout with side nav hover state and transition effects * test(chat-layout): update stories * docs(chat-layout): README * refactor(input-bar): revert gap changes * refactor(chat-layout): expose shouldRenderExpanded from context and fix overflow * fix(chat-layout): peer dep and init changeset
commit 5cf8c9b Merge: 75bd398 616cfb0 Author: Adam Thompson <[email protected]> Date: Fri Nov 7 15:40:20 2025 -0500 Merge branch 'main' into at/wizard-integration commit 616cfb0 Author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri Nov 7 18:49:16 2025 +0000 Version Packages (#3288) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> commit dca8419 Author: Nima Taheri <[email protected]> Date: Fri Nov 7 09:04:10 2025 -0800 LG-5588 more chart customization points (#3274) * feat: more chart customization points * docs: add changelog * feat: apply review feedbacks * feat: move common x/y axis properties into a separate file * fix: lint errors * fix: correct props dependency * fixup! fix: lint errors * feat: process review feedback * feat: apply Stephen's feedback * types: export bar-hover-behavior type * more PR review feedback * fix export issue commit 8976ab2 Author: Stephen Lee <[email protected]> Date: Fri Nov 7 07:39:33 2025 -0800 [LG-5439] feat: ChatLayout integration branch (#3289) * feat(chat-layout): new @lg-chat/chat-layout package with ChatLayout and ChatLayoutContext (#3251) * [LG-5645] feat(chat-layout): implement ChatMain component (#3252) * feat(chat-layout): implement ChatMain component * refactor(chat-layout): remove PropsWithChildren * [LG-5646] feat(chat-layout): implement ChatSideNav component with Header and Content subcomponents (#3271) * chore(chat-layout): add deps for ChatSideNav * feat(chat-layout): implement ChatSideNav and subcomponents * test(chat-layout): update stories * docs(chat-layout): README * fix(chat-layout): apply focus styles on :focus-visible * refactor(chat-layout): PR feedback * refactor(chat-layout): ChatSideNav only renders header and content * [LG-5649] feat(chat-layout): add SideNavItem subcomponent (#3273) * chore(chat-layout): add LG palette dep * feat(chat-layout): implement ChatSideNavItem subcomponent * test(chat-layout): update stories * docs(chat-layout): README * fix(chat-layout): add missing polymorphic dep * fix(chat-layout): ChatSideNavItem default is div * style(chat-layout): use constant for side nav item height * [LG-5650] feat(chat-layout): add hover expand and collapse functionality (#3278) * feat(chat-layout): add header to ChatSideNavContent * fix(input-bar): rm redundant z-index and increase disclaimer text spacing * chore(input-bar): changeset * chore(chat-layout): rm icon-button dependency * feat(chat-layout): enhance ChatLayout with side nav hover state and transition effects * test(chat-layout): update stories * docs(chat-layout): README * refactor(input-bar): revert gap changes * refactor(chat-layout): expose shouldRenderExpanded from context and fix overflow * fix(chat-layout): peer dep and init changeset commit 68b59a0 Author: Stephen Lee <[email protected]> Date: Thu Nov 6 20:18:38 2025 -0800 [LG-5687] fix(message-prompts): update border color (#3282) * style(message-prompts): update border-color * test(message-prompts): fix darkmode propagation * chore(message-prompts): changeset commit eb4ff15 Author: Stephen Lee <[email protected]> Date: Thu Nov 6 16:29:28 2025 -0800 refactor(feature-walls): darkMode propagation (#3287) * refactor(feature-walls): darkMode propagation * fix(feature-walls): drop unused imports commit 5008087 Author: Stephen Lee <[email protected]> Date: Thu Nov 6 15:33:37 2025 -0800 [LG-5684] fix(rich-links): update colors for RichLinkBadge component (#3283) * refactor(rich-links): refactor darkmode propagation and update some colors * test(rich-links): enable darkmode in rich-links stories * chore: changesets commit 1d63f1f Author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu Nov 6 19:39:48 2025 +0000 Version Packages (#3276) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> commit 6494d15 Author: Brooke Scarlett Yalof <[email protected]> Date: Thu Nov 6 12:17:17 2025 -0500 LG-5656: Remove support for refEl property (#3270) * remove support for refEl property * Update clean-news-lay.md commit af60a2d Author: Stephen Lee <[email protected]> Date: Thu Nov 6 07:58:22 2025 -0800 [LG-5664] feat(title-bar): add compact variant support (#3275) * refactor(title-bar): reorg file structure and export Align * refactor(title-bar): styles and install lg chat provider peer dep * feat(title-bar): compact variant * test(title-bar): update stories * docs(title-bar): readme * chore(title-bar): changeset * chore(title-bar): copilot feedback * feat(chat-window): enable compact TitleBar in ChatWindow * fix: chat builds commit 45fb29a Author: Adam Rasheed <[email protected]> Date: Wed Nov 5 09:33:54 2025 -0800 [LG-5681] chore: Update PeerDependencies (#3279) * [LG-5681] chore: Update PeerDependencies * cleanup
✍️ Proposed changes
This PR introduces the
ChatMaincomponent to the@lg-chat/chat-layoutpackage, which represents the main content area of the chat layout. The component automatically positions itself in the CSS Grid system and provides a structured container for chat content.Key changes:
ChatMaincomponent with proper TypeScript types, styles, and comprehensive testsChatLayout.stories.tsxwith a complete working example that includes TitleBar, ChatWindow, MessageFeed, Message, and InputBar components@lg-chat/leafygreen-chat-provideras a peer dependency@lg-chat/title-bar,@lg-chat/chat-window,@lg-chat/message-feed,@lg-chat/message,@lg-chat/input-bar) as dev dependencies🎟️ Jira ticket: LG-5645
✅ Checklist
pnpm changesetand documented my changes🧪 How to test changes
Composition/Chat/ChatLayoutpnpm test chat-layoutto verify all ChatMain tests pass