refactor: remove macOS vibrancy support and unify glass surfaces

Drops the macOS vibrancy toggle, IPC, and related settings copy
Updates dialogs, popovers, tooltips, and dropdowns to use shared glass styles
Adds sticky header fade behavior to model picker and sidebar lists
This commit is contained in:
Bohdan Triapitsyn
2026-08-10 15:10:37 +03:00
parent 90a16d1d44
commit 2c30af5807
36 changed files with 273 additions and 302 deletions
-21
View File
@@ -123,9 +123,6 @@ const sidebarBaseRgb = hexToRgb(theme.colors.surface.muted);
const isDark = theme.metadata.variant === 'dark';
const strongAlpha = isDark ? 0.15 : 0.5;
const softAlpha = isDark ? 0.1 : 0.3;
// Translucent fill painted over the native macOS vibrancy layer for the
// left sidebar — high enough alpha to stay legible, low enough to frost.
const vibrancyAlpha = isDark ? 0.66 : 0.76;
if (sidebarBaseRgb) {
vars.push(
@@ -134,9 +131,6 @@ const sidebarBaseRgb = hexToRgb(theme.colors.surface.muted);
vars.push(
` --sidebar-overlay-soft: rgb(${sidebarBaseRgb} / ${softAlpha}) !important;`,
);
vars.push(
` --sidebar-vibrancy-overlay: rgb(${sidebarBaseRgb} / ${vibrancyAlpha}) !important;`,
);
} else {
const base = theme.colors.surface.muted;
vars.push(
@@ -145,9 +139,6 @@ const sidebarBaseRgb = hexToRgb(theme.colors.surface.muted);
vars.push(
` --sidebar-overlay-soft: ${this.opacity(base, softAlpha)} !important;`,
);
vars.push(
` --sidebar-vibrancy-overlay: ${this.opacity(base, vibrancyAlpha)} !important;`,
);
}
if (theme.colors.charts?.series && Array.isArray(theme.colors.charts.series)) {
@@ -196,18 +187,6 @@ const sidebarBaseRgb = hexToRgb(theme.colors.surface.muted);
document.documentElement.setAttribute('data-theme', theme.metadata.variant);
const hasMacVibrancy = typeof window !== 'undefined'
&& window.__OPENCHAMBER_ELECTRON__?.runtime === 'electron'
&& window.__OPENCHAMBER_ELECTRON__?.macVibrancy === true;
document.documentElement.toggleAttribute('data-oc-vibrancy', hasMacVibrancy);
// Default the "ready" flag here (DOM is guaranteed to exist) rather than
// relying on the preload, which sets it at document-start when
// documentElement may not exist yet — that race left the sidebar stuck
// un-frosted on cold launch until a minimize/restore re-sent ready=true.
// The minimize/restore IPC continues to toggle this afterwards.
if (hasMacVibrancy) {
document.documentElement.toggleAttribute('data-oc-vibrancy-ready', true);
}
}
private generatePrimaryColors(primary: Theme['colors']['primary']): string[] {