Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Ability to react to clicks on user names and avatars

Aperta
#630 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
angular, typescript

Direzione di ricerca

Inizia tracciando i componenti dell’avatar e dell’intestazione del canale, incluso il percorso personalizzato channelHeaderInfoTemplate, per individuare dove vengono visualizzati i nomi e gli avatar. Esamina la InteractiveElementDirective proposta e decidi come devono essere esposti gli eventi di clic e da tastiera, incluso il comportamento diverso per i nomi delle chat di gruppo e delle chat tra due persone. Il lavoro è completato quando gli elementi supportati sono interattivi e accessibili senza richiedere componenti personalizzati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

I have a feature request to open user profile when clicking on avatars and names in the chat.
I think it makes a lot of sense, since all messengers do similar things.

Right now my only option to achieve this seems to be to create custom avatar and channel header components so that I can put click listeners wherever I want.

I believe it would be much simpler if stream-chat-angular implemented click listeners and passed the events through some exposed observables which clients could use to their liking. The event could include user object and potentially other metadata. The feature seems to be pretty simple while bringing a lot of value.

The usually interactive elements such as names and avatars would also have to be tababble, meaning fully accessible without a mouse and thus require listening to keydown.enter and keydown.space events as well. Not the highest priority on this one though.
Here's the directive we use to make any html element accessible with use of a simple (click) listener:

import { Directive, ElementRef, HostBinding, HostListener, Input } from '@angular/core'

@Directive({
  selector: '[appInteractive]',
  host: { role: 'button' },
  standalone: true
})
export class InteractiveElementDirective {
  @Input() appInteractive: boolean | ''

  get isInteractive(): boolean {
    return this.appInteractive !== false
  }

  @HostListener('keydown.enter', ['$event'])
  @HostListener('keydown.space', ['$event'])
  handleEnterKeydown(event: MouseEvent & { currentTarget: HTMLElement }): void {
    if (this.el.nativeElement === event.target && this.isInteractive) {
      event.currentTarget.click()
    }
  }

  @HostBinding('tabindex')
  get tabIndex() {
    return this.isInteractive ? 0 : -1
  }

  constructor(private el: ElementRef) {}
}

The only thing to decide is how to react to clicks on a group chat name (where you have first 5 names separated by commas) vs a 2 person chat name (where you only have one name).
I think listening to clicks on each individual name in a group chat name isn't that valuable, since it's pretty easy to create a custom channelHeaderInfoTemplate which would usually open some sort of custom member list anyway.

Lingua principale
TypeScript
Stelle
67
Fork
34
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di GetStream/stream-chat-angular

Tutte le issue di GetStream/stream-chat-angular

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.