feat(ux): improve interactive mode readability and input visibility
All checks were successful
CI / test (push) Successful in 19s
All checks were successful
CI / test (push) Successful in 19s
- Replace plain 'tai>' prompt with styled console.input() bold cyan prompt - Wrap interactive mode entry in a Rich Panel with border - Frame each AI response with Rule dividers (──── AI Response ────) - Style guardrail warnings with ⚠ prefix and bold yellow - Improve /help output with formatted Panel showing all commands - Style collection report: ✓/✗ per item with color, truncation in dim - Style probe output: ✓/✗ with green/red, host info in dim - Add Rule header divider on session start
This commit is contained in:
@@ -137,8 +137,9 @@ def test_collect_success_prints_summary(monkeypatch) -> None: # type: ignore[no
|
||||
|
||||
assert result.exit_code == 0
|
||||
assert "Collection complete" in result.stdout
|
||||
assert "kernel: ok" in result.stdout
|
||||
assert "journal: ok (truncated)" in result.stdout
|
||||
assert "kernel" in result.stdout
|
||||
assert "journal" in result.stdout
|
||||
assert "truncated" in result.stdout
|
||||
|
||||
|
||||
def test_interactive_collect_then_quit(monkeypatch) -> None: # type: ignore[no-untyped-def]
|
||||
@@ -163,7 +164,7 @@ def test_interactive_collect_then_quit(monkeypatch) -> None: # type: ignore[no-
|
||||
commands = iter(["/collect", "/quit"])
|
||||
|
||||
monkeypatch.setattr("tai.cli.collect_from_plan", fake_collect_from_plan)
|
||||
monkeypatch.setattr("builtins.input", lambda _prompt: next(commands))
|
||||
monkeypatch.setattr("tai.cli.console.input", lambda _prompt: next(commands))
|
||||
|
||||
runner = CliRunner()
|
||||
result = runner.invoke(
|
||||
@@ -180,7 +181,7 @@ def test_interactive_collect_then_quit(monkeypatch) -> None: # type: ignore[no-
|
||||
)
|
||||
|
||||
assert result.exit_code == 0
|
||||
assert "Interactive mode" in result.stdout
|
||||
assert "ask questions directly" in result.stdout.lower()
|
||||
assert "Collection complete" in result.stdout
|
||||
assert "Bye." in result.stdout
|
||||
|
||||
@@ -210,7 +211,7 @@ def test_interactive_unknown_command_prints_hint(monkeypatch) -> None: # type:
|
||||
"tai.cli.AIClient.stream",
|
||||
lambda *_args, **_kwargs: iter(["Check logs."]),
|
||||
)
|
||||
monkeypatch.setattr("builtins.input", lambda _prompt: next(commands))
|
||||
monkeypatch.setattr("tai.cli.console.input", lambda _prompt: next(commands))
|
||||
|
||||
runner = CliRunner()
|
||||
result = runner.invoke(
|
||||
@@ -227,5 +228,5 @@ def test_interactive_unknown_command_prints_hint(monkeypatch) -> None: # type:
|
||||
)
|
||||
|
||||
assert result.exit_code == 0
|
||||
assert "Analyzing..." in result.stdout
|
||||
assert "AI Response" in result.stdout
|
||||
assert "Check logs." in result.stdout
|
||||
|
||||
Reference in New Issue
Block a user