a2ui-project / a2ui-project/a2ui
Fix Modal implementation
- Dominant language
- TypeScript
- Stars
- 16.4k
- Forks
- 1.3k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 134
Description
_↴ 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.
Contributor guide
Research direction
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.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- flutter, typescript
- Domain
- design, frontend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100