Skip to content

feat: expose isAtEnd shared value from KeyboardChatScrollView#1431

Open
jkinggg wants to merge 1 commit intokirillzyusko:mainfrom
jkinggg:feat/expose-is-at-end
Open

feat: expose isAtEnd shared value from KeyboardChatScrollView#1431
jkinggg wants to merge 1 commit intokirillzyusko:mainfrom
jkinggg:feat/expose-is-at-end

Conversation

@jkinggg
Copy link
Copy Markdown

@jkinggg jkinggg commented Apr 10, 2026

📜 Description

This PR adds an optional isAtEnd?: SharedValue<boolean> prop to KeyboardChatScrollView.

When provided, the component updates that shared value on the UI thread using the same internal scroll metrics and isScrollAtEnd(...) logic already used by keyboardLiftBehavior="whenAtEnd".

The goal is to let chat-style apps build jump-to-latest / scroll-to-bottom affordances without reimplementing the component's internal "at end" logic in app code.

💡 Motivation and Context

This change is intended to solve a common gap in chat UIs:

  • the component already knows whether the user is effectively at the end
  • apps often need that same signal for follow-mode and jump-to-latest UI
  • today, consumers must guess based on external scroll heuristics

That duplication is brittle because app-side heuristics can diverge from the component's own keyboard-aware behavior.

This PR keeps the API small by exposing the semantic state (isAtEnd) instead of lower-level raw scroll metrics.

Related issue: #1430

📢 Changelog

JS

  • add optional isAtEnd?: SharedValue<boolean> prop to KeyboardChatScrollView
  • update isAtEnd on the UI thread using existing isScrollAtEnd(...) logic
  • add TypeScript declarations for the new prop

iOS

  • no native changes

Android

  • no native changes

🤔 How Has This Been Tested?

Validated in the fork clone with:

  • yarn typescript
  • yarn lint src/components/KeyboardChatScrollView/index.tsx src/components/KeyboardChatScrollView/types.ts

Not yet completed before opening this draft PR:

  • yarn test
  • manual verification in the example app on iOS
  • manual verification in the example app on Android

📸 Screenshots (if appropriate):

No screenshots yet. This draft PR is mainly to support API discussion from #1430.

📝 Checklist

  • CI successfully passed
  • I added new mocks and corresponding unit-tests if library API was changed

@kirillzyusko kirillzyusko self-assigned this Apr 14, 2026
@kirillzyusko kirillzyusko self-requested a review April 14, 2026 11:45
@kirillzyusko kirillzyusko added enhancement New feature or request KeyboardChatScrollView 💬 Anything about chat functionality labels Apr 14, 2026
@kirillzyusko
Copy link
Copy Markdown
Owner

Hey @jkinggg

Is it final PR? Can we move it to "ready for review" stage?

Copy link
Copy Markdown
Author

@jkinggg jkinggg left a comment

Choose a reason for hiding this comment

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

Hey @kirillzyusko this is ready

@kirillzyusko kirillzyusko marked this pull request as ready for review April 17, 2026 08:22
@github-actions
Copy link
Copy Markdown
Contributor

📊 Package size report

Current size Target Size Difference
313911 bytes 312781 bytes 1130 bytes 📈

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

Labels

enhancement New feature or request KeyboardChatScrollView 💬 Anything about chat functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants