Skip to content

feat(scratchnode): mobile composer pinned to bottom (Slack/Discord)#441

Merged
HomenShum merged 1 commit into
mainfrom
feat/chat-mobile-bottom-composer
May 29, 2026
Merged

feat(scratchnode): mobile composer pinned to bottom (Slack/Discord)#441
HomenShum merged 1 commit into
mainfrom
feat/chat-mobile-bottom-composer

Conversation

@HomenShum
Copy link
Copy Markdown
Owner

Summary

Answers the right question: on phones the composer sat at the top (a sticky "command bar") — the search-box model, not the chat model the room actually is. Every messaging app (Slack, Discord, iMessage, WhatsApp) pins the input to the bottom — thumb reach, and the newest message sits right where you type. This moves the mobile composer to the bottom. Desktop is unchanged (keeps the sticky top command bar).

Why it needed more than a media query

The composer's position was an inline style on the element (style="position:sticky;top:64px;z-index:40"), which beats any stylesheet/media-query rule — so a mobile override was being silently ignored. The fix:

  1. Removed the inline style. The .c {} rule already declared the identical sticky; top:64px, so desktop renders byte-for-byte the same.
  2. Added a ≤540px override: .c { position: fixed; bottom: 0; left:0; right:0 } full-width, top border + lift shadow; .m bottom padding 80px → 112px so the last message scrolls clear of the fixed bar.

(Bonus: this revived the dead .c { top: 60px } mobile rule the inline style had been silently overriding.)

Test plan (Claude Preview, true 375px viewport)

  • Mobile composer position: fixed; bottom: 0px, flush to viewport bottom (composerBottom 812 = innerHeight), inline style gone
  • Feed scrolls fully clear of the fixed composer — after scroll-to-bottom, last item ends at y=628, composer top at y=684 (56px gap); no message hidden
  • Desktop unchanged: position: sticky; top: 64px (mq540: false)
  • Post-deploy spot-check on scratchnode.live (phone + desktop)

Presentation-only, public/proto/home-v5.html (+14/−4).

🤖 Generated with Claude Code

…iscord)

On phones the composer sat at the top (a sticky "command bar") - the search-box
model, not the chat model the room actually is. Every messaging app (Slack,
Discord, iMessage, WhatsApp) pins the input to the BOTTOM: thumb reach, and the
newest message sits right where you type.

Why CSS alone couldn't fix it: the composer's position was an INLINE style on
the element (style="position:sticky;top:64px"), which beats any media-query
rule. Moved position into the stylesheet (the .c rule already declared the
identical sticky-top, so desktop is byte-for-byte unchanged), then added a
<=540px override.

- <=540px: .c becomes position:fixed; bottom:0; full-width, with a top border +
  lift shadow; .m bottom padding raised to 112px so the last message scrolls
  clear of the fixed bar.
- Desktop (>540px): unchanged - sticky top:64px command bar.

Verified (Claude Preview, true 375px): composer position:fixed bottom:0 flush to
the viewport bottom; feed scrolls fully clear (last item bottom 628 < composer
top 684, 56px gap); desktop still sticky top:64px (mq540 false). This also
revived the dead `.c { top: 60px }` mobile rule the inline style had been
silently overriding. Presentation-only, public/proto/home-v5.html.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nodebench-ai Ready Ready Preview, Comment May 29, 2026 5:48am

Request Review

@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented May 29, 2026

🤖 Augment PR Summary

Summary: Updates the ScratchNode home-v5 prototype so the chat composer stays sticky at the top on desktop but is pinned to the bottom on small screens.
Changes: Removes inline sticky positioning in favor of stylesheet rules (allowing the mobile override to apply) and increases mobile feed bottom padding so messages scroll clear of the fixed composer.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread public/proto/home-v5.html
/* Mobile: pin the composer to the bottom (Slack/Discord/iMessage convention — thumb reach,
newest message sits right above where you type). Desktop keeps the sticky top command bar. */
.c {
position: fixed; top: auto; bottom: 0; left: 0; right: 0; z-index: 45;
Copy link
Copy Markdown

@augmentcode augmentcode Bot May 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@media (max-width: 540px) sets .c to position: fixed + bottom: 0, but the later landscape media query (@media (max-height: 480px) and (orientation: landscape)) still sets .c { top: 56px; }—on small landscape screens this can combine into top+bottom and cause the composer to stretch and cover most of the viewport.

Severity: high

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Comment thread public/proto/home-v5.html
@media (max-width: 540px) {
.h { padding: calc(10px + var(--safe-top)) calc(14px + var(--safe-right)) 10px calc(14px + var(--safe-left)); }
.m { padding: 16px calc(14px + var(--safe-right)) calc(80px + var(--safe-bot)) calc(14px + var(--safe-left)); }
.m { padding: 16px calc(14px + var(--safe-right)) calc(112px + var(--safe-bot)) calc(14px + var(--safe-left)); }
Copy link
Copy Markdown

@augmentcode augmentcode Bot May 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the composer now fixed to the bottom, the .m bottom padding being a fixed 112px may still be too small when conditional rows like the reply context bar / private notes inline block are visible, which could re-introduce “last message hidden behind composer” in those states.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@HomenShum HomenShum merged commit 420b68c into main May 29, 2026
16 checks passed
@HomenShum HomenShum deleted the feat/chat-mobile-bottom-composer branch May 29, 2026 06:00
@github-actions
Copy link
Copy Markdown

Demo: walkthrough of the surfaces this PR changed is available as a workflow artifact (pr-demo-441) at https://github.com/HomenShum/nodebench-ai/actions/runs/26620959110

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants