Conversation
There was a problem hiding this comment.
We should be vigilant about naming and avoid proliferation of symbols with names that 1) aren't very descriptive and 2) are very close to other things. There's a similar problem in common.ts in desktop.
Stuff like this really impacts readability because rather than relying on intuition, you have to rely on bulk memorization to know what things do.
Please hold me accountable to this as well.
Rather than introduce 2 more symbols to the useSettings namespace, could we just rename NewTrackSettings to TrackSettings add promptUserOnDelete to TrackSettings.
Putting DeletionSettings into its own namespace doesn't make sense, because if we end up with settings that affect other types of deletions (users, types, etc) then we can't put them in DeletionSettings because it's a child of TrackSettings.
Then, updateNewTrackSettings should move to simply updateTrackSettings.
I'd actually prefer to do away from putting settings into these arbitrary groups at all and have a AnnotatorSettings interface and a updateSettings() function and never have to add new symbols to the useSettings api, but this could be out of scope for this PR.
Understood and I wasn't a fan either considering my last bulletpoint. I'll swap it, I was just avoiding doing an update to users who currently had data in localStorage stored a top level newTrackSettings |
On the balance, maybe don't bother? Just change the name of the variable and let users's settings be overwritten with the defaults. It's just a couple toggle switches. I don't think I'd bother attempting to migrate them. |
|
I need to do some double checking of stuff, and I think refactoring some of the components to composition and using |
|
Okay I think I have this working like it should. a |
* Try settings singleton * Lint fixes * fixing continuous v-model * mend Co-authored-by: Bryon Lewis <Bryon.Lewis@kitware.com>
| } | ||
|
|
||
| function handleRemoveTrack(trackIds: TrackId[]) { | ||
| async function handleRemoveTrack(trackIds: TrackId[], promptOverride = false) { |
There was a problem hiding this comment.
ambiguous boolean. Does override mean to force enable or force disable? Could this be renamed to forceEnable or forceDisable based on what it is supposed to do?
There was a problem hiding this comment.
are you good with forcePromptDisable? just so you know what you're force disabling.
Fixes #190
NewTrackSettingsinto havingTrackSettingswith a newDeletionSettings. It is one value for now but I don't know if more will be added in the future.useModeManagerhandleRemoveTrackto prompt if the user settings indicate so. There is an option override which is used for track visibility deletion tool (The delete button next to track settings).