Skip to content

Conversation

@kookyleo
Copy link

Problem

Users experience unwanted periodic page refreshes due to WebSocket reconnection behavior in the reload library. The current implementation automatically refreshes the page whenever a WebSocket connection is re-established, even when no files have changed. This creates a disruptive editing experience for users who prefer stable workflows.

Solution

  • Add --no-reload flag to disable WebSocket-based auto-refresh functionality
  • Include WebSocket CORS fix when reload is enabled for development environments
  • Provide clear user feedback about current refresh mode on startup
  • Maintain backward compatibility with auto-reload enabled by default

Usage

Enable auto-reload (default behavior)

go-grip README.md
# Output: 📡 Auto-reload enabled. Files will trigger browser refresh.

Disable auto-reload for stable editing

go-grip README.md --no-reload
# Output: 🔄 Auto-reload disabled. Use F5 to manually refresh.

Technical Details

  • When reload is enabled: automatically fixes WebSocket CORS issues for development use
  • When reload is disabled: uses standard HTTP handler without WebSocket overhead
  • Clear status messages help users understand current mode
  • No breaking changes to existing functionality

Benefits

  • ✅ Eliminates unwanted periodic refreshes
  • ✅ Gives users control over their editing workflow
  • ✅ Fixes WebSocket CORS issues in development
  • ✅ Maintains backward compatibility
  • ✅ Provides clear user feedback

…optimized layout

- Add global font support for Chinese, Japanese, Korean, Arabic, Hindi and other major languages
- Optimize print margins with binding-friendly layout (left 2cm, others 1.5cm)
- Improve print typography with proper page breaks and clean backgrounds
- Preserve text colors while removing background interference
- Update README with detailed print features documentation
- Add new --no-reload flag to disable WebSocket-based auto-refresh
- Provide clear user feedback about current refresh mode
- Maintain backward compatibility with auto-reload enabled by default
- Include WebSocket CORS fix when reload is enabled for development use
- Update README with usage example for stable editing workflow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant