Skip to content

Commit

Permalink
Implement highlights and generic events in feeds (#238)
Browse files Browse the repository at this point in the history
* Implement handling unknown referenced events in feeds;
* Implement support for highlights in feeds;
* Upgrade libs;
  • Loading branch information
AleksandarIlic authored Nov 29, 2024
1 parent de32331 commit 34143ec
Show file tree
Hide file tree
Showing 27 changed files with 2,484 additions and 130 deletions.
6 changes: 4 additions & 2 deletions app/detekt-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<ID>CyclomaticComplexMethod:MessagesRemoteMediator.kt$MessagesRemoteMediator$override suspend fun load(loadType: LoadType, state: PagingState&lt;Int, DirectMessage&gt;): MediatorResult</ID>
<ID>CyclomaticComplexMethod:NostrUserText.kt$@Composable fun NostrUserText( displayName: String, internetIdentifier: String?, modifier: Modifier = Modifier, displayNameColor: Color = AppTheme.colorScheme.onSurface, fontSize: TextUnit = TextUnit.Unspecified, style: TextStyle = LocalTextStyle.current, overflow: TextOverflow = TextOverflow.Ellipsis, maxLines: Int = 1, internetIdentifierBadgeSize: Dp = 14.dp, internetIdentifierBadgeAlign: PlaceholderVerticalAlign = PlaceholderVerticalAlign.Center, customBadgeStyle: LegendaryStyle? = null, annotatedStringPrefixBuilder: (AnnotatedString.Builder.() -&gt; Unit)? = null, annotatedStringSuffixBuilder: (AnnotatedString.Builder.() -&gt; Unit)? = null, )</ID>
<ID>CyclomaticComplexMethod:NoteActionsRow.kt$@Composable fun FeedNoteActionsRow( modifier: Modifier, eventStats: EventStatsUi, isBookmarked: Boolean, highlightedNote: Boolean = false, showBookmark: Boolean = false, showCounts: Boolean = true, onPostAction: ((FeedPostAction) -&gt; Unit)? = null, onPostLongPressAction: ((FeedPostAction) -&gt; Unit)? = null, )</ID>
<ID>CyclomaticComplexMethod:NoteContent.kt$@OptIn(ExperimentalFoundationApi::class) @Composable fun NoteContent( modifier: Modifier = Modifier, data: NoteContentUi, expanded: Boolean, noteCallbacks: NoteCallbacks, maxLines: Int = Int.MAX_VALUE, overflow: TextOverflow = TextOverflow.Clip, enableTweetsMode: Boolean = false, textSelectable: Boolean = false, referencedEventsHaveBorder: Boolean = false, highlightColor: Color = AppTheme.colorScheme.secondary, contentColor: Color = AppTheme.colorScheme.onSurface, referencedEventsContainerColor: Color = AppTheme.extraColorScheme.surfaceVariantAlt1, onClick: ((offset: Offset) -&gt; Unit)? = null, onUrlClick: ((url: String) -&gt; Unit)? = null, )</ID>
<ID>CyclomaticComplexMethod:NoteFeedLazyColumn.kt$@ExperimentalMaterial3Api @ExperimentalFoundationApi @Composable fun NoteFeedLazyColumn( modifier: Modifier = Modifier, pagingItems: LazyPagingItems&lt;FeedPostUi&gt;, listState: LazyListState, showPaywall: Boolean, noteCallbacks: NoteCallbacks, onGoToWallet: () -&gt; Unit, showTopZaps: Boolean = false, shouldShowLoadingState: Boolean = true, shouldShowNoContentState: Boolean = true, showReplyTo: Boolean = true, noContentVerticalArrangement: Arrangement.Vertical = Arrangement.Center, noContentPaddingValues: PaddingValues = PaddingValues(all = 0.dp), noContentText: String = stringResource(id = R.string.feed_no_content), contentPadding: PaddingValues = PaddingValues(all = 0.dp), header: @Composable (LazyItemScope.() -&gt; Unit)? = null, stickyHeader: @Composable (LazyItemScope.() -&gt; Unit)? = null, onUiError: ((UiError) -&gt; Unit)? = null, )</ID>
<ID>CyclomaticComplexMethod:NotePublishHandler.kt$NotePublishHandler$@Throws(NostrPublishException::class) suspend fun publishShortTextNote( userId: String, content: String, attachments: List&lt;NoteAttachment&gt; = emptyList(), rootArticleEventId: String? = null, rootArticleId: String? = null, rootArticleAuthorId: String? = null, rootPostId: String? = null, replyToPostId: String? = null, replyToAuthorId: String? = null, ): Boolean</ID>
<ID>CyclomaticComplexMethod:NotificationEvents.kt$private fun ContentPrimalNotification.parseActionPostId(type: NotificationType): String?</ID>
Expand Down Expand Up @@ -95,8 +96,9 @@
<ID>LongParameterList:ArticleDetailsViewModel.kt$ArticleDetailsViewModel$( savedStateHandle: SavedStateHandle, private val activeAccountStore: ActiveAccountStore, private val articleRepository: ArticleRepository, private val feedRepository: FeedRepository, private val profileRepository: ProfileRepository, private val eventRepository: EventRepository, private val zapHandler: ZapHandler, )</ID>
<ID>LongParameterList:ContentAppearance.kt$ContentAppearance$( val noteBodyFontSize: TextUnit, val noteBodyLineHeight: TextUnit, val noteUsernameSize: TextUnit, val noteAvatarSize: Dp, val articleTextFontSize: TextUnit, val articleTextLineHeight: TextUnit, val tweetFontSize: TextUnit, val tweetLineHeight: TextUnit, )</ID>
<ID>LongParameterList:MessagesProcessor.kt$MessagesProcessor$( userId: String, messages: List&lt;NostrEvent&gt;, profileMetadata: List&lt;NostrEvent&gt;, mediaResources: List&lt;PrimalEvent&gt;, primalUserNames: PrimalEvent?, primalLegendProfiles: PrimalEvent?, )</ID>
<ID>LongParameterList:NostrResources.kt$( eventId: String, postIdToPostDataMap: Map&lt;String, PostData&gt;, articleIdToArticle: Map&lt;String, ArticleData&gt;, profileIdToProfileDataMap: Map&lt;String, ProfileData&gt;, cdnResources: Map&lt;String, CdnResource&gt;, linkPreviews: Map&lt;String, LinkPreviewData&gt;, videoThumbnails: Map&lt;String, String&gt;, )</ID>
<ID>LongParameterList:NostrResources.kt$( postIdToPostDataMap: Map&lt;String, PostData&gt;, articleIdToArticle: Map&lt;String, ArticleData&gt;, profileIdToProfileDataMap: Map&lt;String, ProfileData&gt;, cdnResources: Map&lt;String, CdnResource&gt;, linkPreviews: Map&lt;String, LinkPreviewData&gt;, videoThumbnails: Map&lt;String, String&gt;, )</ID>
<ID>LongParameterList:NostrResources.kt$( eventId: String, eventIdToNostrEvent: Map&lt;String, NostrEvent&gt;, postIdToPostDataMap: Map&lt;String, PostData&gt;, articleIdToArticle: Map&lt;String, ArticleData&gt;, profileIdToProfileDataMap: Map&lt;String, ProfileData&gt;, cdnResources: Map&lt;String, CdnResource&gt;, linkPreviews: Map&lt;String, LinkPreviewData&gt;, videoThumbnails: Map&lt;String, String&gt;, )</ID>
<ID>LongParameterList:NostrResources.kt$( eventIdToNostrEvent: Map&lt;String, NostrEvent&gt;, postIdToPostDataMap: Map&lt;String, PostData&gt;, articleIdToArticle: Map&lt;String, ArticleData&gt;, profileIdToProfileDataMap: Map&lt;String, ProfileData&gt;, cdnResources: Map&lt;String, CdnResource&gt;, linkPreviews: Map&lt;String, LinkPreviewData&gt;, videoThumbnails: Map&lt;String, String&gt;, )</ID>
<ID>LongParameterList:NostrResources.kt$( refNote: PostData?, refPostAuthor: ProfileData?, cdnResources: Map&lt;String, CdnResource&gt;, linkPreviews: Map&lt;String, LinkPreviewData&gt;, videoThumbnails: Map&lt;String, String&gt;, eventIdToNostrEvent: Map&lt;String, NostrEvent&gt;, postIdToPostDataMap: Map&lt;String, PostData&gt;, articleIdToArticle: Map&lt;String, ArticleData&gt;, profileIdToProfileDataMap: Map&lt;String, ProfileData&gt;, )</ID>
<ID>LongParameterList:NoteEditorViewModel.kt$NoteEditorViewModel$( @Assisted private val args: NoteEditorArgs, private val dispatcherProvider: CoroutineDispatcherProvider, private val fileAnalyser: FileAnalyser, private val activeAccountStore: ActiveAccountStore, private val feedRepository: FeedRepository, private val notePublishHandler: NotePublishHandler, private val attachmentRepository: AttachmentsRepository, private val exploreRepository: ExploreRepository, private val profileRepository: ProfileRepository, private val articleRepository: ArticleRepository, )</ID>
<ID>LongParameterList:ProfileDetailsViewModel.kt$ProfileDetailsViewModel$( savedStateHandle: SavedStateHandle, private val dispatcherProvider: CoroutineDispatcherProvider, private val activeAccountStore: ActiveAccountStore, private val feedsRepository: FeedsRepository, private val profileRepository: ProfileRepository, private val mutedUserRepository: MutedUserRepository, private val zapHandler: ZapHandler, )</ID>
<ID>LongParameterList:SubscriptionsManager.kt$SubscriptionsManager$( dispatcherProvider: CoroutineDispatcherProvider, private val activeAccountStore: ActiveAccountStore, private val userRepository: UserRepository, private val nostrNotary: NostrNotary, private val appConfigProvider: AppConfigProvider, @PrimalCacheApiClient private val cacheApiClient: PrimalApiClient, @PrimalWalletApiClient private val walletApiClient: PrimalApiClient, )</ID>
Expand Down
Loading

0 comments on commit 34143ec

Please sign in to comment.