Add command-mode floating switcher overlay
Whenever the command query starts with the existing '>' prefix the shell now overlays a 640-wide floating panel — backdrop dim, glass card, three ranked sections (Open tabs from snapshot.tabs, History from snapshot.history_entries, and a fixed action set for workspace + key internal routes), and a footer with the design's keyboard hints. Each result is a real navigation hop; selecting a row dispatches the appropriate shell action and clears the command query so the overlay dismisses without leaving stale chrome state. The overlay reads from the live BrowserSnapshot rather than fabricating results, and matches case-insensitively against title and URL. Empty queries surface the most recent items so the panel stays useful even before the user types.
This commit is contained in:
@@ -72,4 +72,15 @@ impl ElyShell {
|
||||
cx.write_to_clipboard(ClipboardItem::new_string(tab.url().as_str().to_string()));
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn dismiss_command_mode(&mut self, window: &mut Window, cx: &mut Context<Self>) {
|
||||
if let ShellState::Ready(core) = &mut self.state {
|
||||
core.set_command_query(String::new());
|
||||
}
|
||||
|
||||
self.command_input.update(cx, |input, cx| {
|
||||
input.set_value("", window, cx);
|
||||
});
|
||||
cx.notify();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user