diff --git a/apps/sim/app/_shell/dynamic-favicon.tsx b/apps/sim/app/_shell/dynamic-favicon.tsx deleted file mode 100644 index 46e4f3ed37..0000000000 --- a/apps/sim/app/_shell/dynamic-favicon.tsx +++ /dev/null @@ -1,118 +0,0 @@ -'use client' - -import { useEffect } from 'react' -import { usePathname } from 'next/navigation' - -const DEFAULT_FAVICON = '/icon.svg' - -/** - * Sidebar icon color: --text-icon is #5e5e5e (light) / #939393 (dark). - * Favicon needs to be visible on any tab bar, so we use a slightly stronger value. - */ -const ICON_COLOR_LIGHT = '%235e5e5e' -const ICON_COLOR_DARK = '%23939393' - -function pad(viewBox: string): string { - const [x, y, w, h] = viewBox.split(' ').map(Number) - const p = Math.max(w, h) * 0.1 - return `${x - p} ${y - p} ${w + p * 2} ${h + p * 2}` -} - -function wrapStrokeIcon(viewBox: string, paths: string): string { - const svg = `${paths}` - return `data:image/svg+xml,${svg}` -} - -function wrapFilledIcon(viewBox: string, paths: string): string { - const svg = `${paths}` - return `data:image/svg+xml,${svg}` -} - -const FAVICONS: Record = { - home: wrapStrokeIcon( - '-1 -2 24 24', - `` - ), - blimp: wrapFilledIcon( - '1.25 4 18 13', - `` - ), - table: wrapStrokeIcon( - '-1 -2 24 24', - `` - ), - files: wrapStrokeIcon( - '-1 -2 24 24', - `` - ), - knowledge: wrapStrokeIcon( - '-1 -2 24 24', - `` - ), - calendar: wrapStrokeIcon( - '-1 -2 24 24', - `` - ), - library: wrapStrokeIcon( - '-1 -2 24 24', - `` - ), - settings: wrapStrokeIcon( - '0 0 24 24', - `` - ), - templates: wrapStrokeIcon( - '1 1 22 22', - `` - ), -} - -function getRouteSection(pathname: string): string | null { - if (!pathname.includes('/workspace/')) return null - const parts = pathname.split('/') - const sectionIndex = parts.indexOf('workspace') + 2 - return parts[sectionIndex] ?? null -} - -const SECTION_TO_ICON: Record = { - home: 'home', - task: 'home', - w: 'blimp', - tables: 'table', - files: 'files', - knowledge: 'knowledge', - schedules: 'calendar', - logs: 'library', - settings: 'settings', - templates: 'templates', -} - -function setFaviconHrefs(url: string) { - document.querySelectorAll("link[rel*='icon']").forEach((link) => { - if (link.rel === 'apple-touch-icon') return - link.href = url - }) -} - -export function DynamicFavicon() { - const pathname = usePathname() - - useEffect(() => { - const section = getRouteSection(pathname) - const iconKey = section ? SECTION_TO_ICON[section] : null - const url = iconKey ? FAVICONS[iconKey] : DEFAULT_FAVICON - - setFaviconHrefs(url) - - // Re-apply whenever Next.js head reconciliation replaces link elements - const observer = new MutationObserver(() => setFaviconHrefs(url)) - observer.observe(document.head, { childList: true }) - - return () => { - observer.disconnect() - setFaviconHrefs(DEFAULT_FAVICON) - } - }, [pathname]) - - return null -} diff --git a/apps/sim/app/_styles/globals.css b/apps/sim/app/_styles/globals.css index 7f083698af..2418fb5f19 100644 --- a/apps/sim/app/_styles/globals.css +++ b/apps/sim/app/_styles/globals.css @@ -95,7 +95,7 @@ --border-1: #e0e0e0; /* stronger border */ --surface-6: #e5e5e5; /* popovers, elevated surfaces */ --surface-7: #d9d9d9; - --surface-active: #e8e8e8; /* hover/active state */ + --surface-active: #ececec; /* hover/active state */ --workflow-edge: #e0e0e0; /* workflow handles/edges - matches border-1 */ @@ -218,7 +218,7 @@ --border-1: #3d3d3d; --surface-6: #454545; --surface-7: #505050; - --surface-active: #303030; /* hover/active state */ + --surface-active: #2c2c2c; /* hover/active state */ --workflow-edge: #454545; /* workflow handles/edges - same as surface-6 in dark */ diff --git a/apps/sim/app/layout.tsx b/apps/sim/app/layout.tsx index 09727a149e..1a0fbe7235 100644 --- a/apps/sim/app/layout.tsx +++ b/apps/sim/app/layout.tsx @@ -11,7 +11,6 @@ import { import '@/app/_styles/globals.css' import { OneDollarStats } from '@/components/analytics/onedollarstats' import { isReactGrabEnabled, isReactScanEnabled } from '@/lib/core/config/feature-flags' -import { DynamicFavicon } from '@/app/_shell/dynamic-favicon' import { HydrationErrorHandler } from '@/app/_shell/hydration-error-handler' import { QueryProvider } from '@/app/_shell/providers/query-provider' import { SessionProvider } from '@/app/_shell/providers/session-provider' @@ -233,7 +232,6 @@ export default function RootLayout({ children }: { children: React.ReactNode }) - diff --git a/apps/sim/app/workspace/[workspaceId]/components/resource/components/resource-header/resource-header.tsx b/apps/sim/app/workspace/[workspaceId]/components/resource/components/resource-header/resource-header.tsx index 8ab924ee83..d5bc84e4c5 100644 --- a/apps/sim/app/workspace/[workspaceId]/components/resource/components/resource-header/resource-header.tsx +++ b/apps/sim/app/workspace/[workspaceId]/components/resource/components/resource-header/resource-header.tsx @@ -108,7 +108,12 @@ export function ResourceHeader({ className='px-[8px] py-[4px] text-[12px]' > {ActionIcon && ( - + )} {action.label} @@ -121,7 +126,7 @@ export function ResourceHeader({ variant='subtle' className='px-[8px] py-[4px] text-[12px]' > - + {create.label} )} diff --git a/apps/sim/app/workspace/[workspaceId]/components/resource/components/resource-options-bar/resource-options-bar.tsx b/apps/sim/app/workspace/[workspaceId]/components/resource/components/resource-options-bar/resource-options-bar.tsx index 6bc9198886..3d44484c50 100644 --- a/apps/sim/app/workspace/[workspaceId]/components/resource/components/resource-options-bar/resource-options-bar.tsx +++ b/apps/sim/app/workspace/[workspaceId]/components/resource/components/resource-options-bar/resource-options-bar.tsx @@ -119,7 +119,7 @@ export function ResourceOptionsBar({ search, sort, filter, filterTags }: Resourc {search.dropdown && (
{search.dropdown}
@@ -151,7 +151,7 @@ export function ResourceOptionsBar({ search, sort, filter, filterTags }: Resourc align='start' sideOffset={6} className={cn( - 'z-50 rounded-[8px] border border-[var(--border)] bg-white shadow-sm dark:bg-[var(--bg)]' + 'z-50 rounded-[8px] border border-[var(--border)] bg-[var(--bg)] shadow-sm' )} > {filter} diff --git a/apps/sim/app/workspace/[workspaceId]/components/resource/resource.tsx b/apps/sim/app/workspace/[workspaceId]/components/resource/resource.tsx index fa87cad5a9..b38b6c70fc 100644 --- a/apps/sim/app/workspace/[workspaceId]/components/resource/resource.tsx +++ b/apps/sim/app/workspace/[workspaceId]/components/resource/resource.tsx @@ -142,7 +142,7 @@ export function Resource({ return (
@@ -162,7 +162,7 @@ export function Resource({ {emptyMessage}
) : ( -
+
diff --git a/apps/sim/app/workspace/[workspaceId]/files/[fileId]/view/file-viewer.tsx b/apps/sim/app/workspace/[workspaceId]/files/[fileId]/view/file-viewer.tsx index fb858aa0d4..b939d50898 100644 --- a/apps/sim/app/workspace/[workspaceId]/files/[fileId]/view/file-viewer.tsx +++ b/apps/sim/app/workspace/[workspaceId]/files/[fileId]/view/file-viewer.tsx @@ -13,7 +13,7 @@ export function FileViewer({ file }: FileViewerProps) { const serveUrl = `/api/files/serve/${encodeURIComponent(file.key)}?context=workspace` return ( -
+