Skip to content

Conversation

@silverwind
Copy link
Member

@silverwind silverwind commented Dec 17, 2025

Fixes: #36175

  1. Correctly apply setting on textareas spawned by comment edit
  2. When changing the setting, apply it to all textareas on the current page and in all other open tabs

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Dec 17, 2025
@silverwind
Copy link
Member Author

silverwind commented Dec 17, 2025

I think this could be expanded to also apply the setting in other open tabs by leveraging the storage event:

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.

@silverwind silverwind added type/enhancement An improvement of existing functionality and removed type/bug labels Dec 17, 2025
@silverwind
Copy link
Member Author

silverwind commented Dec 17, 2025

I've added the bare minimum to get the setting working across tabs too. There's probably an opportunity to abstract into some localStorage module suitable for more similar localStorage-backed settings, but I'm not totally certain how to design it.

@silverwind silverwind changed the title Fix comment editor monospace toggle for edit mode Fix and enhance comment editor monospace toggle Dec 17, 2025
@silverwind
Copy link
Member Author

web_src/js/modules/storage.ts is now contains minimal localStorage wrapper functions and I've used them everywhere where we previously used localStorage directly (except inline scripts, but that's another topic to be solved via web components). This is in preparation so that these settings can be synced to the server in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/frontend type/enhancement An improvement of existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Monospace font settings broken in comment/issue editor

2 participants