This is a really interesting approach! I ran into a similar edge case recently while working on the frontend logic for a custom calculator web-app.