Skip to content

AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.

fix(settings): drop window size from screen resolution

tianma-if9ddb3466bcf3
diff --git a/apps/ios/EdgeEver/Features/Workspace/SettingsView.swift b/apps/ios/EdgeEver/Features/Workspace/SettingsView.swift
index 19f37cfd..c0e19d3a 100644
--- a/apps/ios/EdgeEver/Features/Workspace/SettingsView.swift
+++ b/apps/ios/EdgeEver/Features/Workspace/SettingsView.swift
@@ -571,22 +571,17 @@ struct SettingsView: View {
private var currentClientDisplaySize: String {
let scene = UIApplication.shared.connectedScenes.compactMap { $0 as? UIWindowScene }.first
let screen = scene?.screen ?? UIScreen.main
- let window = scene?.windows.first(where: \.isKeyWindow) ?? scene?.windows.first
- let windowSize = window?.bounds.size ?? screen.bounds.size
let screenWidth = Int(screen.bounds.width.rounded())
let screenHeight = Int(screen.bounds.height.rounded())
- let windowWidth = Int(windowSize.width.rounded())
- let windowHeight = Int(windowSize.height.rounded())
- guard screenWidth > 0, screenHeight > 0, windowWidth > 0, windowHeight > 0, screen.scale > 0 else {
+ guard screenWidth > 0, screenHeight > 0, screen.scale > 0 else {
return env.preferences.t("未知", en: "Unknown")
}
let screenText = "\(screenWidth)×\(screenHeight)"
- let windowText = "\(windowWidth)×\(windowHeight)"
let dpr = Self.formatDevicePixelRatio(screen.scale)
return env.preferences.t(
- "\(screenText) @\(dpr)x(窗口 \(windowText))",
- en: "\(screenText) @\(dpr)x (window \(windowText))",
- ja: "\(screenText) @\(dpr)x(ウィンドウ \(windowText))"
+ "\(screenText) @\(dpr)x",
+ en: "\(screenText) @\(dpr)x",
+ ja: "\(screenText) @\(dpr)x"
)
}
diff --git a/apps/mobile/src/screens/WorkspaceSettingsView.tsx b/apps/mobile/src/screens/WorkspaceSettingsView.tsx
index 6bcb38f5..043ca76d 100644
--- a/apps/mobile/src/screens/WorkspaceSettingsView.tsx
+++ b/apps/mobile/src/screens/WorkspaceSettingsView.tsx
@@ -541,7 +541,7 @@ const getMobileSystemInfoText = (localePreference: MobileLocaleMode) =>
requestLatency: "Health check time",
deviceModel: "Device model",
screenResolution: "Screen resolution",
- screenResolutionValue: "{{screen}} @{{dpr}}x (window {{windowSize}})",
+ screenResolutionValue: "{{screen}} @{{dpr}}x",
timeZone: "Time zone",
openUpdate: "Get update",
title: "System info",
@@ -588,7 +588,7 @@ const getMobileSystemInfoText = (localePreference: MobileLocaleMode) =>
requestLatency: "健康检查耗时",
deviceModel: "设备型号",
screenResolution: "屏幕分辨率",
- screenResolutionValue: "{{screen}} @{{dpr}}x(窗口 {{windowSize}})",
+ screenResolutionValue: "{{screen}} @{{dpr}}x",
timeZone: "时区",
openUpdate: "前往更新",
title: "系统信息",
@@ -740,8 +740,6 @@ const getMobileSystemInfoGroups = (
devicePixelRatio: PixelRatio.get(),
screenHeight: Dimensions.get("screen").height,
screenWidth: Dimensions.get("screen").width,
- windowHeight: Dimensions.get("window").height,
- windowWidth: Dimensions.get("window").width,
}, copy.screenResolutionValue) || copy.unknown,
},
{ label: copy.language, value: localePreference === "system" ? `${resolvedLocale} (${copy.followSystem})` : resolvedLocale },
diff --git a/apps/web/src/components/settings/SystemInfoPanel.test.mjs b/apps/web/src/components/settings/SystemInfoPanel.test.mjs
index 60652ca8..7ac7ff98 100644
--- a/apps/web/src/components/settings/SystemInfoPanel.test.mjs
+++ b/apps/web/src/components/settings/SystemInfoPanel.test.mjs
@@ -37,7 +37,7 @@ describe("system information diagnostic fields", () => {
expect(feedbackSource).toContain("clientRuntime: clientRuntimeQuery.data");
});
- test("includes current screen resolution with window size", () => {
+ test("includes current screen resolution", () => {
expect(source).toContain('t("systemInfo.screenResolution")');
expect(source).toContain('t("systemInfo.screenResolutionValue", parts)');
expect(source).toMatch(/systemInfo\.screenResolution[\s\S]{0,220}colSpan: "full"/);
diff --git a/apps/web/src/lib/system-diagnostics.ts b/apps/web/src/lib/system-diagnostics.ts
index c11a950c..2fe9c52d 100644
--- a/apps/web/src/lib/system-diagnostics.ts
+++ b/apps/web/src/lib/system-diagnostics.ts
@@ -70,8 +70,6 @@ export const readBrowserClientDisplaySize = (): ClientDisplaySizeInput | null =>
devicePixelRatio: Number(window.devicePixelRatio) || 1,
screenHeight: Number(screen.height),
screenWidth: Number(screen.width),
- windowHeight: Number(window.innerHeight),
- windowWidth: Number(window.innerWidth),
});
};
diff --git a/packages/shared/src/client-display-size.test.mjs b/packages/shared/src/client-display-size.test.mjs
index eb9d1ca3..35082c01 100644
--- a/packages/shared/src/client-display-size.test.mjs
+++ b/packages/shared/src/client-display-size.test.mjs
@@ -1,8 +1,7 @@
import { describe, expect, test } from "bun:test";
import { formatClientDisplaySize, formatDevicePixelRatio, getClientDisplaySizeParts, toDevicePixelScreenSize } from "./client-display-size";
-const chineseTemplate = "{{screen}} @{{dpr}}x(窗口 {{windowSize}})";
-const englishTemplate = "{{screen}} @{{dpr}}x (window {{windowSize}})";
+const template = "{{screen}} @{{dpr}}x";
describe("client display size formatting", () => {
test("exposes interpolation parts for localized system info", () => {
@@ -10,30 +9,23 @@ describe("client display size formatting", () => {
devicePixelRatio: 2,
screenHeight: 982,
screenWidth: 1512,
- windowHeight: 800,
- windowWidth: 1280,
})).toEqual({
dpr: "2",
screen: "1512×982",
- windowSize: "1280×800",
});
});
- test("formats screen size, device pixel ratio, and window size", () => {
+ test("formats screen size and device pixel ratio", () => {
expect(formatClientDisplaySize({
devicePixelRatio: 2,
screenHeight: 982,
screenWidth: 1512,
- windowHeight: 800,
- windowWidth: 1280,
- }, chineseTemplate)).toBe("1512×982 @2x(窗口 1280×800)");
+ }, template)).toBe("1512×982 @2x");
expect(formatClientDisplaySize({
devicePixelRatio: 1.25,
screenHeight: 1080,
screenWidth: 1920,
- windowHeight: 900,
- windowWidth: 1440,
- }, englishTemplate)).toBe("1920×1080 @1.25x (window 1440×900)");
+ }, template)).toBe("1920×1080 @1.25x");
});
test("rounds css pixels and trims integer device pixel ratios", () => {
@@ -44,32 +36,24 @@ describe("client display size formatting", () => {
devicePixelRatio: 2.0000001,
screenHeight: 981.4,
screenWidth: 1511.6,
- windowHeight: 799.6,
- windowWidth: 1279.4,
- }, chineseTemplate)).toBe("1512×981 @2x(窗口 1279×800)");
+ }, template)).toBe("1512×981 @2x");
});
- test("scales CSS screen size to device pixels and keeps window size in CSS pixels", () => {
+ test("scales CSS screen size to device pixels", () => {
expect(toDevicePixelScreenSize({
devicePixelRatio: 2,
screenHeight: 1080,
screenWidth: 1920,
- windowHeight: 925,
- windowWidth: 1920,
})).toEqual({
devicePixelRatio: 2,
screenHeight: 2160,
screenWidth: 3840,
- windowHeight: 925,
- windowWidth: 1920,
});
expect(formatClientDisplaySize(toDevicePixelScreenSize({
devicePixelRatio: 2,
screenHeight: 1080,
screenWidth: 1920,
- windowHeight: 925,
- windowWidth: 1920,
- }), chineseTemplate)).toBe("3840×2160 @2x(窗口 1920×925)");
+ }), template)).toBe("3840×2160 @2x");
});
test("returns null when a display metric is missing", () => {
@@ -77,9 +61,7 @@ describe("client display size formatting", () => {
devicePixelRatio: 2,
screenHeight: 982,
screenWidth: 0,
- windowHeight: 800,
- windowWidth: 1280,
- }, chineseTemplate)).toBeNull();
+ }, template)).toBeNull();
expect(formatDevicePixelRatio(0)).toBeNull();
expect(formatDevicePixelRatio(Number.NaN)).toBeNull();
});
diff --git a/packages/shared/src/client-display-size.ts b/packages/shared/src/client-display-size.ts
index 3bbe9125..07079110 100644
--- a/packages/shared/src/client-display-size.ts
+++ b/packages/shared/src/client-display-size.ts
@@ -2,14 +2,11 @@ export type ClientDisplaySizeInput = {
devicePixelRatio: number;
screenHeight: number;
screenWidth: number;
- windowHeight: number;
- windowWidth: number;
};
export type ClientDisplaySizeParts = {
dpr: string;
screen: string;
- windowSize: string;
};
const formatDisplayPixels = (value: number) => {
@@ -34,8 +31,6 @@ export const toDevicePixelScreenSize = (input: ClientDisplaySizeInput): ClientDi
devicePixelRatio: input.devicePixelRatio,
screenHeight: scaleCssPixelsToDevicePixels(input.screenHeight, input.devicePixelRatio),
screenWidth: scaleCssPixelsToDevicePixels(input.screenWidth, input.devicePixelRatio),
- windowHeight: input.windowHeight,
- windowWidth: input.windowWidth,
});
export const getClientDisplaySizeParts = (
@@ -43,14 +38,11 @@ export const getClientDisplaySizeParts = (
): ClientDisplaySizeParts | null => {
const screenWidth = formatDisplayPixels(input.screenWidth);
const screenHeight = formatDisplayPixels(input.screenHeight);
- const windowWidth = formatDisplayPixels(input.windowWidth);
- const windowHeight = formatDisplayPixels(input.windowHeight);
const dpr = formatDevicePixelRatio(input.devicePixelRatio);
- if (!screenWidth || !screenHeight || !windowWidth || !windowHeight || !dpr) return null;
+ if (!screenWidth || !screenHeight || !dpr) return null;
return {
dpr,
screen: `${screenWidth}×${screenHeight}`,
- windowSize: `${windowWidth}×${windowHeight}`,
};
};
@@ -62,6 +54,5 @@ export const formatClientDisplaySize = (
if (!parts) return null;
return template
.replaceAll("{{screen}}", parts.screen)
- .replaceAll("{{dpr}}", parts.dpr)
- .replaceAll("{{windowSize}}", parts.windowSize);
+ .replaceAll("{{dpr}}", parts.dpr);
};
diff --git a/packages/shared/src/i18n/en-US.ts b/packages/shared/src/i18n/en-US.ts
index 4c667254..b78e8b47 100644
--- a/packages/shared/src/i18n/en-US.ts
+++ b/packages/shared/src/i18n/en-US.ts
@@ -1192,7 +1192,7 @@ export const enUS = {
language: "Language",
timeZone: "Time zone",
screenResolution: "Screen resolution",
- screenResolutionValue: "{{screen}} @{{dpr}}x (window {{windowSize}})",
+ screenResolutionValue: "{{screen}} @{{dpr}}x",
deviceModel: "Device model",
instanceConnection: "Instance connection",
requestLatency: "Health check time",
diff --git a/packages/shared/src/i18n/ja.ts b/packages/shared/src/i18n/ja.ts
index 07ceb806..e26954aa 100644
--- a/packages/shared/src/i18n/ja.ts
+++ b/packages/shared/src/i18n/ja.ts
@@ -1192,7 +1192,7 @@ export const ja = {
language: "言語",
timeZone: "タイムゾーン",
screenResolution: "画面解像度",
- screenResolutionValue: "{{screen}} @{{dpr}}x(ウィンドウ {{windowSize}})",
+ screenResolutionValue: "{{screen}} @{{dpr}}x",
deviceModel: "機種",
instanceConnection: "インスタンス接続",
requestLatency: "ヘルスチェック時間",
diff --git a/packages/shared/src/i18n/zh-CN.ts b/packages/shared/src/i18n/zh-CN.ts
index 7ed821f7..cf404733 100644
--- a/packages/shared/src/i18n/zh-CN.ts
+++ b/packages/shared/src/i18n/zh-CN.ts
@@ -1192,7 +1192,7 @@ export const zhCN = {
language: "语言",
timeZone: "时区",
screenResolution: "屏幕分辨率",
- screenResolutionValue: "{{screen}} @{{dpr}}x(窗口 {{windowSize}})",
+ screenResolutionValue: "{{screen}} @{{dpr}}x",
deviceModel: "设备型号",
instanceConnection: "实例连接",
requestLatency: "健康检查耗时",