RocketChat / RocketChat/Rocket.Chat
Fix usage of "any" in a LiveChat component
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
Description:
Menu in livechat currently declares ref?: any and PopoverMenuWrapper relies on a legacy component-instance shape (Component & { base: Element }). This bypasses strict typing and can hide ref mismatches between Menu and its consumers.
Expected behavior:
Menushould typereffrom the actual rendered element contract (HTMLDivElement) instead ofany.PopoverMenuWrappershould store/use a DOM ref (HTMLDivElement | null) and callgetBoundingClientRect()directly without .base.
Actual behavior:
MenuPropsusesref?: any.PopoverMenuWrapperusesmenuRef?.base?.getBoundingClientRect(), coupling to a legacy component ref shape and weakening type safety.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Search the LiveChat code for the Menu and PopoverMenuWrapper components, then inspect how Menu is rendered and how its ref is consumed. Update the ref types to match the HTMLDivElement contract and confirm that the wrapper uses the DOM element directly for getBoundingClientRect(); run the relevant TypeScript checks or frontend tests if available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 64/100