feat: reveal sandbox sub-options only when sandboxing is on

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-11 10:33:46 -04:00
parent 783bfee79f
commit bafc664251
2 changed files with 45 additions and 9 deletions
+26
View File
@@ -1869,3 +1869,29 @@ async def test_poll_sessions_dispatches_due_prompts_and_notifies():
mock_service.dispatch_due_prompts.assert_awaited_once()
assert any("Prompt sent" in call[0] for call in notify_calls)
@pytest.mark.asyncio
async def test_sandbox_options_hidden_until_switch_on():
"""The fs/net rows are sub-options of the sandbox switch: hidden until it is
turned on, shown when on, hidden again when turned back off."""
app = HqtApp()
async with app.run_test(size=(120, 40)) as pilot:
from hqt.tui.screens.new_session import NewSessionScreen
from textual.widgets import Switch
app.push_screen(
NewSessionScreen(["claude"], is_git_repo=True, sandbox_available=True)
)
await pilot.pause()
options = app.screen.query_one("#sandbox-options")
assert options.display is False
switch = app.screen.query_one("#sandbox-switch", Switch)
switch.value = True
await pilot.pause()
assert options.display is True
switch.value = False
await pilot.pause()
assert options.display is False