Skip to content

Commit 35db724

Browse files
committed
feat(ie-shell): add F5/Ctrl+Shift+R page reload shortcut
Reload re-navigates to the current tab's URL. Added to help overlay listing.
1 parent 7d5c914 commit 35db724

3 files changed

Lines changed: 13 additions & 0 deletions

File tree

crates/ie-render/src/chrome.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ const HELP_SHORTCUTS: &[(&str, &str)] = &[
294294
("Ctrl+Shift+T", "Tab list"),
295295
("Ctrl+D", "Bookmark page"),
296296
("Ctrl+Shift+B", "Bookmarks"),
297+
("F5 / Ctrl+Shift+R", "Reload page"),
297298
("Alt+Left", "Go back"),
298299
("Alt+Right", "Go forward"),
299300
("Ctrl+H / F1", "This help"),

crates/ie-shell/src/app.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,14 @@ impl Browser {
161161
self.overlay = OverlayState::StatusBar;
162162
tracing::info!("overlay: StatusBar");
163163
}
164+
Action::Reload => {
165+
if let Some(tab) = self.tab_manager.active_tab()
166+
&& let Some(url) = tab.url.clone()
167+
{
168+
tracing::info!("reload: tab={}, url={}", tab.id.0, url);
169+
self.start_navigation(url);
170+
}
171+
}
164172
Action::GoBack => {
165173
if self.tab_manager.go_back()
166174
&& let Some(tab) = self.tab_manager.active_tab()

crates/ie-shell/src/keybindings.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ pub enum Action {
1313
ShowBookmarks,
1414
ShowHelp,
1515
ShowStatusBar,
16+
Reload,
1617
GoBack,
1718
GoForward,
1819
DismissOverlay,
@@ -34,13 +35,16 @@ fn resolve_key(key: &Key, modifiers: &ModifiersState) -> Option<Action> {
3435
match key {
3536
Key::Named(NamedKey::Escape) => Some(Action::DismissOverlay),
3637
Key::Named(NamedKey::F1) => Some(Action::ShowHelp),
38+
Key::Named(NamedKey::F5) => Some(Action::Reload),
3739
Key::Named(NamedKey::F12) => Some(Action::ShowStatusBar),
3840
Key::Named(NamedKey::Tab) if ctrl && shift => Some(Action::PrevTab),
3941
Key::Named(NamedKey::Tab) if ctrl => Some(Action::NextTab),
4042
Key::Named(NamedKey::ArrowLeft) if alt => Some(Action::GoBack),
4143
Key::Named(NamedKey::ArrowRight) if alt => Some(Action::GoForward),
4244
Key::Character(c) if ctrl => match c.as_str() {
4345
"h" | "H" => Some(Action::ShowHelp),
46+
"R" => Some(Action::Reload),
47+
"r" if shift => Some(Action::Reload),
4448
"l" | "L" => Some(Action::ShowAddressBar),
4549
"T" => Some(Action::ShowTabList),
4650
"t" if shift => Some(Action::ShowTabList),

0 commit comments

Comments
 (0)