RocketChat / RocketChat/Rocket.Chat

ui-contexts: Improve type safety for ActionManager and AvatarUrl Contexts

Open
#38,826 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: feature
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.