Skip to content

Various small fixes#349

Merged
MickLesk merged 11 commits intomainfrom
fix/some_small_thnigs
Nov 26, 2025
Merged

Various small fixes#349
MickLesk merged 11 commits intomainfrom
fix/some_small_thnigs

Conversation

@michelroegl-brunner
Copy link
Copy Markdown
Member

@michelroegl-brunner michelroegl-brunner commented Nov 26, 2025

This PR includes various small fixes and improvements:

Commits

65bed15 - Fix random page reloads during normal app usage

  • Memoize startReconnectAttempts with useCallback to prevent recreation on every render
  • Fix useEffect dependency arrays to include memoized function
  • Add stricter guards checking refs before starting reconnect attempts
  • Ensure reconnect logic only runs when actually updating (not during normal usage)
  • Add early return in fallback useEffect to prevent false triggers
  • Add ref guards in ResyncButton to prevent multiple simultaneous sync operations
  • Only reload after sync if it was user-initiated

cd51945 - Filter categories to only show those with scripts

  • Add filter to exclude categories with count 0 from category sidebar
  • Only categories with at least one script will be displayed
  • Reduces UI clutter by hiding empty categories

1d36f76 - Fix downloaded scripts count to include vm/ and tools/ scripts

  • Update matching logic to use same robust approach as DownloadedScriptsTab
  • Add normalized slug matching to handle filename-based slugs vs JSON slugs
  • Add multiple fallback matching strategies for better script detection
  • Fixes issue where scripts in vm/ and tools/ directories weren't being counted

d50aff3 - Fix script viewer to support vm/ and tools/ scripts

  • Update ScriptDetailModal to extract scriptName from any path (ct/, vm/, tools/)
  • Refactor TextViewer to use actual script paths from install_methods
  • Remove hardcoded path assumptions and use dynamic script paths
  • Only show Install Script tab for ct/ scripts that have install scripts
  • Rename CT Script tab to Script for better clarity

- Update ScriptDetailModal to extract scriptName from any path (ct/, vm/, tools/)
- Refactor TextViewer to use actual script paths from install_methods
- Remove hardcoded path assumptions and use dynamic script paths
- Only show Install Script tab for ct/ scripts that have install scripts
- Rename CT Script tab to Script for better clarity
- Update matching logic to use same robust approach as DownloadedScriptsTab
- Add normalized slug matching to handle filename-based slugs vs JSON slugs
- Add multiple fallback matching strategies for better script detection
- Fixes issue where scripts in vm/ and tools/ directories weren't being counted
- Add filter to exclude categories with count 0 from category sidebar
- Only categories with at least one script will be displayed
- Reduces UI clutter by hiding empty categories
- Add guards to prevent reload when not updating
- Use refs to track isUpdating and isNetworkError state in interval callbacks
- Add hasReloadedRef flag to prevent multiple reloads
- Clear reconnect interval when update completes or component unmounts
- Only start reconnect attempts when actually updating
- Prevents false positive reloads when server responds normally
- Add WebSocket upgrade detection to only intercept /ws/script-execution
- Pass all other WebSocket upgrades (including HMR) to Next.js handler
- Ensure _next routes and static assets are properly handled by Next.js
- Fixes 400 errors for Next.js HMR WebSocket connections
- Fixes 403 errors for static assets by ensuring proper routing
- Create WebSocketServer with noServer: true to avoid auto-attaching
- Manually handle upgrade events to route /ws/script-execution to our WebSocketServer
- Route all other WebSocket upgrades (including Next.js HMR) to Next.js handler
- This ensures Next.js HMR WebSocket connections are properly handled
- Fixes 400 errors for /_next/webpack-hmr WebSocket connections
- Go back to attaching WebSocketServer directly with path option
- Remove manual upgrade event handling that was causing errors
- The path option should filter to only /ws/script-execution
- Next.js should handle its own HMR WebSocket upgrades naturally
- Save existing upgrade listeners before adding our own
- Call existing listeners for non-matching paths to allow Next.js HMR
- Only handle /ws/script-execution ourselves
- This ensures Next.js can handle its own WebSocket upgrades for HMR
- Memoize startReconnectAttempts with useCallback to prevent recreation on every render
- Fix useEffect dependency arrays to include memoized function
- Add stricter guards checking refs before starting reconnect attempts
- Ensure reconnect logic only runs when actually updating (not during normal usage)
- Add early return in fallback useEffect to prevent false triggers
- Add ref guards in ResyncButton to prevent multiple simultaneous sync operations
- Only reload after sync if it was user-initiated
- Add isUpdating guard before processing updateLogsData.isComplete
- Reset shouldSubscribe when update completes or fails
- Prevent stale isComplete data from triggering reloads during normal usage
- Add UpdateConfirmationModal component that shows changelog before update
- Modify getVersionStatus to include release body (changelog) in response
- Update VersionDisplay to show confirmation modal instead of starting update directly
- Users must review changelog and click 'Proceed with Update' to start update
- Ensures users see potential breaking changes before updating
@MickLesk MickLesk merged commit 66f8a84 into main Nov 26, 2025
4 checks passed
@MickLesk MickLesk deleted the fix/some_small_thnigs branch April 1, 2026 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants