refactor: Revamp admin settings — card-based layout with section navigation#41339
refactor: Revamp admin settings — card-based layout with section navigation#41339rodrigok wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 4af39f0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 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 |
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
WalkthroughAdmin settings sections now render as cards instead of accordions, with optional translated side navigation that scrolls to stable section anchors. Generic and OAuth groups provide navigation data, skeletons match the new layout, and the related end-to-end test no longer expands an accordion. ChangesAdmin settings layout
Sequence Diagram(s)sequenceDiagram
participant Admin
participant SettingsGroupPage
participant SettingsSectionNav
participant SettingsSection
Admin->>SettingsGroupPage: open settings group
SettingsGroupPage->>SettingsSectionNav: render section links
SettingsSectionNav->>SettingsSection: scroll to selected anchor
SettingsSection->>Admin: display selected settings card
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
apps/meteor/client/views/admin/settings/groups/AccountsGroupPage/RegistrationAdvancedSection.tsx (1)
9-9: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRemove the code comment per coding guidelines.
The comment on line 9 violates the project guideline: "Avoid code comments in the implementation" for
**/*.{ts,tsx,js}files. TheHIGHLIGHTED_SETTINGSconstant name is sufficiently descriptive.♻️ Proposed fix
-// Settings already surfaced by the redesigned cards in RegistrationSignupSection. const HIGHLIGHTED_SETTINGS = [🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/meteor/client/views/admin/settings/groups/AccountsGroupPage/RegistrationAdvancedSection.tsx` at line 9, Remove the comment above HIGHLIGHTED_SETTINGS in RegistrationAdvancedSection.tsx, leaving the descriptive constant and surrounding implementation unchanged.Source: Coding guidelines
apps/meteor/client/views/admin/settings/groups/AccountsGroupPage/useEditableSettingField.ts (1)
8-12: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRemove the JSDoc comment block per the project's coding guideline.
The guideline for
**/*.{ts,tsx,js}files states: "Avoid code comments in the implementation." The JSDoc block on lines 8–12 should be removed to comply.♻️ Proposed fix
-/** - * Reads and writes a single setting through the editable-settings (draft) store, - * mirroring the dispatch logic of the generic `<Setting>` component so that the - * redesigned fields persist through the standard save/cancel pipeline. - */ export const useEditableSettingField = (settingId: string) => {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/meteor/client/views/admin/settings/groups/AccountsGroupPage/useEditableSettingField.ts` around lines 8 - 12, Remove the JSDoc comment block immediately preceding the editable setting hook implementation, leaving the surrounding code unchanged.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@apps/meteor/client/views/admin/settings/groups/AccountsGroupPage/AccountsSettingsNav.tsx`:
- Around line 41-59: Update the anchor-rendering Box in the items map to add
aria-current, setting it to 'true' when isActive and leaving it undefined
otherwise.
---
Nitpick comments:
In
`@apps/meteor/client/views/admin/settings/groups/AccountsGroupPage/RegistrationAdvancedSection.tsx`:
- Line 9: Remove the comment above HIGHLIGHTED_SETTINGS in
RegistrationAdvancedSection.tsx, leaving the descriptive constant and
surrounding implementation unchanged.
In
`@apps/meteor/client/views/admin/settings/groups/AccountsGroupPage/useEditableSettingField.ts`:
- Around line 8-12: Remove the JSDoc comment block immediately preceding the
editable setting hook implementation, leaving the surrounding code unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 0ab44893-6239-4dc1-ab14-550a9727c8de
📒 Files selected for processing (11)
.changeset/admin-accounts-registration-revamp.mdapps/meteor/client/views/admin/settings/SettingsGroupSelector/SettingsGroupSelector.tsxapps/meteor/client/views/admin/settings/groups/AccountsGroupPage/AccountsGroupPage.tsxapps/meteor/client/views/admin/settings/groups/AccountsGroupPage/AccountsSettingsNav.tsxapps/meteor/client/views/admin/settings/groups/AccountsGroupPage/RegistrationAdvancedSection.tsxapps/meteor/client/views/admin/settings/groups/AccountsGroupPage/RegistrationSignupSection.tsxapps/meteor/client/views/admin/settings/groups/AccountsGroupPage/SignupCard.tsxapps/meteor/client/views/admin/settings/groups/AccountsGroupPage/SignupToggleField.tsxapps/meteor/client/views/admin/settings/groups/AccountsGroupPage/index.tsapps/meteor/client/views/admin/settings/groups/AccountsGroupPage/useEditableSettingField.tspackages/i18n/src/locales/en.i18n.json
📜 Review details
⏰ Context from checks skipped due to timeout. (5)
- GitHub Check: 📦 Build Packages
- GitHub Check: Hacktron Security Check
- GitHub Check: cubic · AI code reviewer
- GitHub Check: CodeQL-Build
- GitHub Check: CodeQL-Build
🧰 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/views/admin/settings/groups/AccountsGroupPage/index.tsapps/meteor/client/views/admin/settings/groups/AccountsGroupPage/SignupCard.tsxapps/meteor/client/views/admin/settings/SettingsGroupSelector/SettingsGroupSelector.tsxapps/meteor/client/views/admin/settings/groups/AccountsGroupPage/SignupToggleField.tsxapps/meteor/client/views/admin/settings/groups/AccountsGroupPage/useEditableSettingField.tsapps/meteor/client/views/admin/settings/groups/AccountsGroupPage/RegistrationAdvancedSection.tsxapps/meteor/client/views/admin/settings/groups/AccountsGroupPage/AccountsSettingsNav.tsxapps/meteor/client/views/admin/settings/groups/AccountsGroupPage/AccountsGroupPage.tsxapps/meteor/client/views/admin/settings/groups/AccountsGroupPage/RegistrationSignupSection.tsx
🧠 Learnings (7)
📚 Learning: 2026-02-10T16:32:42.586Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 38528
File: apps/meteor/client/startup/roles.ts:14-14
Timestamp: 2026-02-10T16:32:42.586Z
Learning: In Rocket.Chat's Meteor client code, DDP streams use EJSON and Date fields arrive as Date objects; do not manually construct new Date() in stream handlers (for example, in sdk.stream()). Only REST API responses return plain JSON where dates are strings, so implement explicit conversion there if needed. Apply this guidance to all TypeScript files under apps/meteor/client to ensure consistent date handling in DDP streams and REST responses.
Applied to files:
apps/meteor/client/views/admin/settings/groups/AccountsGroupPage/index.tsapps/meteor/client/views/admin/settings/groups/AccountsGroupPage/useEditableSettingField.ts
📚 Learning: 2026-05-11T20:30:35.265Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 40480
File: apps/meteor/client/meteor/startup/accounts.ts:59-61
Timestamp: 2026-05-11T20:30:35.265Z
Learning: In Rocket.Chat’s Meteor client code, when calling `dispatchToastMessage` with `{ type: 'error' }`, pass the raw caught error object as `message` without manual normalization. `dispatchToastMessage` is designed to accept `message: unknown` for error toasts, so avoid converting errors to strings (e.g., `String(error)`) or extracting `error.message` before passing them.
Applied to files:
apps/meteor/client/views/admin/settings/groups/AccountsGroupPage/index.tsapps/meteor/client/views/admin/settings/groups/AccountsGroupPage/useEditableSettingField.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.
Applied to files:
apps/meteor/client/views/admin/settings/groups/AccountsGroupPage/index.tsapps/meteor/client/views/admin/settings/groups/AccountsGroupPage/useEditableSettingField.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In this repository (RocketChat/Rocket.Chat), Biome lint rules are not used even if a biome.json exists. When reviewing TypeScript files (e.g., packages/ui-voip/src/providers/useMediaSession.ts), ensure lint suggestions do not reference Biome-specific rules. Rely on general ESLint/TypeScript lint rules and project conventions instead.
Applied to files:
apps/meteor/client/views/admin/settings/groups/AccountsGroupPage/index.tsapps/meteor/client/views/admin/settings/groups/AccountsGroupPage/useEditableSettingField.ts
📚 Learning: 2026-05-06T12:21:44.083Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 40256
File: apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx:121-149
Timestamp: 2026-05-06T12:21:44.083Z
Learning: Field wrappers in rocket.chat/fuselage-forms (Field, FieldLabel, FieldRow, FieldError, FieldHint) auto-create htmlFor/id associations, aria-describedby, and role="alert" for errors. Do not manually set htmlFor, id, aria-describedby, or role attributes when using these wrappers. This automatic wiring does not apply to plain rocket.chat/fuselage components, which require explicit ID wiring per the accessibility docs. In code reviews, prefer using fuselage-forms wrappers for form fields and verify there is no unnecessary manual ID/aria wiring in files that use these wrappers. If a component uses plain fuselage components, ensure proper id wiring as per docs.
Applied to files:
apps/meteor/client/views/admin/settings/groups/AccountsGroupPage/index.tsapps/meteor/client/views/admin/settings/groups/AccountsGroupPage/SignupCard.tsxapps/meteor/client/views/admin/settings/SettingsGroupSelector/SettingsGroupSelector.tsxapps/meteor/client/views/admin/settings/groups/AccountsGroupPage/SignupToggleField.tsxapps/meteor/client/views/admin/settings/groups/AccountsGroupPage/useEditableSettingField.tsapps/meteor/client/views/admin/settings/groups/AccountsGroupPage/RegistrationAdvancedSection.tsxapps/meteor/client/views/admin/settings/groups/AccountsGroupPage/AccountsSettingsNav.tsxapps/meteor/client/views/admin/settings/groups/AccountsGroupPage/AccountsGroupPage.tsxapps/meteor/client/views/admin/settings/groups/AccountsGroupPage/RegistrationSignupSection.tsx
📚 Learning: 2026-03-27T14:52:56.865Z
Learnt from: dougfabris
Repo: RocketChat/Rocket.Chat PR: 39892
File: apps/meteor/client/views/room/contextualBar/Threads/Thread.tsx:150-155
Timestamp: 2026-03-27T14:52:56.865Z
Learning: In Rocket.Chat, there are two different `ModalBackdrop` components with different prop APIs. During review, confirm the import source: (1) `rocket.chat/fuselage` `ModalBackdrop` uses `ModalBackdropProps` based on `BoxProps` (so it supports `onClick` and other Box/DOM props) and does not have an `onDismiss` prop; (2) `rocket.chat/ui-client` `ModalBackdrop` uses a narrower props interface like `{ children?: ReactNode; onDismiss?: () => void }` and handles Escape keypress and outside mouse-up, and it does not forward arbitrary DOM props such as `onClick`. Flag mismatched props (e.g., `onDismiss` passed to the fuselage component or `onClick` passed to the ui-client component) and ensure the usage matches the correct component being imported.
Applied to files:
apps/meteor/client/views/admin/settings/groups/AccountsGroupPage/SignupCard.tsxapps/meteor/client/views/admin/settings/SettingsGroupSelector/SettingsGroupSelector.tsxapps/meteor/client/views/admin/settings/groups/AccountsGroupPage/SignupToggleField.tsxapps/meteor/client/views/admin/settings/groups/AccountsGroupPage/RegistrationAdvancedSection.tsxapps/meteor/client/views/admin/settings/groups/AccountsGroupPage/AccountsSettingsNav.tsxapps/meteor/client/views/admin/settings/groups/AccountsGroupPage/AccountsGroupPage.tsxapps/meteor/client/views/admin/settings/groups/AccountsGroupPage/RegistrationSignupSection.tsx
📚 Learning: 2026-03-16T21:50:37.589Z
Learnt from: amitb0ra
Repo: RocketChat/Rocket.Chat PR: 39676
File: .changeset/migrate-users-register-openapi.md:3-3
Timestamp: 2026-03-16T21:50:37.589Z
Learning: For changes related to OpenAPI migrations in Rocket.Chat/OpenAPI, when removing endpoint types and validators from rocket.chat/rest-typings (e.g., UserRegisterParamsPOST, /v1/users.register) document this as a minor changeset (not breaking) per RocketChat/Rocket.Chat-Open-API#150 Rule 7. Note that the endpoint type is re-exposed via a module augmentation .d.ts in the consuming package (e.g., packages/web-ui-registration/src/users-register.d.ts). In reviews, ensure the changeset clearly states: this is a non-breaking change, the major version should not be bumped, and the changeset reflects a minor version bump. Do not treat this as a breaking change during OpenAPI migrations.
Applied to files:
.changeset/admin-accounts-registration-revamp.md
🔇 Additional comments (8)
apps/meteor/client/views/admin/settings/SettingsGroupSelector/SettingsGroupSelector.tsx (1)
5-5: LGTM!Also applies to: 39-41
apps/meteor/client/views/admin/settings/groups/AccountsGroupPage/index.ts (1)
1-1: LGTM!.changeset/admin-accounts-registration-revamp.md (1)
1-6: LGTM!apps/meteor/client/views/admin/settings/groups/AccountsGroupPage/AccountsGroupPage.tsx (1)
9-9: Check theREGISTRATION_SECTION_ID/translation-key contract before merge.apps/meteor/client/views/admin/settings/groups/AccountsGroupPage/SignupCard.tsx (1)
1-19: LGTM!apps/meteor/client/views/admin/settings/groups/AccountsGroupPage/RegistrationSignupSection.tsx (1)
42-42: Verify whether manualhtmlFor/idattributes are needed with fuselage-forms Field wrappers.Same concern as
SignupToggleField.tsx:FieldLabelandSelect/TextInputmanually sethtmlFor/idto the setting ID. If the fuselage-formsField/FieldLabelwrappers auto-create these associations, the manual attributes are redundant and could conflict with auto-generated IDs. Please verify and remove if unnecessary.Based on learnings, Field wrappers in rocket.chat/fuselage-forms auto-create htmlFor/id associations; do not manually set htmlFor, id, aria-describedby, or role attributes when using these wrappers.
Also applies to: 48-48, 68-68, 74-74
Source: Learnings
packages/i18n/src/locales/en.i18n.json (1)
427-447: LGTM!apps/meteor/client/views/admin/settings/groups/AccountsGroupPage/SignupToggleField.tsx (1)
29-29: Check theFieldwrapper’s ID wiring — keep the explicithtmlFor/idpair unless this specificFieldcomposition auto-generates matching IDs.
| {items.map(({ id, label }) => { | ||
| const isActive = id === activeId; | ||
| return ( | ||
| <Box | ||
| key={id} | ||
| is='a' | ||
| href={`#${id}`} | ||
| onClick={(event: MouseEvent<HTMLAnchorElement>) => handleClick(event, id)} | ||
| pb={8} | ||
| pis={12} | ||
| mbe={4} | ||
| fontScale='p2' | ||
| color={isActive ? 'info' : 'hint'} | ||
| fontWeight={isActive ? 700 : 400} | ||
| style={{ cursor: 'pointer', textDecoration: 'none' }} | ||
| > | ||
| {label} | ||
| </Box> | ||
| ); |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
Add aria-current to the active nav link.
The active link is visually distinguished by color='info' and fontWeight={700}, but screen reader users have no programmatic indication of which section is active. Add aria-current={isActive ? 'true' : undefined} to the anchor element.
♿ Proposed fix
fontScale='p2'
color={isActive ? 'info' : 'hint'}
fontWeight={isActive ? 700 : 400}
+ aria-current={isActive ? 'true' : undefined}
style={{ cursor: 'pointer', textDecoration: 'none' }}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| {items.map(({ id, label }) => { | |
| const isActive = id === activeId; | |
| return ( | |
| <Box | |
| key={id} | |
| is='a' | |
| href={`#${id}`} | |
| onClick={(event: MouseEvent<HTMLAnchorElement>) => handleClick(event, id)} | |
| pb={8} | |
| pis={12} | |
| mbe={4} | |
| fontScale='p2' | |
| color={isActive ? 'info' : 'hint'} | |
| fontWeight={isActive ? 700 : 400} | |
| style={{ cursor: 'pointer', textDecoration: 'none' }} | |
| > | |
| {label} | |
| </Box> | |
| ); | |
| {items.map(({ id, label }) => { | |
| const isActive = id === activeId; | |
| return ( | |
| <Box | |
| key={id} | |
| is='a' | |
| href={`#${id}`} | |
| onClick={(event: MouseEvent<HTMLAnchorElement>) => handleClick(event, id)} | |
| pb={8} | |
| pis={12} | |
| mbe={4} | |
| fontScale='p2' | |
| color={isActive ? 'info' : 'hint'} | |
| fontWeight={isActive ? 700 : 400} | |
| aria-current={isActive ? 'true' : undefined} | |
| style={{ cursor: 'pointer', textDecoration: 'none' }} | |
| > | |
| {label} | |
| </Box> | |
| ); |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@apps/meteor/client/views/admin/settings/groups/AccountsGroupPage/AccountsSettingsNav.tsx`
around lines 41 - 59, Update the anchor-rendering Box in the items map to add
aria-current, setting it to 'true' when isActive and leaving it undefined
otherwise.
There was a problem hiding this comment.
3 issues found across 11 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/meteor/client/views/admin/settings/groups/AccountsGroupPage/AccountsSettingsNav.tsx">
<violation number="1" location="apps/meteor/client/views/admin/settings/groups/AccountsGroupPage/AccountsSettingsNav.tsx:21">
P3: Section navigation does not update the URL fragment, so a selected Accounts section cannot be bookmarked/shared and browser history has no section state. Preserve/update the hash while retaining smooth scrolling.</violation>
<violation number="2" location="apps/meteor/client/views/admin/settings/groups/AccountsGroupPage/AccountsSettingsNav.tsx:54">
P3: The current section is conveyed only by color/weight. Expose the active navigation item with `aria-current="location"` so assistive technology receives the same state.</violation>
</file>
<file name="apps/meteor/client/views/admin/settings/groups/AccountsGroupPage/RegistrationAdvancedSection.tsx">
<violation number="1" location="apps/meteor/client/views/admin/settings/groups/AccountsGroupPage/RegistrationAdvancedSection.tsx:12">
P1: Admins can no longer rotate or replace a Secret URL: this exclusion removes the only generic setting editor, while the new preview input is read-only. Keep this setting in Advanced options or add an editable secret-value control so an exposed registration URL can be revoked.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| // Settings already surfaced by the redesigned cards in RegistrationSignupSection. | ||
| const HIGHLIGHTED_SETTINGS = [ | ||
| 'Accounts_RegistrationForm', | ||
| 'Accounts_RegistrationForm_SecretURL', |
There was a problem hiding this comment.
P1: Admins can no longer rotate or replace a Secret URL: this exclusion removes the only generic setting editor, while the new preview input is read-only. Keep this setting in Advanced options or add an editable secret-value control so an exposed registration URL can be revoked.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/meteor/client/views/admin/settings/groups/AccountsGroupPage/RegistrationAdvancedSection.tsx, line 12:
<comment>Admins can no longer rotate or replace a Secret URL: this exclusion removes the only generic setting editor, while the new preview input is read-only. Keep this setting in Advanced options or add an editable secret-value control so an exposed registration URL can be revoked.</comment>
<file context>
@@ -0,0 +1,52 @@
+// Settings already surfaced by the redesigned cards in RegistrationSignupSection.
+const HIGHLIGHTED_SETTINGS = [
+ 'Accounts_RegistrationForm',
+ 'Accounts_RegistrationForm_SecretURL',
+ 'Accounts_ManuallyApproveNewUsers',
+ 'Accounts_EmailVerification',
</file context>
| mbe={4} | ||
| fontScale='p2' | ||
| color={isActive ? 'info' : 'hint'} | ||
| fontWeight={isActive ? 700 : 400} |
There was a problem hiding this comment.
P3: The current section is conveyed only by color/weight. Expose the active navigation item with aria-current="location" so assistive technology receives the same state.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/meteor/client/views/admin/settings/groups/AccountsGroupPage/AccountsSettingsNav.tsx, line 54:
<comment>The current section is conveyed only by color/weight. Expose the active navigation item with `aria-current="location"` so assistive technology receives the same state.</comment>
<file context>
@@ -0,0 +1,65 @@
+ mbe={4}
+ fontScale='p2'
+ color={isActive ? 'info' : 'hint'}
+ fontWeight={isActive ? 700 : 400}
+ style={{ cursor: 'pointer', textDecoration: 'none' }}
+ >
</file context>
| const [activeId, setActiveId] = useState(items[0]?.id); | ||
|
|
||
| const handleClick = (event: MouseEvent<HTMLAnchorElement>, id: string): void => { | ||
| event.preventDefault(); |
There was a problem hiding this comment.
P3: Section navigation does not update the URL fragment, so a selected Accounts section cannot be bookmarked/shared and browser history has no section state. Preserve/update the hash while retaining smooth scrolling.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/meteor/client/views/admin/settings/groups/AccountsGroupPage/AccountsSettingsNav.tsx, line 21:
<comment>Section navigation does not update the URL fragment, so a selected Accounts section cannot be bookmarked/shared and browser history has no section state. Preserve/update the hash while retaining smooth scrolling.</comment>
<file context>
@@ -0,0 +1,65 @@
+ const [activeId, setActiveId] = useState(items[0]?.id);
+
+ const handleClick = (event: MouseEvent<HTMLAnchorElement>, id: string): void => {
+ event.preventDefault();
+ setActiveId(id);
+ document.getElementById(id)?.scrollIntoView({ behavior: 'smooth', block: 'start' });
</file context>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #41339 +/- ##
========================================
Coverage 69.04% 69.04%
========================================
Files 3757 3757
Lines 147735 147723 -12
Branches 26395 26385 -10
========================================
- Hits 102000 101992 -8
- Misses 41234 41238 +4
+ Partials 4501 4493 -8
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
…vigation Refreshes the look of every admin settings group by refactoring the shared settings-rendering components, without reorganizing any settings or changing their names/descriptions. - SettingsSection now renders each section as a titled card instead of an accordion item (title kept as an h2 for existing selectors). - SettingsGroupPage renders sections in a two-column layout: stacked cards on the left and a sticky in-page "Settings in <group>" section navigation on the right, replacing the single accordion. - GenericGroupPage / OAuthGroupPage compute stable section anchor ids and the nav item list; a shared getSettingsSectionAnchorId helper keeps ids in sync. - Skeletons updated to match the card layout. Applies uniformly across all settings groups via the generic template. Also drops an obsolete accordion-expand step from the Layout settings e2e, since sections are now always visible. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
0970b1e to
4af39f0
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
apps/meteor/client/views/admin/settings/SettingsGroupPage/SettingsSectionNav.tsx (1)
46-64: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick winAdd
aria-currentto the active nav link.The active link is only distinguished visually (
color/fontWeight); screen reader users get no programmatic indication of the active section.♿ Proposed fix
fontScale='p2' color={isActive ? 'info' : 'hint'} fontWeight={isActive ? 700 : 400} + aria-current={isActive ? 'true' : undefined} style={{ cursor: 'pointer', textDecoration: 'none' }}🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/meteor/client/views/admin/settings/SettingsGroupPage/SettingsSectionNav.tsx` around lines 46 - 64, Add an aria-current attribute to the anchor Box rendered in the items.map callback, setting it to "page" (or the appropriate current-state value) only when isActive is true and leaving it unset otherwise. Preserve the existing visual active styling and navigation behavior.
🧹 Nitpick comments (1)
apps/meteor/client/views/admin/settings/SettingsGroupPage/SettingsSectionNav.tsx (1)
16-28: 🎯 Functional Correctness | 🔵 Trivial | 🏗️ Heavy liftActive section only updates on click, not on scroll.
If the user scrolls manually instead of clicking a nav link,
activeIdnever updates, so the highlighted item can drift out of sync with what's actually in view. Consider anIntersectionObserver-based scroll-spy to keep it accurate.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/meteor/client/views/admin/settings/SettingsGroupPage/SettingsSectionNav.tsx` around lines 16 - 28, Update SettingsSectionNav to observe the section elements with an IntersectionObserver and set activeId as the visible section changes during manual scrolling. Initialize or refresh the observer when items changes, disconnect it during cleanup, and preserve the existing click handling and fallback to items[0]?.id.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@apps/meteor/client/views/admin/settings/groups/OAuthGroupPage/OAuthGroupPage.tsx`:
- Around line 26-30: Update the navItems useMemo mapping in OAuthGroupPage to
cast each sectionName to TranslationKey before passing it to t(). Preserve the
existing filtering, anchor ID generation, and dependency array.
---
Duplicate comments:
In
`@apps/meteor/client/views/admin/settings/SettingsGroupPage/SettingsSectionNav.tsx`:
- Around line 46-64: Add an aria-current attribute to the anchor Box rendered in
the items.map callback, setting it to "page" (or the appropriate current-state
value) only when isActive is true and leaving it unset otherwise. Preserve the
existing visual active styling and navigation behavior.
---
Nitpick comments:
In
`@apps/meteor/client/views/admin/settings/SettingsGroupPage/SettingsSectionNav.tsx`:
- Around line 16-28: Update SettingsSectionNav to observe the section elements
with an IntersectionObserver and set activeId as the visible section changes
during manual scrolling. Initialize or refresh the observer when items changes,
disconnect it during cleanup, and preserve the existing click handling and
fallback to items[0]?.id.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9a665026-73f3-4a2e-a041-8ed8a3d538f3
📒 Files selected for processing (11)
.changeset/admin-settings-card-layout.mdapps/meteor/client/views/admin/settings/SettingsGroupPage/SettingsGroupPage.tsxapps/meteor/client/views/admin/settings/SettingsGroupPage/SettingsGroupPageSkeleton.tsxapps/meteor/client/views/admin/settings/SettingsGroupPage/SettingsSectionNav.tsxapps/meteor/client/views/admin/settings/SettingsSection/SettingsSection.tsxapps/meteor/client/views/admin/settings/SettingsSection/SettingsSectionSkeleton.tsxapps/meteor/client/views/admin/settings/groups/GenericGroupPage.tsxapps/meteor/client/views/admin/settings/groups/OAuthGroupPage/OAuthGroupPage.tsxapps/meteor/client/views/admin/settings/groups/getSettingsSectionAnchorId.tsapps/meteor/tests/e2e/administration-settings.spec.tspackages/i18n/src/locales/en.i18n.json
💤 Files with no reviewable changes (1)
- apps/meteor/tests/e2e/administration-settings.spec.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (3)
- GitHub Check: CodeQL-Build
- GitHub Check: Hacktron Security Check
- GitHub Check: CodeQL-Build
🧰 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/views/admin/settings/SettingsSection/SettingsSectionSkeleton.tsxapps/meteor/client/views/admin/settings/groups/getSettingsSectionAnchorId.tsapps/meteor/client/views/admin/settings/SettingsGroupPage/SettingsGroupPageSkeleton.tsxapps/meteor/client/views/admin/settings/SettingsGroupPage/SettingsSectionNav.tsxapps/meteor/client/views/admin/settings/groups/GenericGroupPage.tsxapps/meteor/client/views/admin/settings/SettingsGroupPage/SettingsGroupPage.tsxapps/meteor/client/views/admin/settings/groups/OAuthGroupPage/OAuthGroupPage.tsxapps/meteor/client/views/admin/settings/SettingsSection/SettingsSection.tsx
🧠 Learnings (7)
📚 Learning: 2026-03-16T21:50:37.589Z
Learnt from: amitb0ra
Repo: RocketChat/Rocket.Chat PR: 39676
File: .changeset/migrate-users-register-openapi.md:3-3
Timestamp: 2026-03-16T21:50:37.589Z
Learning: For changes related to OpenAPI migrations in Rocket.Chat/OpenAPI, when removing endpoint types and validators from rocket.chat/rest-typings (e.g., UserRegisterParamsPOST, /v1/users.register) document this as a minor changeset (not breaking) per RocketChat/Rocket.Chat-Open-API#150 Rule 7. Note that the endpoint type is re-exposed via a module augmentation .d.ts in the consuming package (e.g., packages/web-ui-registration/src/users-register.d.ts). In reviews, ensure the changeset clearly states: this is a non-breaking change, the major version should not be bumped, and the changeset reflects a minor version bump. Do not treat this as a breaking change during OpenAPI migrations.
Applied to files:
.changeset/admin-settings-card-layout.md
📚 Learning: 2026-03-27T14:52:56.865Z
Learnt from: dougfabris
Repo: RocketChat/Rocket.Chat PR: 39892
File: apps/meteor/client/views/room/contextualBar/Threads/Thread.tsx:150-155
Timestamp: 2026-03-27T14:52:56.865Z
Learning: In Rocket.Chat, there are two different `ModalBackdrop` components with different prop APIs. During review, confirm the import source: (1) `rocket.chat/fuselage` `ModalBackdrop` uses `ModalBackdropProps` based on `BoxProps` (so it supports `onClick` and other Box/DOM props) and does not have an `onDismiss` prop; (2) `rocket.chat/ui-client` `ModalBackdrop` uses a narrower props interface like `{ children?: ReactNode; onDismiss?: () => void }` and handles Escape keypress and outside mouse-up, and it does not forward arbitrary DOM props such as `onClick`. Flag mismatched props (e.g., `onDismiss` passed to the fuselage component or `onClick` passed to the ui-client component) and ensure the usage matches the correct component being imported.
Applied to files:
apps/meteor/client/views/admin/settings/SettingsSection/SettingsSectionSkeleton.tsxapps/meteor/client/views/admin/settings/SettingsGroupPage/SettingsGroupPageSkeleton.tsxapps/meteor/client/views/admin/settings/SettingsGroupPage/SettingsSectionNav.tsxapps/meteor/client/views/admin/settings/groups/GenericGroupPage.tsxapps/meteor/client/views/admin/settings/SettingsGroupPage/SettingsGroupPage.tsxapps/meteor/client/views/admin/settings/groups/OAuthGroupPage/OAuthGroupPage.tsxapps/meteor/client/views/admin/settings/SettingsSection/SettingsSection.tsx
📚 Learning: 2026-05-06T12:21:44.083Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 40256
File: apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx:121-149
Timestamp: 2026-05-06T12:21:44.083Z
Learning: Field wrappers in rocket.chat/fuselage-forms (Field, FieldLabel, FieldRow, FieldError, FieldHint) auto-create htmlFor/id associations, aria-describedby, and role="alert" for errors. Do not manually set htmlFor, id, aria-describedby, or role attributes when using these wrappers. This automatic wiring does not apply to plain rocket.chat/fuselage components, which require explicit ID wiring per the accessibility docs. In code reviews, prefer using fuselage-forms wrappers for form fields and verify there is no unnecessary manual ID/aria wiring in files that use these wrappers. If a component uses plain fuselage components, ensure proper id wiring as per docs.
Applied to files:
apps/meteor/client/views/admin/settings/SettingsSection/SettingsSectionSkeleton.tsxapps/meteor/client/views/admin/settings/groups/getSettingsSectionAnchorId.tsapps/meteor/client/views/admin/settings/SettingsGroupPage/SettingsGroupPageSkeleton.tsxapps/meteor/client/views/admin/settings/SettingsGroupPage/SettingsSectionNav.tsxapps/meteor/client/views/admin/settings/groups/GenericGroupPage.tsxapps/meteor/client/views/admin/settings/SettingsGroupPage/SettingsGroupPage.tsxapps/meteor/client/views/admin/settings/groups/OAuthGroupPage/OAuthGroupPage.tsxapps/meteor/client/views/admin/settings/SettingsSection/SettingsSection.tsx
📚 Learning: 2026-02-10T16:32:42.586Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 38528
File: apps/meteor/client/startup/roles.ts:14-14
Timestamp: 2026-02-10T16:32:42.586Z
Learning: In Rocket.Chat's Meteor client code, DDP streams use EJSON and Date fields arrive as Date objects; do not manually construct new Date() in stream handlers (for example, in sdk.stream()). Only REST API responses return plain JSON where dates are strings, so implement explicit conversion there if needed. Apply this guidance to all TypeScript files under apps/meteor/client to ensure consistent date handling in DDP streams and REST responses.
Applied to files:
apps/meteor/client/views/admin/settings/groups/getSettingsSectionAnchorId.ts
📚 Learning: 2026-05-11T20:30:35.265Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 40480
File: apps/meteor/client/meteor/startup/accounts.ts:59-61
Timestamp: 2026-05-11T20:30:35.265Z
Learning: In Rocket.Chat’s Meteor client code, when calling `dispatchToastMessage` with `{ type: 'error' }`, pass the raw caught error object as `message` without manual normalization. `dispatchToastMessage` is designed to accept `message: unknown` for error toasts, so avoid converting errors to strings (e.g., `String(error)`) or extracting `error.message` before passing them.
Applied to files:
apps/meteor/client/views/admin/settings/groups/getSettingsSectionAnchorId.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.
Applied to files:
apps/meteor/client/views/admin/settings/groups/getSettingsSectionAnchorId.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In this repository (RocketChat/Rocket.Chat), Biome lint rules are not used even if a biome.json exists. When reviewing TypeScript files (e.g., packages/ui-voip/src/providers/useMediaSession.ts), ensure lint suggestions do not reference Biome-specific rules. Rely on general ESLint/TypeScript lint rules and project conventions instead.
Applied to files:
apps/meteor/client/views/admin/settings/groups/getSettingsSectionAnchorId.ts
🔇 Additional comments (10)
apps/meteor/client/views/admin/settings/SettingsGroupPage/SettingsGroupPageSkeleton.tsx (1)
1-1: LGTM!Also applies to: 11-17
apps/meteor/client/views/admin/settings/SettingsSection/SettingsSectionSkeleton.tsx (1)
1-18: LGTM!apps/meteor/client/views/admin/settings/SettingsGroupPage/SettingsGroupPage.tsx (1)
2-2: LGTM!Also applies to: 11-12, 24-24, 36-36, 153-170
apps/meteor/client/views/admin/settings/SettingsSection/SettingsSection.tsx (2)
2-2: LGTM!Also applies to: 74-114
17-22: 🎯 Functional Correctness
solohas been removed from allSettingsSectioncallers.packages/i18n/src/locales/en.i18n.json (1)
5005-5005: LGTM!.changeset/admin-settings-card-layout.md (1)
1-6: LGTM!apps/meteor/client/views/admin/settings/groups/getSettingsSectionAnchorId.ts (1)
1-8: LGTM!apps/meteor/client/views/admin/settings/groups/GenericGroupPage.tsx (1)
1-6: LGTM!Also applies to: 22-31, 32-42
apps/meteor/client/views/admin/settings/groups/OAuthGroupPage/OAuthGroupPage.tsx (1)
107-107: LGTM!Also applies to: 124-124, 144-146
| const navItems = useMemo( | ||
| () => | ||
| settingSections.filter(Boolean).map((sectionName) => ({ id: getSettingsSectionAnchorId(_id, sectionName), label: t(sectionName) })), | ||
| [settingSections, _id, t], | ||
| ); |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Inspect the useTranslation import/type used in OAuthGroupPage.tsx and its t() signature.
sed -n '1,10p' apps/meteor/client/views/admin/settings/groups/OAuthGroupPage/OAuthGroupPage.tsx
rg -n "export.*useTranslation" packages/ui-contexts/src 2>/dev/nullRepository: RocketChat/Rocket.Chat
Length of output: 980
🏁 Script executed:
#!/bin/bash
sed -n '1,220p' packages/ui-contexts/src/hooks/useTranslation.ts
printf '\n---\n'
rg -n "type TranslationContextValue|interface TranslationContextValue|TranslationKey" packages/ui-contexts/src packages/ui-contexts -g '!**/dist/**'Repository: RocketChat/Rocket.Chat
Length of output: 2467
🏁 Script executed:
#!/bin/bash
sed -n '1,220p' apps/meteor/client/views/admin/settings/groups/OAuthGroupPage/OAuthGroupPage.tsx
printf '\n---\n'
rg -n "useEditableSettingsGroupSections|settingSections" apps/meteor/client/views/admin/settings -g '!**/dist/**'Repository: RocketChat/Rocket.Chat
Length of output: 6871
🏁 Script executed:
#!/bin/bash
sed -n '1,220p' apps/meteor/client/views/admin/settings/EditableSettingsContext.tsx
printf '\n---\n'
rg -n "useEditableSettingsGroupSections" apps/meteor/client/views/admin/settings -g '!**/dist/**'Repository: RocketChat/Rocket.Chat
Length of output: 1180
🏁 Script executed:
#!/bin/bash
fd -a "EditableSettingsContext.*" apps/meteor/client/views/admin/settings
printf '\n---\n'
fd -a "EditableSettingsContext.*" apps/meteor/client/views/admin
printf '\n---\n'
git ls-files | rg "EditableSettingsContext\.(ts|tsx)$"Repository: RocketChat/Rocket.Chat
Length of output: 388
🏁 Script executed:
#!/bin/bash
sed -n '1,240p' apps/meteor/client/views/admin/EditableSettingsContext.ts
printf '\n---\n'
sed -n '1,220p' apps/meteor/client/views/admin/settings/groups/GenericGroupPage.tsx
printf '\n---\n'
sed -n '1,220p' apps/meteor/client/views/admin/settings/groups/SettingsSection.tsxRepository: RocketChat/Rocket.Chat
Length of output: 5995
Add the TranslationKey cast here too. useEditableSettingsGroupSections() returns string[], but t() only accepts TranslationKey, so t(sectionName) here is a type mismatch.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@apps/meteor/client/views/admin/settings/groups/OAuthGroupPage/OAuthGroupPage.tsx`
around lines 26 - 30, Update the navItems useMemo mapping in OAuthGroupPage to
cast each sectionName to TranslationKey before passing it to t(). Preserve the
existing filtering, anchor ID generation, and dependency array.
Proposed changes
Refreshes the look of every admin settings group by refactoring the shared settings-rendering template components — not by reorganizing settings. All existing groups, sections, names, and descriptions are preserved; this is a presentational refactor that applies uniformly across the admin.
Based on the design mockup (Accounts page), generalized to the whole settings template.
What changed
SettingsSection— renders each section as a titled card (bordered, padded, surface background) instead of an accordion item. The title stays an<h2>so existing selectors keep working;data-qa-sectionis preserved.SettingsGroupPage— replaces the single<Accordion>with a two-column layout: stacked section cards on the left and an in-page "Settings in {group}" section navigation on the right that scroll-jumps to each section.GenericGroupPage/OAuthGroupPage— compute stable section anchor ids and the nav item list; a sharedgetSettingsSectionAnchorIdhelper keeps the anchors and nav in sync.Accordionusage removed).Settings_in_group("Settings in {{group}}") for the nav header.Because the change lives in the generic renderer, it applies to all groups automatically (Accounts, Message, Layout, OAuth, LDAP, Assets, Omnichannel, …). No settings were moved, renamed, or re-described.
Behavior notes
administration-settings.spec.ts), since the "Custom CSS" section is always visible now.Verification
tsc --noEmit(meteor app): 0 errors.data-qa-sectionh2 lookups, omnichannelgroup()clicks) — still valid.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes