feat(desktop): show zoom scale toast and lower UI scale limit to 70%

This commit is contained in:
二丫讲梵
2026-09-12 21:44:42 +08:00
committed by GitHub
parent d36c094c4f
commit 177aba9979
3 changed files with 9 additions and 2 deletions
+7
View File
@@ -1175,16 +1175,23 @@ function setGlobalUiScale(scale: number) {
settingsStore.updateEditorSettings({ uiScale: scale });
}
function showUiScaleToast() {
toast(`${Math.round(settingsStore.editorSettings.uiScale * 100)}%`, 1500);
}
function zoomInUi() {
setGlobalUiScale(settingsStore.editorSettings.uiScale + 0.1);
showUiScaleToast();
}
function zoomOutUi() {
setGlobalUiScale(settingsStore.editorSettings.uiScale - 0.1);
showUiScaleToast();
}
function resetUiZoom() {
setGlobalUiScale(1);
showUiScaleToast();
}
function applyUiFontFamily(fontFamily: string) {
+1 -1
View File
@@ -1138,7 +1138,7 @@ export const STORAGE_KEY = "dbx-editor-settings";
const OLD_FONT_SIZE_KEY = "dbx-query-editor-font-size";
const EXPORT_BATCH_SIZE_DEFAULT_MIGRATION_KEY = "dbx-export-batch-size-default-migrated-v1";
const LEGACY_DEFAULT_EXPORT_BATCH_SIZE = 10000;
const MIN_UI_SCALE = 0.75;
const MIN_UI_SCALE = 0.7;
const MAX_UI_SCALE = 2;
export function normalizeGlobalQueryTimeoutSecs(value: unknown): number {
+1 -1
View File
@@ -1101,7 +1101,7 @@ test("normalizeEditorSettings falls back to the default UI scale", () => {
});
test("normalizeEditorSettings clamps UI scale into the supported range", () => {
assert.equal(normalizeEditorSettings({ uiScale: 0.2 }).uiScale, 0.75);
assert.equal(normalizeEditorSettings({ uiScale: 0.2 }).uiScale, 0.7);
assert.equal(normalizeEditorSettings({ uiScale: 2.8 }).uiScale, 2);
});