Skip to content

add thread display in status detail#1166

Merged
Tlaster merged 1 commit intomasterfrom
feature/context_reply_thread
Aug 12, 2025
Merged

add thread display in status detail#1166
Tlaster merged 1 commit intomasterfrom
feature/context_reply_thread

Conversation

@Tlaster
Copy link
Copy Markdown
Contributor

@Tlaster Tlaster commented Aug 12, 2025

No description provided.

@Tlaster Tlaster requested a review from Copilot August 12, 2025 03:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds thread display functionality to the status detail view by implementing date-time comparison capabilities and enhancing thread structure in status contexts. The changes enable proper ordering and filtering of threaded conversations based on creation timestamps.

  • Adds compareTo operator for UiDateTime across platforms to enable chronological comparison
  • Enhances StatusContextPresenter to filter thread parents based on the current status timestamp
  • Modifies Bluesky data source to better structure threaded replies with proper parent-child relationships

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
UiDateTime.kt Adds expected compareTo operator declaration for cross-platform date comparison
StatusContextPresenter.kt Implements thread filtering logic based on creation timestamps and adds async transform support
TimelinePresenter.kt Changes transform method signature to support async operations
StatusDetailRemoteMediator.kt Restructures Bluesky thread data to use FeedViewPost wrapper with proper reply references
UiDateTime.apple.kt Implements compareTo operator for iOS/macOS using Kotlin instant conversion
UiDateTime.androidJvm.kt Implements compareTo operator for Android/JVM using direct instant comparison

service.context(statusKey)
}.combine(currentStatusCreatedAtFlow) { loader, _ ->
loader
}
Copy link

Copilot AI Aug 12, 2025

Choose a reason for hiding this comment

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

The underscore parameter _ suggests the currentStatusCreatedAtFlow value is being ignored in the combine operation. Consider removing this combine if the flow value isn't needed, or use the value if it's intended for triggering loader updates.

Suggested change
}
}.sample(currentStatusCreatedAtFlow)

Copilot uses AI. Check for mistakes.
if (last != null) {
val parents =
listOfNotNull(it.value.post) +
it.value.replies.toList().dropLast(1).mapNotNull {
Copy link

Copilot AI Aug 12, 2025

Choose a reason for hiding this comment

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

Converting immutable collection to list with toList() and then calling dropLast(1) creates unnecessary intermediate collections. Consider using take(it.value.replies.size - 1) or direct indexing for better performance.

Suggested change
it.value.replies.toList().dropLast(1).mapNotNull {
it.value.replies.take(it.value.replies.size - 1).mapNotNull {

Copilot uses AI. Check for mistakes.
override fun transform(data: UiTimeline): UiTimeline =
data.copy(
override suspend fun transform(data: UiTimeline): UiTimeline {
val currentCreatedAt = currentStatusCreatedAtFlow.firstOrNull()
Copy link

Copilot AI Aug 12, 2025

Choose a reason for hiding this comment

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

Calling firstOrNull() on the flow in every transform operation could be inefficient. Consider passing the current timestamp as a parameter to the transform method or caching it at a higher level.

Copilot uses AI. Check for mistakes.
@Tlaster Tlaster merged commit 6be9a53 into master Aug 12, 2025
5 checks passed
@Tlaster Tlaster deleted the feature/context_reply_thread branch August 12, 2025 04:17
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