From 11ba2fb3b90714a1ee57df92dddc2b53f253dfd5 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Wed, 24 Dec 2025 23:34:38 +0100 Subject: [PATCH] init super basic recovery ui --- src/main/recoveryMode.ts | 27 ++++++++++++++++++++ src/main/tray.ts | 10 +++----- static/views/common.css | 31 +++++++++++++++++++++++ static/views/first-launch.html | 4 +-- static/views/recovery.html | 45 +++++++++++++++++++++++++++++++++ static/views/updater/index.html | 6 ++--- static/views/updater/style.css | 26 +------------------ 7 files changed, 112 insertions(+), 37 deletions(-) create mode 100644 src/main/recoveryMode.ts create mode 100644 static/views/recovery.html diff --git a/src/main/recoveryMode.ts b/src/main/recoveryMode.ts new file mode 100644 index 00000000..e37d9e1f --- /dev/null +++ b/src/main/recoveryMode.ts @@ -0,0 +1,27 @@ +/* + * Vesktop, a desktop app aiming to give you a snappier Discord Experience + * Copyright (c) 2025 Vendicated and Vesktop contributors + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +import { BrowserWindow } from "electron"; + +import { loadView } from "./vesktopStatic"; + +export function createRecoveryModeWindow() { + const width = 650; + const height = width * (9 / 16); + + const win = new BrowserWindow({ + center: true, + autoHideMenuBar: true, + height, + width, + resizable: false, + webPreferences: { + nodeIntegration: true + } + }); + + loadView(win, "recovery.html"); +} diff --git a/src/main/tray.ts b/src/main/tray.ts index f58a7196..2b0aa61a 100644 --- a/src/main/tray.ts +++ b/src/main/tray.ts @@ -8,10 +8,10 @@ import { app, BrowserWindow, Menu, Tray } from "electron"; import { createAboutWindow } from "./about"; import { AppEvents } from "./events"; +import { createRecoveryModeWindow } from "./recoveryMode"; import { Settings } from "./settings"; import { resolveAssetPath } from "./userAssets"; import { clearData } from "./utils/clearData"; -import { downloadVencordFiles } from "./utils/vencordLoader"; let tray: Tray; let trayVariant: "tray" | "trayUnread" = "tray"; @@ -53,12 +53,8 @@ export async function initTray(win: BrowserWindow, setIsQuitting: (val: boolean) click: createAboutWindow }, { - label: "Repair Vencord", - async click() { - await downloadVencordFiles(); - app.relaunch(); - app.quit(); - } + label: "Recovery Mode", + click: createRecoveryModeWindow }, { label: "Reset Vesktop", diff --git a/static/views/common.css b/static/views/common.css index 3b1468d9..5f24e493 100644 --- a/static/views/common.css +++ b/static/views/common.css @@ -7,6 +7,9 @@ --fg-semi-trans: light-dark(rgb(0 0 0 / 0.2), rgb(255 255 255 / 0.2)); --link: light-dark(#006ce7, #00a8fc); --link-hover: light-dark(#005bb5, #0086c3); + + --green: oklab(0.525938 -0.120357 0.0608586); + --red: #d22d39; } html, @@ -29,4 +32,32 @@ a { a:hover { color: var(--link-hover); +} + +.button { + cursor: pointer; + padding: 0.5rem 1rem; + font-size: 1.2em; + color: var(--fg); + border: none; + border-radius: 3px; + font-weight: bold; + transition: filter 0.2 ease-in-out; + + &:hover, + &:active { + filter: brightness(0.9); + } + + &.green { + background-color: var(--green); + } + + &.grey { + background-color: #97979f1f; + } + + &.red { + background-color: var(--red); + } } \ No newline at end of file diff --git a/static/views/first-launch.html b/static/views/first-launch.html index 85265f0d..cf6fbd77 100644 --- a/static/views/first-launch.html +++ b/static/views/first-launch.html @@ -90,7 +90,7 @@ button { padding: 0.6em; - background: red; + background: var(--red); color: white; border-radius: 6px; border: none; @@ -103,7 +103,7 @@ } #submit { - background: green; + background: var(--green); } diff --git a/static/views/recovery.html b/static/views/recovery.html new file mode 100644 index 00000000..166f54e9 --- /dev/null +++ b/static/views/recovery.html @@ -0,0 +1,45 @@ + + + + + Vesktop Recovery Mode + + + + + + + +

Vesktop Recovery Mode

+ +
+ + + + +
+ + + \ No newline at end of file diff --git a/static/views/updater/index.html b/static/views/updater/index.html index e9111001..f326c4cd 100644 --- a/static/views/updater/index.html +++ b/static/views/updater/index.html @@ -30,9 +30,9 @@ diff --git a/static/views/updater/style.css b/static/views/updater/style.css index 97db89f9..ecdad974 100644 --- a/static/views/updater/style.css +++ b/static/views/updater/style.css @@ -61,30 +61,6 @@ body { justify-content: end; } -button { - cursor: pointer; - padding: 0.5rem 1rem; - font-size: 1.2em; - color: var(--fg); - border: none; - border-radius: 3px; - font-weight: bold; - transition: filter 0.2 ease-in-out; -} - -button:hover, -button:active { - filter: brightness(0.9); -} - -.green { - background-color: #248046; -} - -.grey { - background-color: rgba(151, 151, 159, 0.12); -} - .hidden { display: none; } @@ -118,7 +94,7 @@ progress { } #error { - color: red; + color: var(--red); font-weight: bold; }