feat(chat): add compact-mode with sticky header and sticky user messages - #20
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: |
5198daa
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://7776399d.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
e424c89 to
762289c
Compare
762289c to
7d62024
Compare
…owing question options When multiple wrapped options exceeded the dialog body height, the "Type your own answer" row could be clipped off-screen. This adds vertical scroll state to the question body, keeps the focused row visible, and splits the custom answer row out as a sticky footer that always stays pinned at the bottom of the panel.
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)
…transcript - move compact sticky user-message bar from layout rows to an overlay so chat viewport/scroll extents remain constant - keep mouse-wheel scroll region anchored to header-only height in compact mode, independent of sticky visibility - introduce helper to draw the scrollbar over the chat area to avoid thumb occlusion by overlays - extract sticky message visibility/position calculations and body-end handling into dedicated helpers for cleaner overlay logic
Add support for `tui.compactMode` (and `compact_mode` alias) in config parsing/schema/docs, initialize chat sticky-header compact mode from config with persisted fallback, persist `/compact-mode` toggles in preferences storage, and add/extend tests for the new config + prefs behavior.
- persist compact-mode toggle to prefs storage so the setting survives restarts - remove separate sticky fade state (`faded_message_index`) and derive sticky behavior from current render state - refresh chat render cache before sticky layout math and keep `content_height` aligned to avoid stale overlay geometry - align sticky overlay dimensions/content width with normal transcript rendering and adjust related tests for updated signatures/scroll state
7d62024 to
5198daa
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)