SuperChat Mention List Stays Open After the Composer Loses Focus
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 82/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- react, typescript
調査の方向性
src/components/Messaging/useMentionAutocomplete.tsx と ChatComposer の textarea ハンドラーから始め、hook が portal に描画されたメンションメニューをどのように開閉するかを追ってください。composer のテストを見つけ、blur でリストが閉じること、未完了の @query に対して focus で再び開くこと、マウスで選択するとメンションが挿入されることをテストしてください。これらのケースが通り、メディアビューアーを開いたときにメンションリストが表示されたままにならなければ完了です。
索引モデルが issue の本文から書いたものです。
説明
Overview
The @mention suggestion list in ChatComposer, which SuperChat and SuperChatInbox use, stays open after focus leaves the composer. Because the menu is portaled to document.body, it stays on screen over whatever comes next: a media viewer opened from the thread, or a different page in a host app that keeps the inbox mounted while it is hidden. The only way to dismiss it is to go back to the composer and press Escape or delete the @.
Steps to Reproduce
In Storybook: SuperChat › Inbox › Playground
- Type
@in the composer. The participant list opens. - Without choosing anyone, click an image in the thread to open the media viewer.
- The mention list stays open on top of the viewer.
In a host app that keeps the inbox mounted: TimeHuddle wraps its inbox page in React <Activity mode="hidden"> when another tab is showing.
- Type
@in the composer. - Switch to another tab or page.
- The mention list is still on screen over the other page.
Current State
useMentionAutocomplete(src/components/Messaging/useMentionAutocomplete.tsx) closes the menu only on Escape, when an option is inserted, or when an edit removes the@query.- Nothing closes it on textarea blur or on a pointer down outside the menu.
MentionMenurenders throughcreatePortal(..., document.body). Hiding or covering the composer's subtree does not hide the menu. React<Activity mode="hidden">, for example, does not hide portaled content.
Proposed Changes
- Close the menu when the textarea blurs
- Clear the active mention in the composer textarea's
onBlur, for example through aclose()that the hook returns. - Options already use
onMouseDownwithpreventDefault(), so clicking an option keeps focus and still inserts it. - The textarea's
onFocusoronSelectcan callsync()again, so returning to an unfinished@queryreopens the list.
- Clear the active mention in the composer textarea's
- Test
- Type
@, blur the textarea, and expectchat-composer-mention-listto be gone. - Refocus with the caret after the
@, and expect the list to reopen. - Clicking an option still inserts it.
- Type
Acceptance Criteria
- The mention list closes when the composer textarea loses focus.
- Choosing an option with the mouse still inserts the mention.
- Focusing the composer again with an unfinished
@queryreopens the list. - In Storybook, opening the media viewer while the list is open leaves no list on screen.
- A unit test covers closing on blur and reopening on focus.
Out of Scope (for Now)
- Shared listbox keyboard navigation (#376).
- Closing other portaled composer menus (the
+add menu, send options), which already close on outside click throughDropdown. - Changing how a host hides the inbox.
- 主要言語
- TypeScript
- スター
- 2
- フォーク
- 7
- 平均マージ
- 1日 12時間
- マージ済み PR(30日)
- 62
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
mieweb/ui のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
メンテナーはふだん 1 日以内に返信
-
src/tailwind-preset.cjs drifted from tailwind-preset.ts — missing `info` and `chart` color scalesオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
SuperChatInbox: show the chat pane when the host opens or starts a conversation on small screens対応中かも @martincarapia が今日担当しました。 オープンenhancement
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
メンテナーはふだん 1 日以内に返信
-
Mobile compliance: Safari Storybook testing and a Capacitor reference app対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
simstudioai/sim#10710 ·
メンテナーはふだん 1 日以内に返信
-
bug:new
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
callstackincubator/simlock#2088 ·
メンテナーはふだん 1 日以内に返信
-
Make the HTTP server's keep-alive and headers timeouts configurable対応中かも @mattgodbolt が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
compiler-explorer/compiler-explorer#9902 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信