Claude sonnet 4.5 experiments#2
Draft
emberian wants to merge 28 commits into
Draft
Conversation
- Use StoredValue for all contexts to prevent re-creation on re-renders - Fix modal event listener using window_event_listener for proper cleanup - AppState now created once, preventing exponential listener accumulation - Critical bug fixed: login page no longer lags after keystrokes
- Added event_log signal to store all GameEvents - Updated handle_game_event to store events before processing - Added get_event_log_signal accessor for components - Events now accumulated in reactive signals (no HTTP fetches needed) - Implements memory management (keep last 500 events max)
- Completely rewrote GameHistory to read from event_log signal - Removed LocalResource and all HTTP fetching from history panel - Removed deprecated history_version signal and bump_history method - History now updates instantly via reactive signals (no HTTP delay) - Major performance improvement: 0 HTTP requests vs dozens per game
- Added best practices documentation to helpers.rs - Formatted code with cargo fmt - All phases complete and tested - Ready for production use
CRITICAL FIXES: 1. NetworkStatus: Event Listener Leak (CATASTROPHIC) - Fixed manual Closure management with .forget() causing listener accumulation - Replaced with window_event_listener for automatic cleanup - File: webapp/src/components/common.rs 2. KeyboardContext: Global Listener in Constructor (CRITICAL) - Removed setup_listener() from constructor that leaked listeners - Created separate KeyboardListener component with proper cleanup - Every keystroke was firing multiple accumulated listeners causing severe lag - Files: webapp/src/components/keyboard.rs, mod.rs, main.rs 3. Inefficient Signal Subscriptions (HIGH) - All get_*_signal() methods were using .get() creating HashMap subscriptions - Changed to .get_untracked() to avoid unnecessary re-renders - Components no longer re-render on unrelated game additions/removals - File: webapp/src/state.rs IMPACT: - Eliminates input lag in login/register forms - Stops event listener accumulation - Drastically reduces unnecessary component re-renders - Keyboard shortcuts now execute once per keystroke, not N times Documentation: - WEBAPP_PERFORMANCE_ANALYSIS.md: Root cause analysis - WEBAPP_PERFORMANCE_FIXES.md: Summary of fixes and impact 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
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.
inside these commits there's experimentation and a few dozen dollars of claude usage.