RocketChat / RocketChat/Rocket.Chat
ui-contexts: Improve type safety for ActionManager and AvatarUrl Contexts
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
Description:
The current type definitions in ui-contexts for ActionManager and AvatarUrl rely on generic any types, which weakens type safety across the frontend.
Proposed Improvement:
Replace generic any listeners in IActionManager with a semantic ActionEventListener.
Introduce a GetRoomPathAvatar type with explicit overloads for better handling of room avatar URLs.
Improve JSDoc documentation for better IDE support.
Motivation:
These changes provide better developer experience (DX) and catch potential errors at compile-time without any runtime impact.
Related PR:
#38626
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
Start in the ui-contexts definitions for IActionManager and the AvatarUrl context, then review related PR #38626 for existing context. Check how listeners and room avatar URL calls are typed across the frontend. Done means replacing generic any listeners with ActionEventListener, adding GetRoomPathAvatar overloads, and improving the related JSDoc without runtime changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100