mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-12-05 06:03:51 +01:00
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - The task page shows a chat thread with a pinned composer and a bottom navigation bar on mobile > - On a phone, these two bars use a large part of the screen when you read earlier messages > - The old task page hid the bottom navigation when you scrolled. The new chat thread scrolls inside its own container, so that behavior stopped > - This pull request makes the thread scroller drive the auto-hide mobile chrome again, and it also hides the composer > - The benefit is more reading space when you read back through a task, with the standard mobile scroll-to-dismiss behavior ## Linked Issues or Issue Description **Is your feature request related to a problem?** On mobile, the task chat page keeps the composer and the bottom navigation on screen at all times. When you scroll up to read earlier messages, these bars cover a large part of the screen. **Describe the solution you'd like** When you scroll the thread away from the latest message, the composer and the bottom navigation slide out of view. When you scroll back toward the latest message, or reach it, they slide back. When the keyboard is open, the composer stays on screen. **Describe alternatives you've considered** Hide only the bottom navigation. This gives less reading space and does not match common mobile chat apps. ## What Changed - `useMobileNavVisibility` also tracks nested scroll containers that have `data-mobile-chrome-scroll="bottom"`. It measures distance from the bottom of the thread, so the resting zone is the latest message. It ignores the viewport growth that occurs when the composer collapses, so the bars do not flicker. An open keyboard keeps the chrome visible. - `TaskMessageScroller` sets the marker attribute on the thread scroller. - `Layout` and `Layout.production` publish `data-mobile-nav` on `#main-content`. - `index.css` slides the composer dock out with a negative bottom margin and removes the bottom padding while the chrome is hidden. The motion uses the existing mobile nav motion tokens. Reduced motion makes the change instant. - `TaskChatComposerDock` measures its height on mobile as well as in the coordinator layout. The wheel forwarding stays coordinator-only. - New unit tests: `ui/src/hooks/useMobileNavVisibility.test.tsx`. - New Storybook stories: `Tasks and conversations/Task creation and lifecycle/Task chat/Mobile chrome auto-hide` (interactive, reading back, heading back), with play assertions. ## Verification - `npx vitest run ui/src/hooks/useMobileNavVisibility.test.tsx ui/src/lib/mobile-nav-scroll` passes (11 tests). - `npx vitest run ui/src/components/Layout.mobile.test.tsx ui/src/components/TaskChatThread.test.tsx ui/src/hooks/useMobileVisualViewport.test.tsx` passes (446 tests). - I ran the three stories in Storybook at 390×844. Reading back gives `data-mobile-nav="hidden"`, the nav has `data-visible="false"`, and the dock is hidden. Heading back restores all three. - Manual: open a long task on a phone, scroll up, and confirm both bars slide away. Then scroll down and confirm they return. ## Risks - Low risk. The change applies only on mobile when a task chat shell is present. Desktop and the coordinator layout keep their current behavior. - Physical iPhone touch acceptance is still needed. Momentum scroll and rubber-band behavior can differ from the browser test. ## Model Used - Claude Opus 5.5 (`claude-opus-5-5`), with tool use and code execution. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [ ] All Paperclip CI gates are green - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>