Skip to content

refactor: move app/highlight-words module - #41919

Open
tassoevan wants to merge 1 commit into
refactor/remove-stale-modulesfrom
refactor/move-app-highlight-client-modules
Open

refactor: move app/highlight-words module#41919
tassoevan wants to merge 1 commit into
refactor/remove-stale-modulesfrom
refactor/move-app-highlight-client-modules

Conversation

@tassoevan

@tassoevan tassoevan commented Aug 24, 2026

Copy link
Copy Markdown
Member

Proposed changes (including videos or screenshots)

It moves client modules from app/highlight-words/ to client/.

Issue(s)

Steps to test or reproduce

Further comments


Stack created with GitHub Stacks CLIGive Feedback 💬

Review in cubic

Summary by CodeRabbit

  • Bug Fixes
    • Improved highlighting pattern handling, including URL matching.
    • Preserved existing message highlighting behavior while improving consistency across the application.

Task: ARCH-2390

@tassoevan
tassoevan requested review from a team as code owners August 24, 2026 20:49
@changeset-bot

changeset-bot Bot commented Aug 24, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: eedaeac

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dionisio-bot

dionisio-bot Bot commented Aug 24, 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

@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e56155e7-8590-4c59-bb5f-fbd32f55572d

📥 Commits

Reviewing files that changed from the base of the PR and between fd5f5e9 and d2a0ec2.

📒 Files selected for processing (3)
  • apps/meteor/client/lib/highlightWords.ts
  • apps/meteor/client/views/room/MessageList/providers/MessageListProvider.tsx
  • apps/meteor/tests/unit/app/highlight-words/helper.tests.js

Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout. (4)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: Hacktron Security Check
  • GitHub Check: CodeQL-Build
🧰 Additional context used
📓 Path-based instructions (2)
The main Rocket.Chat Meteor application resides in `apps/meteor/`; place its application code there rather than in other monorepo areas.

📄 CodeRabbit inference engine (CLAUDE.md)

Files:

  • apps/meteor/tests/unit/app/highlight-words/helper.tests.js
  • apps/meteor/client/lib/highlightWords.ts
  • apps/meteor/client/views/room/MessageList/providers/MessageListProvider.tsx
Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests

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

Files:

  • apps/meteor/tests/unit/app/highlight-words/helper.tests.js
  • apps/meteor/client/lib/highlightWords.ts
  • apps/meteor/client/views/room/MessageList/providers/MessageListProvider.tsx
🪛 ast-grep (0.45.1)
apps/meteor/client/lib/highlightWords.ts

[warning] 17-20: Regular expression constructed from variable input detected. This can lead to Regular Expression Denial of Service (ReDoS) attacks if the variable contains malicious patterns. Use libraries like 'recheck' to validate regex safety or use static patterns.
Context: new RegExp(
(^|\\b|[\\s\\n\\r\\t.,،'\\"\\+!?:-])(${escapeRegExp(highlight)})($|\\b|[\\s\\n\\r\\t.,،'\\"\\+!?:-])(?![^<]*>|[^<>]*<\\/),
'gmi',
)
Note: [CWE-1333] Inefficient Regular Expression Complexity

(regexp-from-variable)


[warning] 23-28: Regular expression constructed from variable input detected. This can lead to Regular Expression Denial of Service (ReDoS) attacks if the variable contains malicious patterns. Use libraries like 'recheck' to validate regex safety or use static patterns.
Context: new RegExp(
https?://(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)(${escapeRegExp( highlight, )})\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*),
'gmi',
)
Note: [CWE-1333] Inefficient Regular Expression Complexity

(regexp-from-variable)

🪛 Biome (2.5.7)
apps/meteor/tests/unit/app/highlight-words/helper.tests.js

[error] 3-3: Illegal use of an import declaration outside of a module

(parse)

🔇 Additional comments (3)
apps/meteor/client/lib/highlightWords.ts (1)

19-21: LGTM!

Also applies to: 23-25

apps/meteor/client/views/room/MessageList/providers/MessageListProvider.tsx (1)

11-11: LGTM!

apps/meteor/tests/unit/app/highlight-words/helper.tests.js (1)

3-3: LGTM!


Walkthrough

The change updates highlight regular-expression literals and aligns production and test imports with the client library location. Matching logic and call sites remain unchanged.

Changes

Highlight helper update

Layer / File(s) Summary
Highlight helper and import alignment
apps/meteor/client/lib/highlightWords.ts, apps/meteor/client/views/room/MessageList/providers/MessageListProvider.tsx, apps/meteor/tests/unit/app/highlight-words/helper.tests.js
The URL regular-expression literal no longer escapes forward slashes. Production and test imports now use client/lib/highlightWords.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Merge Risk: ⚪ Minimal · up to d2a0e

This change only relocates the highlight-words client module and updates its references, with no actionable merge-blocking risk remaining beyond normal checks and review.

Suggested labels: type: chore

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the module move shown in the changes and stated objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3 files.
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

Some tools did not complete. Review the errors below.

🔧 Biome (2.5.7)
apps/meteor/tests/unit/app/highlight-words/helper.tests.js

File contains syntax errors that prevent linting: Line 1: Illegal use of an import declaration outside of a module; Line 3: Illegal use of an import declaration outside of a module


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.

@tassoevan tassoevan added this to the 8.9.0 milestone Aug 24, 2026
@tassoevan

Copy link
Copy Markdown
Member Author

/jira ARCH

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

No issues found across 3 files

Re-trigger cubic

@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.33%. Comparing base (a53a436) to head (3f5257d).

Additional details and impacted files

Impacted file tree graph

@@                        Coverage Diff                        @@
##           refactor/remove-stale-modules   #41919      +/-   ##
=================================================================
+ Coverage                          69.29%   69.33%   +0.03%     
=================================================================
  Files                               4254     4254              
  Lines                             168646   168646              
  Branches                           30066    30044      -22     
=================================================================
+ Hits                              116870   116925      +55     
+ Misses                             46599    46540      -59     
- Partials                            5177     5181       +4     
Flag Coverage Δ
e2e 58.76% <ø> (-0.03%) ⬇️
e2e-api 45.86% <ø> (ø)
unit 71.28% <ø> (+0.06%) ⬆️

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.

@tassoevan
tassoevan force-pushed the refactor/move-app-highlight-client-modules branch from d2a0ec2 to 59e95d7 Compare August 24, 2026 21:45
sampaiodiego
sampaiodiego previously approved these changes Aug 24, 2026
@rc-layne

rc-layne Bot commented Aug 24, 2026

Copy link
Copy Markdown

⚠️ Layne — scan incomplete

Layne could not analyze all changed content. Review the Check Run summary before merging.

@tassoevan
tassoevan force-pushed the refactor/move-app-highlight-client-modules branch 2 times, most recently from c3fe37b to eedaeac Compare August 25, 2026 03:57
@tassoevan
tassoevan force-pushed the refactor/move-app-highlight-client-modules branch from eedaeac to 3f5257d Compare August 25, 2026 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants