Skip to content

feat: classification banners for ABAC rooms - #41307

Merged
dionisio-bot[bot] merged 43 commits into
developfrom
feat/abac-classification-banners
Jul 30, 2026
Merged

feat: classification banners for ABAC rooms#41307
dionisio-bot[bot] merged 43 commits into
developfrom
feat/abac-classification-banners

Conversation

@KevLehman

@KevLehman KevLehman commented Jul 10, 2026

Copy link
Copy Markdown
Member

Proposed changes (including videos or screenshots)

Adds classification banners to ABAC-managed rooms (EE, abac module): a colored strip rendered above the room header displaying US-Government-style classification markings (classification level, need-to-know compartments, releasability, etc.), driven by a JSON configuration.

image

How it works

  • Configuration — two new settings under Admin → ABAC → Settings → Classification banners (new accordion):
    • ABAC_Classification_Banners_Enabled (boolean toggle, public)
    • ABAC_Classification_Banners_Config (type: code, application/json, multiline, public) — a v1 JSON document describing attributes, value→label/color mappings and banner options. JSON syntax is validated on save via the existing code-setting pipeline; JSON-Schema/cross-field enforcement lands separately (see Further comments).
  • Engine — pure functions colocated with the component (client/views/room/ClassificationBanner/lib/): segment assembly (array order, delimiters, label prefixes, alphabetical sorting, group-collapse threshold), color resolution (values ranked most restrictive first — index 0 = highest, matching Virtru HIERARCHY convention; highest/attribute color modes), WCAG relative-luminance foreground, and a fallback banner when the room has no covered values. 19 unit tests, 100% statement coverage.
  • RenderingClassificationBanner component mounted via a new classificationBanner slot in RoomLayout, above the header. Renders only for ABAC-managed rooms, gated by the abac license module (+ ABAC_Enabled) and the enable toggle. The config is a public setting synced to clients, so the banner is computed client-side and updates live on config or room-attribute changes, no reload or server restart. Three styles supported: classic, segmented, edge.
  • Schema & docs — v1 JSON Schema published at ee/packages/abac/docs/classification-banners.schema.json ($id: https://rocket.chat/schemas/classification-banners/v1.json). The full reference documentation (semantics, cross-field rules, example) lives in the builder's Docs modal.
  • Builder — a standalone, GH-Pages-compatible configuration builder maintained at https://github.com/RocketChat/abac-banner-builder (published at https://rocketchat.github.io/abac-banner-builder/): live banner preview, attribute/value editors, simulated room values, warn-only cross-field linting, import/copy JSON, docs modal, light/dark themes using Fuselage tokens.

Example: a room with classification: [topsecret] and needtoknow: [ops, int] renders TOP SECRET // NTK-INT/OPS on the Top Secret orange with computed-contrast text.

Issue(s)

Steps to test or reproduce

  1. With an EE license including the abac module: Admin → ABAC → Settings, enable ABAC and, under the Classification banners accordion, enable the toggle and paste a config (use the builder — its Docs modal and "Load example" provide a reference configuration).
  2. Create a private room, assign ABAC attributes matching the config (e.g. classification: topsecret) via Admin → ABAC → Rooms.
  3. Open the room as a member: the banner renders above the header with the configured label/color. Add more values to cross a groupThreshold and the segment collapses to its multipleLabel.
  4. Rooms with no covered values render the configured fallback text/color; non-ABAC rooms render nothing.
  5. Edit the config → open clients update live.

Further comments

  • Save-time validation against the published JSON Schema + cross-field rules (exactly one drivesColor, unique ids/sources, multipleLabel with groupThreshold, bannerLabel with showLabel) is intentionally out of scope — a separate settings-validation effort will cover it. Until then the engine parses defensively (malformed config → no banner) and the builder lints the rules warn-only.
  • The config being a public setting is a deliberate tradeoff (initially it was admin-only with a server-computed banner endpoint): it makes banners fully reactive and removes an endpoint, at the cost of any logged-in user being able to read the mapping catalog. Documented in classification-banners.md.
  • The engine ranks hierarchy values most restrictive first (index 0 = highest) to match Virtru's HIERARCHY attribute convention.
    https://rocketchat.atlassian.net/browse/ABAC3-32

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Added configurable classification banners for ABAC-managed rooms, controlled by new admin settings for enablement and JSON configuration.
    • Banners display above the room header with support for segmented text and automatically themed colors.
  • Documentation

    • Added a versioned JSON schema that defines the banner configuration format.
  • Validation & Quality

    • Enhanced JSON-schema validation for JSON-based settings, with tighter enforcement for banner configuration.
    • Added unit and end-to-end tests covering banner rendering and configuration validation.

@changeset-bot

changeset-bot Bot commented Jul 10, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1455f76

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

This PR includes changesets to release 3 packages
Name Type
@rocket.chat/meteor Minor
@rocket.chat/core-typings Minor
@rocket.chat/rest-typings Minor

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

@dionisio-bot

dionisio-bot Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

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

  • This PR is targeting the wrong base branch. It should target 8.8.0, but it targets 8.7.0

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds administrator-configured ABAC classification banner settings, JSON Schema validation, a processing engine for room attributes, and a room UI component that renders colored banners above the header.

Changes

ABAC classification banners

Layer / File(s) Summary
Classification banner contract
apps/meteor/client/views/room/ClassificationBanner/lib/types.ts, ee/packages/abac/docs/classification-banners.schema.json, apps/meteor/client/views/room/ClassificationBanner/lib/schema.spec.ts
Defines typed banner configuration and validates version, styling, attributes, values, separators, thresholds, and colors against the JSON Schema.
Schema-backed setting validation
apps/meteor/server/settings/..., apps/meteor/tests/unit/server/{lib,settings}/...
Registers per-setting AJV validators and validates JSON settings before existing rule-based validation, with unit coverage for valid, invalid, malformed, and empty values.
Classification banner engine
apps/meteor/client/views/room/ClassificationBanner/lib/{engine,colors}.*
Parses configuration, maps room attributes into segments, applies grouping and sorting, resolves colors, computes readable text colors, and provides fallback output.
Administrative banner settings
apps/meteor/ee/server/settings/abac.ts, apps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingsPage.tsx, packages/i18n/src/locales/en.i18n.json, .changeset/abac-classification-banners.md
Adds enablement and multiline JSON settings, exposes them in the ABAC settings page, adds English translations, and records a minor release change.
Room banner rendering and integration tests
apps/meteor/client/views/room/ClassificationBanner/*, apps/meteor/client/views/room/{Room.tsx,layout/RoomLayout.tsx}, apps/meteor/tests/e2e/{abac-classification-banner.spec.ts,end-to-end/api/abac.ts}
Renders segmented or single classification banners for ABAC-managed rooms and verifies configured, disabled, and schema-rejected scenarios.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Admin
  participant ABACSettings
  participant SettingsRegistry
  participant Room
  participant ClassificationBanner
  participant BannerEngine
  participant RoomLayout

  Admin->>ABACSettings: save banner enablement and JSON configuration
  ABACSettings->>SettingsRegistry: register setting schema
  SettingsRegistry-->>ABACSettings: compiled validator available
  Room->>ClassificationBanner: render current room
  ClassificationBanner->>ABACSettings: read banner settings
  ClassificationBanner->>BannerEngine: parse configuration and build payload
  BannerEngine-->>ClassificationBanner: text, segments, and colors
  ClassificationBanner->>RoomLayout: provide banner content
  RoomLayout-->>Room: display banner above room header
Loading

Possibly related PRs

Suggested labels: type: feature

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding classification banners for ABAC rooms.
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.

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (2)
  • A0F8F29D-2585: Request failed with status code 401
  • ABAC3-32: 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.

@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.34146% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.77%. Comparing base (8d4507d) to head (1455f76).
⚠️ Report is 62 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #41307      +/-   ##
===========================================
+ Coverage    68.58%   68.77%   +0.18%     
===========================================
  Files         4134     4155      +21     
  Lines       160802   159673    -1129     
  Branches     29244    28098    -1146     
===========================================
- Hits        110294   109813     -481     
+ Misses       45403    44676     -727     
- Partials      5105     5184      +79     
Flag Coverage Δ
e2e 58.84% <67.18%> (-0.03%) ⬇️
e2e-api 45.96% <77.27%> (+0.62%) ⬆️
unit 70.72% <95.20%> (+0.18%) ⬆️

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.

@KevLehman
KevLehman force-pushed the feat/abac-classification-banners branch from 7e85d24 to 7ce3e7f Compare July 16, 2026 18:02
@KevLehman KevLehman added this to the 8.8.0 milestone Jul 17, 2026
@KevLehman KevLehman added the stat: QA assured Means it has been tested and approved by a company insider label Jul 17, 2026
@KevLehman
KevLehman marked this pull request as ready for review July 17, 2026 16:49
@KevLehman
KevLehman requested a review from a team as a code owner July 17, 2026 16:49
@coderabbitai coderabbitai Bot added the type: feature Pull requests that introduces new feature label Jul 17, 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: 2

🧹 Nitpick comments (1)
apps/meteor/client/views/room/ClassificationBanner/lib/colors.ts (1)

1-8: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Remove implementation comments from the banner engine.

  • apps/meteor/client/views/room/ClassificationBanner/lib/colors.ts#L1-L8: remove the readableTextColor documentation block.
  • apps/meteor/client/views/room/ClassificationBanner/lib/colors.ts#L16-L22: remove the shade documentation block.
  • apps/meteor/client/views/room/ClassificationBanner/lib/engine.ts#L51-L52: replace the ranking explanation with self-documenting names.

As per coding guidelines, “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/room/ClassificationBanner/lib/colors.ts` around
lines 1 - 8, Remove the readableTextColor and shade documentation blocks in
apps/meteor/client/views/room/ClassificationBanner/lib/colors.ts at lines 1-8
and 16-22. In apps/meteor/client/views/room/ClassificationBanner/lib/engine.ts
at lines 51-52, replace the ranking explanation comment with self-documenting
variable or function names; make no other implementation changes.

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/room/ClassificationBanner/lib/colors.ts`:
- Around line 9-13: Update readableTextColor to select between '`#1F2329`' and
'`#FFFFFF`' by calculating each candidate’s WCAG contrast ratio against the parsed
background luminance, then return the candidate with the higher ratio. Remove
the fixed luminance > 0.55 decision while preserving the existing hex parsing
and luminance calculation.

In `@apps/meteor/client/views/room/ClassificationBanner/lib/engine.ts`:
- Around line 12-18: Update parseClassificationBannersConfig to validate the
JSON result against the v1 ClassificationBannersConfig schema before returning
it, rather than relying on the TypeScript cast. Return null for malformed
structures, including {}, arrays, and other schema-invalid objects, while
preserving null for invalid JSON.

---

Nitpick comments:
In `@apps/meteor/client/views/room/ClassificationBanner/lib/colors.ts`:
- Around line 1-8: Remove the readableTextColor and shade documentation blocks
in apps/meteor/client/views/room/ClassificationBanner/lib/colors.ts at lines 1-8
and 16-22. In apps/meteor/client/views/room/ClassificationBanner/lib/engine.ts
at lines 51-52, replace the ranking explanation comment with self-documenting
variable or function names; make no other implementation changes.
🪄 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: 726dd09d-be6d-4f24-a53e-4616c1045e9b

📥 Commits

Reviewing files that changed from the base of the PR and between f96b66d and ce49a3f.

📒 Files selected for processing (14)
  • .changeset/abac-classification-banners.md
  • apps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingsPage.tsx
  • apps/meteor/client/views/room/ClassificationBanner/ClassificationBanner.tsx
  • apps/meteor/client/views/room/ClassificationBanner/index.ts
  • apps/meteor/client/views/room/ClassificationBanner/lib/colors.ts
  • apps/meteor/client/views/room/ClassificationBanner/lib/engine.spec.ts
  • apps/meteor/client/views/room/ClassificationBanner/lib/engine.ts
  • apps/meteor/client/views/room/ClassificationBanner/lib/schema.spec.ts
  • apps/meteor/client/views/room/ClassificationBanner/lib/types.ts
  • apps/meteor/client/views/room/Room.tsx
  • apps/meteor/client/views/room/layout/RoomLayout.tsx
  • apps/meteor/ee/server/settings/abac.ts
  • ee/packages/abac/docs/classification-banners.schema.json
  • packages/i18n/src/locales/en.i18n.json
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: Hacktron Security Check
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{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/ABAC/ABACSettingTab/SettingsPage.tsx
  • apps/meteor/client/views/room/ClassificationBanner/lib/colors.ts
  • apps/meteor/client/views/room/ClassificationBanner/lib/types.ts
  • apps/meteor/ee/server/settings/abac.ts
  • apps/meteor/client/views/room/Room.tsx
  • apps/meteor/client/views/room/ClassificationBanner/ClassificationBanner.tsx
  • apps/meteor/client/views/room/ClassificationBanner/lib/schema.spec.ts
  • apps/meteor/client/views/room/ClassificationBanner/lib/engine.spec.ts
  • apps/meteor/client/views/room/ClassificationBanner/index.ts
  • apps/meteor/client/views/room/ClassificationBanner/lib/engine.ts
  • apps/meteor/client/views/room/layout/RoomLayout.tsx
**/*.spec.ts

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.spec.ts: Use descriptive test names that clearly communicate expected behavior in Playwright tests
Use .spec.ts extension for test files (e.g., login.spec.ts)

Files:

  • apps/meteor/client/views/room/ClassificationBanner/lib/schema.spec.ts
  • apps/meteor/client/views/room/ClassificationBanner/lib/engine.spec.ts
🧠 Learnings (9)
📚 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/ABAC/ABACSettingTab/SettingsPage.tsx
  • apps/meteor/client/views/room/Room.tsx
  • apps/meteor/client/views/room/ClassificationBanner/ClassificationBanner.tsx
  • apps/meteor/client/views/room/layout/RoomLayout.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/ABAC/ABACSettingTab/SettingsPage.tsx
  • apps/meteor/client/views/room/ClassificationBanner/lib/colors.ts
  • apps/meteor/client/views/room/ClassificationBanner/lib/types.ts
  • apps/meteor/ee/server/settings/abac.ts
  • apps/meteor/client/views/room/Room.tsx
  • apps/meteor/client/views/room/ClassificationBanner/ClassificationBanner.tsx
  • apps/meteor/client/views/room/ClassificationBanner/lib/schema.spec.ts
  • apps/meteor/client/views/room/ClassificationBanner/lib/engine.spec.ts
  • apps/meteor/client/views/room/ClassificationBanner/index.ts
  • apps/meteor/client/views/room/ClassificationBanner/lib/engine.ts
  • apps/meteor/client/views/room/layout/RoomLayout.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/abac-classification-banners.md
📚 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/room/ClassificationBanner/lib/colors.ts
  • apps/meteor/client/views/room/ClassificationBanner/lib/types.ts
  • apps/meteor/client/views/room/ClassificationBanner/lib/schema.spec.ts
  • apps/meteor/client/views/room/ClassificationBanner/lib/engine.spec.ts
  • apps/meteor/client/views/room/ClassificationBanner/index.ts
  • apps/meteor/client/views/room/ClassificationBanner/lib/engine.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/room/ClassificationBanner/lib/colors.ts
  • apps/meteor/client/views/room/ClassificationBanner/lib/types.ts
  • apps/meteor/client/views/room/ClassificationBanner/lib/schema.spec.ts
  • apps/meteor/client/views/room/ClassificationBanner/lib/engine.spec.ts
  • apps/meteor/client/views/room/ClassificationBanner/index.ts
  • apps/meteor/client/views/room/ClassificationBanner/lib/engine.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/room/ClassificationBanner/lib/colors.ts
  • apps/meteor/client/views/room/ClassificationBanner/lib/types.ts
  • apps/meteor/ee/server/settings/abac.ts
  • apps/meteor/client/views/room/ClassificationBanner/lib/schema.spec.ts
  • apps/meteor/client/views/room/ClassificationBanner/lib/engine.spec.ts
  • apps/meteor/client/views/room/ClassificationBanner/index.ts
  • apps/meteor/client/views/room/ClassificationBanner/lib/engine.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/room/ClassificationBanner/lib/colors.ts
  • apps/meteor/client/views/room/ClassificationBanner/lib/types.ts
  • apps/meteor/ee/server/settings/abac.ts
  • apps/meteor/client/views/room/ClassificationBanner/lib/schema.spec.ts
  • apps/meteor/client/views/room/ClassificationBanner/lib/engine.spec.ts
  • apps/meteor/client/views/room/ClassificationBanner/index.ts
  • apps/meteor/client/views/room/ClassificationBanner/lib/engine.ts
📚 Learning: 2026-02-24T19:22:48.358Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 38493
File: apps/meteor/tests/e2e/omnichannel/omnichannel-send-pdf-transcript.spec.ts:66-67
Timestamp: 2026-02-24T19:22:48.358Z
Learning: In Playwright end-to-end tests (e.g., under apps/meteor/tests/e2e/...), prefer locating elements by translated text (getByText) and ARIA roles (getByRole) over data-qa attributes. If translation values change, update the corresponding test locators accordingly. Never use data-qa locators. This guideline applies to all Playwright e2e test specs in the repository and helps keep tests robust to UI text changes and accessible semantics.

Applied to files:

  • apps/meteor/client/views/room/ClassificationBanner/lib/schema.spec.ts
  • apps/meteor/client/views/room/ClassificationBanner/lib/engine.spec.ts
📚 Learning: 2026-03-06T18:10:15.268Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 39397
File: packages/gazzodown/src/code/CodeBlock.spec.tsx:47-68
Timestamp: 2026-03-06T18:10:15.268Z
Learning: In tests (especially those using testing-library/dom/jsdom) for Rocket.Chat components, the HTML <code> element has an implicit ARIA role of 'code'. Therefore, screen.getByRole('code') or screen.findByRole('code') will locate <code> elements even without a role attribute. Do not flag findByRole('code') as invalid in reviews; prefer using the implicit role instead of adding role="code" unless necessary for accessibility.

Applied to files:

  • apps/meteor/client/views/room/ClassificationBanner/lib/schema.spec.ts
  • apps/meteor/client/views/room/ClassificationBanner/lib/engine.spec.ts
🔇 Additional comments (14)
apps/meteor/ee/server/settings/abac.ts (1)

53-70: LGTM!

apps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingsPage.tsx (1)

35-41: LGTM!

packages/i18n/src/locales/en.i18n.json (1)

40-44: LGTM!

.changeset/abac-classification-banners.md (1)

1-5: LGTM!

apps/meteor/client/views/room/ClassificationBanner/lib/types.ts (1)

1-53: LGTM!

ee/packages/abac/docs/classification-banners.schema.json (1)

1-93: LGTM!

apps/meteor/client/views/room/ClassificationBanner/lib/schema.spec.ts (1)

1-79: LGTM!

apps/meteor/client/views/room/ClassificationBanner/lib/colors.ts (1)

23-26: LGTM!

apps/meteor/client/views/room/ClassificationBanner/lib/engine.ts (1)

1-10: LGTM!

Also applies to: 20-50, 53-94

apps/meteor/client/views/room/ClassificationBanner/lib/engine.spec.ts (1)

1-205: LGTM!

apps/meteor/client/views/room/ClassificationBanner/ClassificationBanner.tsx (1)

11-77: LGTM!

apps/meteor/client/views/room/ClassificationBanner/index.ts (1)

1-1: LGTM!

apps/meteor/client/views/room/Room.tsx (1)

10-10: LGTM!

Also applies to: 58-58

apps/meteor/client/views/room/layout/RoomLayout.tsx (1)

12-12: LGTM!

Also applies to: 38-38, 62-62

Comment thread apps/meteor/client/views/room/ClassificationBanner/lib/colors.ts Outdated
Comment thread apps/meteor/client/views/room/ClassificationBanner/lib/engine.ts

@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.

All reported issues were addressed across 14 files

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

Re-trigger cubic

Comment thread apps/meteor/client/views/room/ClassificationBanner/lib/engine.ts
Comment thread apps/meteor/client/views/room/ClassificationBanner/lib/colors.ts
Comment thread apps/meteor/client/views/room/ClassificationBanner/lib/colors.ts Outdated
Comment thread apps/meteor/client/views/room/ClassificationBanner/ClassificationBanner.tsx Outdated
@KevLehman
KevLehman force-pushed the feat/abac-classification-banners branch from ce49a3f to 7ea9bd7 Compare July 20, 2026 14:27
@KevLehman
KevLehman requested a review from a team as a code owner July 20, 2026 16:29

@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: 2

🧹 Nitpick comments (1)
apps/meteor/server/lib/settingValidationRules.ts (1)

65-69: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Log schema validation errors for better observability.

When JSON schema validation fails, the ajv error details are discarded, and a generic SettingValidationError is thrown upstream. Logging validate.errors and any JSON parsing exceptions will make it much easier for administrators or developers to diagnose exactly why a configuration payload was rejected.

💡 Proposed refactor to log errors
 	try {
-		return !!validate(JSON.parse(value));
-	} catch {
+		const parsed = JSON.parse(value);
+		const isValid = validate(parsed);
+		if (!isValid) {
+			logger.warn({ msg: 'JSON schema validation failed', settingId: setting._id, errors: validate.errors });
+		}
+		return !!isValid;
+	} catch (err) {
+		logger.warn({ msg: 'Failed to parse JSON for schema validation', settingId: setting._id, err });
 		return false;
 	}
🤖 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/server/lib/settingValidationRules.ts` around lines 65 - 69,
Update the JSON schema validation flow around validate and JSON.parse to log
diagnostic details before returning false: record validate.errors when AJV
validation fails and capture the parsing exception when JSON parsing throws. Use
the existing application logging mechanism and preserve the current boolean
return behavior.
🤖 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/tests/e2e/abac-classification-banner.spec.ts`:
- Around line 74-77: In apps/meteor/tests/e2e/abac-classification-banner.spec.ts
lines 74-77, update the admin user mutation to use $push on abacAttributes,
appending only the test-specific { key: attrKey, values: ['TS', 'U'] } entry. In
the cleanup at lines 86-89, replace $unset with $pull on abacAttributes filtered
by key: attrKey, so cleanup removes only this test’s attribute.
- Line 117: Replace the data-qa-based locator in the classification banner
assertion with an appropriate semantic Playwright locator, using the banner’s
accessible role or visible text while preserving the expectation that it is
absent.

---

Nitpick comments:
In `@apps/meteor/server/lib/settingValidationRules.ts`:
- Around line 65-69: Update the JSON schema validation flow around validate and
JSON.parse to log diagnostic details before returning false: record
validate.errors when AJV validation fails and capture the parsing exception when
JSON parsing throws. Use the existing application logging mechanism and preserve
the current boolean return behavior.
🪄 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: 0d81a475-e24a-4e4e-bd37-2720121bf815

📥 Commits

Reviewing files that changed from the base of the PR and between 7ea9bd7 and 15360f1.

📒 Files selected for processing (9)
  • apps/meteor/ee/server/settings/abac.ts
  • apps/meteor/server/lib/settingValidationRules.ts
  • apps/meteor/server/settings/SettingsRegistry.ts
  • apps/meteor/server/settings/functions/settingSchemas.ts
  • apps/meteor/tests/e2e/abac-classification-banner.spec.ts
  • apps/meteor/tests/end-to-end/api/abac.ts
  • apps/meteor/tests/unit/server/lib/settingValidationRules.spec.ts
  • apps/meteor/tests/unit/server/settings/functions/settings.tests.ts
  • packages/i18n/src/locales/en.i18n.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • apps/meteor/ee/server/settings/abac.ts
  • packages/i18n/src/locales/en.i18n.json
📜 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 (4)
**/*.{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/server/settings/functions/settingSchemas.ts
  • apps/meteor/tests/unit/server/settings/functions/settings.tests.ts
  • apps/meteor/tests/end-to-end/api/abac.ts
  • apps/meteor/tests/unit/server/lib/settingValidationRules.spec.ts
  • apps/meteor/tests/e2e/abac-classification-banner.spec.ts
  • apps/meteor/server/settings/SettingsRegistry.ts
  • apps/meteor/server/lib/settingValidationRules.ts
**/*.spec.ts

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.spec.ts: Use descriptive test names that clearly communicate expected behavior in Playwright tests
Use .spec.ts extension for test files (e.g., login.spec.ts)

Files:

  • apps/meteor/tests/unit/server/lib/settingValidationRules.spec.ts
  • apps/meteor/tests/e2e/abac-classification-banner.spec.ts
apps/meteor/tests/e2e/**/*.spec.ts

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

apps/meteor/tests/e2e/**/*.spec.ts: All test files must be created in apps/meteor/tests/e2e/ directory
Avoid using page.locator() in Playwright tests - always prefer semantic locators such as page.getByRole(), page.getByLabel(), page.getByText(), or page.getByTitle()
Use test.beforeAll() and test.afterAll() for setup/teardown in Playwright tests
Use test.step() for complex test scenarios to improve organization in Playwright tests
Group related tests in the same file
Utilize Playwright fixtures (test, page, expect) for consistency in test files
Prefer web-first assertions (toBeVisible, toHaveText, etc.) in Playwright tests
Use expect matchers for assertions (toEqual, toContain, toBeTruthy, toHaveLength, etc.) instead of assert statements in Playwright tests
Use page.waitFor() with specific conditions instead of hardcoded timeouts in Playwright tests
Implement proper wait strategies for dynamic content in Playwright tests
Maintain test isolation between test cases in Playwright tests
Ensure clean state for each test execution in Playwright tests
Ensure tests run reliably in parallel without shared state conflicts

Files:

  • apps/meteor/tests/e2e/abac-classification-banner.spec.ts
apps/meteor/tests/e2e/**/*.{ts,spec.ts}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

apps/meteor/tests/e2e/**/*.{ts,spec.ts}: Store commonly used locators in variables/constants for reuse
Follow Page Object Model pattern consistently in Playwright tests

Files:

  • apps/meteor/tests/e2e/abac-classification-banner.spec.ts
🧠 Learnings (6)
📚 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/server/settings/functions/settingSchemas.ts
  • apps/meteor/tests/unit/server/settings/functions/settings.tests.ts
  • apps/meteor/tests/end-to-end/api/abac.ts
  • apps/meteor/tests/unit/server/lib/settingValidationRules.spec.ts
  • apps/meteor/tests/e2e/abac-classification-banner.spec.ts
  • apps/meteor/server/settings/SettingsRegistry.ts
  • apps/meteor/server/lib/settingValidationRules.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/server/settings/functions/settingSchemas.ts
  • apps/meteor/tests/unit/server/settings/functions/settings.tests.ts
  • apps/meteor/tests/end-to-end/api/abac.ts
  • apps/meteor/tests/unit/server/lib/settingValidationRules.spec.ts
  • apps/meteor/tests/e2e/abac-classification-banner.spec.ts
  • apps/meteor/server/settings/SettingsRegistry.ts
  • apps/meteor/server/lib/settingValidationRules.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/server/settings/functions/settingSchemas.ts
  • apps/meteor/tests/unit/server/settings/functions/settings.tests.ts
  • apps/meteor/tests/end-to-end/api/abac.ts
  • apps/meteor/tests/unit/server/lib/settingValidationRules.spec.ts
  • apps/meteor/tests/e2e/abac-classification-banner.spec.ts
  • apps/meteor/server/settings/SettingsRegistry.ts
  • apps/meteor/server/lib/settingValidationRules.ts
📚 Learning: 2026-02-24T19:22:48.358Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 38493
File: apps/meteor/tests/e2e/omnichannel/omnichannel-send-pdf-transcript.spec.ts:66-67
Timestamp: 2026-02-24T19:22:48.358Z
Learning: In Playwright end-to-end tests (e.g., under apps/meteor/tests/e2e/...), prefer locating elements by translated text (getByText) and ARIA roles (getByRole) over data-qa attributes. If translation values change, update the corresponding test locators accordingly. Never use data-qa locators. This guideline applies to all Playwright e2e test specs in the repository and helps keep tests robust to UI text changes and accessible semantics.

Applied to files:

  • apps/meteor/tests/unit/server/lib/settingValidationRules.spec.ts
  • apps/meteor/tests/e2e/abac-classification-banner.spec.ts
📚 Learning: 2026-03-06T18:10:15.268Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 39397
File: packages/gazzodown/src/code/CodeBlock.spec.tsx:47-68
Timestamp: 2026-03-06T18:10:15.268Z
Learning: In tests (especially those using testing-library/dom/jsdom) for Rocket.Chat components, the HTML <code> element has an implicit ARIA role of 'code'. Therefore, screen.getByRole('code') or screen.findByRole('code') will locate <code> elements even without a role attribute. Do not flag findByRole('code') as invalid in reviews; prefer using the implicit role instead of adding role="code" unless necessary for accessibility.

Applied to files:

  • apps/meteor/tests/unit/server/lib/settingValidationRules.spec.ts
  • apps/meteor/tests/e2e/abac-classification-banner.spec.ts
📚 Learning: 2026-02-24T19:39:42.247Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 38493
File: apps/meteor/tests/e2e/page-objects/fragments/message.ts:7-7
Timestamp: 2026-02-24T19:39:42.247Z
Learning: In RocketChat e2e tests, avoid using data-qa attributes to locate elements. Prefer semantic locators such as getByRole, getByLabel, getByText, getByTitle and ARIA-based selectors. Apply this rule to all TypeScript files under apps/meteor/tests/e2e to improve test reliability, accessibility, and maintainability.

Applied to files:

  • apps/meteor/tests/e2e/abac-classification-banner.spec.ts
🔇 Additional comments (5)
apps/meteor/server/settings/functions/settingSchemas.ts (1)

6-10: LGTM!

apps/meteor/server/settings/SettingsRegistry.ts (1)

107-115: LGTM!

apps/meteor/tests/unit/server/lib/settingValidationRules.spec.ts (1)

152-196: LGTM!

apps/meteor/tests/unit/server/settings/functions/settings.tests.ts (1)

87-108: LGTM!

apps/meteor/tests/end-to-end/api/abac.ts (1)

4539-4616: LGTM!

Comment thread apps/meteor/tests/e2e/abac-classification-banner.spec.ts Outdated
Comment thread apps/meteor/tests/e2e/abac-classification-banner.spec.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.

All reported issues were addressed across 9 files (changes from recent commits).

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

Re-trigger cubic

Comment thread apps/meteor/tests/e2e/abac-classification-banner.spec.ts Outdated
…ema on save

JSON code settings may now declare a schema add-option: kept in memory
(never persisted), pre-compiled at registration, and enforced for every
save path by validateSettingRules — empty means unconfigured and always
passes. The banners config setting declares the published schema, so
unparsable or non-conforming documents are rejected with
ABAC_Classification_Banners_Config_Invalid.
@KevLehman
KevLehman force-pushed the feat/abac-classification-banners branch from 15360f1 to 0ec0412 Compare July 20, 2026 18:59

@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

🤖 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/server/lib/settingValidationRules.ts`:
- Around line 50-55: Remove the JSDoc comment immediately above the
validatesSchema function while leaving the function implementation 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: 6bf0dcb1-92ff-485e-8a9b-ebe36ac46ba2

📥 Commits

Reviewing files that changed from the base of the PR and between 15360f1 and 0ec0412.

📒 Files selected for processing (21)
  • .changeset/abac-classification-banners.md
  • apps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingsPage.tsx
  • apps/meteor/client/views/room/ClassificationBanner/ClassificationBanner.tsx
  • apps/meteor/client/views/room/ClassificationBanner/index.ts
  • apps/meteor/client/views/room/ClassificationBanner/lib/colors.ts
  • apps/meteor/client/views/room/ClassificationBanner/lib/engine.spec.ts
  • apps/meteor/client/views/room/ClassificationBanner/lib/engine.ts
  • apps/meteor/client/views/room/ClassificationBanner/lib/schema.spec.ts
  • apps/meteor/client/views/room/ClassificationBanner/lib/types.ts
  • apps/meteor/client/views/room/Room.tsx
  • apps/meteor/client/views/room/layout/RoomLayout.tsx
  • apps/meteor/ee/server/settings/abac.ts
  • apps/meteor/server/lib/settingValidationRules.ts
  • apps/meteor/server/settings/SettingsRegistry.ts
  • apps/meteor/server/settings/functions/settingSchemas.ts
  • apps/meteor/tests/e2e/abac-classification-banner.spec.ts
  • apps/meteor/tests/end-to-end/api/abac.ts
  • apps/meteor/tests/unit/server/lib/settingValidationRules.spec.ts
  • apps/meteor/tests/unit/server/settings/functions/settings.tests.ts
  • ee/packages/abac/docs/classification-banners.schema.json
  • packages/i18n/src/locales/en.i18n.json
🚧 Files skipped from review as they are similar to previous changes (19)
  • apps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingsPage.tsx
  • apps/meteor/client/views/room/ClassificationBanner/lib/colors.ts
  • apps/meteor/client/views/room/ClassificationBanner/lib/types.ts
  • apps/meteor/server/settings/functions/settingSchemas.ts
  • .changeset/abac-classification-banners.md
  • apps/meteor/client/views/room/Room.tsx
  • apps/meteor/tests/unit/server/settings/functions/settings.tests.ts
  • apps/meteor/server/settings/SettingsRegistry.ts
  • ee/packages/abac/docs/classification-banners.schema.json
  • apps/meteor/client/views/room/ClassificationBanner/lib/engine.spec.ts
  • apps/meteor/tests/end-to-end/api/abac.ts
  • apps/meteor/client/views/room/ClassificationBanner/lib/engine.ts
  • packages/i18n/src/locales/en.i18n.json
  • apps/meteor/client/views/room/ClassificationBanner/lib/schema.spec.ts
  • apps/meteor/client/views/room/ClassificationBanner/ClassificationBanner.tsx
  • apps/meteor/tests/unit/server/lib/settingValidationRules.spec.ts
  • apps/meteor/client/views/room/ClassificationBanner/index.ts
  • apps/meteor/ee/server/settings/abac.ts
  • apps/meteor/tests/e2e/abac-classification-banner.spec.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (3)
  • GitHub Check: 📦 Build Packages
  • 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/room/layout/RoomLayout.tsx
  • apps/meteor/server/lib/settingValidationRules.ts
🧠 Learnings (4)
📚 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/room/layout/RoomLayout.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/room/layout/RoomLayout.tsx
  • apps/meteor/server/lib/settingValidationRules.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/server/lib/settingValidationRules.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/server/lib/settingValidationRules.ts
🔇 Additional comments (2)
apps/meteor/client/views/room/layout/RoomLayout.tsx (1)

12-12: LGTM!

Also applies to: 38-38, 62-62

apps/meteor/server/lib/settingValidationRules.ts (1)

138-148: LGTM!

Comment thread apps/meteor/server/lib/settingValidationRules.ts Outdated
- pick the banner ink by comparing WCAG contrast ratios instead of a
  fixed luminance threshold, so mid-range backgrounds like #999999 and
  the TS orange get the more legible color
- index the segment React key since duplicate attribute ids are not
  rejected server-side
- scope the Playwright admin attribute seeding with $push/$pull so
  parallel specs cannot clobber each other, and locate the banner by
  role instead of data-qa-id
- trim the validatesSchema JSDoc down to its one non-obvious line
@dougfabris
dougfabris force-pushed the feat/abac-classification-banners branch from 4e0ba18 to 219f6fa Compare July 23, 2026 20:54
@dougfabris
dougfabris force-pushed the feat/abac-classification-banners branch from 219f6fa to ba380a8 Compare July 23, 2026 21:02

@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.

All reported issues were addressed across 4 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread apps/meteor/client/views/room/ClassificationBanner/lib/types.ts
dougfabris
dougfabris previously approved these changes Jul 30, 2026

@dougfabris dougfabris left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I was wondering if we could benefit from storing the banner types in core-typings.
Overall looks good to me! Approving on behalf of frontend

@KevLehman
KevLehman requested a review from ricardogarim July 30, 2026 16:56
@KevLehman KevLehman added the stat: ready to merge PR tested and approved waiting for merge label Jul 30, 2026
@dionisio-bot
dionisio-bot Bot added this pull request to the merge queue Jul 30, 2026
Merged via the queue into develop with commit 4409899 Jul 30, 2026
56 checks passed
@dionisio-bot
dionisio-bot Bot deleted the feat/abac-classification-banners branch July 30, 2026 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge type: feature Pull requests that introduces new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants