feat(account): polish reviews favorites and account UI

This commit is contained in:
2026-05-29 21:34:42 +08:00
parent abeb511c06
commit 439af8c26f
40 changed files with 3158 additions and 250 deletions
+22
View File
@@ -249,6 +249,7 @@ async function createWindow() {
title: "星火应用商店",
width: 1366,
height: 768,
frame: false,
autoHideMenuBar: true,
icon: path.join(process.env.VITE_PUBLIC, "favicon.ico"),
webPreferences: {
@@ -307,6 +308,27 @@ ipcMain.on("set-theme-source", (event, theme: "system" | "light" | "dark") => {
nativeTheme.themeSource = theme;
});
ipcMain.on("window-control-minimize", () => {
win?.minimize();
});
ipcMain.on("window-control-toggle-maximize", () => {
if (!win) {
return;
}
if (win.isMaximized()) {
win.unmaximize();
return;
}
win.maximize();
});
ipcMain.on("window-control-close", () => {
win?.close();
});
// 配置文件路径
const SPARK_CONFIG_DIR = path.join(
os.homedir(),
+12
View File
@@ -42,6 +42,12 @@ type IpcRendererFacade = {
invoke: typeof ipcRenderer.invoke;
};
type WindowControlBridge = {
minimize: () => void;
toggleMaximize: () => void;
close: () => void;
};
type UpdateCenterStateListener = (snapshot: UpdateCenterSnapshot) => void;
type UpdateCenterStartTask = {
taskKey: string;
@@ -91,6 +97,12 @@ contextBridge.exposeInMainWorld("apm_store", {
})(),
});
contextBridge.exposeInMainWorld("windowControls", {
minimize: () => ipcRenderer.send("window-control-minimize"),
toggleMaximize: () => ipcRenderer.send("window-control-toggle-maximize"),
close: () => ipcRenderer.send("window-control-close"),
} satisfies WindowControlBridge);
contextBridge.exposeInMainWorld("updateCenter", {
open: (storeFilter: StoreFilter = "both"): Promise<UpdateCenterSnapshot> =>
ipcRenderer.invoke("update-center-open", storeFilter),