Skip to content

0005. UI as view models plus thin widgets

  • Status: accepted
  • Date: 2026-10-02

GUI code tends to accumulate logic (layout maths, hit-testing, snapping, formatting), which then cannot be tested and cannot survive a change of toolkit.

core/ui_model and the domain cores hold view models and all geometry and interaction logic as pure C++. Widgets in ui/<toolkit>/ only draw and forward input. Theme values are tokens defined by role.

  • UI logic is unit tested.
  • A new toolkit needs new widgets only.
  • Widgets need a small amount of glue to map toolkit events to interaction objects.