Skip to content

fix: make date chip gliding work with new virtualized list system#40621

Open
pranithakshayreddy-tech wants to merge 1 commit into
RocketChat:developfrom
pranithakshayreddy-tech:fix/date-chip-gliding
Open

fix: make date chip gliding work with new virtualized list system#40621
pranithakshayreddy-tech wants to merge 1 commit into
RocketChat:developfrom
pranithakshayreddy-tech:fix/date-chip-gliding

Conversation

@pranithakshayreddy-tech
Copy link
Copy Markdown

@pranithakshayreddy-tech pranithakshayreddy-tech commented May 20, 2026

### Proposed changes
The floating date chip "gliding" effect was broken after the migration to the new virtualized list system.
The old code used a CSS selector targeting data-time='YYYYMMDD' to hide the date divider behind the floating chip. However, the new system uses data-id with a Unix timestamp instead.
Updated the listStyle CSS selector in useDateScroll.ts to target data-id using new Date(bubbleDate.date).getTime() to match the correct divider element and restore the gliding behavior.
### Issue(s)
Related to the TODO comment at useDateScroll.ts#L148
### Steps to test or reproduce

Open any room with many messages
Scroll up quickly through the message list
Observe the floating date chip at the top
The date divider behind the chip should now be hidden (opacity: 0)
Previously the divider was visible behind the chip — now it is correctly hidden

### Further comments
The removed TODO comment confirms this was a known issue left for future fixing after the virtualized list migration. No new dependencies or breaking changes introduced.

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced the display of date dividers when scrolling through message history in rooms.

Review Change Stack

@pranithakshayreddy-tech pranithakshayreddy-tech requested a review from a team as a code owner May 20, 2026 07:46
@dionisio-bot
Copy link
Copy Markdown
Contributor

dionisio-bot Bot commented May 20, 2026

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 missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 20, 2026

CLA assistant check
All committers have signed the CLA.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 20, 2026

⚠️ No Changeset found

Latest commit: aada1e3

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 20, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 87dc5543-8c1b-49bb-9536-ae7d5a0ad13c

📥 Commits

Reviewing files that changed from the base of the PR and between 7f2bdf1 and aada1e3.

📒 Files selected for processing (1)
  • apps/meteor/client/views/room/hooks/useDateScroll.ts
📜 Recent review details
🧰 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/hooks/useDateScroll.ts
🧠 Learnings (5)
📚 Learning: 2026-02-10T16:32:42.586Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 38528
File: apps/meteor/client/startup/roles.ts:14-14
Timestamp: 2026-02-10T16:32:42.586Z
Learning: In Rocket.Chat's Meteor client code, DDP streams use EJSON and Date fields arrive as Date objects; do not manually construct new Date() in stream handlers (for example, in sdk.stream()). Only REST API responses return plain JSON where dates are strings, so implement explicit conversion there if needed. Apply this guidance to all TypeScript files under apps/meteor/client to ensure consistent date handling in DDP streams and REST responses.

Applied to files:

  • apps/meteor/client/views/room/hooks/useDateScroll.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/hooks/useDateScroll.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/hooks/useDateScroll.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/hooks/useDateScroll.ts
📚 Learning: 2026-05-06T12:21:44.083Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 40256
File: apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx:121-149
Timestamp: 2026-05-06T12:21:44.083Z
Learning: Field wrappers in rocket.chat/fuselage-forms (Field, FieldLabel, FieldRow, FieldError, FieldHint) auto-create htmlFor/id associations, aria-describedby, and role="alert" for errors. Do not manually set htmlFor, id, aria-describedby, or role attributes when using these wrappers. This automatic wiring does not apply to plain rocket.chat/fuselage components, which require explicit ID wiring per the accessibility docs. In code reviews, prefer using fuselage-forms wrappers for form fields and verify there is no unnecessary manual ID/aria wiring in files that use these wrappers. If a component uses plain fuselage components, ensure proper id wiring as per docs.

Applied to files:

  • apps/meteor/client/views/room/hooks/useDateScroll.ts
🔇 Additional comments (1)
apps/meteor/client/views/room/hooks/useDateScroll.ts (1)

148-156: LGTM!


Walkthrough

The PR updates the useDateScroll hook to dynamically compute a listStyle CSS block that hides the date divider matching the current bubbleDate via data-id attribute targeting. The previous hardcoded undefined value and older commented selector logic are replaced with conditional CSS generation.

Changes

Date Divider Visibility

Layer / File(s) Summary
ListStyle CSS computation
apps/meteor/client/views/room/hooks/useDateScroll.ts
useDateScroll now derives listStyle from bubbleDate.show and bubbleDate.date to conditionally apply CSS hiding the current date divider via [data-id='<timestamp>'] selector with opacity: 0, replacing the previous hardcoded undefined assignment.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Suggested labels

type: bug

🚥 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 specifically describes the main fix: restoring the date chip gliding effect after migration to a virtualized list system, which aligns perfectly with the changeset.
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.

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

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


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 and usage tips.

Copy link
Copy Markdown
Contributor

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

Choose a reason for hiding this comment

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

No issues found across 1 file

Re-trigger cubic

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