From 553d05745c62f3b4b456f27bc962b795754e2738 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 23 Mar 2026 18:42:05 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Palette:=20Add=20actionable=20in?= =?UTF-8?q?struction=20to=20checkpoint=20empty=20state?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated the "No checkpoints found." message to include a concrete instruction on how to create one using the `checkpoint create` command. Added a regression test and logged the UX learning in .Jules/palette.md. Co-authored-by: ivangegovdve-sudo <225339531+ivangegovdve-sudo@users.noreply.github.com> --- .Jules/palette.md | 4 ++++ src/python_learning_orchestrated/cli.py | 4 +++- tests/test_cli_smoke.py | 8 ++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.Jules/palette.md b/.Jules/palette.md index 35ad244..7d4449b 100644 --- a/.Jules/palette.md +++ b/.Jules/palette.md @@ -5,3 +5,7 @@ ## 2024-05-24 - CLI Output Scannability and Human-Readability **Learning:** In text-based CLI menus, using internal identifiers (like `lesson-1`) and verbose status strings (like `pending` or `completed`) makes lists hard to scan and feels too technical. **Action:** When displaying lists of items with states, use familiar visual symbols (like `[x]` vs `[ ]`) and human-readable titles (like "Variables") to improve scannability and create a more friendly, intuitive interface. + +## 2024-05-25 - Actionable Empty States +**Learning:** In CLI applications, empty states (e.g., "No items found") can leave users at a dead end, unsure of what to do next. +**Action:** Always provide actionable instructions or commands in empty state messages to guide the user on how to create the missing resource. diff --git a/src/python_learning_orchestrated/cli.py b/src/python_learning_orchestrated/cli.py index 31751d2..3d8ec02 100644 --- a/src/python_learning_orchestrated/cli.py +++ b/src/python_learning_orchestrated/cli.py @@ -223,7 +223,9 @@ def main( if args.checkpoint_command == "list": checkpoints = checkpoint_store.list_checkpoints() if not checkpoints: - output_fn("No checkpoints found.") + output_fn( + "No checkpoints found. Create one using 'checkpoint create '." + ) return output_fn(f"Checkpoints ({len(checkpoints)}):") for checkpoint in checkpoints: diff --git a/tests/test_cli_smoke.py b/tests/test_cli_smoke.py index e54e34c..19af151 100644 --- a/tests/test_cli_smoke.py +++ b/tests/test_cli_smoke.py @@ -91,6 +91,14 @@ def test_cli_export_and_import_progress_commands(tmp_path, capsys) -> None: assert len(session_payload["attempts"]) == 1 +def test_cli_checkpoint_list_empty(capsys) -> None: + main(["checkpoint", "list"]) + output = capsys.readouterr().out + assert ( + "No checkpoints found. Create one using 'checkpoint create '." in output + ) + + def test_cli_checkpoint_create_and_list(tmp_path, capsys, monkeypatch) -> None: session_file = tmp_path / "session.json" checkpoint_dir = tmp_path / "checkpoints"