Fix /clear-chat to restore the welcome banner#26
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: Payel-git-ol#25
… screen The /clear-chat handler reset the transcript to an empty array, dropping the startup banner and the getting-started tips panel and leaving an awkward, near-empty view (Payel-git-ol#25). Reset to a fresh banner item instead so the post-clear screen matches a freshly-launched session. - Add a regression test that runs /clear-chat after producing output and asserts the banner/tips return while prior output is gone. - Update README description and bump version to 0.4.1.
Working session summaryCI passes ( SummaryI fixed issue #25: the Root cause — In Fix — Reset the transcript to a single fresh Changes:
Verification — All 103 tests pass locally; PR: #26 This summary was automatically extracted from the AI working session output. |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost: $2.634369📊 Context and tokens usage:
Total: (3.2K new + 78.8K cache writes + 3.3M cache reads) input tokens, 18.5K output tokens, $2.634369 cost 🤖 Models used:
📎 Log file uploaded as Gist (1706KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
Summary
Fixes #25.
The
/clear-chatcommand cleared the transcript by resetting the history to an empty array (setHistory([])). That dropped the startup banner and the "getting started" tips panel, leaving an awkward, near-empty screen with only the input prompt (the "after" state shown in the issue).Root cause
In
src/cli/App.tsx, the/clear-chathandler did:The initial transcript always starts with a
banneritem. Resetting to[]removed it.Fix
Reset the transcript to a single fresh
banneritem — identical to a freshly-launched session — so the post-clear screen shows the wordmark, the version line, and the tips panel, matching the desired result in the issue.Reproduction & verification
/help), then run/clear-chat. Before the fix the screen went blank except for the prompt; after the fix the welcome banner + tips return.tests/cli.test.tsx→ "restores the banner and getting-started tips after /clear-chat" runs/helpto produce output, then/clear-chat, and asserts the tips panel returns while the priorCommands:output is gone. The test fails against the oldsetHistory([])code and passes with the fix.experiments/clear-chat-frame.tsxrenders the before/after terminal frames for manual inspection.Rendered result after
/clear-chat(matches the issue's "ideal" screenshot)Changes
src/cli/App.tsx— reset/clear-chatto a fresh banner item (+versionadded to theruncallback deps).tests/cli.test.tsx— regression test.README.md— clarify the/clear-chatdescription.package.json/package-lock.json— bump version to0.4.1.experiments/clear-chat-frame.tsx— before/after frame renderer.All 103 tests pass;
typecheckandbuildare green.