diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 625e5449..cf0e53d6 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -11,9 +11,6 @@ on: schedule: # 13:30 UTC = 00:00 Adelaide during daylight saving (ACDT, UTC+10:30) - cron: "30 13 * * *" - # 14:30 UTC = 00:00 Adelaide during standard time (ACST, UTC+9:30) - - cron: "30 14 * * *" - workflow_dispatch: permissions: contents: write @@ -29,33 +26,15 @@ jobs: run: shell: bash steps: - - name: Check Adelaide midnight - id: time_check - run: | - if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then - echo "proceed=true" >> "$GITHUB_OUTPUT" - exit 0 - fi - export TZ=Australia/Adelaide - NOW="$(date +'%Y-%m-%d %H:%M %Z')" - if [ "$(date +%H%M)" = "0000" ]; then - echo "proceed=true" >> "$GITHUB_OUTPUT" - else - echo "proceed=false" >> "$GITHUB_OUTPUT" - echo "Skipping: not midnight Australia/Adelaide ($NOW)" - fi - uses: actions/checkout@v4 - if: steps.time_check.outputs.proceed == 'true' - name: Set build date id: build_date - if: steps.time_check.outputs.proceed == 'true' run: echo "date=$(TZ=Australia/Adelaide date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT" - name: Build extension id: build - if: steps.time_check.outputs.proceed == 'true' uses: ./.github/actions/build-extension with: gh_release_update_check: "true" @@ -64,7 +43,6 @@ jobs: release_repo: ${{ github.repository }} - name: Ensure nightly release exists - if: steps.time_check.outputs.proceed == 'true' run: | TITLE="Nightly (${{ steps.build_date.outputs.date }})" if ! gh release view "${{ env.NIGHTLY_TAG }}" 2>/dev/null; then @@ -77,7 +55,6 @@ jobs: fi - name: Upload nightly assets - if: steps.time_check.outputs.proceed == 'true' run: | gh release upload "${{ env.NIGHTLY_TAG }}" \ --clobber \ diff --git a/.npmrc b/.npmrc index 8c1d73ae..521a9f7c 100644 --- a/.npmrc +++ b/.npmrc @@ -1,2 +1 @@ legacy-peer-deps=true - diff --git a/build-log.txt b/build-log.txt deleted file mode 100644 index 3e0cfb75..00000000 Binary files a/build-log.txt and /dev/null differ diff --git a/jest.config.js b/jest.config.js index a63ca1c1..1d125826 100644 --- a/jest.config.js +++ b/jest.config.js @@ -24,4 +24,4 @@ export default { 'src/**/*.ts', '!src/**/*.d.ts', ], -}; \ No newline at end of file +}; diff --git a/lib/closePlugin.ts b/lib/closePlugin.ts deleted file mode 100644 index 9494f298..00000000 --- a/lib/closePlugin.ts +++ /dev/null @@ -1,20 +0,0 @@ -// ref: https://stackoverflow.com/a/76920975 -import type { Plugin } from "vite"; - -/** Exit with code 1 on build failure; do not exit on success (multi-target builds). */ -export default function ClosePlugin(): Plugin { - return { - name: "ClosePlugin", - buildEnd(error) { - if (error) { - console.error("Error bundling", error); - process.exit(1); - } else { - console.log("Build ended"); - } - }, - closeBundle() { - console.log("Bundle closed"); - }, - }; -} diff --git a/lib/dedupePublicAssets.ts b/lib/dedupePublicAssets.ts new file mode 100644 index 00000000..d3c5c9dd --- /dev/null +++ b/lib/dedupePublicAssets.ts @@ -0,0 +1,53 @@ +import { createHash } from "node:crypto"; +import { readFileSync, unlinkSync, writeFileSync } from "node:fs"; +import { resolve } from "node:path"; +import { dirname, relative } from "node:path/posix"; +import { globSync } from "glob"; +import type { Plugin } from "rollup"; + +const hash = (path: string) => + createHash("sha256").update(readFileSync(path)).digest("hex"); + +/** Reuse identical files already copied to stable extension paths. */ +export default (): Plugin => ({ + name: "dedupe-public-assets", + writeBundle({ dir }) { + if (!dir) return; + const files = globSync("**/*", { cwd: dir, nodir: true }); + const stable = new Map(); + const duplicates = new Map(); + for (const file of files) { + if (file.startsWith("resources/")) + stable.set(hash(resolve(dir, file)), file); + } + for (const file of files) { + const match = file.startsWith("assets/") + ? stable.get(hash(resolve(dir, file))) + : undefined; + if (match) duplicates.set(file, match); + } + for (const file of files.filter((file) => + /\.(?:css|html|js)$/.test(file), + )) { + const path = resolve(dir, file); + let output = readFileSync(path, "utf8"); + for (const [asset, canonical] of duplicates) { + output = output.replaceAll( + relative(dirname(file), asset), + relative(dirname(file), canonical), + ); + } + writeFileSync(path, output); + } + for (const file of duplicates.keys()) unlinkSync(resolve(dir, file)); + + const manifestPath = resolve(dir, "manifest.json"); + const manifest = JSON.parse(readFileSync(manifestPath, "utf8")); + for (const entry of manifest.web_accessible_resources ?? []) { + entry.resources = entry.resources.filter( + (file: string) => !duplicates.has(file), + ); + } + writeFileSync(manifestPath, `${JSON.stringify(manifest, null, 2)}\n`); + }, +}); diff --git a/lib/inlineWorker.ts b/lib/inlineWorker.ts index cfd846b5..91c9d96b 100644 --- a/lib/inlineWorker.ts +++ b/lib/inlineWorker.ts @@ -1,5 +1,6 @@ import { Plugin } from "vite"; import { build } from "esbuild"; +import { resolve } from "node:path"; /** Bundle worker entry points imported with `?inlineWorker` as Blob-backed Workers in dev. */ export default function InlineWorkerDevPlugin(): Plugin { @@ -16,6 +17,12 @@ export default function InlineWorkerDevPlugin(): Plugin { platform: "browser", format: "iife", target: "esnext", + minify: true, + alias: { + "@huggingface/transformers": resolve( + "node_modules/@huggingface/transformers/dist/transformers.web.js", + ), + }, external: ["webextension-polyfill"], }); diff --git a/package.json b/package.json index 4bf8cc04..ab671dd7 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "browserslist": "> 0.5%, last 2 versions, not dead", "scripts": { "compile:layerchart": "node scripts/compile-layerchart-vendor.mjs", - "postinstall": "node scripts/copy-pdfjs-assets.mjs && node scripts/copy-ort-wasm-assets.mjs && npm run compile:layerchart", + "postinstall": "node scripts/copy-runtime-assets.mjs && npm run compile:layerchart", "autoaudit": "npm audit && npm audit fix && npm run build", "dev": "cross-env MODE=chrome vite dev", "dev:firefox": "cross-env MODE=firefox vite build --watch", @@ -25,7 +25,7 @@ "test:ci": "npm run test:unit && npm run build && npm run test:smoke", "release": "gh release create $npm_package_version --repo BetterSEQTA/BetterSEQTA-Plus ./dist/*.zip --generate-notes", "publish": "bun lib/publish.js --b", - "zip": "bedframe zip" + "zip": "node scripts/package-extension-zips.mjs" }, "keywords": [], "author": { diff --git a/scripts/analyze-trace.mjs b/scripts/analyze-trace.mjs new file mode 100644 index 00000000..1c3bc00e --- /dev/null +++ b/scripts/analyze-trace.mjs @@ -0,0 +1,180 @@ +/** + * Chrome trace analyzer — aggregates hotspots for BetterSEQTA+ optimization. + * Usage: node scripts/analyze-trace.mjs + */ +import fs from "node:fs"; + +const path = process.argv[2]; +if (!path) { + console.error("Usage: node scripts/analyze-trace.mjs "); + process.exit(1); +} + +const raw = fs.readFileSync(path, "utf8"); +const { traceEvents } = JSON.parse(raw); + +const DURATION_PHASES = new Set(["X", "b", "e"]); +const openStacks = new Map(); // key -> { name, cat, args, ts } + +const byName = new Map(); +const byCat = new Map(); +const byUrl = new Map(); +const byFunction = new Map(); +const layoutEvents = []; +const paintEvents = []; +const longTasks = []; +const timers = []; +const observers = []; +const hitTests = []; +const betterseqtaHits = new Map(); +const ipcMessages = new Map(); +const gcEvents = []; + +let minTs = Infinity; +let maxTs = -Infinity; + +function add(map, key, dur, count = 1) { + const e = map.get(key) ?? { dur: 0, count: 0 }; + e.dur += dur; + e.count += count; + map.set(key, e); +} + +function stackKey(ev) { + return `${ev.pid}:${ev.tid}:${ev.name}:${ev.ts}`; +} + +for (const ev of traceEvents) { + if (ev.ts != null) { + minTs = Math.min(minTs, ev.ts); + maxTs = Math.max(maxTs, ev.ts); + } + + const ph = ev.ph; + const name = ev.name ?? ""; + const cat = ev.cat ?? ""; + const args = ev.args ?? {}; + + if (ph === "b") { + openStacks.set(`${ev.pid}:${ev.tid}:${ev.id ?? name}`, ev); + continue; + } + + let dur = ev.dur ?? 0; + if (ph === "e" && ev.id != null) { + const start = openStacks.get(`${ev.pid}:${ev.tid}:${ev.id}`); + if (start) dur = ev.ts - start.ts; + } + if (dur <= 0 && ph !== "X") continue; + + add(byName, name, dur); + + const catParts = cat.split(",").filter(Boolean); + for (const c of catParts.length ? catParts : [cat || "(none)"]) { + add(byCat, c, dur); + } + + const url = + args.data?.url ?? + args.url ?? + args.fileName ?? + args.data?.scriptName ?? + args.data?.frame ?? + ""; + if (url && typeof url === "string" && dur > 0) { + add(byUrl, url.slice(0, 200), dur); + } + + const fn = + args.data?.functionName ?? + args.functionName ?? + args.data?.columnNumber != null + ? `${args.data?.functionName ?? name}@${args.data?.url ?? ""}:${args.data?.lineNumber ?? "?"}` + : ""; + if (fn && dur > 100) { + add(byFunction, String(fn).slice(0, 250), dur); + } + + if (/Layout|UpdateLayoutTree|InvalidateLayout|LocalFrameView::performLayout/i.test(name)) { + layoutEvents.push({ name, dur, ts: ev.ts, cat }); + } + if (/Paint|Raster|DrawFrame|CompositeLayers|UpdateLayer/i.test(name)) { + paintEvents.push({ name, dur, ts: ev.ts }); + } + if (name === "RunTask" && dur > 50000) { + longTasks.push({ dur, ts: ev.ts, cat, args: JSON.stringify(args).slice(0, 300) }); + } + if (/Timer|setTimeout|setInterval|FireIdleCallback|requestAnimationFrame|RequestAnimationFrame/i.test(name)) { + timers.push({ name, dur, ts: ev.ts }); + } + if (/MutationObserver|ResizeObserver|IntersectionObserver|DeliverObservations|NotifyMutation/i.test(name)) { + observers.push({ name, dur, ts: ev.ts }); + } + if (/HitTest|FindElement|ElementAt/i.test(name)) { + hitTests.push({ name, dur, ts: ev.ts }); + } + if (/V8\.GC|GC_|MajorGC|MinorGC|IncrementalMarking/i.test(name)) { + gcEvents.push({ name, dur, ts: ev.ts }); + } + if (/IPC|MessagePort|postMessage/i.test(name)) { + add(ipcMessages, name, dur); + } + + const blob = JSON.stringify(args); + if (/betterseqta|BetterSEQTA|bsplus|SEQTA\.ts|monofile|AddBetterSEQTA/i.test(blob + name + url)) { + const key = `${name} | ${(url || blob).slice(0, 120)}`; + add(betterseqtaHits, key, dur); + } +} + +function top(map, n = 40, minCount = 1) { + return [...map.entries()] + .filter(([, v]) => v.count >= minCount) + .sort((a, b) => b[1].dur - a[1].dur) + .slice(0, n) + .map(([k, v]) => ({ + key: k, + totalMs: (v.dur / 1000).toFixed(1), + count: v.count, + avgMs: (v.dur / v.count / 1000).toFixed(2), + })); +} + +const traceDurationMs = ((maxTs - minTs) / 1000).toFixed(0); + +console.log(JSON.stringify({ + summary: { + traceDurationMs, + eventCount: traceEvents.length, + layoutCount: layoutEvents.length, + layoutTotalMs: (layoutEvents.reduce((s, e) => s + e.dur, 0) / 1000).toFixed(1), + paintCount: paintEvents.length, + paintTotalMs: (paintEvents.reduce((s, e) => s + e.dur, 0) / 1000).toFixed(1), + longTaskCount: longTasks.length, + longTaskTotalMs: (longTasks.reduce((s, e) => s + e.dur, 0) / 1000).toFixed(1), + timerCount: timers.length, + timerTotalMs: (timers.reduce((s, e) => s + e.dur, 0) / 1000).toFixed(1), + observerCount: observers.length, + observerTotalMs: (observers.reduce((s, e) => s + e.dur, 0) / 1000).toFixed(1), + hitTestCount: hitTests.length, + hitTestTotalMs: (hitTests.reduce((s, e) => s + e.dur, 0) / 1000).toFixed(1), + gcCount: gcEvents.length, + gcTotalMs: (gcEvents.reduce((s, e) => s + e.dur, 0) / 1000).toFixed(1), + }, + topEventNames: top(byName, 50), + topCategories: top(byCat, 30), + topUrls: top(byUrl, 40), + topFunctions: top(byFunction, 40, 1), + topBetterseqta: top(betterseqtaHits, 50), + topLongTasks: longTasks.sort((a, b) => b.dur - a.dur).slice(0, 20).map(e => ({ + ms: (e.dur / 1000).toFixed(1), + cat: e.cat, + args: e.args, + })), + topLayout: layoutEvents.sort((a, b) => b.dur - a.dur).slice(0, 15).map(e => ({ + name: e.name, ms: (e.dur / 1000).toFixed(2), + })), + topObservers: observers.sort((a, b) => b.dur - a.dur).slice(0, 15).map(e => ({ + name: e.name, ms: (e.dur / 1000).toFixed(2), count: 1, + })), +}, null, 2)); diff --git a/scripts/copy-ort-wasm-assets.mjs b/scripts/copy-ort-wasm-assets.mjs deleted file mode 100644 index 9fc172b9..00000000 --- a/scripts/copy-ort-wasm-assets.mjs +++ /dev/null @@ -1,28 +0,0 @@ -import { copyFileSync, existsSync, mkdirSync } from "node:fs"; -import { createRequire } from "node:module"; -import { dirname, join } from "node:path"; -import { fileURLToPath } from "node:url"; - -const root = join(dirname(fileURLToPath(import.meta.url)), ".."); -const require = createRequire(import.meta.url); - -const transformersDist = dirname(require.resolve("@huggingface/transformers")); -const outDir = join(root, "src", "public", "resources", "ort"); - -mkdirSync(outDir, { recursive: true }); - -const ortFiles = [ - "ort-wasm-simd-threaded.jsep.mjs", - "ort-wasm-simd-threaded.jsep.wasm", -]; - -for (const file of ortFiles) { - const src = join(transformersDist, file); - if (!existsSync(src)) { - throw new Error( - `Missing ONNX Runtime WASM asset: ${src}\n` + - "Ensure @huggingface/transformers is installed (direct dependency).", - ); - } - copyFileSync(src, join(outDir, file)); -} diff --git a/scripts/copy-pdfjs-assets.mjs b/scripts/copy-pdfjs-assets.mjs deleted file mode 100644 index 2ed5cc77..00000000 --- a/scripts/copy-pdfjs-assets.mjs +++ /dev/null @@ -1,17 +0,0 @@ -import { copyFileSync, mkdirSync } from "node:fs"; -import { dirname, join } from "node:path"; -import { fileURLToPath } from "node:url"; - -const root = join(dirname(fileURLToPath(import.meta.url)), ".."); -const pdfjsRoot = join(root, "node_modules", "pdfjs-dist"); -const outDir = join(root, "src", "public", "resources", "pdfjs"); - -mkdirSync(outDir, { recursive: true }); -copyFileSync( - join(pdfjsRoot, "build", "pdf.worker.min.mjs"), - join(outDir, "pdf.worker.min.mjs"), -); -copyFileSync( - join(pdfjsRoot, "legacy", "build", "pdf.min.mjs"), - join(outDir, "pdf.legacy.min.mjs"), -); diff --git a/scripts/copy-runtime-assets.mjs b/scripts/copy-runtime-assets.mjs new file mode 100644 index 00000000..bcd5c262 --- /dev/null +++ b/scripts/copy-runtime-assets.mjs @@ -0,0 +1,24 @@ +import { copyFileSync, mkdirSync } from "node:fs"; +import { dirname, join } from "node:path"; +import { fileURLToPath } from "node:url"; + +const root = join(dirname(fileURLToPath(import.meta.url)), ".."); +const resources = join(root, "src", "public", "resources"); +const files = [ + ["pdfjs-dist/build/pdf.worker.min.mjs", "pdfjs/pdf.worker.min.mjs"], + ["pdfjs-dist/legacy/build/pdf.min.mjs", "pdfjs/pdf.legacy.min.mjs"], + [ + "@huggingface/transformers/dist/ort-wasm-simd-threaded.jsep.mjs", + "ort/ort-wasm-simd-threaded.jsep.mjs", + ], + [ + "@huggingface/transformers/dist/ort-wasm-simd-threaded.jsep.wasm", + "ort/ort-wasm-simd-threaded.jsep.wasm", + ], +]; + +for (const [source, target] of files) { + const output = join(resources, target); + mkdirSync(dirname(output), { recursive: true }); + copyFileSync(join(root, "node_modules", source), output); +} diff --git a/scripts/package-extension-zips.mjs b/scripts/package-extension-zips.mjs index 015d96fc..1a2f70ab 100644 --- a/scripts/package-extension-zips.mjs +++ b/scripts/package-extension-zips.mjs @@ -42,7 +42,7 @@ const buildLabel = process.env.BUILD_LABEL || ""; const base = updateChannel === "nightly" && buildLabel ? `betterseqtaplus-nightly-${buildLabel}` - : `betterseqtaplus-${version}`; + : `${pkg.name}@${version}`; const chromeZip = `dist/${base}-chrome.zip`; const firefoxZip = `dist/${base}-firefox.zip`; diff --git a/src/css/documentload.scss b/src/css/documentload.scss index 6ef051a3..bf8587e5 100644 --- a/src/css/documentload.scss +++ b/src/css/documentload.scss @@ -38,7 +38,7 @@ @layer override { .legacy-root, - .legacy-root * { + .legacy-root *:not(.iconFamily) { font-family: var(--betterseqta-font-family, Rubik), sans-serif !important; } diff --git a/src/css/injected.scss b/src/css/injected.scss index 15b0e9c8..d0b6486b 100644 --- a/src/css/injected.scss +++ b/src/css/injected.scss @@ -16,6 +16,7 @@ @include meta.load-css("injected/sidebar-styles.scss"); @include meta.load-css("injected/theme.scss"); @include meta.load-css("injected/transparency.scss"); +@include meta.load-css("injected/performance-mode.scss"); :root { background: var(--better-main) !important; @@ -44,12 +45,12 @@ button.bsplus-timetable-control.iconFamily, body, .legacy-root input, .legacy-root textarea, -.legacy-root button, +.legacy-root button:not(.iconFamily), .legacy-root select, .legacy-root option, .legacy-root .input, html { - font-family: Rubik, sans-serif !important; + font-family: var(--betterseqta-font-family, Rubik), sans-serif !important; } .legacy-root { @@ -126,9 +127,17 @@ select option { background: var(--auto-background) !important; } .legacy-root, -.legacy-root * { - font-family: Rubik, sans-serif !important; - --theme-fg-parts: white; +.legacy-root *:not(.iconFamily) { + font-family: var(--betterseqta-font-family, Rubik), sans-serif !important; +} + +/* SEQTA uses `rgb(var(--theme-fg-parts))` — must be an rgb triplet, not `white`. */ +html.dark .legacy-root { + --theme-fg-parts: 255, 255, 255; +} + +html:not(.dark) .legacy-root { + --theme-fg-parts: 0, 0, 0; } .extension-editor { background: var(--background-primary); @@ -487,15 +496,15 @@ ul.magicDelete > li.deleting { pointer-events: none; } -#menu li.hasChildren.active > .sub { +#menu li.hasChildren:is(.active, .bsplus-active) > .sub { pointer-events: auto; } -#menu li.hasChildren.active > .sub:has(.hasChildren.active) { +#menu li.hasChildren:is(.active, .bsplus-active) > .sub:has(.hasChildren:is(.active, .bsplus-active)) { pointer-events: none !important; } -#menu li.hasChildren.active .hasChildren.active > .sub { +#menu li.hasChildren:is(.active, .bsplus-active) .hasChildren:is(.active, .bsplus-active) > .sub { pointer-events: auto !important; } @@ -532,8 +541,7 @@ ul.magicDelete > li.deleting { visibility: visible !important; } -/* Edit rows should match normal custom-sidebar item size (not shrunk). */ -#menu.bsplus-sidebar-edit-mode > #bsplus-sidebar-root > li.item.draggable, +/* Edit rows should match normal sidebar item size (not shrunk). */ #menu.bsplus-sidebar-edit-mode .item.draggable { display: flex !important; align-items: center !important; @@ -619,26 +627,6 @@ ul.magicDelete > li.deleting { transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1); } -/* Hide native menu as soon as possible (during loading), before Svelte mounts. - Keep `#bsplus-sidebar-root` visible — themes target `#menu > ul > li.item` on it. */ -html.bsplus-custom-sidebar-pending #menu > ul:not(#bsplus-sidebar-root), -html.bsplus-custom-sidebar-pending #menu > #userInfo, -html.bsplus-custom-sidebar-pending #menu > .icon-cover, -#menu.bsplus-custom-sidebar > ul:not(#bsplus-sidebar-root), -#menu.bsplus-custom-sidebar > #userInfo, -#menu.bsplus-custom-sidebar > .icon-cover { - position: absolute !important; - left: -10000px !important; - width: 1px !important; - height: 1px !important; - margin: 0 !important; - padding: 0 !important; - overflow: hidden !important; - opacity: 0 !important; - pointer-events: none !important; - clip: rect(0, 0, 0, 0) !important; -} - /* Custom title bar: keep native `#title` children for sync, hide them visually. Loading overlay stays until waitForCustomTitleBarReady() so this is ready underneath. */ html.bsplus-custom-title-pending #title > :not(#bsplus-title-root), @@ -665,157 +653,6 @@ html.bsplus-custom-title-pending #title > :not(#bsplus-title-root), align-items: center; } -/* Custom Svelte sidebar: keep `#menu > ul > li.item` / `.sub` shape for theme CSS. */ -#menu.bsplus-custom-sidebar { - position: absolute !important; - top: 0 !important; - bottom: 0 !important; - left: 0 !important; - display: flex !important; - flex-direction: column !important; - box-sizing: border-box !important; - height: auto !important; - max-height: none !important; - overflow: hidden !important; - - > #bsplus-sidebar-root { - flex: 1 1 auto; - min-height: 0; - width: 100%; - height: 100%; - z-index: 2; - position: relative; - padding-top: 0 !important; - - /* - * Extend the logo spacer for the same gap as between items. - * SEQTA's #menu>ul::before border-bottom is the hairline under the logo. - */ - &::before { - box-shadow: none !important; - border-bottom: none !important; - height: calc(71px + 8px) !important; - } - } - - li.hasChildren { - position: static !important; - } - - /* Native list may keep `.active` after click-through; force our rows clickable, - then lock siblings only while a custom drill `.sub` is open. */ - > #bsplus-sidebar-root > li.item { - pointer-events: auto !important; - width: auto !important; - max-width: none !important; - margin: 0 6px 8px !important; - box-sizing: border-box !important; - } - - &:has(> #bsplus-sidebar-root > li.hasChildren.active > .sub) - > #bsplus-sidebar-root - > li:not(.hasChildren.active), - &:has(> #bsplus-sidebar-root > li.hasChildren.active > .sub) - > #bsplus-sidebar-root - > li:not(.hasChildren.active) - * { - pointer-events: none !important; - } - - /* Same locks keyed off `.drilling` so nested leaf clicks do not flicker when - SEQTA briefly strips `.active` from folder rows. */ - > #bsplus-sidebar-root.drilling > li:not(.hasChildren), - > #bsplus-sidebar-root.drilling > li:not(.hasChildren) * { - pointer-events: none !important; - } - - > #bsplus-sidebar-root .sub { - pointer-events: none; - } - - > #bsplus-sidebar-root li.hasChildren.active > .sub { - pointer-events: auto; - background: transparent !important; - background-image: none !important; - } - - > #bsplus-sidebar-root li.hasChildren.active > .sub:has(.hasChildren.active) { - pointer-events: none !important; - } - - > #bsplus-sidebar-root li.hasChildren.active .hasChildren.active > .sub { - pointer-events: auto !important; - background: transparent !important; - background-image: none !important; - } - - > #bsplus-sidebar-root.drilling li.hasChildren > .sub:not(:has(.sub)) { - pointer-events: auto !important; - background: transparent !important; - background-image: none !important; - } - - > #bsplus-sidebar-root.drilling li.hasChildren > .sub:has(.sub) { - pointer-events: none !important; - } - - > #bsplus-sidebar-root.drilling li.hasChildren > .sub .sub { - pointer-events: auto !important; - background: transparent !important; - background-image: none !important; - } - - > #bsplus-sidebar-root > li.hasChildren.active > label, - > #bsplus-sidebar-root.drilling > li.hasChildren > label { - pointer-events: none !important; - } - - /* Theme decorations on root leaves (Beach palm/sand) must not show through - the transparent drill `.sub` panel. */ - > #bsplus-sidebar-root:has(> li.hasChildren.active > .sub) - > li:not(.hasChildren.active)::before, - > #bsplus-sidebar-root:has(> li.hasChildren.active > .sub) - > li:not(.hasChildren.active)::after { - content: none !important; - display: none !important; - animation: none !important; - opacity: 0 !important; - } - - > #bsplus-sidebar-root.drilling > li:not(.hasChildren)::before, - > #bsplus-sidebar-root.drilling > li:not(.hasChildren)::after { - content: none !important; - display: none !important; - animation: none !important; - opacity: 0 !important; - } - - #bsplus-sidebar-root .sub .back { - display: flex; - align-items: center; - gap: 4px; - padding: 12px 16px 8px; - cursor: pointer; - font-weight: 700; - color: inherit; - } - - #bsplus-sidebar-root .sub .back:hover { - opacity: 0.9; - } - - #bsplus-sidebar-root .sub .backLabel { - font-size: 16px; - font-weight: 700; - } - - #bsplus-sidebar-root .sub > ul { - list-style: none; - margin: 0; - padding: 0 0 16px; - } -} - #menu li > label > svg, #menu section > label > svg { margin: 0 10px 0 4px; @@ -824,7 +661,7 @@ html.bsplus-custom-title-pending #title > :not(#bsplus-title-root), } /* Icon Only Sidebar - compact mode. When submenu is open, all styles are disabled so it behaves as normal sidebar. */ -body.icon-only-sidebar:not(:has(#menu li.hasChildren.active)) { +body.icon-only-sidebar:not(:has(#menu li.hasChildren:is(.active, .bsplus-active))) { #menu { width: 70px !important; transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1); @@ -910,6 +747,7 @@ body.icon-only-sidebar:not(:has(#menu li.hasChildren.active)) { } } + [class*="notifications__items___"] { -ms-overflow-style: none !important; scrollbar-width: none !important; @@ -959,7 +797,7 @@ body > .sortable-fallback.bsplus-sortable-drag, } #menu { - li.active > .sub > ul > .item:not(.hasChildren) { + li:is(.active, .hasChildren.bsplus-active) > .sub > ul > .item:not(.hasChildren) { position: relative; &::before { @@ -974,10 +812,11 @@ body > .sortable-fallback.bsplus-sortable-drag, width 100ms, transform 0.3s ease; border-radius: 8px 0 0 8px; + pointer-events: none; } &:hover::before, - &.active::before { + &:is(.active, .bsplus-active)::before { width: 6px; background: var(--item-colour, transparent); } @@ -1116,9 +955,9 @@ ol:has([class*="MessageList__avatar___"] svg) { -webkit-box-shadow: 0px 5px 16px 6px rgba(0, 0, 0, 0.2) !important; box-shadow: 0px 0px 4px 2px rgba(0, 0, 0, 0.2) !important; } -/* Custom sidebar: keep title depth to the right, not a hairline under the logo into the menu. */ -body:has(#menu.bsplus-custom-sidebar) #container #content #title, -body:has(#menu.bsplus-custom-sidebar).menuShown #container #content #title { +/* Styled sidebar: keep title depth to the right, not a hairline under the logo into the menu. */ +body:has(#menu.bsplus-styled-sidebar) #container #content #title, +body:has(#menu.bsplus-styled-sidebar).menuShown #container #content #title { -webkit-box-shadow: 6px 0 8px -4px rgba(0, 0, 0, 0.25) !important; box-shadow: 6px 0 8px -4px rgba(0, 0, 0, 0.25) !important; } @@ -1420,7 +1259,7 @@ html.transparencyEffects transform: translatex(var(--bsplus-sidebar-width, 270px)); } - body.icon-only-sidebar:not(:has(#menu li.hasChildren.active)) { + body.icon-only-sidebar:not(:has(#menu li.hasChildren:is(.active, .bsplus-active))) { #menu { -webkit-transform: translatex(-70px); transform: translatex(-70px); @@ -2027,11 +1866,11 @@ html.transparencyEffects width: 25px; height: 25px; } -.dark .legacy-root button::after { +.dark .legacy-root button.iconFamily::after { background: white; } -.legacy-root button::after { - background: black !important; +.legacy-root button.iconFamily::after { + background: currentColor; } .legacy-root button:not([disabled]):focus { border-color: var(--better-sub); @@ -2063,11 +1902,21 @@ html.transparencyEffects box-shadow: 0px 10px 15px -3px rgba(0, 0, 0, 0.4); } -/* Smoothed by attachNotificationsPanelAnimation (matches #ExtensionPopup spring) */ +/* Smoothed by attachNotificationsPanelAnimation (CSS transition, no JS spring ticks) */ .bsplus-notifications-panel { transform-origin: top right; - will-change: opacity, transform; + opacity: 0; + transform: scale(0.94); + transition: + opacity 0.2s cubic-bezier(0.22, 1, 0.36, 1), + transform 0.2s cubic-bezier(0.22, 1, 0.36, 1); filter: drop-shadow(0px 0px 20px rgba(0, 0, 0, 0.35)); + backface-visibility: hidden; +} + +.bsplus-notifications-panel--open { + opacity: 1; + transform: scale(1); } #menu li.active { @@ -3836,18 +3685,320 @@ div.day-empty { .userInfo { display: flex; align-items: center; - padding-top: 4px; + padding: 4px 0; } .userInfoText { text-align: end; + padding: 2px 0; } .userInfoName { margin: 0 !important; font-size: 20px; font-weight: 700; + line-height: 1.2; } .userInfoCode { margin: 0 !important; + line-height: 1.2; +} +.userInfoNameRow { + display: inline-flex; + align-items: center; + justify-content: flex-end; + gap: 6px; +} +.userInfoDetails { + display: flex; + flex-direction: column; + align-items: flex-end; + gap: 2px; +} +.userInfoHouseWrap { + display: inline-block; + margin: 0 8px; + text-align: center; +} +.userInfoHouseWrap .userInfohouse { + display: block; + margin: 0 !important; + padding: 0 6px !important; + box-sizing: border-box; +} +.userInfoHouseWrap .bsplus-founder-badge-slot { + width: 100%; + margin-top: 4px; +} +.userInfoHouseWrap .bsplus-founder-badge-slot[hidden], +.bsplus-founder-badge-slot[hidden] { + display: none; +} +.bsplus-founder-badge--titlebar { + display: block; + width: 100%; + border-radius: 5px; +} +.bsplus-founder-badge--titlebar .bsplus-founder-badge__glass, +.bsplus-founder-badge--titlebar .bsplus-founder-badge__content { + width: 100%; + border-radius: 5px; + box-sizing: border-box; +} +.bsplus-founder-badge--titlebar .bsplus-founder-badge__content { + justify-content: center; + padding: 0 6px; + gap: 0; + min-height: 0; + height: auto; + font-size: 15px; + line-height: normal; + backdrop-filter: none; + -webkit-backdrop-filter: none; + background: rgba(255, 255, 255, 0.12); + box-shadow: + inset 0 0 0 1px rgba(255, 255, 255, 0.28), + inset 0 1px 0 rgba(255, 255, 255, 0.16), + inset 0 -1px 0 rgba(0, 0, 0, 0.12); +} +.bsplus-founder-badge--titlebar .bsplus-founder-badge__label { + display: block; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + text-align: center; +} +.bsplus-founder-badge--titlebar:focus-visible .bsplus-founder-badge__content { + box-shadow: + inset 0 0 0 1px rgba(255, 255, 255, 0.28), + inset 0 1px 0 rgba(255, 255, 255, 0.16), + inset 0 -1px 0 rgba(0, 0, 0, 0.12), + 0 0 0 2px var(--theme-primary, #f97316), + 0 0 0 4px rgba(249, 115, 22, 0.35); +} +.legacy-root .bsplus-founder-badge, +.legacy-root .bsplus-founder-badge-actions .bsplus-cal-btn { + background: transparent !important; +} +.legacy-root .bsplus-founder-badge::after, +.legacy-root .bsplus-founder-badge-actions .bsplus-cal-btn::after { + display: none !important; + content: none !important; +} +.legacy-root .bsplus-founder-badge-actions .bsplus-cal-btn--ghost { + background: color-mix(in srgb, var(--text-primary, #111) 8%, transparent) !important; +} +.legacy-root .bsplus-founder-badge-actions .bsplus-cal-btn--ghost:hover { + background: color-mix(in srgb, var(--text-primary, #111) 14%, transparent) !important; +} +.legacy-root .bsplus-founder-badge-actions .bsplus-cal-btn--primary { + background: var(--better-main, #3b82f6) !important; +} +.bsplus-founder-badge { + position: relative; + display: inline-flex; + padding: 0; + margin: 0; + border: none; + border-radius: 5px; + background: transparent; + vertical-align: middle; + cursor: pointer; + font-family: var(--betterseqta-font-family, Rubik), sans-serif !important; + transition: transform 0.2s ease; + white-space: nowrap; +} +.bsplus-founder-badge--hero { + border-radius: 12px; +} +.bsplus-founder-badge:hover { + transform: scale(1.02); +} +.bsplus-founder-badge:focus { + outline: none; +} +.bsplus-founder-badge:focus-visible .bsplus-founder-badge__glass { + box-shadow: + inset 0 0 0 1px rgba(255, 255, 255, 0.78), + inset 0 1px 0 rgba(255, 255, 255, 0.52), + inset 0 2px 8px rgba(255, 255, 255, 0.14), + inset 0 -1px 0 rgba(0, 0, 0, 0.08), + 0 0 0 2px var(--theme-primary, #f97316), + 0 0 0 4px rgba(249, 115, 22, 0.35); +} +.bsplus-founder-badge__glass { + position: relative; + display: inline-flex; + overflow: hidden; + border-radius: inherit; + background: var(--badge-base, #1e293b); +} +.bsplus-founder-badge__blobs { + position: absolute; + inset: 0; + pointer-events: none; + background: + radial-gradient(ellipse 72% 68% at 18% 42%, var(--badge-blob-a), transparent 72%), + radial-gradient(ellipse 68% 62% at 82% 58%, var(--badge-blob-b), transparent 70%), + radial-gradient(ellipse 64% 56% at 50% 88%, var(--badge-blob-c), transparent 68%); + filter: blur(1px); +} +.bsplus-founder-badge__content { + position: relative; + z-index: 1; + display: inline-flex; + align-items: center; + gap: 5px; + padding: 0 10px; + min-height: 22px; + border-radius: inherit; + color: #fff; + font-size: 15px; + font-weight: 600; + line-height: 22px; + letter-spacing: 0.01em; + font-family: inherit; + text-shadow: 0 1px 1px rgba(0, 0, 0, 0.22); + backdrop-filter: blur(14px) saturate(1.3); + -webkit-backdrop-filter: blur(14px) saturate(1.3); + background: rgba(255, 255, 255, 0.16); + box-shadow: + inset 0 0 0 1px rgba(255, 255, 255, 0.78), + inset 0 1px 0 rgba(255, 255, 255, 0.52), + inset 0 2px 8px rgba(255, 255, 255, 0.14), + inset 0 -1px 0 rgba(0, 0, 0, 0.08); +} +.bsplus-founder-badge--hero .bsplus-founder-badge__content { + gap: 8px; + padding: 10px 16px; + min-height: auto; + font-size: 14px; + line-height: 1.2; + backdrop-filter: none; + -webkit-backdrop-filter: none; + background: rgba(255, 255, 255, 0.2); +} +.bsplus-founder-badge--hero .bsplus-founder-badge__glass { + background: transparent; +} +.bsplus-founder-badge__icon { + flex-shrink: 0; + width: 15px; + height: 15px; + opacity: 0.95; +} +.bsplus-founder-badge--hero .bsplus-founder-badge__icon { + width: 20px; + height: 20px; +} +.bsplus-founder-badge-hero { + position: relative; + display: block; + overflow: hidden; + margin: 0 auto; + width: 90%; + aspect-ratio: 16 / 9; + border-radius: 16px; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.3); + background: var(--badge-base, #0f172a); +} +.bsplus-founder-badge-hero__blobs { + position: absolute; + inset: -22%; + pointer-events: none; + background: + radial-gradient(ellipse 72% 62% at 18% 34%, var(--badge-blob-a), transparent 76%), + radial-gradient(ellipse 68% 58% at 82% 42%, var(--badge-blob-b), transparent 74%), + radial-gradient(ellipse 74% 64% at 52% 88%, var(--badge-blob-c), transparent 76%), + radial-gradient(ellipse 78% 68% at 48% 52%, var(--badge-blob-b), transparent 78%); + filter: blur(10px); +} +.bsplus-founder-badge-hero__vignette { + position: absolute; + inset: 0; + pointer-events: none; + background: radial-gradient(ellipse at center, transparent 34%, rgba(0, 0, 0, 0.62) 100%); + opacity: 0.84; +} +.bsplus-founder-badge-hero__stage { + position: absolute; + inset: 0; + display: grid; + place-items: center; + pointer-events: none; +} +.bsplus-founder-badge-hero__stage .bsplus-founder-badge { + pointer-events: auto; +} +.whatsnewTextContainer.bsplus-founder-badge-body p { + margin: 0 0 1rem; + font-size: 1.2rem; + line-height: 1.6; +} +.whatsnewTextContainer.bsplus-founder-badge-body a { + color: inherit; + text-decoration: underline; + text-underline-offset: 2px; +} +.bsplus-founder-badge-signup { + margin: 0 0 1rem !important; + padding: 0.55rem 0.75rem; + border-radius: 0.6rem; + border: 1px solid color-mix(in srgb, var(--text-primary) 12%, transparent); + background: color-mix(in srgb, var(--text-primary) 5%, transparent); + font-size: 1rem !important; + font-weight: 600; + font-variant-numeric: tabular-nums; +} +.bsplus-founder-badge-header { + align-items: center; + text-align: center; + + h1, + p { + width: 100%; + } +} +.bsplus-founder-badge-actions { + display: flex; + flex-wrap: wrap; + gap: 8px; + justify-content: center; + margin-top: 1.25rem; +} +.bsplus-founder-badge-actions .bsplus-cal-btn { + padding: 8px 14px; + border: none; + border-radius: 10px; + font-size: 13px; + font-weight: 600; + font-family: inherit; + line-height: 1.25; + cursor: pointer; + transition: all 0.2s ease; +} +.bsplus-founder-badge-actions .bsplus-cal-btn:focus-visible { + outline: none; + box-shadow: + 0 0 0 2px var(--background-primary, #fff), + 0 0 0 4px var(--better-main, #3b82f6); +} +.bsplus-founder-badge-actions .bsplus-cal-btn--ghost { + background: color-mix(in srgb, var(--text-primary, #111) 8%, transparent); + color: var(--text-primary, #111); +} +.bsplus-founder-badge-actions .bsplus-cal-btn--ghost:hover { + background: color-mix(in srgb, var(--text-primary, #111) 14%, transparent); + transform: scale(1.02); +} +.bsplus-founder-badge-actions .bsplus-cal-btn--primary { + background: var(--better-main, #3b82f6); + color: #fff; +} +.bsplus-founder-badge-actions .bsplus-cal-btn--primary:hover { + filter: brightness(1.06); + transform: scale(1.02); +} +.bsplus-founder-badge-actions .bsplus-cal-btn:active { + transform: scale(0.98); } .userInfosvg { width: 50px; @@ -3890,6 +4041,7 @@ div.day-empty { color: var(--text-primary); background: var(--auto-background); outline: solid 1px black; + text-align: center; } .DarkLightButton { right: 145px !important; @@ -3978,6 +4130,40 @@ div.day-empty { z-index: 49; transform: scale(1) !important; } + +/* Lightweight popup motion (performance mode) — fade + scale, no blur springs. */ +.whatsnewBackground.bsplus-popup-css-animate { + opacity: 0; + transition: opacity var(--bs-motion-duration, 0.2s) var(--bs-motion-ease, cubic-bezier(0.22, 1, 0.36, 1)); + + .whatsnewContainer { + opacity: 0; + transform: scale(0.94); + transition: + opacity var(--bs-motion-duration, 0.2s) var(--bs-motion-ease, cubic-bezier(0.22, 1, 0.36, 1)), + transform var(--bs-motion-duration, 0.2s) var(--bs-motion-ease, cubic-bezier(0.22, 1, 0.36, 1)); + } + + &.bsplus-popup-css-animate--open { + opacity: 1; + + .whatsnewContainer { + opacity: 1; + transform: scale(1); + } + } +} + +.whatsnewBackground.bsplus-popup-backdrop--lite { + backdrop-filter: none !important; + -webkit-backdrop-filter: none !important; + background: rgba(0, 0, 0, 0.55) !important; + + .whatsnewContainer { + backdrop-filter: none !important; + -webkit-backdrop-filter: none !important; + } +} .whatsnewImgContainer { width: 96%; display: flex; diff --git a/src/css/injected/performance-mode.scss b/src/css/injected/performance-mode.scss new file mode 100644 index 00000000..c6ff5a25 --- /dev/null +++ b/src/css/injected/performance-mode.scss @@ -0,0 +1,51 @@ +html.performanceMode { + --bs-settings-ease: 0.2s cubic-bezier(0.22, 1, 0.36, 1); + --bs-motion-duration: 0.2s; + --bs-motion-ease: cubic-bezier(0.22, 1, 0.36, 1); + + backdrop-filter: none !important; + -webkit-backdrop-filter: none !important; + filter: none !important; + + /* Inline page loaders only — boot overlay lives in #loading shadow DOM. */ + .bkloading-inline .big-circle, + .bkloading-inline .small-circle, + .bkloading-inline .outer-circle { + animation: none !important; + } + + /* Custom title: cheaper hit-testing during mouse moves (trace showed many HitTests). */ + .bsplus-custom-title, + #title.bsplus-custom-title { + contain: layout style paint; + } + + /* Settings backdrop — skip expensive blur in performance mode. */ + #ExtensionPopup ~ *, + .outside-container.hide { + backdrop-filter: none !important; + } +} + +html.performanceModeSimpleUi { + .bsplus-analytics-charts, + .bsplus-analytics-chart-cell { + display: none !important; + } +} + +/* Boot loading spinner uses shadow DOM; custom properties inherit from the host. */ +#loading.bkloading { + --bk-stage-duration: 0.85s !important; + --bk-spin-outer: 1s !important; + --bk-spin-inner: 3s !important; + --bk-spin-small: 3s !important; +} + +html.performanceMode.transparencyEffects, +html.performanceMode .backdrop-blur-xl, +html.performanceMode .backdrop-blur-sm, +html.performanceMode [class*="backdrop-blur"] { + backdrop-filter: none !important; + -webkit-backdrop-filter: none !important; +} diff --git a/src/css/injected/popup.scss b/src/css/injected/popup.scss index e012349f..87a8ab99 100644 --- a/src/css/injected/popup.scss +++ b/src/css/injected/popup.scss @@ -34,9 +34,21 @@ #ExtensionPopup { border-radius: 0; filter: none; - /* Avoid transform on the host — it makes shadow `position: fixed` children - size to the host instead of the viewport on Engage stacking contexts. */ transform-origin: center center; - will-change: opacity; - transition: opacity 0.05s; + opacity: 0; + transition: opacity var(--bs-motion-duration, 0.2s) cubic-bezier(0.22, 1, 0.36, 1); +} + +#ExtensionPopup.bsplus-settings-host--open { + opacity: 1; +} + +#ExtensionPopup.bsplus-settings-host--closing { + opacity: 0; + pointer-events: none; +} + +/* Feedback modal scrollport — host overflow:hidden otherwise clips fixed overlays. */ +#ExtensionPopup.bsplus-feedback-open { + overflow: auto !important; } diff --git a/src/css/injected/sidebar-animation.scss b/src/css/injected/sidebar-animation.scss index 03cd1172..9bbd4c50 100644 --- a/src/css/injected/sidebar-animation.scss +++ b/src/css/injected/sidebar-animation.scss @@ -1,20 +1,22 @@ -#menu ul:has(li.hasChildren.active) li.hasChildren.active { +#menu ul:has(li.hasChildren:is(.active, .bsplus-active)) + li.hasChildren:is(.active, .bsplus-active) { box-shadow: inset 0px 0 var(--item-colour, transparent) !important; background: transparent !important; } -#menu ul:not(:has(li.hasChildren.active)) { +#menu ul:not(:has(li.hasChildren:is(.active, .bsplus-active))) { overflow-y: scroll !important; } -#menu > ul:has(li.hasChildren.active) > li::before, -#menu > ul:has(li.hasChildren.active) > li::after, -#menu > ul ul:has(li.hasChildren.active) > li::before, -#menu > ul ul:has(li.hasChildren.active) > li::after, -#menu > ul:has(li.hasChildren.active) > li > label, -#menu > ul:has(li.hasChildren.active) > li > svg, -#menu > ul ul:has(li.hasChildren.active) > li > label, -#menu > ul ul:has(li.hasChildren.active) > li > svg { +#menu > ul:has(li.hasChildren:is(.active, .bsplus-active)) > li::before, +#menu > ul:has(li.hasChildren:is(.active, .bsplus-active)) > li::after, +#menu > ul ul:has(li.hasChildren:is(.active, .bsplus-active)) > li::before, +#menu > ul ul:has(li.hasChildren:is(.active, .bsplus-active)) > li::after, +#menu > ul:has(li.hasChildren:is(.active, .bsplus-active)) > li > label, +#menu > ul:has(li.hasChildren:is(.active, .bsplus-active)) > li > svg, +#menu > ul ul:has(li.hasChildren:is(.active, .bsplus-active)) > li > label, +#menu > ul ul:has(li.hasChildren:is(.active, .bsplus-active)) > li > svg { + /* !important beats theme animations (e.g. Beach palm-slide forwards). */ transform: translateX(-320px) !important; animation: none !important; } @@ -24,16 +26,65 @@ transition: transform 0.3s ease; } +/* Frontmost drill panel: rows move with `.sub` only — no separate enter animation. */ +#menu + li.hasChildren:is(.active, .bsplus-active):not( + :has(.sub li.hasChildren:is(.active, .bsplus-active)) + ) + > .sub + > ul + > li, +#menu + li.hasChildren:is(.active, .bsplus-active):not( + :has(.sub li.hasChildren:is(.active, .bsplus-active)) + ) + > .sub + > ul + > li + > label, +#menu + li.hasChildren:is(.active, .bsplus-active):not( + :has(.sub li.hasChildren:is(.active, .bsplus-active)) + ) + > .sub + > ul + > li + > svg, +#menu + li.hasChildren:is(.active, .bsplus-active):not( + :has(.sub li.hasChildren:is(.active, .bsplus-active)) + ) + > .sub + > ul + > li::before, +#menu + li.hasChildren:is(.active, .bsplus-active):not( + :has(.sub li.hasChildren:is(.active, .bsplus-active)) + ) + > .sub + > ul + > li::after { + animation: none !important; + transition: none !important; + transform: none !important; +} + #menu .sub { transition: transform 0.3s ease, left 0.4s cubic-bezier(0.4, 0, 0.2, 1); } -#menu > ul:has(li.hasChildren.active) > li.active { +#menu .sub ul:has(> li.hasChildren:is(.active, .bsplus-active)) + > li:not(:is(.active, .bsplus-active)) { + pointer-events: none !important; +} + +#menu > ul:has(li.hasChildren:is(.active, .bsplus-active)) + > li:is(.active, .bsplus-active) { background: transparent !important; } -#menu li.hasChildren:not(.active) li .sub { - display: none; +#menu li.hasChildren:not(:is(.active, .bsplus-active)) li .sub { + display: none; // improves performance } .sub .sub { @@ -41,87 +92,20 @@ padding-top: 2px; } -.sub:has(ul > li.hasChildren.active) > .nav > .back { +.sub:has(ul > li.hasChildren:is(.active, .bsplus-active)) > .nav > .back { display: none !important; } -body.icon-only-sidebar:not(:has(#menu li.hasChildren.active)) #menu > ul:has(li.hasChildren.active) > li::before, -body.icon-only-sidebar:not(:has(#menu li.hasChildren.active)) #menu > ul ul:has(li.hasChildren.active) > li::before, -body.icon-only-sidebar:not(:has(#menu li.hasChildren.active)) #menu > ul:has(li.hasChildren.active) > li > label, -body.icon-only-sidebar:not(:has(#menu li.hasChildren.active)) #menu > ul:has(li.hasChildren.active) > li > svg, -body.icon-only-sidebar:not(:has(#menu li.hasChildren.active)) #menu > ul ul:has(li.hasChildren.active) > li > label, -body.icon-only-sidebar:not(:has(#menu li.hasChildren.active)) #menu > ul ul:has(li.hasChildren.active) > li > svg { - transform: translateX(-70px); -} - -/* - * Custom sidebar drill slides — use `.drilling` / `.drill-entering` / `.drill-returning`, - * not `:has(.active)` (SEQTA strips `.active` on nested clicks). - */ -#menu.bsplus-custom-sidebar #bsplus-sidebar-root { +#menu { --bsplus-slide-off: -320px; - - .sub { - transition: none !important; - } - - &.drilling { - overflow: hidden !important; - - &:not(.drill-returning) > li::before, - &:not(.drill-returning) > li::after, - &:not(.drill-returning) > li > label, - &:not(.drill-returning) > li > svg, - &:not(.drill-returning) .sub:has(.sub) > ul > li::before, - &:not(.drill-returning) .sub:has(.sub) > ul > li::after, - &:not(.drill-returning) .sub:has(.sub) > ul > li > label, - &:not(.drill-returning) .sub:has(.sub) > ul > li > svg { - transform: translateX(var(--bsplus-slide-off)) !important; - animation: none !important; - } - - &:not(.drill-entering):not(.drill-returning) { - > li::before, - > li::after, - > li > label, - > li > svg, - .sub:has(.sub) > ul > li::before, - .sub:has(.sub) > ul > li::after, - .sub:has(.sub) > ul > li > label, - .sub:has(.sub) > ul > li > svg { - transition: none !important; - } - - .sub { - transform: translateX(0) !important; - opacity: 1 !important; - } - } - - .sub:has(.sub) > .nav > .back { - display: none !important; - } - } - - &.drill-entering .sub.bsplus-sub-enter { - animation: bsplus-submenu-enter 0.32s cubic-bezier(0.22, 1, 0.36, 1); - } - - &.drill-returning:not(.drilling) > li::before, - &.drill-returning:not(.drilling) > li::after, - &.drill-returning:not(.drilling) > li > label, - &.drill-returning:not(.drilling) > li > svg, - &.drilling.drill-returning > li.hasChildren > .sub > ul > li::before, - &.drilling.drill-returning > li.hasChildren > .sub > ul > li::after, - &.drilling.drill-returning > li.hasChildren > .sub > ul > li > label, - &.drilling.drill-returning > li.hasChildren > .sub > ul > li > svg { - transition: none !important; - animation: bsplus-sidebar-return 0.32s cubic-bezier(0.22, 1, 0.36, 1) both !important; - } } -body.icon-only-sidebar #menu.bsplus-custom-sidebar #bsplus-sidebar-root { - --bsplus-slide-off: -70px; +/* Reverse slide when drilling back — label/svg motion is driven inline in JS + so text stays off-screen until `.active` clears. Pseudo-elements use CSS. */ +#menu.bsplus-sidebar-returning ul.bsplus-drill-return-target > li::before, +#menu.bsplus-sidebar-returning ul.bsplus-drill-return-target > li::after { + animation: bsplus-sidebar-return 0.3s cubic-bezier(0.4, 0, 0.2, 1) both !important; + transition: none !important; } @keyframes bsplus-sidebar-return { @@ -133,13 +117,41 @@ body.icon-only-sidebar #menu.bsplus-custom-sidebar #bsplus-sidebar-root { } } -@keyframes bsplus-submenu-enter { - from { - opacity: 0.35; - transform: translateX(28px); - } - to { - opacity: 1; - transform: translateX(0); - } +/* Icon-only collapsed: submenu slides over narrow icons. */ +body.icon-only-sidebar:not(:has(#menu li.hasChildren:is(.active, .bsplus-active))) + #menu + > ul:has(li.hasChildren:is(.active, .bsplus-active)) + > li::before, +body.icon-only-sidebar:not(:has(#menu li.hasChildren:is(.active, .bsplus-active))) + #menu + > ul + ul:has(li.hasChildren:is(.active, .bsplus-active)) + > li::before, +body.icon-only-sidebar:not(:has(#menu li.hasChildren:is(.active, .bsplus-active))) + #menu + > ul:has(li.hasChildren:is(.active, .bsplus-active)) + > li + > label, +body.icon-only-sidebar:not(:has(#menu li.hasChildren:is(.active, .bsplus-active))) + #menu + > ul:has(li.hasChildren:is(.active, .bsplus-active)) + > li + > svg, +body.icon-only-sidebar:not(:has(#menu li.hasChildren:is(.active, .bsplus-active))) + #menu + > ul + ul:has(li.hasChildren:is(.active, .bsplus-active)) + > li + > label, +body.icon-only-sidebar:not(:has(#menu li.hasChildren:is(.active, .bsplus-active))) + #menu + > ul + ul:has(li.hasChildren:is(.active, .bsplus-active)) + > li + > svg { + transform: translateX(-70px); +} + +body.icon-only-sidebar #menu { + --bsplus-slide-off: -70px; } diff --git a/src/css/injected/sidebar-position.scss b/src/css/injected/sidebar-position.scss new file mode 100644 index 00000000..5b385ccd --- /dev/null +++ b/src/css/injected/sidebar-position.scss @@ -0,0 +1,133 @@ +/* Sidebar on the right edge — layout, drill direction, and mirrored accents. */ + +body.bsplus-sidebar-right { + #menu { + left: auto !important; + right: 0 !important; + width: var(--bsplus-sidebar-width, 270px) !important; + overflow: visible !important; + } + + #content { + left: 0 !important; + right: var(--bsplus-sidebar-width, 270px) !important; + transition: + right 0.4s cubic-bezier(0.4, 0, 0.2, 1), + left 0.4s cubic-bezier(0.4, 0, 0.2, 1), + transform 0.4s ease !important; + } + + /* Sub panels open to the left of the menu — anchor to menu edge, not viewport. */ + #menu .sub { + left: auto !important; + right: 100% !important; + width: var(--bsplus-sidebar-width, 270px) !important; + } + + /* Title bar spans the full viewport; only page content respects sidebar inset. */ + #container #content #title, + #title { + left: 0 !important; + right: 0 !important; + width: 100% !important; + max-width: none !important; + } + + &.icon-only-sidebar:not(:has(#menu li.hasChildren:is(.active, .bsplus-active))) { + #menu { + width: 70px !important; + } + + #content { + right: 70px !important; + } + + #menu .sub { + right: 100% !important; + width: var(--bsplus-sidebar-width, 270px) !important; + } + } + + &:has(#menu.bsplus-styled-sidebar) #container #content #title, + &.menuShown:has(#menu.bsplus-styled-sidebar) #container #content #title { + box-shadow: -6px 0 8px -4px rgb(0 0 0 / 0.25) !important; + } + + #menu.bsplus-styled-sidebar { + &.bsplus-sidebar-indicator-bar:not(.bsplus-sidebar-style-strip) { + > ul > li.item.active:not(.hasChildren)::after, + .sub li.item.active:not(.hasChildren)::after { + left: auto !important; + right: 0 !important; + } + } + + &.bsplus-sidebar-style-strip { + > ul > li.item.active:not(.hasChildren)::after, + .sub li.item.active:not(.hasChildren)::after { + left: auto !important; + right: 0 !important; + } + } + } + + #menu li:is(.active, .hasChildren.bsplus-active) > .sub > ul > .item:not(.hasChildren)::before { + left: auto !important; + right: 0 !important; + border-radius: 0 8px 8px 0 !important; + } +} + +@media (max-width: 900px) { + body.bsplus-sidebar-right { + #menu { + left: auto !important; + right: 0 !important; + transform: translateX(var(--bsplus-sidebar-width, 270px)) !important; + } + + &.menuShown #menu { + transform: translateX(0) !important; + } + + #content { + left: 0 !important; + right: 0 !important; + } + + &.menuShown #content { + transform: translateX(calc(-1 * var(--bsplus-sidebar-width, 270px))) !important; + } + + &.icon-only-sidebar:not(:has(#menu li.hasChildren:is(.active, .bsplus-active))) { + #menu { + transform: translateX(70px) !important; + } + + &.menuShown #content { + transform: translateX(-70px) !important; + } + } + + #menuToggle { + left: auto !important; + right: 8px !important; + } + + #container #content #title, + #title { + left: 0 !important; + right: 0 !important; + width: 100% !important; + } + + /* Counter `#content` slide so the fixed title stays viewport-wide. */ + &.menuShown #container #content #title { + transform: translateX(var(--bsplus-sidebar-width, 270px)) !important; + } + + &.icon-only-sidebar.menuShown #container #content #title { + transform: translateX(70px) !important; + } + } +} diff --git a/src/css/injected/sidebar-styles.scss b/src/css/injected/sidebar-styles.scss index b43d03cb..729959c6 100644 --- a/src/css/injected/sidebar-styles.scss +++ b/src/css/injected/sidebar-styles.scss @@ -1,4 +1,4 @@ -/* Custom sidebar style presets + Look (density / radius / indicator). */ +/* Native sidebar style presets + Look (density / radius / indicator). */ $sidebar-motion: 0.4s cubic-bezier(0.4, 0, 0.2, 1); @@ -18,25 +18,36 @@ $sidebar-motion: 0.4s cubic-bezier(0.4, 0, 0.2, 1); display: block !important; } -#menu.bsplus-custom-sidebar { - $item: "> #bsplus-sidebar-root > li.item:not(.bsplus-sidebar-edit-header):not(.bsplus-sidebar-edit-actions)"; - $label: "> #bsplus-sidebar-root > li.item > label:not(.toggle)"; - $active: "> #bsplus-sidebar-root > li.item.active:not(.hasChildren)"; +#menu.bsplus-styled-sidebar { + $rootItem: "> ul > li.item"; + $subItem: ".sub li.item"; + $item: "#{$rootItem}, #{$subItem}"; + $rootLabel: "> ul > li.item > label:not(.toggle)"; + $subLabel: ".sub li.item > label:not(.toggle)"; + $label: "#{$rootLabel}, #{$subLabel}"; + $active: "> ul > li.item.active:not(.hasChildren), .sub li.item.active:not(.hasChildren)"; - /* Look: base radius (pill / sharp / strip override). - Density/radius animate with the same easing as sidebar width. */ - #{$item} { + /* Look: base radius — layout transitions only on root rows (settings tweaks). + Submenu rows must not animate margin/padding during folder drill slides. */ + #{$rootItem} { border-radius: var(--bsplus-sidebar-radius, 12px) !important; transition: padding $sidebar-motion, margin $sidebar-motion, border-radius $sidebar-motion, background-color 0.2s ease, - box-shadow 0.2s ease, - opacity 0.2s ease; + box-shadow 0.2s ease; } - #{$label} { + #{$subItem} { + border-radius: var(--bsplus-sidebar-radius, 12px) !important; + transition: + background-color 0.2s ease, + box-shadow 0.2s ease; + } + + #{$rootLabel} { + min-height: 28px !important; transition: font-size $sidebar-motion, line-height $sidebar-motion, @@ -51,6 +62,11 @@ $sidebar-motion: 0.4s cubic-bezier(0.4, 0, 0.2, 1); } } + #{$subLabel} { + min-height: 28px !important; + transition: none; + } + /* —— Style presets —— */ &.bsplus-sidebar-style-soft { #{$item} { @@ -74,13 +90,23 @@ $sidebar-motion: 0.4s cubic-bezier(0.4, 0, 0.2, 1); } &.bsplus-sidebar-style-glass { - #{$item} { + /* Never put backdrop-filter on an open folder — it becomes a clip + containing-block and hides `.sub` labels on Chromium/Edge. */ + #{$item}:not(:has(> .sub)) { margin: 0 8px 8px !important; background: rgba(255, 255, 255, 0.1) !important; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14); } + #{$item}:has(> .sub) { + background: transparent !important; + backdrop-filter: none !important; + -webkit-backdrop-filter: none !important; + box-shadow: none !important; + overflow: visible !important; + contain: none !important; + } #{$active} { background: rgba(255, 255, 255, 0.2) !important; box-shadow: @@ -147,7 +173,7 @@ $sidebar-motion: 0.4s cubic-bezier(0.4, 0, 0.2, 1); margin: 0 !important; font-size: 13px !important; line-height: 1.2 !important; - min-height: 0 !important; + min-height: 20px !important; height: auto !important; white-space: nowrap !important; @@ -169,6 +195,7 @@ $sidebar-motion: 0.4s cubic-bezier(0.4, 0, 0.2, 1); padding: 0 !important; font-size: 17px !important; line-height: 1.25 !important; + min-height: 30px !important; > svg { width: 30px !important; diff --git a/src/css/injected/transparency.scss b/src/css/injected/transparency.scss index c96c7642..0092b4bd 100644 --- a/src/css/injected/transparency.scss +++ b/src/css/injected/transparency.scss @@ -39,8 +39,6 @@ html.transparencyEffects { [class*="LabelList__selected___"], .buttonChecklist, .pane, - .legacy-root button, - .legacy-root a, [class*="MessageList__MessageList___"] { backdrop-filter: blur(80px); } diff --git a/src/interface/components/FeedbackModal.svelte b/src/interface/components/FeedbackModal.svelte index 068ec5e3..e47bb0a1 100644 --- a/src/interface/components/FeedbackModal.svelte +++ b/src/interface/components/FeedbackModal.svelte @@ -1,6 +1,6 @@ +
{ - if (e.target === e.currentTarget && !busy) onClose(); - }} - onkeydown={(e) => { - if (e.key === "Escape" && !busy) onClose(); - }} - role="button" - tabindex="-1" transition:fade={{ duration: $settingsState.animations ? 200 : 0 }} > - -