rainlanguage / rain.orderbook

Rain orderbook libraries, subgraph and contract implementation.
7 stars 4 forks source link

Remove 'apply settings' button #452

Open mattyg opened 3 months ago

mattyg commented 3 months ago

Currently to make settings changes active, the user has to manually click "Apply Settings".

Instead, automatically apply settings when textarea content changes, with some debounce.

Currently clicking the button sets a store:

https://github.com/rainlanguage/rain.orderbook/blob/e20609c919bec3e9e7d2b89954ff2418881d7288/tauri-app/src/routes/settings/%2Bpage.svelte#L10-L12

There's then a derived store that attempts to call the Tauri command which is how the user gets error feedback. If we simply debounce the setting of this store, the user would get toast errors after the debounce time. Not the best UX, so this needs a little more thought.

This file has currently no tests, so completion of this issue must include tests for the whole page component. There's some reference for how to do component tests here: https://github.com/rainlanguage/rain.orderbook/blob/main/tauri-app/src/lib/components/Words.test.ts

thedavidmeister commented 1 month ago

we discussed this in TG today

there is some resistance to removing the "apply settings" button because modifying the settings can cause the GUI to stop working with unhelpful error messages, or worse just silently break

the problem is that the current state of settings handling means that the app can invisibly put itself into a different state to what is in the GUI, for some of the most important state that the app has

there's absolutely no way to know whether the current app state currently reflects what is on the settings page without clicking "apply" anyway, so what benefit does the button bring? and does this benefit really justify the cost of inconsistency and incorrectness in a quite common situation (user makes a change then navigates)?

note that we DO see users make this mistake commonly in the wild, they update settings and forget to "apply" and get no visual feedback, and so obsessively click "apply" several times "just to be sure" (currently we are causing users anxiety)

imo the baseline for our GUI across the board should be: