@@ -177,3 +177,39 @@ def test_collapse_all_only_in_tree_mode(self):
177177 value_view_tree_mode = False ,
178178 )
179179 assert sm .check_action (ctx , "collapse_all_json_nodes" ) is False
180+
181+
182+ class TestEmptyExplorerFooter :
183+ """Empty-state footer must guide a first-time user toward `n` for New."""
184+
185+ def test_new_connection_in_footer_when_explorer_focused_empty (self ):
186+ sm = UIStateMachine ()
187+ ctx = make_context (focus = "explorer" , tree_node_kind = None )
188+ left , _right = sm .get_display_bindings (ctx )
189+ actions = [b .action for b in left ]
190+ assert "new_connection" in actions , (
191+ "First-time users with no connections must see `n` for New "
192+ "in the footer when the explorer is focused."
193+ )
194+
195+ def test_refresh_tree_in_footer_when_explorer_focused_empty (self ):
196+ sm = UIStateMachine ()
197+ ctx = make_context (focus = "explorer" , tree_node_kind = None )
198+ left , _right = sm .get_display_bindings (ctx )
199+ actions = [b .action for b in left ]
200+ assert "refresh_tree" in actions
201+
202+ def test_visual_mode_hidden_from_footer_when_tree_empty (self ):
203+ """Visual selection mode only makes sense when there's something to select."""
204+ sm = UIStateMachine ()
205+ ctx = make_context (focus = "explorer" , tree_node_kind = None )
206+ left , _right = sm .get_display_bindings (ctx )
207+ actions = [b .action for b in left ]
208+ assert "enter_tree_visual_mode" not in actions
209+
210+ def test_visual_mode_shown_in_footer_when_node_highlighted (self ):
211+ sm = UIStateMachine ()
212+ ctx = make_context (focus = "explorer" , tree_node_kind = "connection" )
213+ left , _right = sm .get_display_bindings (ctx )
214+ actions = [b .action for b in left ]
215+ assert "enter_tree_visual_mode" in actions
0 commit comments