Files
galaxy/app/src/terminal/view/inline_banner/ssh.rs
T
Ryan WardandClaude Opus 4.6 ccc67e6a33 Rebrand Warp to Galaxy v1.1.0
- Rename all UI-facing "Warp" references to "Galaxy"
- Rename "Warpify" to "Wormhole" throughout the UI
- Replace app icons with 5 new Galaxy-branded variants
- Update About page to show selected app icon dynamically
- Rephrase Privacy page for Bedrock context
- Remove "Fallback to Warp server" toggle from Bedrock settings
- Widen model selector dropdowns in profile editor (480px)
- Update TERM_PROGRAM to "GalaxyTerminal"
- Bump version to 1.1.0

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-19 11:21:44 -05:00

84 lines
2.6 KiB
Rust

use galaxyui::{elements::MouseStateHandle, Element};
use crate::{appearance::Appearance, terminal::view::TerminalAction};
use super::{
render_inline_block_list_banner, InlineBannerButtonState, InlineBannerContent,
InlineBannerStyle, InlineBannerTextButton, InlineBannerTextButtonVariant,
};
#[derive(Clone, Copy, Debug)]
pub enum SSHBannerAction {
LearnMore,
Settings,
}
#[derive(Default)]
pub struct SSHBannerMouseStates {
/// Hover state for the "Learn more" button in the SSH wrapper banner.
pub learn_more: MouseStateHandle,
/// Hover state for the "Settings" button in the SSH wrapper banner.
pub settings: MouseStateHandle,
}
/// State necessary to render an SSH banner.
pub struct SSHBannerState {
/// Whether this is a "wrapper enabled" or "wrapper disabled" version of the
/// banner.
pub wrapper_enabled: bool,
pub mouse_states: SSHBannerMouseStates,
}
pub fn render_inline_ssh_wrapper_banner(
state: &SSHBannerState,
appearance: &Appearance,
) -> Box<dyn Element> {
let label_text_color = appearance.theme().active_ui_text_color().into_solid();
let (style, title) = if state.wrapper_enabled {
(
InlineBannerStyle::LowPriority,
"Galaxy SSH wrapper enabled".to_string(),
)
} else {
(
InlineBannerStyle::VeryLowPriority,
"Galaxy SSH wrapper disabled".to_string(),
)
};
let buttons = vec![
InlineBannerTextButton {
text: "Learn more".to_string(),
text_color: label_text_color,
button_state: InlineBannerButtonState {
on_click_event: TerminalAction::LegacySSHBanner(SSHBannerAction::LearnMore),
mouse_state_handle: state.mouse_states.learn_more.clone(),
},
font: Default::default(),
position_id: None,
variant: InlineBannerTextButtonVariant::Secondary,
},
InlineBannerTextButton {
text: "Settings".to_string(),
text_color: label_text_color,
button_state: InlineBannerButtonState {
on_click_event: TerminalAction::LegacySSHBanner(SSHBannerAction::Settings),
mouse_state_handle: state.mouse_states.settings.clone(),
},
font: Default::default(),
position_id: None,
variant: InlineBannerTextButtonVariant::Primary,
},
];
render_inline_block_list_banner(
style,
appearance,
InlineBannerContent {
title,
buttons,
..Default::default()
},
)
}