diff --git a/assets/Extensions/ApplicationSearch/macos-generic-app-icon.png b/assets/Extensions/ApplicationSearch/macos-generic-app-icon.png new file mode 100644 index 00000000..17ce0cf6 Binary files /dev/null and b/assets/Extensions/ApplicationSearch/macos-generic-app-icon.png differ diff --git a/assets/Extensions/ApplicationSearch/windows-applications.png b/assets/Extensions/ApplicationSearch/windows-applications.png new file mode 100644 index 00000000..f8b22656 Binary files /dev/null and b/assets/Extensions/ApplicationSearch/windows-applications.png differ diff --git a/assets/Extensions/ApplicationSearch/windows-generic-app-icon.png b/assets/Extensions/ApplicationSearch/windows-generic-app-icon.png new file mode 100644 index 00000000..9850a35c Binary files /dev/null and b/assets/Extensions/ApplicationSearch/windows-generic-app-icon.png differ diff --git a/src/common/Core/ContextBridge.ts b/src/common/Core/ContextBridge.ts index 9d09af63..18ad3bd8 100644 --- a/src/common/Core/ContextBridge.ts +++ b/src/common/Core/ContextBridge.ts @@ -11,6 +11,7 @@ export type ContextBridge = { on: IpcRenderer["on"]; }; + resetChache: () => Promise; copyTextToClipboard: (textToCopy: string) => void; extensionDisabled: (extensionId: string) => void; extensionEnabled: (extensionId: string) => void; diff --git a/src/main/Core/ExtensionManager/ExtensionManagerModule.ts b/src/main/Core/ExtensionManager/ExtensionManagerModule.ts index e15ad36b..ec85c01b 100644 --- a/src/main/Core/ExtensionManager/ExtensionManagerModule.ts +++ b/src/main/Core/ExtensionManager/ExtensionManagerModule.ts @@ -25,6 +25,11 @@ export class ExtensionManagerModule { await extensionManager.populateSearchIndex(); + ipcMain.handle("resetCache", async () => { + await dependencyRegistry.get("FileImageGenerator").clearCache(); + await extensionManager.populateSearchIndex(); + }); + ipcMain.on("getExtensionTranslations", (event) => { event.returnValue = extensionManager.getSupportedExtensions().map((extension) => ({ extensionId: extension.id, diff --git a/src/main/Core/FileSystemUtility/Contract/FileSystemUtility.ts b/src/main/Core/FileSystemUtility/Contract/FileSystemUtility.ts index 58517cc4..6909f432 100644 --- a/src/main/Core/FileSystemUtility/Contract/FileSystemUtility.ts +++ b/src/main/Core/FileSystemUtility/Contract/FileSystemUtility.ts @@ -1,5 +1,6 @@ export interface FileSystemUtility { createFolderIfDoesntExist(folderPath: string): Promise; + clearFolder(folderPath: string): Promise; pathExists(fileOrFolderPath: string): Promise; readJsonFile(filePath: string): Promise; readJsonFileSync(filePath: string): T; diff --git a/src/main/Core/FileSystemUtility/NodeJsFileSystemUtility.ts b/src/main/Core/FileSystemUtility/NodeJsFileSystemUtility.ts index f2fad984..969fbd20 100644 --- a/src/main/Core/FileSystemUtility/NodeJsFileSystemUtility.ts +++ b/src/main/Core/FileSystemUtility/NodeJsFileSystemUtility.ts @@ -5,14 +5,21 @@ import { mkdir, readFile, readFileSync, + readdir, statSync, unlink, writeFile, writeFileSync, } from "fs"; +import { join } from "path"; import type { FileSystemUtility } from "./Contract"; export class NodeJsFileSystemUtility implements FileSystemUtility { + public async clearFolder(folderPath: string): Promise { + const filePaths = await this.readDirectory(folderPath); + await Promise.all(filePaths.map((filePath) => this.removeFile(filePath))); + } + public async createFolderIfDoesntExist(folderPath: string): Promise { const exists = await this.pathExists(folderPath); @@ -110,4 +117,16 @@ export class NodeJsFileSystemUtility implements FileSystemUtility { private readFileSync(filePath: string): Buffer { return readFileSync(filePath); } + + private readDirectory(folderPath: string): Promise { + return new Promise((resolve, reject) => { + readdir(folderPath, (error, fileNames) => { + if (error) { + reject(error); + } else { + resolve(fileNames.map((fileName) => join(folderPath, fileName))); + } + }); + }); + } } diff --git a/src/main/Core/ImageGenerator/Contract/FileImageGenerator.ts b/src/main/Core/ImageGenerator/Contract/FileImageGenerator.ts index 02197ab1..6142267b 100644 --- a/src/main/Core/ImageGenerator/Contract/FileImageGenerator.ts +++ b/src/main/Core/ImageGenerator/Contract/FileImageGenerator.ts @@ -2,4 +2,5 @@ import type { Image } from "@common/Core/Image"; export interface FileImageGenerator { getImage(filePath: string): Promise; + clearCache: () => Promise; } diff --git a/src/main/Core/ImageGenerator/FileImageGenerator.test.ts b/src/main/Core/ImageGenerator/FileImageGenerator.test.ts index 33dddb9c..56448fa2 100644 --- a/src/main/Core/ImageGenerator/FileImageGenerator.test.ts +++ b/src/main/Core/ImageGenerator/FileImageGenerator.test.ts @@ -8,6 +8,32 @@ import { FileImageGenerator } from "./FileImageGenerator"; describe(FileImageGenerator, () => { const cacheFolderPath = "cacheFolderPath"; + it("should clear cache folder if it exists", async () => { + const pathExistsMock = vi.fn().mockReturnValue(true); + const clearFolderMock = vi.fn().mockReturnValue(Promise.resolve()); + + const fileSystemUtility = { + pathExists: (f) => pathExistsMock(f), + clearFolder: (f) => clearFolderMock(f), + }; + + const fileImageGenerator = new FileImageGenerator(cacheFolderPath, fileSystemUtility); + + await fileImageGenerator.clearCache(); + expect(pathExistsMock).toHaveBeenCalledWith(cacheFolderPath); + expect(clearFolderMock).toHaveBeenCalledWith(cacheFolderPath); + }); + + it("should do nothing if cache folder does not exist", async () => { + const pathExistsMock = vi.fn().mockReturnValue(false); + const fileSystemUtility = { pathExists: (f) => pathExistsMock(f) }; + + const fileImageGenerator = new FileImageGenerator(cacheFolderPath, fileSystemUtility); + + await fileImageGenerator.clearCache(); + expect(pathExistsMock).toHaveBeenCalledWith(cacheFolderPath); + }); + it("should create the cached file if it doesn't exist and return the image", async () => { const pathExistsMock = vi.fn().mockReturnValue(false); const writePngMock = vi.fn().mockReturnValue(Promise.resolve()); diff --git a/src/main/Core/ImageGenerator/FileImageGenerator.ts b/src/main/Core/ImageGenerator/FileImageGenerator.ts index 8b9bf630..07ff4c81 100644 --- a/src/main/Core/ImageGenerator/FileImageGenerator.ts +++ b/src/main/Core/ImageGenerator/FileImageGenerator.ts @@ -11,6 +11,14 @@ export class FileImageGenerator implements FileImageGeneratorInterface { private readonly fileSystemUtility: FileSystemUtility, ) {} + public async clearCache(): Promise { + const exists = await this.fileSystemUtility.pathExists(this.cacheFolderPath); + + if (exists) { + await this.fileSystemUtility.clearFolder(this.cacheFolderPath); + } + } + public async getImage(filePath: string): Promise { const cachedPngFilePath = await this.ensureCachedPngFileExists(filePath); @@ -23,7 +31,13 @@ export class FileImageGenerator implements FileImageGeneratorInterface { const exists = await this.fileSystemUtility.pathExists(cachedPngFilePath); if (!exists) { - await this.fileSystemUtility.writePng(getFileIcon(filePath), cachedPngFilePath); + const buffer = getFileIcon(filePath); + + if (!buffer.byteLength) { + throw new Error(`getFileIcon returned Buffer with length 0`); + } + + await this.fileSystemUtility.writePng(buffer, cachedPngFilePath); } return cachedPngFilePath; diff --git a/src/main/Core/Logger/Logger.test.ts b/src/main/Core/Logger/Logger.test.ts index 6858615a..27ff9942 100644 --- a/src/main/Core/Logger/Logger.test.ts +++ b/src/main/Core/Logger/Logger.test.ts @@ -1,3 +1,4 @@ +import type { BrowserWindowNotifier } from "@Core/BrowserWindowNotifier"; import type { Clock } from "@Core/Clock/Clock"; import { describe, expect, it, vi } from "vitest"; import { Logger } from "./Logger"; @@ -7,45 +8,65 @@ describe(Logger, () => { it("should log an error", () => { const getCurrentTimeAsStringMock = vi.fn().mockReturnValue(nowAsString); + const notifyMock = vi.fn(); - const logger = new Logger({ getCurrentTimeAsString: () => getCurrentTimeAsStringMock() }); + const logger = new Logger( + { getCurrentTimeAsString: () => getCurrentTimeAsStringMock() }, + { notify: (c) => notifyMock(c) }, + ); logger.error("This is an error"); expect(logger.getLogs()).toEqual([`[${nowAsString}][ERROR] This is an error`]); expect(getCurrentTimeAsStringMock).toHaveBeenCalledOnce(); + expect(notifyMock).toHaveBeenCalledWith("logsUpdated"); }); it("should log a debug message", () => { const getCurrentTimeAsStringMock = vi.fn().mockReturnValue(nowAsString); + const notifyMock = vi.fn(); - const logger = new Logger({ getCurrentTimeAsString: () => getCurrentTimeAsStringMock() }); + const logger = new Logger( + { getCurrentTimeAsString: () => getCurrentTimeAsStringMock() }, + { notify: (c) => notifyMock(c) }, + ); logger.debug("This is a debug message"); expect(logger.getLogs()).toEqual([`[${nowAsString}][DEBUG] This is a debug message`]); expect(getCurrentTimeAsStringMock).toHaveBeenCalledOnce(); + expect(notifyMock).toHaveBeenCalledWith("logsUpdated"); }); it("should log a info message", () => { const getCurrentTimeAsStringMock = vi.fn().mockReturnValue(nowAsString); + const notifyMock = vi.fn(); - const logger = new Logger({ getCurrentTimeAsString: () => getCurrentTimeAsStringMock() }); + const logger = new Logger( + { getCurrentTimeAsString: () => getCurrentTimeAsStringMock() }, + { notify: (c) => notifyMock(c) }, + ); logger.info("This is a info message"); expect(logger.getLogs()).toEqual([`[${nowAsString}][INFO] This is a info message`]); expect(getCurrentTimeAsStringMock).toHaveBeenCalledOnce(); + expect(notifyMock).toHaveBeenCalledWith("logsUpdated"); }); it("should log a warning", () => { const getCurrentTimeAsStringMock = vi.fn().mockReturnValue(nowAsString); + const notifyMock = vi.fn(); - const logger = new Logger({ getCurrentTimeAsString: () => getCurrentTimeAsStringMock() }); + const logger = new Logger( + { getCurrentTimeAsString: () => getCurrentTimeAsStringMock() }, + { notify: (c) => notifyMock(c) }, + ); logger.warn("This is a warning"); expect(logger.getLogs()).toEqual([`[${nowAsString}][WARNING] This is a warning`]); expect(getCurrentTimeAsStringMock).toHaveBeenCalledOnce(); + expect(notifyMock).toHaveBeenCalledWith("logsUpdated"); }); }); diff --git a/src/main/Core/Logger/Logger.ts b/src/main/Core/Logger/Logger.ts index 29a7f624..4ac333e6 100644 --- a/src/main/Core/Logger/Logger.ts +++ b/src/main/Core/Logger/Logger.ts @@ -1,10 +1,14 @@ +import type { BrowserWindowNotifier } from "@Core/BrowserWindowNotifier"; import type { Clock } from "../Clock"; import type { Logger as LoggerInterface } from "./Contract"; export class Logger implements LoggerInterface { private logs: string[] = []; - public constructor(private readonly clock: Clock) {} + public constructor( + private readonly clock: Clock, + private readonly browserWindowNotifier: BrowserWindowNotifier, + ) {} public error(message: string): void { this.writeLog("ERROR", message); @@ -28,5 +32,6 @@ export class Logger implements LoggerInterface { private writeLog(logLevel: string, message: string) { this.logs.push(`[${this.clock.getCurrentTimeAsString()}][${logLevel}] ${message}`); + this.browserWindowNotifier.notify("logsUpdated"); } } diff --git a/src/main/Core/Logger/LoggerModule.ts b/src/main/Core/Logger/LoggerModule.ts index 29eb46cb..07ca0db9 100644 --- a/src/main/Core/Logger/LoggerModule.ts +++ b/src/main/Core/Logger/LoggerModule.ts @@ -5,9 +5,8 @@ import { Logger } from "./Logger"; export class LoggerModule { public static bootstrap(dependencyRegistry: DependencyRegistry) { const ipcMain = dependencyRegistry.get("IpcMain"); - const clock = dependencyRegistry.get("Clock"); - const logger = new Logger(clock); + const logger = new Logger(dependencyRegistry.get("Clock"), dependencyRegistry.get("BrowserWindowNotifier")); dependencyRegistry.register("Logger", logger); ipcMain.on("getLogs", (event) => (event.returnValue = logger.getLogs())); diff --git a/src/main/Extensions/ApplicationSearch/ApplicationSearch.ts b/src/main/Extensions/ApplicationSearch/ApplicationSearch.ts index 71ea1e05..ae04a5ab 100644 --- a/src/main/Extensions/ApplicationSearch/ApplicationSearch.ts +++ b/src/main/Extensions/ApplicationSearch/ApplicationSearch.ts @@ -21,7 +21,7 @@ export class ApplicationSearch implements Extension { }; public constructor( - private readonly currentOperatingSystem: OperatingSystem, + private readonly operatingSystem: OperatingSystem, private readonly applicationRepository: ApplicationRepository, private readonly settings: Settings, private readonly assetPathResolver: AssetPathResolver, @@ -34,7 +34,7 @@ export class ApplicationSearch implements Extension { public isSupported(): boolean { const supportedOperatingSystems: OperatingSystem[] = ["Windows", "macOS"]; - return supportedOperatingSystems.includes(this.currentOperatingSystem); + return supportedOperatingSystems.includes(this.operatingSystem); } public getSettingDefaultValue(key: string): T { @@ -51,8 +51,14 @@ export class ApplicationSearch implements Extension { } public getImage(): Image { + const fileNames: Record = { + Linux: null, // not supported, + macOS: "macos-applications.png", + Windows: "windows-applications.png", + }; + return { - url: `file://${this.assetPathResolver.getExtensionAssetPath(this.id, "macos-applications.png")}`, + url: `file://${this.assetPathResolver.getExtensionAssetPath(this.id, fileNames[this.operatingSystem])}`, }; } diff --git a/src/main/Extensions/ApplicationSearch/ApplicationSearchModule.ts b/src/main/Extensions/ApplicationSearch/ApplicationSearchModule.ts index 8703a704..f2bc57b2 100644 --- a/src/main/Extensions/ApplicationSearch/ApplicationSearchModule.ts +++ b/src/main/Extensions/ApplicationSearch/ApplicationSearchModule.ts @@ -23,12 +23,14 @@ export class ApplicationSearchModule implements ExtensionModule { dependencyRegistry.get("FileImageGenerator"), dependencyRegistry.get("Logger"), settings, + dependencyRegistry.get("AssetPathResolver"), ), Windows: new WindowsApplicationRepository( dependencyRegistry.get("PowershellUtility"), settings, dependencyRegistry.get("FileImageGenerator"), dependencyRegistry.get("Logger"), + dependencyRegistry.get("AssetPathResolver"), ), Linux: undefined, // not supported }; diff --git a/src/main/Extensions/ApplicationSearch/Windows/WindowsApplicationRepository.ts b/src/main/Extensions/ApplicationSearch/Windows/WindowsApplicationRepository.ts index 37e6dbba..05408257 100644 --- a/src/main/Extensions/ApplicationSearch/Windows/WindowsApplicationRepository.ts +++ b/src/main/Extensions/ApplicationSearch/Windows/WindowsApplicationRepository.ts @@ -1,3 +1,4 @@ +import type { AssetPathResolver } from "@Core/AssetPathResolver"; import type { FileImageGenerator } from "@Core/ImageGenerator"; import type { Logger } from "@Core/Logger"; import type { PowershellUtility } from "@Core/PowershellUtility"; @@ -15,6 +16,7 @@ export class WindowsApplicationRepository implements ApplicationRepository { private readonly settings: Settings, private readonly fileImageGenerator: FileImageGenerator, private readonly logger: Logger, + private readonly assetPathResolver: AssetPathResolver, ) {} public async getApplications(): Promise { @@ -40,7 +42,14 @@ export class WindowsApplicationRepository implements ApplicationRepository { const appIcons = await this.getAppIcons(windowsApplicationRetrieverResults.map(({ FullName }) => FullName)); return windowsApplicationRetrieverResults.map( - ({ BaseName, FullName }) => new Application(BaseName, FullName, appIcons[FullName]), + ({ BaseName, FullName }) => + new Application( + BaseName, + FullName, + appIcons[FullName] ?? { + url: `file://${this.assetPathResolver.getExtensionAssetPath("ApplicationSearch", "windows-generic-app-icon.png")}`, + }, + ), ); } diff --git a/src/main/Extensions/ApplicationSearch/macOS/MacOsApplicationRepository.ts b/src/main/Extensions/ApplicationSearch/macOS/MacOsApplicationRepository.ts index 1d98409d..8d19d8ae 100644 --- a/src/main/Extensions/ApplicationSearch/macOS/MacOsApplicationRepository.ts +++ b/src/main/Extensions/ApplicationSearch/macOS/MacOsApplicationRepository.ts @@ -1,3 +1,4 @@ +import type { AssetPathResolver } from "@Core/AssetPathResolver"; import type { CommandlineUtility } from "@Core/CommandlineUtility"; import type { FileImageGenerator } from "@Core/ImageGenerator"; import type { Logger } from "@Core/Logger"; @@ -13,6 +14,7 @@ export class MacOsApplicationRepository implements ApplicationRepository { private readonly fileImageGenerator: FileImageGenerator, private readonly logger: Logger, private readonly settings: Settings, + private readonly assetPathResolver: AssetPathResolver, ) {} public async getApplications(): Promise { @@ -21,7 +23,16 @@ export class MacOsApplicationRepository implements ApplicationRepository { return filePaths .filter((filePath) => !!icons[filePath]) - .map((filePath) => new Application(parse(filePath).name, filePath, icons[filePath])); + .map( + (filePath) => + new Application( + parse(filePath).name, + filePath, + icons[filePath] ?? { + url: `file://${this.assetPathResolver.getExtensionAssetPath("ApplicationSearch", "macos-generic-app-icon.png")}`, + }, + ), + ); } private async getAllFilePaths(): Promise { diff --git a/src/main/index.ts b/src/main/index.ts index 5f756237..7ff09243 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -26,6 +26,8 @@ import * as Extensions from "./Extensions"; dependencyRegistry.register("SafeStorage", Electron.safeStorage); // Core Modules + Core.EventEmitterModule.bootstrap(dependencyRegistry); + Core.EventSubscriberModule.bootstrap(dependencyRegistry); Core.RandomStringProviderModule.bootstrap(dependencyRegistry); Core.SafeStorageEncryptionModule.bootstrap(dependencyRegistry); Core.AssetPathResolverModule.bootstrap(dependencyRegistry); @@ -33,10 +35,8 @@ import * as Extensions from "./Extensions"; Core.ClipboardModule.bootstrap(dependencyRegistry); Core.ClockModule.bootstrap(dependencyRegistry); Core.AboutUeliModule.bootstrap(dependencyRegistry); - Core.LoggerModule.bootstrap(dependencyRegistry); - Core.EventEmitterModule.bootstrap(dependencyRegistry); - Core.EventSubscriberModule.bootstrap(dependencyRegistry); Core.BrowserWindowNotifierModule.bootstrap(dependencyRegistry); + Core.LoggerModule.bootstrap(dependencyRegistry); Core.CommandlineUtilityModule.bootstrap(dependencyRegistry); Core.FileSystemUtilityModule.bootstrap(dependencyRegistry); await Core.PowershellUtilityModule.bootstrap(dependencyRegistry); diff --git a/src/preload/index.ts b/src/preload/index.ts index f812abd4..d6911726 100644 --- a/src/preload/index.ts +++ b/src/preload/index.ts @@ -6,6 +6,7 @@ const contextBridgeImplementation: ContextBridge = { on: (channel, listener) => ipcRenderer.on(channel, listener), }, + resetChache: () => ipcRenderer.invoke("resetCache"), copyTextToClipboard: (textToCopy) => ipcRenderer.send("copyTextToClipboard", { textToCopy }), extensionDisabled: (extensionId) => ipcRenderer.send("extensionDisabled", { extensionId }), extensionEnabled: (extensionId) => ipcRenderer.send("extensionEnabled", { extensionId }), diff --git a/src/renderer/Core/I18n/getCoreTranslations.ts b/src/renderer/Core/I18n/getCoreTranslations.ts index 760dd506..c3124839 100644 --- a/src/renderer/Core/I18n/getCoreTranslations.ts +++ b/src/renderer/Core/I18n/getCoreTranslations.ts @@ -102,7 +102,16 @@ export const getCoreTranslations = (): { namespace: string; translations: Transl translations: { "en-US": { title: "Debug", + resetCache: "Reset cache", + resetCacheHint: "This might help when troubleshooting issues with icons.", + resettingCache: "Resetting cache...", + resetCacheDialogTitle: "Are you sure?", + resetCacheDialogContent: "You are about to reset the cache. This might take a few seconds.", + resetCacheCancel: "Cancel", + resetCacheConfirm: "Reset Cache", resetAllSettings: "Reset all settings", + resetAllSettingsHint: + "This resets all settings to their default values. You will lose all settings that you changed.", resetAllSettingsButton: "Reset", resetAllSettingsDialogTitle: "Are you sure?", resetAllSettingsDialogContent: "You are about to reset all settings to their default values.", @@ -111,7 +120,17 @@ export const getCoreTranslations = (): { namespace: string; translations: Transl }, "de-CH": { title: "Fehlerbehebung", + resetCache: "Zwischenspeicher zurücksetzen", + resetCacheHint: "Dies kann bei der Behebung von Problemen mit Symbolen hilfreich sein.", + resettingCache: "Zwischenspeicher wird zurückgesetzt...", + resetCacheDialogTitle: "Bist du sicher?", + resetCacheDialogContent: + "Du bist dabei, den Cache zurückzusetzen. Dies kann ein paar Sekunden dauern.", + resetCacheCancel: "Abbrechen", + resetCacheConfirm: "Zwischenspeicher zurücksetzen", resetAllSettings: "Alle Einstellungen zurücksetzen", + resetAllSettingsHint: + "Dadurch werden alle Einstellungen auf ihre Standardwerte zurückgesetzt. Du verlierst alle Einstellungen, die du geändert hast.", resetAllSettingsButton: "Zurücksetzen", resetAllSettingsDialogTitle: "Bist du sicher?", resetAllSettingsDialogContent: diff --git a/src/renderer/Core/Search/FavoritesList.tsx b/src/renderer/Core/Search/FavoritesList.tsx index 80483c6f..2b8b305b 100644 --- a/src/renderer/Core/Search/FavoritesList.tsx +++ b/src/renderer/Core/Search/FavoritesList.tsx @@ -53,7 +53,7 @@ export const FavoritesList = ({ invokeSearchResultItem }: FavoritesListProps) => style={{ width: "100%" }} src={getImageUrl({ image: searchResultItem.image, - onDarkBackground: contextBridge.themeShouldUseDarkColors(), + shouldPreferDarkColors: contextBridge.themeShouldUseDarkColors(), })} alt="App Name Document" /> diff --git a/src/renderer/Core/Search/SearchResultListItem.tsx b/src/renderer/Core/Search/SearchResultListItem.tsx index aa00d3f2..bee313a2 100644 --- a/src/renderer/Core/Search/SearchResultListItem.tsx +++ b/src/renderer/Core/Search/SearchResultListItem.tsx @@ -103,7 +103,7 @@ export const SearchResultListItem = ({ }} src={getImageUrl({ image: searchResultItem.image, - onDarkBackground: contextBridge.themeShouldUseDarkColors(), + shouldPreferDarkColors: contextBridge.themeShouldUseDarkColors(), })} /> diff --git a/src/renderer/Core/Settings/Navigation.tsx b/src/renderer/Core/Settings/Navigation.tsx index be3888ab..cec8baaf 100644 --- a/src/renderer/Core/Settings/Navigation.tsx +++ b/src/renderer/Core/Settings/Navigation.tsx @@ -58,7 +58,7 @@ export const Navigation = ({ settingsPages, enabledExtensions }: NavigationProps style={{ maxWidth: "100%", maxHeight: "100%" }} src={getImageUrl({ image: e.image, - onDarkBackground: contextBridge.themeShouldUseDarkColors(), + shouldPreferDarkColors: contextBridge.themeShouldUseDarkColors(), })} /> diff --git a/src/renderer/Core/Settings/Pages/Debug.tsx b/src/renderer/Core/Settings/Pages/Debug.tsx deleted file mode 100644 index cc9d3c29..00000000 --- a/src/renderer/Core/Settings/Pages/Debug.tsx +++ /dev/null @@ -1,73 +0,0 @@ -import { - Button, - Dialog, - DialogActions, - DialogBody, - DialogContent, - DialogSurface, - DialogTitle, - DialogTrigger, - Field, -} from "@fluentui/react-components"; -import { useTranslation } from "react-i18next"; -import { useContextBridge, useTheme } from "../../Hooks"; -import { Section } from "../Section"; -import { SectionList } from "../SectionList"; - -export const Debug = () => { - const { t } = useTranslation(); - const ns = "settingsDebug"; - const { contextBridge } = useContextBridge(); - const { theme } = useTheme(); - - return ( - -
- - - -
- -
-
- - - {t("resetAllSettingsDialogTitle", { ns })} - {t("resetAllSettingsDialogContent", { ns })} - - - - - - - - -
-
-
-
- -