a2ui-project / a2ui-project/a2ui

Fix Modal implementation

Abierto
#1,837 0 comentarios 0 reacciones 0 asignados Ver en GitHub
component: genui component: standard catalog specification P2 status: first-line-handled
Lenguaje dominante
TypeScript
Estrellas
16.4k
Forks
1.3k
Merge medio
2 d 13 h
PR fusionados (30 d)
134

Descripción

_↴ Ported from [flutter/genui#504](https://github.com/flutter/genui/issues/504) — originally opened by [jacobsimionato](https://github.com/jacobsimionato) on 2025-11-10._
_Original labels: P2, front-line-handled, second-line-triaged, a: core_catalog_

---

It seems like we implemented Modal so that it accepts a child which should be a button, and then there's an undocumented protocol for the event that this button must emit to show the modal, and special cased logic in genui_surface.dart to handle it.

We should not have any of this special cased logic for specific catalog items in the core SDK code.

Instead, I think the entryPointChild of Modal should be like a "text" widget etc, and Modal itself should wrap it with a tap handler or button which triggers the modal.

---

### 2 comment(s) from the original issue

**[gspencergoog](https://github.com/gspencergoog)** commented on 2025-11-11:

In general, I think we need to think more about what "modal" use case is. Should it be a modal dialog? Should it be a bottom sheet? Should it be a menu? It feels ill-defined. Once we have a better handle on it, then it seems like we could make better decisions about how it should operate.

For your specific suggestion about `entryPointChild`, it makes me wonder how the LLM could make the button look like other buttons, if it, say, puts it in a row of chips.

I agree we shouldn't have any special-cased logic for specific items, though.

---

**[jacobsimionato](https://github.com/jacobsimionato)** commented on 2025-11-12:

Hey yes +1 about defining it better!

I think all those options you mentioned are interesting hints though they're more about rendering than usage.

There is also an interesting example of navigation in the "A2UI Customer Requirements" doc which could also maybe be handled by this component.

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Look at the Modal component implementation in the codebase, likely in a core SDK file like genui_surface.dart. Examine how it currently accepts a child button and the undocumented event protocol. The goal is to refactor so Modal wraps its entryPointChild with its own tap handler, removing special-cased logic for catalog items. Start by understanding the existing Modal usage and the 'A2UI Customer Requirements' doc for context on navigation use cases.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
flutter, typescript
Área
design, frontend
Tipo de issue
Refactorización
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.