Skip to content

Conversation

@cubicj
Copy link
Contributor

@cubicj cubicj commented Oct 22, 2025

PR Checklist

  • Have you checked if it works normally in all models? Ignore this if it doesn't use models.
  • Have you checked if it works normally in all web, local, and node hosted versions? If it doesn't, have you blocked it in those versions?
  • Have you added type definitions?

Description

This PR adds an option to prevent the browser's default refresh behavior when pressing Ctrl+R or Ctrl+Shift+R. This is useful for users who want to use these shortcuts for other purposes without accidentally refreshing the page.

What's New

  • New preventBrowserRefresh option in Database interface
  • Toggle control in Accessibility Settings page
  • Keyboard event handler to block Ctrl+R and Ctrl+Shift+R when option is enabled
  • Support for Korean and English languages

Implementation Details

  • Added preventBrowserRefresh optional boolean field to Database interface
  • Implemented keyboard event prevention in hotkey.ts when option is enabled
  • Case-insensitive key detection to handle both Ctrl+R and Ctrl+Shift+R
  • Added UI toggle in AccessibilitySettings.svelte for easy user control
  • Included language strings in both ko.ts and en.ts

Usage

  1. Go to Settings > Accessibility
  2. Enable "Prevent Browser Refresh (Ctrl+R)" option
  3. Both Ctrl+R and Ctrl+Shift+R will no longer refresh the page when enabled

Technical Changes

  • database.svelte.ts: Added preventBrowserRefresh optional field to Database interface
  • hotkey.ts: Added keyboard event detection with case-insensitive comparison to handle both Ctrl+R and Ctrl+Shift+R
  • AccessibilitySettings.svelte: Added UI toggle for the option
  • ko.ts/en.ts: Added language strings for the new option

This feature provides users with more control over keyboard shortcuts and prevents accidental page refreshes during chat sessions.

Added preventBrowserRefresh option to Database interface.
Added toggle in Accessibility Settings to enable/disable Ctrl+R blocking.
Implemented keyboard event handler to prevent default browser refresh behavior when option is enabled.
Added language support for Korean and English.
Make refresh prevention case-insensitive to handle Ctrl+Shift+R properly
@cubicj cubicj changed the title feat: Add option to prevent browser refresh (Ctrl+R) feat: Add option to prevent browser refresh (Ctrl+R, Ctrl+Shift+R) Oct 28, 2025
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