Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR centralizes PagingConfig usage by introducing a shared pagingConfig constant to replace inline PagingConfig instantiations throughout the codebase. This improves consistency and makes future configuration changes easier to manage.
- Creates platform-specific
pagingConfigimplementations using expect/actual declarations - Replaces inline PagingConfig instantiations with the shared configuration
- Maintains existing pageSize = 20 behavior while adding platform-specific optimizations
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| Paging.kt | Adds expect declaration for pagingConfig and updates existing usages |
| Paging.android.kt | Provides Android-specific PagingConfig implementation |
| Paging.apple.kt | Provides Apple-specific PagingConfig with additional optimizations |
| Paging.jvm.kt | Provides JVM-specific PagingConfig implementation |
| LocalCacheSearchPresenter.kt | Replaces inline PagingConfig with shared pagingConfig |
| NodeInfoPresenter.kt | Replaces inline PagingConfig with shared pagingConfig |
| TimelinePresenter.kt | Replaces inline PagingConfig with shared pagingConfig |
| XQTDataSource.kt | Replaces inline PagingConfig with shared pagingConfig |
| val pagerFlow = | ||
| Pager( | ||
| config = PagingConfig(pageSize = pageSize), | ||
| config = pagingConfig, |
There was a problem hiding this comment.
The pageSize parameter is now ignored since pagingConfig has a fixed pageSize. Consider removing the pageSize parameter from this function or documenting that it's no longer used.
| @@ -143,7 +143,7 @@ public abstract class TimelinePresenter : | |||
| pageSize: Int = 20, | |||
There was a problem hiding this comment.
The pageSize parameter is now ignored since pagingConfig has a fixed pageSize. Consider removing the pageSize parameter from this function or documenting that it's no longer used.
| pageSize: Int = 20, |
| val pagerFlow = | ||
| Pager( | ||
| config = PagingConfig(pageSize = pageSize), | ||
| config = pagingConfig, |
There was a problem hiding this comment.
The pageSize parameter is now ignored since pagingConfig has a fixed pageSize. Consider removing the pageSize parameter from this function or documenting that it's no longer used.
| ): Flow<PagingData<T>> = | ||
| Pager( | ||
| config = PagingConfig(pageSize = pageSize), | ||
| config = pagingConfig, |
There was a problem hiding this comment.
The pageSize parameter is now ignored since pagingConfig has a fixed pageSize. Consider removing the pageSize parameter from this function or documenting that it's no longer used.
| if (type == NotificationFilter.All) { | ||
| return Pager( | ||
| config = PagingConfig(pageSize = pageSize), | ||
| config = pagingConfig, |
There was a problem hiding this comment.
The pageSize parameter is now ignored since pagingConfig has a fixed pageSize. Consider removing the pageSize parameter from functions that use this Pager or documenting that pageSize is no longer configurable.
No description provided.