SuperChat Mention List Stays Open After the Composer Loses Focus
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 82/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- react, typescript
Línea de trabajo
Empieza por src/components/Messaging/useMentionAutocomplete.tsx y los manejadores del textarea de ChatComposer; sigue cómo el hook abre y cierra el menú de menciones renderizado en un portal. Busca las pruebas del composer y cubre el cierre de la lista al perder el foco, su reapertura al recuperar el foco para una @query sin terminar y la inserción de la mención al seleccionarla con el ratón. El trabajo está terminado cuando esos casos pasan y al abrir el visor de medios no queda visible ninguna lista de menciones.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 2
- Forks
- 7
- Merge medio
- 1 d 12 h
- PR fusionados (30 d)
- 62
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de mieweb/ui
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 1 día
-
src/tailwind-preset.cjs drifted from tailwind-preset.ts — missing `info` and `chart` color scalesAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
SuperChatInbox: show the chat pane when the host opens or starts a conversation on small screensPosiblemente ocupada @martincarapia la tomó hoy. Abiertoenhancement
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 15/100
Los mantenedores suelen responder en 1 día
-
Mobile compliance: Safari Storybook testing and a Capacitor reference appPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
mieweb/ui#841 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
simstudioai/sim#10710 ·
Los mantenedores suelen responder en 1 día
-
bug:new
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
callstackincubator/simlock#2088 ·
Los mantenedores suelen responder en 1 día
-
Make the HTTP server's keep-alive and headers timeouts configurablePosiblemente ocupada @mattgodbolt la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
compiler-explorer/compiler-explorer#9902 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 74/100
juspay/odu#193 · 1 comentario ·
Los mantenedores suelen responder en 1 día