-
Notifications
You must be signed in to change notification settings - Fork 13k
feat: Added invitation badge to sidebar #37635
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
|
Looks like this PR is ready to merge! 🎉 |
🦋 Changeset detectedLatest commit: a492ca8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 42 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughAdds a new InvitationBadge component (with Storybook stories and tests), integrates it into multiple sidebar/sidepanel badge renderers, introduces an UnreadBadge component, adds an English translation key, and includes a changeset documenting the UI change. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20–30 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
⛔ Files ignored due to path filters (1)
📒 Files selected for processing (15)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (7)
🧰 Additional context used📓 Path-based instructions (1)**/*.{ts,tsx,js}📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
Files:
🧠 Learnings (17)📚 Learning: 2025-11-24T17:08:17.065ZApplied to files:
📚 Learning: 2025-11-24T17:08:17.065ZApplied to files:
📚 Learning: 2025-11-24T17:08:17.065ZApplied to files:
📚 Learning: 2025-12-10T21:00:54.909ZApplied to files:
📚 Learning: 2025-11-24T17:08:17.065ZApplied to files:
📚 Learning: 2025-11-24T17:08:17.065ZApplied to files:
📚 Learning: 2025-11-24T17:08:17.065ZApplied to files:
📚 Learning: 2025-11-24T17:08:17.065ZApplied to files:
📚 Learning: 2025-11-24T17:08:17.065ZApplied to files:
📚 Learning: 2025-11-24T17:08:17.065ZApplied to files:
📚 Learning: 2025-11-17T15:07:13.273ZApplied to files:
📚 Learning: 2025-11-19T18:20:07.720ZApplied to files:
📚 Learning: 2025-11-19T12:32:29.696ZApplied to files:
📚 Learning: 2025-12-16T17:29:45.163ZApplied to files:
📚 Learning: 2025-09-23T19:22:59.217ZApplied to files:
📚 Learning: 2025-11-24T17:08:17.065ZApplied to files:
📚 Learning: 2025-11-24T17:08:17.065ZApplied to files:
🧬 Code graph analysis (4)apps/meteor/client/views/navigation/sidebar/badges/UnreadBadge.tsx (1)
apps/meteor/client/components/InvitationBadge/InvitationBadge.tsx (2)
apps/meteor/client/sidebar/badges/SidebarItemBadges.spec.tsx (1)
apps/meteor/client/views/navigation/sidepanel/SidepanelItem/RoomSidePanelItemBadges.spec.tsx (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
🔇 Additional comments (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
a575a7a to
5a0d940
Compare
81a1dde to
77a6e7a
Compare
02ef424 to
432d3b1
Compare
432d3b1 to
2b81d46
Compare
b2cc5c0 to
0d14b19
Compare
77a6e7a to
5f7daad
Compare
5f7daad to
c1fcb78
Compare
dba8733 to
85183c9
Compare
85183c9 to
aa7354e
Compare
3a67be6 to
7788fbf
Compare
c420eb2 to
36e006f
Compare
7788fbf to
32faeff
Compare
36e006f to
65ca437
Compare
32faeff to
f896a80
Compare
apps/meteor/client/components/InvitationBadge/InvitationBadge.tsx
Outdated
Show resolved
Hide resolved
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.
Actionable comments posted: 0
🧹 Nitpick comments (2)
apps/meteor/client/components/InvitationBadge/InvitationBadge.tsx (2)
14-14: Consider handling the missing date scenario more explicitly.When
invitationDateis not provided, the formatted date becomes an empty string, resulting in a title like "Invited " with no date. Consider either:
- Making
invitationDaterequired in the type definition if it should always be present- Providing a fallback message or not rendering the badge when the date is unavailable
23-23: Remove redundantaria-hidden='false'.The
aria-hidden='false'is the default behavior for elements and is redundant. Removing it simplifies the code without changing functionality.Apply this diff to remove the redundant prop:
<Icon size='x20' {...props} role='status' color='info' name='mail' - aria-hidden='false' title={t('Invited__date__', { date: formattedDate })} />
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
apps/meteor/client/components/InvitationBadge/__snapshots__/InvitationBadge.spec.tsx.snapis excluded by!**/*.snap
📒 Files selected for processing (1)
apps/meteor/client/components/InvitationBadge/InvitationBadge.tsx(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}
📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation
Files:
apps/meteor/client/components/InvitationBadge/InvitationBadge.tsx
🧠 Learnings (1)
📚 Learning: 2025-11-17T15:07:13.273Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37398
File: packages/fuselage-ui-kit/src/surfaces/FuselageSurfaceRenderer.tsx:357-363
Timestamp: 2025-11-17T15:07:13.273Z
Learning: In packages/fuselage-ui-kit/src/surfaces/FuselageSurfaceRenderer.tsx, IconElement is a presentational, non-actionable element that does not require wrapping in AppIdProvider, similar to plain_text and mrkdwn renderers. Only actionable elements (those with actions, actionId, or interactive behavior) should be wrapped in AppIdProvider.
Applied to files:
apps/meteor/client/components/InvitationBadge/InvitationBadge.tsx
🧬 Code graph analysis (1)
apps/meteor/client/components/InvitationBadge/InvitationBadge.tsx (2)
packages/ui-contexts/src/index.ts (1)
useTranslation(81-81)apps/meteor/client/lib/utils/timeAgo.ts (1)
timeAgo(12-26)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: CodeQL-Build
- GitHub Check: CodeQL-Build
🔇 Additional comments (2)
apps/meteor/client/components/InvitationBadge/InvitationBadge.tsx (2)
1-5: LGTM!The imports are appropriate and necessary for the component implementation.
7-9: LGTM!The type definition correctly omits the hardcoded props and allows flexible prop forwarding.
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.
Actionable comments posted: 1
🧹 Nitpick comments (2)
apps/meteor/client/components/InvitationBadge/InvitationBadge.tsx (2)
7-9: Prop typing: excludetitle(or make precedence explicit).
BecauseInvitationBadgePropscurrently allows passingtitleviaComponentProps<typeof Icon>, callers can accidentally override the computedtitle={formattedDate}(or vice-versa, depending on prop spread order). Consider also omittingtitlefromInvitationBadgePropsto keep the badge’s accessible label consistent.-type InvitationBadgeProps = Omit<ComponentProps<typeof Icon>, 'name' | 'color' | 'role'> & { +type InvitationBadgeProps = Omit<ComponentProps<typeof Icon>, 'name' | 'color' | 'role' | 'title'> & { invitationDate?: string | Date; };
11-17: Minor: avoid recomputingformattedDateon every render if this badge re-renders frequently.
Not critical, but if this sits in a heavily re-rendered sidebar, wrapping the formatting inuseMemokeyed byinvitationDate,t, andtimeAgocan reduce churn.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
apps/meteor/client/components/InvitationBadge/__snapshots__/InvitationBadge.spec.tsx.snapis excluded by!**/*.snap
📒 Files selected for processing (2)
apps/meteor/client/components/InvitationBadge/InvitationBadge.tsx(1 hunks)packages/i18n/src/locales/en.i18n.json(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/i18n/src/locales/en.i18n.json
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}
📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation
Files:
apps/meteor/client/components/InvitationBadge/InvitationBadge.tsx
🧠 Learnings (1)
📚 Learning: 2025-11-17T15:07:13.273Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37398
File: packages/fuselage-ui-kit/src/surfaces/FuselageSurfaceRenderer.tsx:357-363
Timestamp: 2025-11-17T15:07:13.273Z
Learning: In packages/fuselage-ui-kit/src/surfaces/FuselageSurfaceRenderer.tsx, IconElement is a presentational, non-actionable element that does not require wrapping in AppIdProvider, similar to plain_text and mrkdwn renderers. Only actionable elements (those with actions, actionId, or interactive behavior) should be wrapped in AppIdProvider.
Applied to files:
apps/meteor/client/components/InvitationBadge/InvitationBadge.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: 📦 Build Packages
- GitHub Check: CodeQL-Build
- GitHub Check: CodeQL-Build
apps/meteor/client/components/InvitationBadge/InvitationBadge.tsx
Outdated
Show resolved
Hide resolved
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.
Maybe I didn't made myself clear. I will try again!
We already have a storybook for the sidebar, so I think we could generate some snapshots (e.g for sidebar which uses the InvitationBadge) adding the new invitation badge to cover this addition, instead of creating a new test file and snapshot file just for this pure visual component
f1967a5 to
a492ca8
Compare
@dougfabris One of the reasons why this component was added to |
dougfabris
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.
LGTM!
Proposed changes (including videos or screenshots)
Issue(s)
FB-64
Steps to test or reproduce
Further comments
Summary by CodeRabbit
New Features
Tests
Localization
Chores
✏️ Tip: You can customize this high-level summary in your review settings.