Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions apps/desktop/src/main/runtime-host-quit-copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import type { UiLocale } from '@maka/core/ui-locale';
import type { UiCatalog, UiLocale } from '@maka/core/ui-locale';
import type { MessageBoxOptions } from 'electron';

export interface RuntimeHostQuitDialog<Decision extends string> {
Expand Down Expand Up @@ -46,6 +46,14 @@ export function buildRuntimeHostActiveQuitDialog(
};
}

interface RuntimeHostQuitCopy {
readonly activeTitle: string;
readonly activeMessage: string;
readonly activeDetail: string;
readonly stopAndQuit: string;
readonly keepRunning: string;
}

const COPY = {
en: {
activeTitle: 'Maka is still working',
Expand All @@ -71,4 +79,4 @@ const COPY = {
stopAndQuit: '停止工作並結束',
keepRunning: '繼續執行 Maka',
},
} as const;
} satisfies UiCatalog<RuntimeHostQuitCopy>;
12 changes: 10 additions & 2 deletions apps/desktop/src/main/runtime-host-wsl-handoff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import type { UiLocale } from '@maka/core/ui-locale';
import type { UiCatalog, UiLocale } from '@maka/core/ui-locale';
import type { EnvironmentRuntimeHostProfile, HostHandoffBlocker, HostHandoffPhase, RuntimeHostRemoteCompatibilityError } from '@maka/runtime-host/client';
import { compareProductReleaseVersions } from '@maka/runtime-host/operator';
import type { DesktopRuntimeHostManagedServiceBinding } from './runtime-host-managed-services.js';
Expand Down Expand Up @@ -110,6 +110,14 @@ export async function resolveDesktopWslHostHandoff(
}


interface WslHandoffGuidance {
readonly client: string;
readonly binding: string;
readonly source: string;
readonly target: string;
readonly development: string;
}

const GUIDANCE = {
en: {
client: 'Update Desktop to a build compatible with this Host. The Host will not be downgraded.',
Expand All @@ -132,4 +140,4 @@ const GUIDANCE = {
target: '目前 Desktop 無法驗證合適的替換套件。請更新 Desktop,或透過開發環境明確管理選定的開發套件;現有 Host 會被保留。',
development: '選定的開發構建',
},
} as const;
} satisfies UiCatalog<WslHandoffGuidance>;
15 changes: 13 additions & 2 deletions apps/desktop/src/main/startup-progress-window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import { randomUUID } from 'node:crypto';
import { MAKA_WORDMARK_PATH } from '@maka/core/maka-wordmark';
import type { UiLocale } from '@maka/core/ui-locale';
import type { UiCatalog, UiLocale } from '@maka/core/ui-locale';
import { formatHostHandoff, type HostHandoffView, type HostHandoffAction } from '@maka/runtime-host/client';
import type { BrowserWindow, BrowserWindowConstructorOptions } from 'electron';

Expand All @@ -28,6 +28,17 @@ export type StartupPhase =
| 'checking' | 'staging' | 'retiring' | 'replacing' | 'restart'
| 'attention' | 'renderer';

interface StartupProgressCopy {
readonly title: string;
readonly detail: string;
readonly slow: string;
readonly copy: string;
readonly copied: string;
readonly copyFailed: string;
readonly elapsed: string;
readonly phases: Record<StartupPhase, string>;
}

const COPY = {
en: {
title: 'Opening your workspace',
Expand Down Expand Up @@ -67,7 +78,7 @@ const COPY = {
attention: '等待你的確認', renderer: '正在開啟工作區',
},
},
} as const;
} satisfies UiCatalog<StartupProgressCopy>;

export interface StartupProgressWindow {
update(phase: StartupPhase): void;
Expand Down
9 changes: 8 additions & 1 deletion apps/desktop/src/main/windows-app-tray.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

import type { Menu, MenuItemConstructorOptions, Tray } from 'electron';
import type { UiCatalog } from '@maka/core/ui-locale';
import type { DesktopLocaleAuthority } from './desktop-locale-authority.js';

type TraySurface = Pick<Tray, 'setToolTip' | 'setContextMenu' | 'on' | 'destroy' | 'isDestroyed'>;
Expand All @@ -33,11 +34,17 @@ interface WindowsAppTrayDeps {
onError(error: unknown): void;
}

interface WindowsAppTrayCopy {
readonly open: string;
readonly workHub: string;
readonly quit: string;
}

const copy = {
en: { open: 'Open Maka', workHub: 'Open WorkHub', quit: 'Quit Maka' },
'zh-CN': { open: '打开 Maka', workHub: '打开 WorkHub', quit: '退出 Maka' },
'zh-TW': { open: '開啟 Maka', workHub: '開啟 WorkHub', quit: '結束 Maka' },
};
} satisfies UiCatalog<WindowsAppTrayCopy>;

/** Windows needs a visible way back after the last product window closes. */
export function createWindowsAppTray(deps: WindowsAppTrayDeps) {
Expand Down