bug: Reaction popups are cut off by the channel header or composer (DialogAnchor can't use `fitAvailableSpace`)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 62/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- react, typescript
- 領域
- frontend
調査の方向性
Start in src/components/Dialog/service/DialogAnchor.tsx and useDialogAnchor, where fitAvailableSpace needs to be accepted and passed to usePopoverPosition, which already supports it for Dropdown. Then check MessageReactions and ReactionSelectorWithButton so they pass the option through. In the ResizeObserver callback, defer update with requestAnimationFrame and cancel it on cleanup to avoid the loop warning. Done when the reaction popups cap their height to the available space and scroll, with no ResizeObserver loop error in the console.
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
The reaction popups open through DialogAnchor: the list of who reacted (MessageReactions), and the reaction selector with its "+" list of every emoji (ReactionSelectorWithButton). When one is taller than the space on both sides of the message, floating-ui flips it to the roomier side, but it still overflows. The channel header or the composer then covers part of it.
usePopoverPosition already supports fitAvailableSpace, which caps the floating element's height to the space available. Only Dropdown uses it today. DialogAnchor and useDialogAnchor don't accept or pass it through, so the reaction popups can't use it.
A second problem shows up once it's turned on. With updatePositionOnContentResize, useDialogAnchor calls update directly inside its ResizeObserver callback. Fitting the dialog resizes it again during that same callback, and the browser logs "ResizeObserver loop completed with undelivered notifications".
To Reproduce
- Open a channel in a short window, for example about 600px tall.
- On a message near the middle of the list, open the reaction selector and expand the full emoji list with "+". Or open the reactions detail on a message with many reactions.
- The popup extends under the channel header or the composer.
Expected behavior
The popup's height is capped to the space on the side it opens toward, and its content scrolls.
Suggested fix
We've patched the built ES output. We can open a PR against the source, with a test, if you'd like:
- Add
fitAvailableSpacetoDialogAnchor's props and touseDialogAnchor, and pass it tousePopoverPosition. - Pass
fitAvailableSpacefromMessageReactionsandReactionSelectorWithButton. - In the
ResizeObservercallback, deferupdateto the next animation frame, and cancel that frame on cleanup:
let frame = 0;
const resizeObserver = new ResizeObserver(() => {
cancelAnimationFrame(frame);
frame = requestAnimationFrame(update);
});
resizeObserver.observe(popperElement);
return () => {
cancelAnimationFrame(frame);
resizeObserver.disconnect();
};
Our workaround
The patch described above, applied to dist/es and the types with pnpm's patchedDependencies.
Package version
- stream-chat-react: 15.0.0. The same code is in 15.0.2, checked in source (
src/components/Dialog/service/DialogAnchor.tsx). - stream-chat-js: 10.0.1
Desktop
- Chrome on macOS
Additional context
App id: 67855
- 主要言語
- TypeScript
- スター
- 845
- フォーク
- 295
- 平均マージ
- 1日 8時間
- マージ済み PR(30日)
- 106
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
GetStream/stream-chat-react のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
GetStream/stream-chat-react#3467 ·
メンテナーはふだん 1 日以内に返信
-
bug: Composer textarea doesn't resize when the SDK sets its text (paste, draft, clear after send)オープン
難易度 3/5 1〜2日 初心者へのやさしさ 62/100
GetStream/stream-chat-react#3468 ·
メンテナーはふだん 1 日以内に返信
-
bug status: unconfirmed
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
GetStream/stream-chat-react#2647 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
dependencies
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
GetStream/stream-chat-react#1982 · コメント 8 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
GetStream/stream-chat-react の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
vercel-labs/ui#1139 ·
メンテナーはふだん 1 日以内に返信
-
generate_image reference URL guard lets through IPv4-mapped IPv6 hosts and 100.64.0.0/10対応中かも @goranai が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
bot:ai-assisted component:platform-js status:untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
midnightntwrk/platform-js#93 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 74/100
nicobailon/pi-web-access#710 ·
メンテナーはふだん 1 日以内に返信