As I said, terminals are best suited for command line applications; lines of text in, lines of text out. Something that would work on classic ASR-33 or ADM-3A.
Dialog boxes, menus, and views are concepts that are more fitted to GUIs. And as such the right tool these days would be Wayland. For example, you get native keyboard scancode events and XKB keymaps, allowing far better input handling capabilities than any layering of hacks on top ANSI escape codes ever can.
The whole point of terminals is that they are simple, text based, and as such interoperable and standardized. ANSI escape code extensions are decidedly not text nor simple, and often very non-interoperable to varying degrees. As such they are pretty antithetical to the whole idea of terminals.