MCPcopy Create free account
hub / github.com/GCWing/BitFun / navigate_back

Method navigate_back

src/apps/cli/src/ui/startup.rs:2035–2072  ·  view source on GitHub ↗

Navigate back to the previous popup in the stack, or close current if at the root

(&mut self)

Source from the content-addressed store, hash-verified

2033
2034 /// Navigate back to the previous popup in the stack, or close current if at the root
2035 fn navigate_back(&mut self) {
2036 // First hide the currently visible popup
2037 if self.command_palette.is_visible() {
2038 self.command_palette.hide();
2039 } else if self.model_selector.is_visible() {
2040 self.model_selector.hide();
2041 } else if self.agent_selector.is_visible() {
2042 self.agent_selector.hide();
2043 } else if self.session_selector.is_visible() {
2044 self.session_selector.hide();
2045 } else if self.skill_selector.is_visible() {
2046 self.skill_selector.hide();
2047 } else if self.subagent_selector.is_visible() {
2048 self.subagent_selector.hide();
2049 } else if self.theme_selector.is_visible() {
2050 self.theme_selector.hide();
2051 self.cancel_theme_preview();
2052 } else if self.provider_selector.is_visible() {
2053 self.provider_selector.hide();
2054 } else if self.model_config_form.is_visible() {
2055 self.model_config_form.hide();
2056 }
2057
2058 // If there's a previous popup in the stack, re-show it
2059 if let Some(previous) = self.popup_stack.pop() {
2060 match previous {
2061 PopupType::CommandPalette => self.command_palette.reshow(),
2062 PopupType::ModelSelector => self.model_selector.reshow(),
2063 PopupType::AgentSelector => self.agent_selector.reshow(),
2064 PopupType::SessionSelector => self.session_selector.reshow(),
2065 PopupType::SkillSelector => self.skill_selector.reshow(),
2066 PopupType::SubagentSelector => self.subagent_selector.reshow(),
2067 PopupType::ThemeSelector => self.theme_selector.reshow(),
2068 PopupType::ProviderSelector => self.provider_selector.reshow(),
2069 PopupType::ModelConfigForm => self.model_config_form.reshow(),
2070 }
2071 }
2072 }
2073
2074 /// Close all popups and clear the navigation stack
2075 fn close_all_popups(&mut self) {

Callers 1

handle_keyMethod · 0.45

Calls 5

is_visibleMethod · 0.45
hideMethod · 0.45
cancel_theme_previewMethod · 0.45
popMethod · 0.45
reshowMethod · 0.45

Tested by

no test coverage detected