Skip to content

fix: pagination state on search for custom sounds and emojis - #40115

Open
nazabucciarelli wants to merge 3 commits into
developfrom
fix/pagination-reset-sounds-and-emojis
Open

fix: pagination state on search for custom sounds and emojis#40115
nazabucciarelli wants to merge 3 commits into
developfrom
fix/pagination-reset-sounds-and-emojis

Conversation

@nazabucciarelli

@nazabucciarelli nazabucciarelli commented Apr 11, 2026

Copy link
Copy Markdown
Contributor

Proposed changes (including videos or screenshots)

Introduced a new optional parameter resetDependencies (an array) to the usePagination custom hook. When any value inside this array changes, the hook automatically resets the current page to 0.

Instead of accepting a single value for the reset trigger, I implemented it directly as an array. This allows any table using this hook to easily handle multiple simultaneous filters in the future (e.g., [text, status, category]) without modifying the hook's signature again.

Issue(s)

CORE-2096 [Improvement] Pagination not resetting on search in Custom Sounds and Custom Emojis tables

Steps to test or reproduce

  1. Navigate to Workspace > Custom Sounds (or Custom Emojis).
  2. Go to page 2 (or higher) of the table (you will need many records to test this).
  3. Type a search term in the search bar.
  4. Observe that the table returns an empty state (no results) because the API request is made using the updated search term but keeping the offset from page 2.

Further comments

Summary by CodeRabbit

Bug Fixes

  • Pagination now resets to the first page when searching or filtering Custom Sounds and Custom Emojis, preventing empty or out-of-range pages and ensuring filtered results start from the beginning.

@nazabucciarelli nazabucciarelli added this to the 8.4.0 milestone Apr 11, 2026
@dionisio-bot

dionisio-bot Bot commented Apr 11, 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
  • 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

@changeset-bot

changeset-bot Bot commented Apr 11, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2194484

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

@coderabbitai

coderabbitai Bot commented Apr 11, 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

Custom Emoji and Custom Sounds now reset pagination to page 0 when filter text changes. Custom Emoji also updates its no-results check. A changeset declares patch releases for @rocket.chat/meteor and @rocket.chat/ui-client.

Changes

Admin pagination reset

Layer / File(s) Summary
Filtered table pagination behavior
apps/meteor/client/views/admin/customEmoji/CustomEmoji.tsx, apps/meteor/client/views/admin/customSounds/CustomSoundsTable/CustomSoundsTable.tsx
Filter changes update the text and reset pagination to page 0. Custom Emoji uses optional chaining when checking for empty results.
Pagination fix release metadata
.changeset/real-suns-float.md
Adds patch release metadata for @rocket.chat/meteor and @rocket.chat/ui-client and documents the pagination fix.

Estimated code review effort: 2 (Simple) | ~8 minutes

Suggested reviewers: dougfabris, ggazzo, tassoevan

🚥 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 describes the pagination reset fix for searches in the Custom Sounds and Custom Emojis tables.
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.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • CORE-2096: 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.

@nazabucciarelli
nazabucciarelli marked this pull request as ready for review April 11, 2026 02:53
@nazabucciarelli
nazabucciarelli requested a review from a team as a code owner April 11, 2026 02:53

@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 the current code and only fix it if needed.

Inline comments:
In @.changeset/real-suns-float.md:
- Line 5: Update the changeset description string that currently reads "Fixes
pagination reset on search for Customs Sounds and Emojis" to use the correct
wording "Custom Sounds" (i.e., change "Customs Sounds" → "Custom Sounds") so the
description becomes "Fixes pagination reset on search for Custom Sounds and
Emojis"; ensure only the typo is corrected and punctuation/capitalization
remains consistent.
🪄 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: 8f2e7b1d-0bb3-4f4a-ae81-9d97ae3b6e81

📥 Commits

Reviewing files that changed from the base of the PR and between 9760d84 and 5b8801f.

📒 Files selected for processing (3)
  • .changeset/real-suns-float.md
  • apps/meteor/client/views/admin/customEmoji/CustomEmoji.tsx
  • apps/meteor/client/views/admin/customSounds/CustomSoundsTable/CustomSoundsTable.tsx
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: CodeQL-Build
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

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

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/client/views/admin/customSounds/CustomSoundsTable/CustomSoundsTable.tsx
  • apps/meteor/client/views/admin/customEmoji/CustomEmoji.tsx
🧠 Learnings (5)
📚 Learning: 2026-02-24T19:09:09.561Z
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 38974
File: apps/meteor/app/api/server/v1/im.ts:220-221
Timestamp: 2026-02-24T19:09:09.561Z
Learning: In RocketChat/Rocket.Chat OpenAPI migration PRs for apps/meteor/app/api/server/v1 endpoints, maintainers prefer to avoid any logic changes; style-only cleanups (like removing inline comments) may be deferred to follow-ups to keep scope tight.

Applied to files:

  • .changeset/real-suns-float.md
📚 Learning: 2026-02-24T19:05:56.710Z
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 0
File: :0-0
Timestamp: 2026-02-24T19:05:56.710Z
Learning: Rocket.Chat repo context: When a workspace manifest on develop already pins a dependency version (e.g., packages/web-ui-registration → "rocket.chat/ui-contexts": "27.0.1"), a lockfile change in a feature PR that upgrades only that dependency’s resolution is considered a manifest-driven sync and can be kept, preferably as a small "chore: sync yarn.lock with manifests" commit.

Applied to files:

  • .changeset/real-suns-float.md
📚 Learning: 2025-11-19T18:20:07.720Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37419
File: packages/i18n/src/locales/en.i18n.json:918-921
Timestamp: 2025-11-19T18:20:07.720Z
Learning: Repo: RocketChat/Rocket.Chat — i18n/formatting
Learning: This repository uses a custom message formatting parser in UI blocks/messages; do not assume standard Markdown rules. For keys like Call_ended_bold, Call_not_answered_bold, Call_failed_bold, and Call_transferred_bold in packages/i18n/src/locales/en.i18n.json, retain the existing single-asterisk emphasis unless maintainers request otherwise.

Applied to files:

  • .changeset/real-suns-float.md
📚 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/real-suns-float.md
📚 Learning: 2026-03-27T14:52:56.865Z
Learnt from: dougfabris
Repo: RocketChat/Rocket.Chat PR: 39892
File: apps/meteor/client/views/room/contextualBar/Threads/Thread.tsx:150-155
Timestamp: 2026-03-27T14:52:56.865Z
Learning: In Rocket.Chat, there are two different `ModalBackdrop` components with different prop APIs. During review, confirm the import source: (1) `rocket.chat/fuselage` `ModalBackdrop` uses `ModalBackdropProps` based on `BoxProps` (so it supports `onClick` and other Box/DOM props) and does not have an `onDismiss` prop; (2) `rocket.chat/ui-client` `ModalBackdrop` uses a narrower props interface like `{ children?: ReactNode; onDismiss?: () => void }` and handles Escape keypress and outside mouse-up, and it does not forward arbitrary DOM props such as `onClick`. Flag mismatched props (e.g., `onDismiss` passed to the fuselage component or `onClick` passed to the ui-client component) and ensure the usage matches the correct component being imported.

Applied to files:

  • apps/meteor/client/views/admin/customSounds/CustomSoundsTable/CustomSoundsTable.tsx
  • apps/meteor/client/views/admin/customEmoji/CustomEmoji.tsx
🔇 Additional comments (2)
apps/meteor/client/views/admin/customSounds/CustomSoundsTable/CustomSoundsTable.tsx (1)

68-74: Good fix: page index reset is applied at the right place.

Resetting current inside the search onChange handler correctly prevents stale offsets during filtered queries.

apps/meteor/client/views/admin/customEmoji/CustomEmoji.tsx (1)

71-77: Looks correct: search now reliably starts from page 1.

This change properly resets pagination state when the filter text changes.

Comment thread .changeset/real-suns-float.md 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.

No issues found across 3 files

@codecov

codecov Bot commented Apr 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 60.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.48%. Comparing base (297df1a) to head (2194484).
⚠️ Report is 116 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #40115      +/-   ##
===========================================
- Coverage    68.61%   68.48%   -0.13%     
===========================================
  Files         4133     4159      +26     
  Lines       160773   158822    -1951     
  Branches     29243    28361     -882     
===========================================
- Hits        110315   108770    -1545     
+ Misses       45348    44845     -503     
- Partials      5110     5207      +97     
Flag Coverage Δ
unit 70.56% <60.00%> (+0.03%) ⬆️

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.

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

This fix seems a little weak, I'm wondering if we could have a more wider solution under the usePagination or something else, so all places we use it, could benefit from a potential fix

@nazabucciarelli nazabucciarelli modified the milestones: 8.4.0, 8.5.0 Apr 19, 2026
@alfredodelfabro alfredodelfabro removed this from the 8.5.0 milestone Apr 30, 2026
@nazabucciarelli
nazabucciarelli force-pushed the fix/pagination-reset-sounds-and-emojis branch from 6c822db to e341162 Compare May 7, 2026 01:34
@nazabucciarelli
nazabucciarelli requested a review from Copilot May 7, 2026 01:35

Copilot AI 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.

Pull request overview

This PR fixes an admin UI pagination bug where searching in Custom Sounds / Custom Emojis could keep the previous page offset, resulting in empty/out-of-range results. It does so by extending the shared usePagination hook to allow resetting the current page when specified “reset trigger” values change.

Changes:

  • Extended usePagination to accept an optional resetDependencies array that triggers setCurrent(0) when any dependency changes.
  • Wired Custom Sounds and Custom Emojis tables to reset pagination when the search text changes.
  • Added a changeset entry for a patch release.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
packages/ui-client/src/components/GenericTable/hooks/usePagination.ts Adds optional reset-dependencies support to reset pagination state when filters/search change.
apps/meteor/client/views/admin/customSounds/CustomSoundsTable/CustomSoundsTable.tsx Passes search text into usePagination so pagination resets on search changes.
apps/meteor/client/views/admin/customEmoji/CustomEmoji.tsx Passes search text into usePagination so pagination resets on search changes; minor null-safe condition tweak.
.changeset/real-suns-float.md Patch release note for the pagination reset fix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/ui-client/src/components/GenericTable/hooks/usePagination.ts Outdated
@nazabucciarelli
nazabucciarelli marked this pull request as draft May 11, 2026 14:33
@ricardogarim
ricardogarim force-pushed the fix/pagination-reset-sounds-and-emojis branch from e341162 to c45e386 Compare July 20, 2026 20:13
@ricardogarim ricardogarim added this to the 8.8.0 milestone Jul 20, 2026
@ricardogarim
ricardogarim requested a review from dougfabris July 20, 2026 20:15
@ricardogarim
ricardogarim marked this pull request as ready for review July 20, 2026 20:16

@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 5 files

Re-trigger cubic

@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 (2)
apps/meteor/client/views/admin/customEmoji/CustomEmoji.tsx (2)

32-32: 🗄️ Data Integrity & Integration | 🔵 Trivial | 🏗️ Heavy lift

Confirm the intended pagination reset contract.

usePagination() is not scoped to text; the reset now exists only in the FilterByText handler at Line 73-76. The PR objective describes a reusable resetDependencies array, but the current hook definition accepts no reset dependency and only resets on itemsPerPage. Confirm which contract is intended. If the hook-level contract is required, restore it and pass [text]; otherwise, update the objective and keep the local reset deliberate. (raw.githubusercontent.com)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/meteor/client/views/admin/customEmoji/CustomEmoji.tsx` at line 32,
Clarify and implement the intended pagination reset contract: update
usePagination to accept the reusable resetDependencies input and pass [text]
from CustomEmoji, or explicitly retain the local FilterByText reset if that is
the intended design. Keep reset behavior consistent with the selected contract
and update related documentation/objective accordingly.

71-77: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add a regression test for the filtered-page reset.

When current is non-zero, change FilterByText and advance the 500 ms debounce. Assert that the request uses offset: 0 and that the first-page result renders. This covers the reported page-2 search path. (github.com)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/meteor/client/views/admin/customEmoji/CustomEmoji.tsx` around lines 71 -
77, Add a regression test around the CustomEmoji filtering flow: set the current
page to a non-zero value, change FilterByText, advance the 500 ms debounce, and
assert the request uses offset: 0 and the first-page results render. Anchor the
test to the CustomEmoji component and its FilterByText/onSetCurrent 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.

Nitpick comments:
In `@apps/meteor/client/views/admin/customEmoji/CustomEmoji.tsx`:
- Line 32: Clarify and implement the intended pagination reset contract: update
usePagination to accept the reusable resetDependencies input and pass [text]
from CustomEmoji, or explicitly retain the local FilterByText reset if that is
the intended design. Keep reset behavior consistent with the selected contract
and update related documentation/objective accordingly.
- Around line 71-77: Add a regression test around the CustomEmoji filtering
flow: set the current page to a non-zero value, change FilterByText, advance the
500 ms debounce, and assert the request uses offset: 0 and the first-page
results render. Anchor the test to the CustomEmoji component and its
FilterByText/onSetCurrent behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f12eb372-0fd0-4725-8611-26c9f65941f0

📥 Commits

Reviewing files that changed from the base of the PR and between c45e386 and 13e93c8.

📒 Files selected for processing (3)
  • .changeset/real-suns-float.md
  • apps/meteor/client/views/admin/customEmoji/CustomEmoji.tsx
  • apps/meteor/client/views/admin/customSounds/CustomSoundsTable/CustomSoundsTable.tsx
💤 Files with no reviewable changes (1)
  • .changeset/real-suns-float.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/meteor/client/views/admin/customSounds/CustomSoundsTable/CustomSoundsTable.tsx
📜 Review details
⏰ Context from checks skipped due to timeout. (4)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: CodeQL-Build
  • GitHub Check: Hacktron Security Check
  • GitHub Check: CodeQL-Build
⚠️ CI failures not shown inline (3)

GitHub Check: Dionisio QA: Some checks did not pass

Conclusion: failure

View job details

**Conclusion:** failure
### Steps
- ✅ **No merge conflicts**
- ❌ **QA assured** — This PR is missing the 'stat: QA assured' label
- ✅ **Mergeable**
- ✅ **Has milestone or project**
- ✅ **Valid PR title**
- ✅ **Correct target version**

GitHub Check: Dionisio QA: Some checks did not pass

Conclusion: failure

View job details

**Conclusion:** failure
### Steps
- ✅ **No merge conflicts**
- ❌ **QA assured** — This PR is missing the 'stat: QA assured' label
- ✅ **Mergeable**
- ✅ **Has milestone or project**
- ✅ **Valid PR title**
- ✅ **Correct target version**

GitHub Check: Dionisio QA: Some checks did not pass

Conclusion: failure

View job details

**Conclusion:** failure
### Steps
- ✅ **No merge conflicts**
- ❌ **QA assured** — This PR is missing the 'stat: QA assured' label
- ✅ **Mergeable**
- ✅ **Has milestone or project**
- ✅ **Valid PR title**
- ✅ **Correct target version**
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

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

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/client/views/admin/customEmoji/CustomEmoji.tsx
🧠 Learnings (2)
📚 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/customEmoji/CustomEmoji.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/customEmoji/CustomEmoji.tsx
🔇 Additional comments (1)
apps/meteor/client/views/admin/customEmoji/CustomEmoji.tsx (1)

123-123: LGTM!

@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 5 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/meteor/client/views/admin/customEmoji/CustomEmoji.tsx">

<violation number="1" location="apps/meteor/client/views/admin/customEmoji/CustomEmoji.tsx:75">
P3: The new search-reset behavior is not covered by a regression test: the current specs never search from a later page or assert that the resulting custom emoji/sound request uses offset 0. Adding an interaction test that navigates to page 2, types a search term, and verifies the endpoint query would make CORE-2096 resistant to regressions.

(Based on your team's feedback about meaningful behavior and edge-case tests.) .</violation>
</file>

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

Re-trigger cubic

value={text}
onChange={(event) => {
setText(event.target.value);
onSetCurrent(0);

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.

P3: The new search-reset behavior is not covered by a regression test: the current specs never search from a later page or assert that the resulting custom emoji/sound request uses offset 0. Adding an interaction test that navigates to page 2, types a search term, and verifies the endpoint query would make CORE-2096 resistant to regressions.

(Based on your team's feedback about meaningful behavior and edge-case tests.) .

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/meteor/client/views/admin/customEmoji/CustomEmoji.tsx, line 75:

<comment>The new search-reset behavior is not covered by a regression test: the current specs never search from a later page or assert that the resulting custom emoji/sound request uses offset 0. Adding an interaction test that navigates to page 2, types a search term, and verifies the endpoint query would make CORE-2096 resistant to regressions.

(Based on your team's feedback about meaningful behavior and edge-case tests.) .</comment>

<file context>
@@ -68,7 +68,13 @@ const CustomEmoji = ({ onClick, reload }: CustomEmojiProps) => {
+				value={text}
+				onChange={(event) => {
+					setText(event.target.value);
+					onSetCurrent(0);
+				}}
+			/>
</file context>

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.

5 participants