ui: set up something router-like to save state