feat: add message pining to macOS#48
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Adds “pin latest user message to top” behavior to the macOS chat transcript, mirroring the existing mobile flow so freshly-sent turns stay stable while streaming/layout settles.
Changes:
- Replaces macOS
MessageListView’sListimplementation with aScrollView/LazyVStackand introduces active-turn pin-to-top + dynamic tail spacer logic. - Adds
ChatBridge.sendRequestID+markUserSendRequested()and wires it from input-bar send actions to clear/prepare scroll state before the next user row appears. - Adjusts
chatMessageListRowStyle()to apply padding on macOS, and aligns mobile/macOS pin animation timing constants.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| RxCodeMobile/Views/MobileChatView.swift | Tweaks pin-to-top timing constants and the pin settle loop on mobile. |
| Packages/Sources/RxCodeChatKit/MessageListView.swift | Implements macOS pin-to-top behavior, dynamic tail spacer measurement, and replaces List with ScrollView/LazyVStack. |
| Packages/Sources/RxCodeChatKit/InputBarView+Queue.swift | Marks “send requested” for queued-send actions. |
| Packages/Sources/RxCodeChatKit/InputBarView.swift | Marks “send requested” for normal send + certain slash command sends. |
| Packages/Sources/RxCodeChatKit/ChatMessageListView.swift | Adds macOS padding to row styling to work outside of List. |
| Packages/Sources/RxCodeChatKit/ChatBridge.swift | Adds sendRequestID and markUserSendRequested() hook for message containers. |
Comments suppressed due to low confidence (1)
Packages/Sources/RxCodeChatKit/MessageListView.swift:530
logScrollStateis called from high-frequency paths (scroll geometry updates and geometry-change callbacks) but logs at.info, which can generate a very large volume of logs during normal scrolling/streaming. This can impact performance and produce noisy production logs. Consider downgrading this to.debugand/or gating it behind#if DEBUGor a runtime flag, keeping.infofor coarse lifecycle events only.
private func logScrollState(_ label: String, extra: String = "") {
let active = activeTurnUserMessageID?.uuidString ?? "<nil>"
let latestTurnHeight = max(0, tailSpacerMinY - latestUserMinY) + pendingIndicatorSpacerReduction
let extraSpacer = pinTailSpacerExtraHeight
let suffix = extra.isEmpty ? "" : " \(extra)"
Self.log.info(
"[ScrollPin] \(label, privacy: .public) sid=\(windowState.currentSessionId ?? "<nil>", privacy: .public) active=\(active, privacy: .public) pinning=\(isPinningLatestTurnToTop) releaseArmed=\(canReleasePinnedTurnByScroll) userDriven=\(isUserDrivenScroll) stream=\(chatBridge.isStreaming) scrollH=\(Double(scrollViewHeight), privacy: .public) userY=\(Double(latestUserMinY), privacy: .public) tailY=\(Double(tailSpacerMinY), privacy: .public) turnH=\(Double(latestTurnHeight), privacy: .public) minTail=\(Double(minTailSpacer), privacy: .public) extraSpacer=\(Double(extraSpacer), privacy: .public) pendingReduce=\(Double(pendingIndicatorSpacerReduction), privacy: .public)\(suffix, privacy: .public)"
)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+71
to
+73
| public func markUserSendRequested() { | ||
| sendRequestID = UUID() | ||
| } |
Comment on lines
+49
to
+51
| private static let streamingIndicatorEstimatedHeight: CGFloat = 36 | ||
| private static let pinToTopAnimationDuration: Duration = .milliseconds(320) | ||
| private static let pinToTopAnimationSeconds: Double = 0.32 |
Comment on lines
+118
to
+119
| private static let pinToTopAnimationDuration: Duration = .milliseconds(320) | ||
| private static let pinToTopAnimationSeconds: Double = 0.32 |
Contributor
Author
|
🎉 This PR is included in version 1.10.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.