SurfSense/surfsense_web/app
yeranyang 4845b96209 perf(blog): derive search results with useMemo instead of useState+useEffect
Fixes #1246

Replace the useState/useEffect pattern that synced fuzzy search results
into local state on every search or searcher change with a single useMemo
that derives results directly during render.

Before:
  const [results, setResults] = useState(allBlogs);
  useEffect(() => {
    setResults(searcher.search(search));
  }, [search, searcher]);

After:
  const gridItems = useMemo(() => {
    const results = search.trim() ? searcher.search(search) : allBlogs;
    ...
  }, [search, searcher, allBlogs, featuredSlug]);

This removes an extra re-render per keystroke and eliminates the stale
intermediate state that occurred between the search input change and the
effect firing.
2026-04-29 12:34:12 +08:00
..
(home) perf(blog): derive search results with useMemo instead of useState+useEffect 2026-04-29 12:34:12 +08:00
api chore: ran linting 2026-04-22 06:40:39 +05:30
auth/callback fix: remove message from loading UI 2026-01-27 15:28:30 +05:30
dashboard Merge upstream/dev 2026-04-27 22:44:40 +02:00
db try vercel fix 2025-09-30 22:45:04 -07:00
desktop Deduplicate user-turn images by full base64 data and update desktop permissions copy for Screenshot Assist. 2026-04-27 19:25:39 +02:00
docs feat: enhance SurfSense with new skills, blog section, and improve SEO metadata 2026-04-11 23:38:12 -07:00
invite/[invite_code] feat: replace Loader2 with Spinner component for consistent loading indicators 2026-01-25 15:23:45 +05:30
public/[token] chore: linting 2026-03-27 03:17:05 -07:00
verify-token chore: ran biome checks 2026-03-07 12:57:27 +05:30
apple-icon.png feat: enhance SurfSense with new skills, blog section, and improve SEO metadata 2026-04-11 23:38:12 -07:00
error.tsx feat: add processing mode support for document uploads and ETL pipeline, improded error handling ux 2026-04-14 21:26:00 -07:00
favicon.ico feat: updated logo 2026-01-08 23:03:43 -08:00
global-error.tsx feat: add processing mode support for document uploads and ETL pipeline, improded error handling ux 2026-04-14 21:26:00 -07:00
globals.css perf: add content-visibility: auto to long list items 2026-04-02 02:26:55 +05:30
icon.png feat: enhance SurfSense with new skills, blog section, and improve SEO metadata 2026-04-11 23:38:12 -07:00
layout.config.tsx chore: ran linting 2026-03-10 16:17:12 +05:30
layout.tsx feat: update SEO titles and descriptions for improved clarity and focus 2026-04-21 01:33:58 -07:00
not-found.tsx feat: add processing mode support for document uploads and ETL pipeline, improded error handling ux 2026-04-14 21:26:00 -07:00
robots.ts feat: enhance SurfSense with new skills, blog section, and improve SEO metadata 2026-04-11 23:38:12 -07:00
sitemap.ts cloud: added openrouter integration with global configs 2026-04-15 23:46:29 -07:00