Skip to content

Allow newlines in the message composer and fix loading earlier messages - #101

Merged
kody-bot merged 1 commit into
mainfrom
cursor/fix-composer-newline-and-infinite-scroll-1d47
Oct 5, 2026
Merged

kody-bot merged 1 commit into
mainfrom
cursor/fix-composer-newline-and-infinite-scroll-1d47

Conversation

@kentcdodds

Copy link
Copy Markdown
Member

Fixes the two bugs from this Cap recording on the recipient thread page.

Newlines in the composer. Enter used to add the message to the queue, so on phones the Return key queued half-written notes and there was no obvious way to add a line break. Enter now inserts a newline on every device. Cmd/Ctrl+Enter or the "Add to Queue" button adds the message. The textarea also sets enterKeyHint="enter" so mobile keyboards label the key as a line break.

Infinite scroll. "Scroll up to load earlier messages" never loaded anything. The fetcher loaded ?cursor=… from an index route without ?index, so React Router sent the request to the parent $recipientId layout loader. That loader has no pastMessages and no searchQuery, so the merge effect returned early every time. The fetch now includes index, and earlier pages append while keeping the scroll position.

Test Plan

  • New tests/e2e/recipient-thread.test.ts:
    • Typing, pressing Enter, and typing again leaves one multi-line draft with nothing queued. The button queues First line\nSecond line, and Cmd/Ctrl+Enter queues a second message.
    • With 75 sent messages, scrolling to the top with the mouse wheel loads 30, then 60, then all 75, and the "Scroll up…" hint goes away.
    • Both tests fail on main (Enter queues the message, and the thread stays at 30 messages) and pass with this change. They passed 5 repeats each.
  • Full e2e suite with one worker, as in CI: 16/16 pass. bun run lint, bun run typecheck, and bun run test pass.

Checklist

  • Tests updated
  • Docs updated

Screenshots

Before (from the recording): the thread is stuck at "Scroll up to load earlier messages."

Open in Web Open in Cursor 

Enter now inserts a newline in the new-message composer (so the mobile
Return key no longer queues the message); Cmd/Ctrl+Enter or the button
adds it to the queue.

Loading earlier messages targeted the parent $recipientId layout loader
because the fetcher URL lacked ?index, so pages never got appended.

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
@kody-bot
kody-bot marked this pull request as ready for review October 5, 2026 20:59
@kentcdodds

Copy link
Copy Markdown
Member Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit cae650e. Configure here.

@kody-bot
kody-bot merged commit 5cfffdd into main Oct 5, 2026
7 checks passed
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.

3 participants