feat(chat): add compact-mode with sticky header and sticky user messages - #20
feat(chat): add compact-mode with sticky header and sticky user messages#20Blankeos wants to merge 6 commits into
Conversation
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Deploying crabcode with
|
| Latest commit: |
d6bb183
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://3ae0f572.crabcode.pages.dev |
| Branch Preview URL: | https://feat-sticky-message-headers.crabcode.pages.dev |
aca9074 to
767d637
Compare
PR Review:
|
| File | +/− | What changed |
|---|---|---|
src/views/chat.rs |
~+270 | Compact-mode layout: split area into 3 chunks (prior messages / sticky bar / latest reply), sticky‑click target tracking, hysteresis logic for sticky index, compact→normal state teardown |
src/app.rs |
~+60 | chat_scroll_region fn to include sticky bar in scroll area, mouse click handler for sticky bar, /compact-mode intercept to toggle chat_state.compact_mode |
src/command/handlers.rs |
+16 | New /compact-mode command registration |
src/ui/components/chat.rs |
+1 | scroll_to_message_index (possibly pre-existing unused until now) |
Issues found
⚠️ 1. Registry test not updated — will fail CI
src/command/handlers.rs:1392 asserts names.len() == 19, but the new compact-mode command makes it 20. The test also doesn't verify the new command at all.
Fix: bump to 20 and add assertions for compact-mode (name + is_chat_only).
Regressions
None. The compact mode is opt-in (defaults off) and adds no branching to the normal render path beyond the early if self.chat_state.compact_mode check at src/views/chat.rs:78. All existing tests pass except the pre-existing question_dialog oserror failures.
| Test suite | Result |
|---|---|
cargo build |
✅ clean |
cargo fmt --check |
✅ clean |
cargo test views::chat |
✅ all pass |
cargo test app::tests |
✅ all pass |
cargo test ui::components::chat |
✅ all pass |
cargo test command::handlers |
❌ 1 fail (test not updated — see #1) |
Migration / checklists
No DB schema or data migrations needed. No config format changes.
Pre-merge checklist
- Fix
test_registry_has_all_commands: bump expected count to 20, addcompact-modeto the assertions list - Run
just fmtafter the fix - (Nice to have) Add a dedicated unit/integration test for compact mode toggle and sticky message rendering
Add `/compact-mode` command support to toggle compact layout while preserving chat-only behavior. Implement sticky session-title header and last fully-scrolled user message in compact mode with click-to-scroll, plus faded viewport copy handling and adjusted hit-testing to keep interaction and rendering stable.
…atting - add helper to render user message content with shared line-wrapping and image-placeholder styling - update compact sticky preview to use the shared formatter so it visually matches real user messages (including truncation behavior and colors)
767d637 to
d6bb183
Compare
Add
/compact-modecommand support to toggle compact layout while preserving chat-only behavior. Implement sticky session-title header and last fully-scrolled user message in compact mode with click-to-scroll, plus faded viewport copy handling and adjusted hit-testing to keep interaction and rendering stable.I wanted to kinda copy Grok. It looked convenient.. It's toggleable by
/compact-mode(also similar to Grok Build)