Fix and enhance comment editor monospace toggle#36181
Fix and enhance comment editor monospace toggle#36181wxiaoguang merged 22 commits intogo-gitea:mainfrom
Conversation
|
I think this could be expanded to also apply the setting in other open tabs by leveraging the https://developer.mozilla.org/en-US/docs/Web/API/Window/storage_event I guess a small storage helper module is needed to abstract this out of the file and be useful for all localStorage-backed variables. |
|
I've added the bare minimum to get the setting working across tabs too. There's probably an opportunity to abstract into some |
|
|
|
To make code maintainable: b32c75f |
|
Instead of all these |
It doesn't work. Or, you can make changes as your proposal. |
It won't work like magic because our code needs to handle string parsing (not simply use the local storage value as-is). I believe the current design is good enough, easy to use and error-proof. So I think we can get it merged. |
|
Hmm fine, I still think Typescript could be leveraged and that functions like |
|
Assuming we will sync to server later, I would not name it |
I believe no at the moment. Because when that time reaches, the design will be quite different. And since there is TypeScript type checking, it is easier to rewrite in the future. |
I guess it's actually ok because these settings are always kept local currently, so we can later rename the var to fit. |
|
lgtm |
Fixes: #36175