Skip to content

mixed timeline#1063

Merged
Tlaster merged 15 commits intomasterfrom
feature/mix_timeline
Jul 4, 2025
Merged

mixed timeline#1063
Tlaster merged 15 commits intomasterfrom
feature/mix_timeline

Conversation

@Tlaster
Copy link
Copy Markdown
Contributor

@Tlaster Tlaster commented Jun 27, 2025

No description provided.

@Tlaster Tlaster requested a review from Copilot June 27, 2025 08:40

This comment was marked as outdated.

@Tlaster Tlaster requested a review from Copilot June 30, 2025 09:39

This comment was marked as outdated.

@Tlaster Tlaster requested a review from Copilot June 30, 2025 14:11

This comment was marked as outdated.

…ce/bluesky/NotificationRemoteMediator.kt

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Tlaster Tlaster requested a review from Copilot June 30, 2025 14:14

This comment was marked as outdated.

@Tlaster Tlaster requested a review from Copilot July 4, 2025 11:46

This comment was marked as outdated.

@Tlaster Tlaster requested a review from Copilot July 4, 2025 12:15
@Tlaster Tlaster marked this pull request as ready for review July 4, 2025 12:15
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 refactors the app’s paging architecture to standardize on a unified BaseTimelineLoader API and TimelinePresenter across all presenters.

  • Switch from accountServiceProvider + collectAsLazyPagingItems() to accountServiceFlow + loader: Flow<BaseTimelineLoader>
  • Rewrite each presenter to use the new TimelinePresenter base class and remove legacy paging helpers
  • Update remote mediators to return Result(endOfPaginationReached, data) instead of the old BaseRemoteMediator

Reviewed Changes

Copilot reviewed 135 out of 135 changed files in this pull request and generated 2 comments.

File Description
StatusContextPresenter.kt Refactor to use TimelinePresenter and unified loader API
ProfilePresenter.kt Migrate profile data fetching to Flow<BaseTimelineLoader>
TimelinePresenter.kt Introduce BaseTimelineLoader and remove legacy paging code
Comments suppressed due to low confidence (1)

shared/src/commonMain/kotlin/dev/dimension/flare/ui/presenter/profile/ProfilePresenter.kt:5

  • [nitpick] The collectAsState import appears unused or inconsistent with the UI model's collectAsUiState helper; consider removing or replacing it for consistency.
import androidx.compose.runtime.collectAsState

import dev.dimension.flare.data.repository.AccountRepository
import dev.dimension.flare.data.repository.NoActiveAccountException
import dev.dimension.flare.data.repository.accountServiceFlow
import dev.dimension.flare.data.repository.accountServiceProvider
Copy link

Copilot AI Jul 4, 2025

Choose a reason for hiding this comment

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

Remove the deprecated accountServiceProvider import now that all presenters use accountServiceFlow for consistency.

Suggested change
import dev.dimension.flare.data.repository.accountServiceProvider

Copilot uses AI. Check for mistakes.
Comment on lines 142 to 145
val accountServiceState = accountServiceProvider(accountType = accountType, repository = accountRepository)
val userState =
accountServiceState.map { service ->
val userId =
userKey?.id
?: if (service is AuthenticatedMicroblogDataSource) {
service.accountKey.id
} else {
null
}
if (userId == null) {
throw NoActiveAccountException
} else {
remember(service, userKey) {
service.userById(userId)
}.collectAsState()
}
}
val userState by userStateFlow.collectAsState(UiState.Loading())
accountServiceState.onSuccess {
val userKey = userKey ?: if (it is AuthenticatedMicroblogDataSource) it.accountKey else null
Copy link

Copilot AI Jul 4, 2025

Choose a reason for hiding this comment

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

The body method still uses accountServiceProvider instead of the new accountServiceFlow API, leading to inconsistent data loading; replace this call with accountServiceFlow and collect its UI state.

Suggested change
val accountServiceState = accountServiceProvider(accountType = accountType, repository = accountRepository)
val userState =
accountServiceState.map { service ->
val userId =
userKey?.id
?: if (service is AuthenticatedMicroblogDataSource) {
service.accountKey.id
} else {
null
}
if (userId == null) {
throw NoActiveAccountException
} else {
remember(service, userKey) {
service.userById(userId)
}.collectAsState()
}
}
val userState by userStateFlow.collectAsState(UiState.Loading())
accountServiceState.onSuccess {
val userKey = userKey ?: if (it is AuthenticatedMicroblogDataSource) it.accountKey else null
val accountServiceState by accountServiceFlow(accountType = accountType, accountRepository).collectAsState(UiState.Loading())
val userState by userStateFlow.collectAsState(UiState.Loading())
accountServiceState.onSuccess { service ->
val userKey = userKey ?: if (service is AuthenticatedMicroblogDataSource) service.accountKey else null

Copilot uses AI. Check for mistakes.
@Tlaster Tlaster enabled auto-merge July 4, 2025 12:54
@Tlaster Tlaster merged commit aa12de5 into master Jul 4, 2025
5 checks passed
@Tlaster Tlaster deleted the feature/mix_timeline branch July 4, 2025 13:15
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