feat: performance and visual improvements

This commit is contained in:
SethBurkart123
2025-06-06 10:16:42 +10:00
parent e94008efba
commit 074c2ff4bb
4 changed files with 15 additions and 15 deletions
+7 -6
View File
@@ -11,6 +11,7 @@ import type {
import { eventManager } from "@/seqta/utils/listeners/EventManager";
import ReactFiber from "@/seqta/utils/ReactFiber";
import browser from "webextension-polyfill";
import { settingsState } from "@/seqta/utils/listeners/SettingsState";
function createSEQTAAPI(): SEQTAAPI {
return {
@@ -115,16 +116,16 @@ function createSettingsAPI<T extends PluginSettings>(
// Fill with defaults first
for (const key in plugin.settings) {
settingsWithMeta[key] = plugin.settings[key].default;
if (plugin.settings[key].type !== 'component' && plugin.settings[key].type !== 'button') {
settingsWithMeta[key] = plugin.settings[key].default;
}
}
// Load stored settings and override defaults
const loaded = (async () => {
try {
const stored = await browser.storage.local.get(storageKey);
const storedSettings = stored[storageKey] as Partial<
Record<keyof T, any>
>;
const allSettings = settingsState.getAll() as unknown as Record<string, unknown>;
const storedSettings = allSettings[storageKey] as Partial<Record<keyof T, any>>;
if (storedSettings) {
for (const key in storedSettings) {
if (key in settingsWithMeta) {
@@ -205,7 +206,7 @@ function createStorageAPI<T = any>(
// Load all existing storage values for this plugin
const loadStoragePromise = (async () => {
try {
const allStorage = await browser.storage.local.get(null);
const allStorage = settingsState.getAll();
// Filter for this plugin's storage keys and populate cache
Object.entries(allStorage).forEach(([key, value]) => {
+3 -4
View File
@@ -11,6 +11,7 @@ import type {
} from "./types";
import { createPluginAPI } from "./createAPI";
import browser from "webextension-polyfill";
import { settingsState } from "@/seqta/utils/listeners/SettingsState";
interface PluginSettingsStorage {
enabled?: boolean;
@@ -150,10 +151,8 @@ export class PluginManager {
// Check if plugin is enabled before starting
if (plugin.disableToggle) {
const settings = await browser.storage.local.get(
`plugin.${pluginId}.settings`,
);
const pluginSettings = settings[`plugin.${pluginId}.settings`] as
const all = settingsState.getAll() as unknown as Record<string, unknown>;
const pluginSettings = all[`plugin.${pluginId}.settings`] as
| PluginSettingsStorage
| undefined;
const enabled =