Skip to content
Merged
7 changes: 7 additions & 0 deletions crates/okena-app/src/keybindings/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,13 @@ impl KeybindingConfig {
KeybindingEntry::new("ctrl-shift-m", Some("TerminalPane")),
],
);
bindings.insert(
"ToggleUnread".to_string(),
vec![
KeybindingEntry::new("cmd-u", Some("TerminalPane")),
KeybindingEntry::new("ctrl-shift-u", Some("TerminalPane")),
],
);
bindings.insert(
"Copy".to_string(),
vec![
Expand Down
13 changes: 11 additions & 2 deletions crates/okena-app/src/keybindings/descriptions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ use super::{
ShowFileSearch, ShowHookLog, ShowKeybindings, ShowLogConsole, ShowProfileManager,
ShowProjectSwitcher, ShowSessionManager, ShowSettings, ShowThemeSelector, SplitHorizontal,
SplitVertical, StartAllServices, StopAllServices, ToggleFullscreen, TogglePaneSwitcher,
ToggleProjectLayout, ToggleProjectVisibility, ToggleSidebar, ToggleSidebarAutoHide, ZoomIn,
ZoomOut,
ToggleProjectLayout, ToggleProjectVisibility, ToggleSidebar, ToggleSidebarAutoHide,
ToggleUnread, ZoomIn, ZoomOut,
};

/// Get human-readable descriptions for all actions
Expand Down Expand Up @@ -160,6 +160,15 @@ pub fn get_action_descriptions() -> HashMap<&'static str, ActionDescription> {
factory: || Box::new(MinimizeTerminal),
},
);
map.insert(
"ToggleUnread",
ActionDescription {
name: "Mark as Unread",
description: "Raise (or clear) the terminal's unread bell mark",
category: "Terminal",
factory: || Box::new(ToggleUnread),
},
);
map.insert(
"Copy",
ActionDescription {
Expand Down
3 changes: 2 additions & 1 deletion crates/okena-app/src/keybindings/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub use okena_views_terminal::actions::{
FocusPrevTerminal, FocusRight, FocusUp, FullscreenNextTerminal, FullscreenPrevTerminal,
JumpToNextFailedCommand, JumpToNextPrompt, JumpToPreviousFailedCommand, JumpToPreviousPrompt,
MinimizeTerminal, Paste, ResetZoom, Search, SearchNext, SearchPrev, SendBacktab, SendEscape,
SendTab, SplitHorizontal, SplitVertical, ToggleFullscreen, ZoomIn, ZoomOut,
SendTab, SplitHorizontal, SplitVertical, ToggleFullscreen, ToggleUnread, ZoomIn, ZoomOut,
};

// Sidebar-specific actions (defined in okena-views-sidebar crate)
Expand Down Expand Up @@ -388,6 +388,7 @@ fn create_keybinding(action: &str, keystroke: &str, context: Option<&str>) -> Op
"AddTab" => Some(KeyBinding::new(keystroke, AddTab, context)),
"CloseTerminal" => Some(KeyBinding::new(keystroke, CloseTerminal, context)),
"MinimizeTerminal" => Some(KeyBinding::new(keystroke, MinimizeTerminal, context)),
"ToggleUnread" => Some(KeyBinding::new(keystroke, ToggleUnread, context)),
"FocusNextTerminal" => Some(KeyBinding::new(keystroke, FocusNextTerminal, context)),
"FocusPrevTerminal" => Some(KeyBinding::new(keystroke, FocusPrevTerminal, context)),
"FocusLeft" => Some(KeyBinding::new(keystroke, FocusLeft, context)),
Expand Down
93 changes: 73 additions & 20 deletions crates/okena-app/src/views/overlay_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,14 @@ pub enum OverlayManagerEvent {
},

/// Context menu: Add terminal to project
AddTerminal { project_id: String },
AddTerminal {
project_id: String,
},

/// Context menu: Create worktree from project
CreateWorktree { project_id: String },
CreateWorktree {
project_id: String,
},

/// Context menu: Rename project
RenameProject {
Expand All @@ -157,7 +161,9 @@ pub enum OverlayManagerEvent {
},

/// Context menu: Close worktree project (opens the confirm dialog)
CloseWorktree { project_id: String },
CloseWorktree {
project_id: String,
},

/// Context menu: Open the daemon-backed worktree list.
ManageWorktrees {
Expand All @@ -174,19 +180,29 @@ pub enum OverlayManagerEvent {
},

/// Context menu: Delete project
DeleteProject { project_id: String },
DeleteProject {
project_id: String,
},

/// Context menu: Toggle a project's pinned flag
ToggleProjectPinned { project_id: String },
ToggleProjectPinned {
project_id: String,
},

/// Folder context menu: Delete folder
DeleteFolder { folder_id: String },
DeleteFolder {
folder_id: String,
},

/// Context menu: Configure hooks for a project
ConfigureHooks { project_id: String },
ConfigureHooks {
project_id: String,
},

/// Context menu: Quick create worktree (one-click)
QuickCreateWorktree { project_id: String },
QuickCreateWorktree {
project_id: String,
},

/// Color picker: project color was changed (for remote sync)
ProjectColorChanged {
Expand All @@ -195,7 +211,9 @@ pub enum OverlayManagerEvent {
},

/// Color picker: a worktree project's color override was reset to its parent
WorktreeColorReset { project_id: String },
WorktreeColorReset {
project_id: String,
},

/// Color picker: folder color was changed
FolderColorChanged {
Expand All @@ -204,10 +222,14 @@ pub enum OverlayManagerEvent {
},

/// Context menu: Reload services (okena.yaml) for a project
ReloadServices { project_id: String },
ReloadServices {
project_id: String,
},

/// Context menu: Focus parent project of a worktree
FocusParent { project_id: String },
FocusParent {
project_id: String,
},

/// Project switcher: Focus a specific project
FocusProject(String),
Expand All @@ -220,10 +242,14 @@ pub enum OverlayManagerEvent {
ToggleProjectVisibility(String),

/// Remote connect dialog: connection paired and ready
RemoteConnected { config: RemoteConnectionConfig },
RemoteConnected {
config: RemoteConnectionConfig,
},

/// Remote context menu: reconnect to a connection
RemoteReconnect { connection_id: String },
RemoteReconnect {
connection_id: String,
},

/// Remote context menu: open pair dialog
RemotePair {
Expand All @@ -238,25 +264,41 @@ pub enum OverlayManagerEvent {
},

/// Remote pair dialog: user submitted a code
RemotePaired { connection_id: String, code: String },
RemotePaired {
connection_id: String,
code: String,
},

/// Remote context menu: remove a connection
RemoteRemoveConnection { connection_id: String },
RemoteRemoveConnection {
connection_id: String,
},

/// Terminal context menu: copy
TerminalCopy { terminal_id: String },
TerminalCopy {
terminal_id: String,
},
/// Terminal context menu: annotate the selection and send it back.
/// The host owns the terminals, so only it can snapshot the selected text.
TerminalAnnotate {
terminal_id: String,
position: gpui::Point<gpui::Pixels>,
},
/// Terminal context menu: paste
TerminalPaste { terminal_id: String },
TerminalPaste {
terminal_id: String,
},
/// Terminal context menu: clear
TerminalClear { terminal_id: String },
TerminalClear {
terminal_id: String,
},
TerminalToggleUnread {
terminal_id: String,
},
/// Terminal context menu: select all
TerminalSelectAll { terminal_id: String },
TerminalSelectAll {
terminal_id: String,
},
/// Terminal context menu: split
TerminalSplit {
project_id: String,
Expand Down Expand Up @@ -289,7 +331,10 @@ pub enum OverlayManagerEvent {
},

/// File viewer blame click: open the named commit in the diff viewer.
OpenCommitFromBlame { project_id: String, hash: String },
OpenCommitFromBlame {
project_id: String,
hash: String,
},

OpenFileExternally {
path: String,
Expand Down Expand Up @@ -1258,6 +1303,7 @@ impl OverlayManager {
layout_path: Vec<usize>,
position: gpui::Point<gpui::Pixels>,
has_selection: bool,
has_bell: bool,
link_url: Option<String>,
cx: &mut Context<Self>,
) {
Expand All @@ -1271,6 +1317,7 @@ impl OverlayManager {
layout_path,
position,
has_selection,
has_bell,
link_url,
cx,
)
Expand Down Expand Up @@ -1316,6 +1363,12 @@ impl OverlayManager {
terminal_id: terminal_id.clone(),
});
}
TerminalContextMenuEvent::ToggleUnread { terminal_id } => {
this.hide_terminal_context_menu(cx);
cx.emit(OverlayManagerEvent::TerminalToggleUnread {
terminal_id: terminal_id.clone(),
});
}
TerminalContextMenuEvent::Split {
project_id,
layout_path,
Expand Down
Loading
Loading