[Bug]: File Gallery loses selected file-type filter when new messages arrive

オープン 初心者向け
#1,477 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@PritamMishra065 がすでに取り組んでいます。

2026年12月4日 から。

  • #1488 @PritamMishra065 による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
84/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
javascript, react
領域
frontend

調査の方向性

packages/react/src/views/MessageAggregators/FileGallery.jsから始め、メッセージが変わったときやgetAllFiles()がリストを更新するときにselectedFilterがどのように使われるかを追ってください。ファイルタイプが選択されている状態でメッセージリストが変わる場合の回帰テストを追加してください。新しいメッセージが届いた後も、ドロップダウンと表示されるファイルの状態が同期していれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug
Description

The File Gallery does not preserve the selected file-type filter when new messages arrive in the chat.

When the message list updates, FileGallery fetches all files without considering the currently selected filter. As a result, files of other types may appear while the dropdown continues to display the selected file type.

Steps to reproduce
  1. Open EmbeddedChat and navigate to a channel containing different types of file attachments.
  2. Open the Files sidebar.
  3. Select a specific file type, such as Images.
  4. Send or receive a new message in the channel.
  5. Observe the files displayed in the sidebar.
Expected behavior

The File Gallery should preserve the selected file-type filter when new messages arrive and display only files matching the selected type.

Actual behavior

Based on source code inspection, the file list is refreshed without applying the selected filter, potentially displaying files of all types.

Root cause

The useEffect in FileGallery.js calls getAllFiles() with an empty type filter whenever the messages array changes, regardless of the selectedFilter state.

Proposed solution
  • Preserve the selected file-type filter during automatic refreshes.
  • Keep the filter dropdown and displayed file list synchronized.
  • Add regression tests to verify filter persistence.
Relevant file

packages/react/src/views/MessageAggregators/FileGallery.js

Additional context

I would like to work on this issue and submit a PR if the maintainers approve the proposed solution.

主要言語
JavaScript
スター
171
フォーク
421
平均マージ
3日 6時間
マージ済み PR(30日)
4

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

RocketChat/EmbeddedChat のほかの issue

RocketChat/EmbeddedChat の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。