perf: resolve all 7 open performance issues - #20
Merged
Conversation
- lib/supabase/server.ts: wrap createAdminClient with React cache() so all server actions within the same request share one Supabase client instance instead of constructing a fresh one per call (closes #17) - components/nodes/BaseNode.tsx: replace transition-all with transition-[border-color,opacity] to avoid triggering style recalc for unrelated CSS properties on every state change (closes #11) https://claude.ai/code/session_017P7S4SuivspHeeXfok7WzX
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #20 +/- ##
=======================================
Coverage 72.50% 72.50%
=======================================
Files 11 11
Lines 440 440
Branches 134 134
=======================================
Hits 319 319
Misses 72 72
Partials 49 49 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
$(cat <<'EOF'
Summary
Resolves all 7 open GitHub performance issues. Two were already fixed in the current codebase (#12, #13) and closed without code changes; the remaining five are addressed here.
completions.ts— Replace racy SELECT + UPDATE XP pattern with the pre-existing atomicincrement_xpRPC. Eliminates the race condition where two concurrent completions could overwrite each other's XP, and cuts 2 sequential DB round-trips to 1.ChallengeLayout— Extract draft-saving into a new render-lessDraftSavercomponent that subscribes to the architecture store via Zustand'ssubscribe()API (outside React's render cycle).ChallengeLayoutno longer subscribes tonodes/edges, so it no longer re-renders on every drag pixel.lib/supabase/server.ts— WrapcreateAdminClientwith Reactcache()so all server actions within the same request share one client instance.BaseNode.tsx— Replacetransition-allwithtransition-[border-color,opacity]to avoid triggering style recalc for unrelated CSS properties on every state change.Test plan
DraftSaver.test.tsx— covers subscribe-on-mount, 1500ms trailing debounce, rapid-change debounce reset, and unmount cleanupcompletions.test.ts— replacedmockUpdateEq/mockProfileSinglewithmockRpc; added assertions thatincrement_xpis called with correct args and is NOT called on a repeat passconfig-panel.spec.ts— scopedconfig-instanceCountlocators to the desktop sidebar wrapper to avoid strict-mode ambiguity withMobileConfigPanelhttps://claude.ai/code/session_017P7S4SuivspHeeXfok7WzX
EOF
)
Generated by Claude Code