The button program had additional complexities: it ran a JSON-RPC pub-sub server over websockets (lol). A separate menu program subscribed to the button-press events over JSON-RPC and used them to drive changes in a state machine for an OLED menu.
In hindsight, this was a pretty ridiculous arrangement.
The button logic is now included in the menu program. No more JSON-RPC pub-sub. The result is far less code, fewer dependencies, easier readability and major performance gains.
I love these moments when I can really sense how far I've come in my learning 🖤