SurfSense/surfsense_web
Matt Van Horn 8cf957b301
fix(theme-toggle): use functional setIsDark in toggleTheme (#1247)
Closes #1247.

toggleTheme's previous implementation read isDark from the closure via
setIsDark(!isDark), which forced isDark into the useCallback dependency
array. As a result toggleTheme's reference changed on every click,
invalidating any downstream memoization.

Switched to the functional updater setIsDark((prev) => !prev) and
dropped isDark from the dependency list. The sibling setCrazyLightTheme
and setCrazyDarkTheme callbacks already use this pattern (they pass
concrete values to setIsDark without listing isDark in deps), so this
keeps the three theme callbacks consistent.

No observable behavior change — clicking the theme toggle still flips
isDark. The callback reference is now stable between clicks, which is
also safer under concurrent updates per React's standard guidance.
2026-04-20 01:58:20 -07:00
..
app Merge pull request #1240 from AnishSarkar22/feat/resume-builder 2026-04-17 13:41:32 -07:00
atoms Merge pull request #1240 from AnishSarkar22/feat/resume-builder 2026-04-17 13:41:32 -07:00
changelog/content chore: added missed changelogs 2026-04-16 22:14:44 -07:00
components fix(theme-toggle): use functional setIsDark in toggleTheme (#1247) 2026-04-20 01:58:20 -07:00
content/docs style: simplify LLM model terminology in UI 2026-04-02 10:11:35 +05:30
contexts cloud: added openrouter integration with global configs 2026-04-15 23:46:29 -07:00
contracts feat: no login experience and prem tokens 2026-04-15 17:02:00 -07:00
hooks refactor: improve password input layout and enhance chat thread title update logic 2026-04-14 21:13:01 +05:30
i18n chore: linting 2026-03-27 03:17:05 -07:00
lib feat: no login experience and prem tokens 2026-04-15 17:02:00 -07:00
messages feat: add processing mode support for document uploads and ETL pipeline, improded error handling ux 2026-04-14 21:26:00 -07:00
public feat: enhance SurfSense with new skills, blog section, and improve SEO metadata 2026-04-11 23:38:12 -07:00
types feat: enhance SurfSense with new skills, blog section, and improve SEO metadata 2026-04-11 23:38:12 -07:00
zero feat: enhance folder indexing with metadata management and improve folder structure handling in UI components 2026-04-08 16:48:40 +05:30
.cursorrules feat: monorepo 2025-04-07 23:47:06 -07:00
.dockerignore feat: frontend docker to use nextjs production build 2025-10-23 20:37:01 -07:00
.env.example feat: no login experience and prem tokens 2026-04-15 17:02:00 -07:00
.gitignore chore: remove connector status config from .gitignore 2026-01-12 14:09:45 -08:00
biome.json chore: update biome configuration and dependencies to Biome version 2.4.6, enhancing compatibility and functionality 2026-03-07 12:52:05 +05:30
components.json chore: ran linting 2026-02-17 12:47:39 +05:30
docker-entrypoint.js format: auto-fix via pnpm format:fix 2026-03-24 16:07:28 +02:00
docker-entrypoint.sh feat: add Docker configuration files and installation script for SurfSense 2026-02-24 22:45:37 +05:30
Dockerfile feat: add Zero infra — docker-compose, env vars, Dockerfile, CI workflows 2026-03-23 18:27:18 +02:00
drizzle.config.ts chore: biome checks 2025-10-15 14:38:26 -07:00
eslint.config.mjs Biome: fixes for eslint config 2025-07-27 11:47:38 -07:00
instrumentation-client.ts feat: update instrumentation-client to include platform property in events 2026-04-08 02:41:33 -07:00
instrumentation.ts feat: enhance error handling with PostHog integration 2026-03-12 01:28:39 -07:00
LICENSE feat: monorepo 2025-04-07 23:47:06 -07:00
mdx-components.tsx perf(images): add sizes prop to improve Next.js image loading 2026-04-03 22:11:21 +07:00
next.config.ts feat: add experimental package import optimization configuration 2026-04-01 13:07:27 +02:00
package.json Merge pull request #1240 from AnishSarkar22/feat/resume-builder 2026-04-17 13:41:32 -07:00
pnpm-lock.yaml Merge pull request #1240 from AnishSarkar22/feat/resume-builder 2026-04-17 13:41:32 -07:00
postcss.config.mjs Initial formatting using biome 2025-07-27 10:05:37 -07:00
source.config.ts feat: enhance SurfSense with new skills, blog section, and improve SEO metadata 2026-04-11 23:38:12 -07:00
svgr.d.ts chore: ran linting 2026-02-10 19:06:21 +05:30
tailwind.config.js feat: enhance UI components with new border radius and tooltip features 2026-01-20 17:35:08 +05:30
tsconfig.json feat: old chat to new-chat with persistance 2025-12-21 16:32:55 -08:00