You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This tracks @sanjaiyan-dev's "Frontend Performance & Modernization" proposal.
Sub-task 1 (Top Priority): Fix the emailThreads double-fetch bug. DataContext.tsx rebuilds emailThreads on every list update, and that changes getMessages and getCachedMessages. Because the fetch effect in ThreadPage.tsx depends on both, it runs again. Opening an unread thread fetches it twice, and the second fetch can overwrite an optimistic reply. The effect should only re-run when threadId changes.
Sub-task 2: Bump React Router to 8.5.0. Move imports from react-router-dom to react-router (react-router-dom stops at 7.x), and raise engines to Node >= 22.22.0. This PR shouldn't change behavior.
Sub-task 3: Migrate to createBrowserRouter + <RouterProvider> and enable useTransitions. Keep DataContext for data rather than moving everything into route loaders. TanStack Query can come later as a hybrid step, once we know how it fits with DataContext and the IndexedDB cache.
Sub-task 4: Test <Suspense> boundaries and lazy route transitions locally and check the fallback UX. Try a boundary above the routes, and compare bundle size before and after.
This tracks @sanjaiyan-dev's "Frontend Performance & Modernization" proposal.
Sub-task 1 (Top Priority): Fix the emailThreads double-fetch bug. DataContext.tsx rebuilds emailThreads on every list update, and that changes getMessages and getCachedMessages. Because the fetch effect in ThreadPage.tsx depends on both, it runs again. Opening an unread thread fetches it twice, and the second fetch can overwrite an optimistic reply. The effect should only re-run when threadId changes.
Sub-task 2: Bump React Router to 8.5.0. Move imports from react-router-dom to react-router (react-router-dom stops at 7.x), and raise engines to Node >= 22.22.0. This PR shouldn't change behavior.
Sub-task 3: Migrate to createBrowserRouter + <RouterProvider> and enable useTransitions. Keep DataContext for data rather than moving everything into route loaders. TanStack Query can come later as a hybrid step, once we know how it fits with DataContext and the IndexedDB cache.
Sub-task 4: Test <Suspense> boundaries and lazy route transitions locally and check the fallback UX. Try a boundary above the routes, and compare bundle size before and after.
My plan is to start with useDeferredValue for concurrent rendering since it’s pretty low-risk with a solid payoff.
From there, I'll do a few small type cleanups and optimize the presence logic without breaking anything. I also want to test lazy route loading locally to see how React Router handles it before putting up a PR. Once that looks good, we can bring in React Query and bump React Router to the latest data APIs.
Quick question on Biome: do you prefer rolling it out file-by-file, or just setting it up across the repo in one PR?
Here is the update for Week 1. While a couple of tasks expanded slightly beyond the initial outline during code exploration, all changes are low-risk, backward-compatible, and high-impact for UX and codebase health.
🚀 Week 1 Pull Requests Overview
• #53: refactor: clean up React imports and optimize transitions/search
• #54: Optimize mailbox and thread navigation with syntax improvements
• #55: chore(deps): upgrade dependencies and migrate to unified react-email
• #56: Improve SEO with Open Graph metadata and update manifest.json
:magnifying_glass: Key Technical Highlights
PR refactor: clean up React imports and optimize transitions/search 🏎️ #53 — Non-blocking Transitions & React Hygiene
• Added useDeferredValue with query trimming so real-time thread search never locks up the input or drops frames.
• Wrapped route navigation in startTransition (ComposePage, NotFoundPage) and activated useTransitions on the router.
• Removed redundant React default imports and hardened EMAIL_PROVIDERS as a const assertion.
PR Optimize mailbox and thread navigation with syntax improvements 🚀 #54 — Virtualizer Tuning & O(N) Aggregation
• O(N) Grouping: Replaced spread copying [...(groups.get(key) || []), thread] with in-place .push(), eliminating GC spikes and temporary array allocations when grouping large thread lists.
• Resilient Logout: Migrated Promise.all -> Promise.allSettled in logoutAll so one failing session revocation doesn't block local cleanup.
• Dynamic Virtualization: Attached ref={rowVirtualizer.measureElement} with data-index, replaced MUI Box with lightweight HTML divs inside the high-frequency row loop to avoid runtime CSS-in-JS overhead, and aligned offset caching with scrollToOffset(0).
• Deferred Previews: Form inputs in TemplateEditor remain high-priority by deferring markdown/HTML preview rendering via useDeferredValue.
PR chore(deps): upgrade dependencies and migrate to unified react-email #55 — Modernized Dependencies & Deprecation Cleanups
• Migrated away from deprecated @react-email/components (1.0.12) to unified react-email (^6.11.6) and updated @react-email/render to 2.2.0.
• Upgraded @tanstack/react-virtual (3.14.24) to fix touch/fling momentum scroll bugs on mobile devices.
• Upgraded styled-components (6.6.0) to fix the MUI styled-engine hook evaluation crash, updated dompurify (native types, removed @types/dompurify), and upgraded Vite tooling.
PR Improve SEO with Open Graph metadata and update manifest.json #56 — SEO, PWA & Social Graph Metadata
• Added Schema.org JSON-LD structured data (WebApplication, SoftwareSourceCode, Organization) and full Open Graph / Twitter cards.
• Added noindex, nofollow to 404.html SPA routing redirects to protect crawler indexing budgets.
• Updated manifest.json with Quicksilver theme tokens (#00696F), scope paths, and direct OS action shortcuts (Inbox, Compose).
• (Attached the generated Sri Lanka-themed preview hero asset celebrating local language support and the schema graph for reference).
📆 Plan for Week 2
Client-side Mini-Search: Debounced indexing across participant names and message metadata..
Form Architecture (react-hook-form): Refactor compose and draft forms to uncontrolled subscriptions to eliminate full-component re-renders on keystrokes..
TanStack Query & React Router Data Mode: Move towards createBrowserRouter loaders alongside TanStack Query to resolve the remaining thread double-fetch issues..
Huge thanks to @maneesha-xyz for the reviews and guidance so far! Let me know if you have any feedback on the PRs.
Here is the update for Week 2 (including the latest merged PRs and a quick follow-up fix PR). I spent some unscheduled time on performance optimization this week after profiling <MailPage> in React DevTools and noticing significant main-thread lag, alongside landing keyboard navigation via @tanstack/react-hotkeys.
(Screen recordings and React DevTools profiler traces are attached to the respective PRs and below for comparison.)
Relevance-Ranked Fuzzy Search: Replaced the basic .filter().includes() implementation with minisearch. The previous search failed on typos, partial terms, or differing word order (e.g., searching "Overseas Scholarships A/L" failed to match "Undergraduate Scholarships... for A/L High Achievers"). The new search supports fuzzy queries, prefix matching, and typo tolerance, ranking results by relevance with subject matches prioritized.
Smooth Sidebar Resizer: Building on Ranuga Disansa’s foundational work in d30b57b:
Replaced direct style updates with requestAnimationFrame to prevent dropped frames while dragging.
Disabled text selection during drag interactions.
Deferred localStorage persistence to mouseup instead of writing on every pixel move.
Added double-click to reset width to the default (360px), along with keyboard navigation (Home, End, and Arrow keys).
(Note: ~95% of the PR diff is pnpm-lock.yaml; application changes are scoped to ~150 lines in MailPage.tsx.)
Context: Profiling <MailPage> revealed frequent frame drops, and manual memoization (useMemo/useCallback) was becoming difficult to maintain across components. Rather than adding manual boilerplate, I integrated the official React Compiler Vite plugin.
Profiler Results (Before vs. After):
Metric
Before
After
Impact
Cumulative render time
490.9ms
145.8ms
~70% reduction
Median render time (p50)
15.7ms
5.1ms
~67% faster
Long tasks (>50ms)
4
0
Eliminated
120 FPS passes
1
11
11x increase
Zero Boilerplate: Added 0 lines of manual memoization while improving input latency and INP scores, especially on lower-end mobile devices.
Controlled Re-renders: Switched LoginForm to react-hook-form to eliminate full-component re-renders on every keystroke.
Stricter Client-Side Validation: Replaced the loose email regex (!/\S+@\S+\.\S+/) with Zod schema validation before requests hit the backend—using Zod’s default pattern (aligned with standard Gmail-style rules: /^(?!\.)(?!.*\.\.)([a-z0-9_'+\-\.]*)[a-z0-9_+-]@([a-z0-9][a-z0-9\-]*\.)+[a-z]{2,}$/i).
#61 — Keyboard Shortcuts for Navigation & Thread Actions
TanStack Hotkeys Integration: Added @tanstack/react-hotkeys for lightweight sequence and single-key bindings following familiar email client conventions:
Global Navigation (App.tsx):C (/compose), G then I (/inbox), G then P (/profile), and G then L (/login), with route updates wrapped in startTransition for non-blocking navigation.
Thread Actions (ThreadPage.tsx):R (Reply), A (Reply All), and F (Forward).
Input Guarding: Configured options: { enabled: !isModalOpen } on thread shortcuts so typing inside reply/compose fields never triggers background actions.
#62 — Follow-up: Form Handling & Loading State Fixes
Post-Merge Cleanup: Resolved loading-state regressions introduced during merge conflict resolution in #60 and completed the PasswordResetForm migration missed in #59:
Removed leftover setSubmitting(false) / setLoading(false) calls in AddAccountForm and ProfileForm.
Updated LoginForm, RegistrationForm, and PasswordResetForm to rely on isSubmitting (loading || isSubmitting) so loading states reset cleanly.
Converted PasswordResetForm to react-hook-form (replacing manual state and validation).
📆 Roadmap Updates & Next Steps
Availability & Refactor Pacing: I have university exams coming up in early December, so my hours will be lighter over the next couple of weeks while I focus on prep. To avoid rushing the TanStack Query + React Router Data Mode (createBrowserRouter loaders) refactor half-baked, I will wrap up #62 cleanly now and pick up the router/cache synchronization work at full speed right after exams. In the meantime, I'd love to collaborate with @maneesha-xyz on defining/scoping the next batch of issues so everything is ready to go.
Exploratory Note — WebMCP: Following up on our Slack discussion, WebMCP (navigator.modelContext) is still experimental (early browser origin-trial stage), unlike production backend MCP integrations such as Superhuman Mail's hosted MCP server. While it's an interesting browser-native alternative to brittle DOM scraping, any future exploration in Quicksilver should remain strictly read/assistive (e.g., searching, sorting, or preparing drafts with explicit human confirmation before sending)—and wait until after our core TanStack Query + React Router refactor is complete.
Huge thanks to @maneesha-xyz for reviewing and merging the Week 2 PRs (#58–#61) and helping scope upcoming issues, and to Ranuga Disansa for the initial sidebar resizer implementation! Let me know if you have any feedback on #62.
Activity
sanjaiyan-dev commentedon Oct 28, 2026
Thanks for setting up the issue @maneesha-xyz :)
My plan is to start with
useDeferredValuefor concurrent rendering since it’s pretty low-risk with a solid payoff.From there, I'll do a few small type cleanups and optimize the presence logic without breaking anything. I also want to test lazy route loading locally to see how React Router handles it before putting up a PR. Once that looks good, we can bring in React Query and bump React Router to the latest data APIs.
Quick question on Biome: do you prefer rolling it out file-by-file, or just setting it up across the repo in one PR?
maneesha-xyz commentedon Oct 28, 2026
Looks good.
RE Biome: we can do it repo wide.
sanjaiyan-dev commentedon Nov 4, 2026
Hi,
Here is the update for Week 1. While a couple of tasks expanded slightly beyond the initial outline during code exploration, all changes are low-risk, backward-compatible, and high-impact for UX and codebase health.
🚀 Week 1 Pull Requests Overview
• #53: refactor: clean up React imports and optimize transitions/search
• #54: Optimize mailbox and thread navigation with syntax improvements
• #55: chore(deps): upgrade dependencies and migrate to unified react-email
• #56: Improve SEO with Open Graph metadata and update manifest.json
:magnifying_glass: Key Technical Highlights
PR refactor: clean up React imports and optimize transitions/search 🏎️ #53 — Non-blocking Transitions & React Hygiene
• Added useDeferredValue with query trimming so real-time thread search never locks up the input or drops frames.
• Wrapped route navigation in startTransition (ComposePage, NotFoundPage) and activated useTransitions on the router.
• Removed redundant React default imports and hardened EMAIL_PROVIDERS as a const assertion.
PR Optimize mailbox and thread navigation with syntax improvements 🚀 #54 — Virtualizer Tuning & O(N) Aggregation
• O(N) Grouping: Replaced spread copying [...(groups.get(key) || []), thread] with in-place .push(), eliminating GC spikes and temporary array allocations when grouping large thread lists.
• Resilient Logout: Migrated Promise.all -> Promise.allSettled in logoutAll so one failing session revocation doesn't block local cleanup.
• Dynamic Virtualization: Attached ref={rowVirtualizer.measureElement} with data-index, replaced MUI Box with lightweight HTML divs inside the high-frequency row loop to avoid runtime CSS-in-JS overhead, and aligned offset caching with scrollToOffset(0).
• Deferred Previews: Form inputs in TemplateEditor remain high-priority by deferring markdown/HTML preview rendering via useDeferredValue.
PR chore(deps): upgrade dependencies and migrate to unified
react-email#55 — Modernized Dependencies & Deprecation Cleanups• Migrated away from deprecated @react-email/components (1.0.12) to unified react-email (^6.11.6) and updated @react-email/render to 2.2.0.
• Upgraded @tanstack/react-virtual (3.14.24) to fix touch/fling momentum scroll bugs on mobile devices.
• Upgraded styled-components (6.6.0) to fix the MUI styled-engine hook evaluation crash, updated dompurify (native types, removed @types/dompurify), and upgraded Vite tooling.
PR Improve SEO with Open Graph metadata and update manifest.json #56 — SEO, PWA & Social Graph Metadata
• Added Schema.org JSON-LD structured data (WebApplication, SoftwareSourceCode, Organization) and full Open Graph / Twitter cards.
• Added noindex, nofollow to 404.html SPA routing redirects to protect crawler indexing budgets.
• Updated manifest.json with Quicksilver theme tokens (#00696F), scope paths, and direct OS action shortcuts (Inbox, Compose).
• (Attached the generated Sri Lanka-themed preview hero asset celebrating local language support and the schema graph for reference).
📆 Plan for Week 2
Huge thanks to @maneesha-xyz for the reviews and guidance so far! Let me know if you have any feedback on the PRs.
sanjaiyan-dev commentedon Nov 18, 2026
Hi,
Here is the update for Week 2 (including the latest merged PRs and a quick follow-up fix PR). I spent some unscheduled time on performance optimization this week after profiling
<MailPage>in React DevTools and noticing significant main-thread lag, alongside landing keyboard navigation via@tanstack/react-hotkeys.(Screen recordings and React DevTools profiler traces are attached to the respective PRs and below for comparison.)
🚀 Week 2 Pull Requests Overview
react-hook-form+ Zod (Merged)fix: Refactor form handling and improve loading state management(Open follow-up)🔍 Key Technical Highlights
#58 — MiniSearch Integration & Sidebar Resizer
.filter().includes()implementation withminisearch. The previous search failed on typos, partial terms, or differing word order (e.g., searching"Overseas Scholarships A/L"failed to match"Undergraduate Scholarships... for A/L High Achievers"). The new search supports fuzzy queries, prefix matching, and typo tolerance, ranking results by relevance with subject matches prioritized.requestAnimationFrameto prevent dropped frames while dragging.localStoragepersistence tomouseupinstead of writing on every pixel move.360px), along with keyboard navigation (Home,End, andArrowkeys).pnpm-lock.yaml; application changes are scoped to ~150 lines inMailPage.tsx.)#60 — React Compiler via Vite Plugin
<MailPage>revealed frequent frame drops, and manual memoization (useMemo/useCallback) was becoming difficult to maintain across components. Rather than adding manual boilerplate, I integrated the official React Compiler Vite plugin.490.9ms145.8ms15.7ms5.1ms>50ms)40111#59 — LoginForm:
react-hook-form+ ZodLoginFormtoreact-hook-formto eliminate full-component re-renders on every keystroke.!/\S+@\S+\.\S+/) with Zod schema validation before requests hit the backend—using Zod’s default pattern (aligned with standard Gmail-style rules:/^(?!\.)(?!.*\.\.)([a-z0-9_'+\-\.]*)[a-z0-9_+-]@([a-z0-9][a-z0-9\-]*\.)+[a-z]{2,}$/i).#61 — Keyboard Shortcuts for Navigation & Thread Actions
@tanstack/react-hotkeysfor lightweight sequence and single-key bindings following familiar email client conventions:App.tsx):C(/compose),GthenI(/inbox),GthenP(/profile), andGthenL(/login), with route updates wrapped instartTransitionfor non-blocking navigation.ThreadPage.tsx):R(Reply),A(Reply All), andF(Forward).options: { enabled: !isModalOpen }on thread shortcuts so typing inside reply/compose fields never triggers background actions.#62 — Follow-up: Form Handling & Loading State Fixes
#60and completed thePasswordResetFormmigration missed in#59:setSubmitting(false)/setLoading(false)calls inAddAccountFormandProfileForm.LoginForm,RegistrationForm, andPasswordResetFormto rely onisSubmitting(loading || isSubmitting) so loading states reset cleanly.PasswordResetFormtoreact-hook-form(replacing manual state and validation).📆 Roadmap Updates & Next Steps
createBrowserRouterloaders) refactor half-baked, I will wrap up#62cleanly now and pick up the router/cache synchronization work at full speed right after exams. In the meantime, I'd love to collaborate with @maneesha-xyz on defining/scoping the next batch of issues so everything is ready to go.<Suspense>: Lazy-loading heavier views to reduce initial bundle size (Sub-task 4).navigator.modelContext) is still experimental (early browser origin-trial stage), unlike production backend MCP integrations such as Superhuman Mail's hosted MCP server. While it's an interesting browser-native alternative to brittle DOM scraping, any future exploration in Quicksilver should remain strictly read/assistive (e.g., searching, sorting, or preparing drafts with explicit human confirmation before sending)—and wait until after our core TanStack Query + React Router refactor is complete.Huge thanks to @maneesha-xyz for reviewing and merging the Week 2 PRs (
#58–#61) and helping scope upcoming issues, and to Ranuga Disansa for the initial sidebar resizer implementation! Let me know if you have any feedback on#62.