SIGN IN SIGN UP

feat(previews/text-editor): add toolbar for monaco editor (#560)

* feat(monaco): add more elements

Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>

* feat(monaco): add webpage fullscreen

Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>

* feat(monaco): finetune layout

Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>

* perf: optimize encoding detection with BOM detection and confidence filtering

- Skip string inputs (TextEncoder always produces UTF-8)
- Add BOM detection for UTF-8/UTF-16 LE/BE (fast and accurate)
- Filter chardet results by minimum confidence threshold (30%)
- Hoist encodingLabels to module scope with Set for O(1) lookup

* fix: MonacoEditor falsely reports modified state on open

Use on() with defer:true to skip the initial setValue call, preventing
a false onDidChangeModelContent trigger that increments the version ID.

* feat: add exit confirmation for unsaved changes in text editor

* feat: add language switch

Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>

* feat: support close minimap

Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>

* fix: remove untranslated modified

Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>

* refactor: reuse StreamUpload form home/uploads/stream

Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>

* feat: save monaco toolbar state to local storage

Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>

* fix: add write permission check

Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>

* style: revert MonacoEditor minimum height to 60vh

Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>

* refactor: implement copy-to-clipboard

Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>

* chore: adjust button properties

Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>

* style: use ButtonGroup in LocalSettings

Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>

* style: integrate BoxWithFullScreen component and clean up fullscreen logic in TextEditor

Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>

* feat: add tooltip

Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>

* chore: improve code quality

Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>

* fix(monaco): preserve editor state

---------

Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>
Co-authored-by: Suyunmeng <Susus0175@proton.me>
M
MadDogOwner committed
5114ba84ffccfc3248da85c7c8ceada38ef3954d
Parent: e49ceef
Committed by GitHub <noreply@github.com> on 7/22/2026, 9:22:55 AM