Skip to content

feat(desktop): push user roles to the desktop app - #41056

Merged
ggazzo merged 4 commits into
developfrom
feat/desktop-set-user-roles
Jun 24, 2026
Merged

feat(desktop): push user roles to the desktop app#41056
ggazzo merged 4 commits into
developfrom
feat/desktop-set-user-roles

Conversation

@ggazzo

@ggazzo ggazzo commented Jun 23, 2026

Copy link
Copy Markdown
Member

Jira: ARCH-2192

Proposal

Expose the logged-in user's roles to the desktop app so it can decide which supportedVersions messages to show — e.g. restrict version-expiration warnings to admins (the only ones who can act on them) instead of showing them to every user.

Changes

  • @rocket.chat/desktop-api: add setUserRoles(roles: string[]) to IRocketChatDesktop.
  • meteor client: new useDesktopUserRoles hook that reads the current user's roles via useUser() and pushes them through window.RocketChatDesktop?.setUserRoles?.(...). Mounted in AppLayout alongside the other useDesktop* hooks. The push is reactive — role changes propagate live.

The call is optional (?.) so a web client running inside an older desktop build without the bridge method keeps working; that desktop falls back to its own role lookup.

Desktop side

Pairs with the desktop change that consumes this bridge and filters role-targeted supportedVersions messages: RocketChat/Rocket.Chat.Electron#3371. The desktop uses a hybrid acquisition — bridge push (this PR) takes precedence, with a /api/v1/me REST fallback for clients that predate this change.

Notes

  • supportedVersions messages are a shared contract (desktop + mobile, produced by cloud). The role-targeting field (Message.roles) is added on the desktop side; this PR provides the role signal the desktop needs.
  • Client-side UX, not a security boundary.

Review in cubic

Summary by CodeRabbit

Release Notes

  • New Features
    • Added automatic syncing of the logged-in user’s roles to the desktop app, updating reactively as roles change.
    • Introduced a new desktop API bridge method to receive role updates, enabling role-based restrictions for select desktop notifications (including supported-versions related messages).
    • Desktop builds that don’t include the new bridge method continue to work using the existing role lookup behavior.

Add a setUserRoles method to the desktop API bridge and push the logged-in
user's roles to the desktop app reactively. This lets the desktop client
restrict supportedVersions messages (e.g. version-expiration warnings) to
specific roles such as admins instead of showing them to every user.

The call is optional so desktop builds without the bridge method keep working
and fall back to their own role lookup.
@ggazzo
ggazzo requested a review from a team as a code owner June 23, 2026 18:24
@dionisio-bot

dionisio-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot

changeset-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c42e8f1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@rocket.chat/desktop-api Minor
@rocket.chat/meteor Patch
@rocket.chat/ui-voip Patch
@rocket.chat/core-typings Patch
@rocket.chat/rest-typings Patch

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

@ggazzo ggazzo added this to the 8.7.0 milestone Jun 23, 2026
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Adds setUserRoles(roles: string[]) to IRocketChatDesktop, introduces useDesktopUserRoles to push the current user's roles to the desktop bridge, and mounts the hook in AppLayout. A changeset records the package version bumps.

Changes

Desktop User Roles Bridge

Layer / File(s) Summary
API contract and hook implementation
packages/desktop-api/src/index.ts, apps/meteor/client/views/root/hooks/useDesktopUserRoles.ts
IRocketChatDesktop gains setUserRoles(roles: string[]): void. The new useDesktopUserRoles hook reads the current user via useUser, computes a roles key, and calls window.RocketChatDesktop?.setUserRoles?.() in a client-only useEffect that re-runs on roles changes.
AppLayout wiring and changeset
apps/meteor/client/views/root/AppLayout.tsx, .changeset/desktop-set-user-roles.md
AppLayout imports and invokes useDesktopUserRoles as a top-level hook. The changeset bumps @rocket.chat/desktop-api (minor) and @rocket.chat/meteor (patch).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: pushing user roles from Meteor to the desktop app.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (2)
  • ARCH-2192: Request failed with status code 401
  • ARCH-2190: Request failed with status code 401

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot added the type: feature Pull requests that introduces new feature label Jun 23, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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 (1)
apps/meteor/client/views/root/hooks/useDesktopUserRoles.ts (1)

4-9: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Drop the new JSDoc block.

The repo guideline for TypeScript files says to avoid code comments in implementation, and this block doesn’t add enough value to keep.

🤖 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/root/hooks/useDesktopUserRoles.ts` around lines 4 -
9, Remove the entire JSDoc comment block that describes the purpose of pushing
logged-in user roles to the desktop app. According to the repository guidelines
for TypeScript files, implementation comments should be avoided when they don't
provide substantial value. Delete the multi-line comment block (starting with
/** and ending with */) that precedes the function definition.

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/root/hooks/useDesktopUserRoles.ts`:
- Around line 10-19: The useEffect in useDesktopUserRoles returns early when
userId is not available, which leaves the previous user's roles cached on
window.RocketChatDesktop during logout or account switching. Remove the early
return on !userId and instead ensure that
window.RocketChatDesktop?.setUserRoles?. is always called with either the
current user's roles (if userId exists) or an empty array (if userId is
null/undefined). This way the cached roles will be properly cleared when a user
logs out or switches accounts.

---

Nitpick comments:
In `@apps/meteor/client/views/root/hooks/useDesktopUserRoles.ts`:
- Around line 4-9: Remove the entire JSDoc comment block that describes the
purpose of pushing logged-in user roles to the desktop app. According to the
repository guidelines for TypeScript files, implementation comments should be
avoided when they don't provide substantial value. Delete the multi-line comment
block (starting with /** and ending with */) that precedes the function
definition.
🪄 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: 55a81297-fb06-45fb-af76-d87e28eeacb7

📥 Commits

Reviewing files that changed from the base of the PR and between e626fb9 and 7ad8267.

📒 Files selected for processing (4)
  • .changeset/desktop-set-user-roles.md
  • apps/meteor/client/views/root/AppLayout.tsx
  • apps/meteor/client/views/root/hooks/useDesktopUserRoles.ts
  • packages/desktop-api/src/index.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (5)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: cubic · AI code reviewer
  • 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/root/hooks/useDesktopUserRoles.ts
  • apps/meteor/client/views/root/AppLayout.tsx
  • packages/desktop-api/src/index.ts
🧠 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/root/hooks/useDesktopUserRoles.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/root/hooks/useDesktopUserRoles.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/root/hooks/useDesktopUserRoles.ts
  • packages/desktop-api/src/index.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/root/hooks/useDesktopUserRoles.ts
  • packages/desktop-api/src/index.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/root/hooks/useDesktopUserRoles.ts
  • apps/meteor/client/views/root/AppLayout.tsx
  • packages/desktop-api/src/index.ts
📚 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/desktop-set-user-roles.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/root/AppLayout.tsx
🔇 Additional comments (4)
packages/desktop-api/src/index.ts (1)

41-41: LGTM!

apps/meteor/client/views/root/AppLayout.tsx (2)

21-21: LGTM!


77-77: LGTM!

.changeset/desktop-set-user-roles.md (1)

2-6: LGTM!

Comment thread apps/meteor/client/views/root/hooks/useDesktopUserRoles.ts Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 4 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread apps/meteor/client/views/root/hooks/useDesktopUserRoles.ts Outdated
@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.14%. Comparing base (e626fb9) to head (c42e8f1).
⚠️ Report is 8 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #41056      +/-   ##
===========================================
- Coverage    70.14%   70.14%   -0.01%     
===========================================
  Files         3361     3361              
  Lines       129698   129699       +1     
  Branches     22483    22489       +6     
===========================================
  Hits         90980    90980              
- Misses       35405    35412       +7     
+ Partials      3313     3307       -6     
Flag Coverage Δ
unit 70.04% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jeanfbrito

Copy link
Copy Markdown
Member

Reviewed alongside the desktop consumer (RocketChat/Rocket.Chat.Electron#3371). The contract lines up exactly: setUserRoles(roles: string[]) on IRocketChatDesktop matches the bridge method the desktop registers, and the changeset (desktop-api minor + meteor patch) is correct.

Looks good

  • Reactive push works as describeduseDesktopUserRoles keys the effect on userId + rolesKey (roles.join(',')), so role changes re-fire and re-push live.
  • Graceful degradation — optional window.RocketChatDesktop?.setUserRoles?.(...) means a web client inside an older desktop build no-ops safely and the desktop falls back to its /api/v1/me lookup.

Notes (non-blocking)

  • The join(',')/split(',') round-trip exists only to derive a stable useEffect dependency primitive — works, just slightly indirect.
  • Logout isn't pushed here (if (!userId) return), but that's intentional and covered on the desktop side: setUserLoggedIn(false) -> clearUserRoles(). The coordination is correct but implicit across the two PRs — worth a line in the description.
  • Empty-roles edge: a logged-in user with zero roles pushes [], which the desktop treats like "unknown" (role-targeted messages hidden). Realistically every user has at least the user role, so benign.

Approving.

jeanfbrito
jeanfbrito previously approved these changes Jun 24, 2026
Push an empty roles array when there is no logged-in user so the desktop app
clears previously-pushed roles on logout or account switch, instead of keeping
stale ones cached.
ggazzo added 2 commits June 24, 2026 12:11
Collapse the role push to one canonical key derived from the reactive user and
push only when it changes. Logout, login and account switch all surface as a
change to that key, so stale roles are cleared without a userId branch or an
effect cleanup.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
apps/meteor/client/views/root/hooks/useDesktopUserRoles.ts (1)

11-16: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Remove the implementation comment block in this hook.

This inline rationale comment violates the repo rule for TS/JS implementation code; keep this context in PR/commit docs instead.

Proposed change
 export const useDesktopUserRoles = () => {
-	// A single canonical value derived from the reactive user. Logout, login and
-	// account switch all surface as a change to this key, so the effect re-runs
-	// and re-pushes only when the roles actually change — no userId branch and no
-	// effect cleanup (which would fire on every deps change and flicker
-	// role-targeted UI). Logged-out and "logged in with no roles" both resolve to
-	// an empty list, which is the correct signal for the desktop either way.
 	const rolesKey = (useUser()?.roles ?? []).join(',');

As per coding guidelines: "**/*.{ts,tsx,js}: ... Avoid code comments in the implementation".

🤖 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/root/hooks/useDesktopUserRoles.ts` around lines 11 -
16, The inline rationale comment in useDesktopUserRoles should be removed
because implementation comments are disallowed in TS/JS code. Delete the comment
block near the hook logic and keep any rationale in PR/commit docs instead,
without changing the hook’s behavior or surrounding reactive role handling.

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.

Nitpick comments:
In `@apps/meteor/client/views/root/hooks/useDesktopUserRoles.ts`:
- Around line 11-16: The inline rationale comment in useDesktopUserRoles should
be removed because implementation comments are disallowed in TS/JS code. Delete
the comment block near the hook logic and keep any rationale in PR/commit docs
instead, without changing the hook’s behavior or surrounding reactive role
handling.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e30bf5c8-2960-438d-acf6-be4ffe664bb4

📥 Commits

Reviewing files that changed from the base of the PR and between 0798cf1 and c42e8f1.

📒 Files selected for processing (1)
  • apps/meteor/client/views/root/hooks/useDesktopUserRoles.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (4)
  • GitHub Check: 📦 Build Packages
  • 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/root/hooks/useDesktopUserRoles.ts
🧠 Learnings (5)
📚 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/root/hooks/useDesktopUserRoles.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/root/hooks/useDesktopUserRoles.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/root/hooks/useDesktopUserRoles.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/root/hooks/useDesktopUserRoles.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/root/hooks/useDesktopUserRoles.ts

@ggazzo
ggazzo merged commit 0433f00 into develop Jun 24, 2026
18 of 19 checks passed
@ggazzo
ggazzo deleted the feat/desktop-set-user-roles branch June 24, 2026 15:24
This was referenced Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feature Pull requests that introduces new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants