mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +00:00
Add KDoc to the features/messages API interfaces
Document HtmlConverterProvider, MessageComposerContext, PinnedEventsTimelineProvider, the MessagesEntryPoint node proxy and the voice message composer factory. HtmlConverterProvider carries the ordering constraint that matters: the converter is rebuilt from the Compose theme, so Update has to be composed before provide is called. MessagesEntryPoint and its Callback are navigation plumbing and out of scope. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
+1
@@ -17,5 +17,6 @@ import io.element.android.libraries.textcomposer.model.MessageComposerMode
|
|||||||
* the composer is in a thread, if it's editing a message, etc.
|
* the composer is in a thread, if it's editing a message, etc.
|
||||||
*/
|
*/
|
||||||
interface MessageComposerContext {
|
interface MessageComposerContext {
|
||||||
|
/** What the composer is currently doing: writing a new message, editing one, replying, or composing in a thread. */
|
||||||
val composerMode: MessageComposerMode
|
val composerMode: MessageComposerMode
|
||||||
}
|
}
|
||||||
|
|||||||
+9
@@ -50,7 +50,16 @@ interface MessagesEntryPoint : FeatureEntryPoint {
|
|||||||
callback: Callback,
|
callback: Callback,
|
||||||
): Node
|
): Node
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lets callers outside this feature drive an already created messages node, for navigation that has to happen after it is attached.
|
||||||
|
*/
|
||||||
interface NodeProxy {
|
interface NodeProxy {
|
||||||
|
/**
|
||||||
|
* Opens a thread on top of the messages screen, suspending until the thread node is attached.
|
||||||
|
*
|
||||||
|
* @param threadId the thread to open.
|
||||||
|
* @param focusedEventId the event to scroll to within the thread, or `null` to open at the latest message.
|
||||||
|
*/
|
||||||
suspend fun attachThread(threadId: ThreadId, focusedEventId: EventId?)
|
suspend fun attachThread(threadId: ThreadId, focusedEventId: EventId?)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+5
@@ -10,4 +10,9 @@ package io.element.android.features.messages.api.pinned
|
|||||||
|
|
||||||
import io.element.android.libraries.matrix.api.timeline.TimelineProvider
|
import io.element.android.libraries.matrix.api.timeline.TimelineProvider
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A [TimelineProvider] whose active timeline holds the pinned events of the room, rather than its live events.
|
||||||
|
*
|
||||||
|
* It exists as its own type so that it can be injected where only the pinned timeline is wanted.
|
||||||
|
*/
|
||||||
interface PinnedEventsTimelineProvider : TimelineProvider
|
interface PinnedEventsTimelineProvider : TimelineProvider
|
||||||
|
|||||||
+7
@@ -11,9 +11,16 @@ package io.element.android.features.messages.api.timeline
|
|||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import io.element.android.wysiwyg.utils.HtmlConverter
|
import io.element.android.wysiwyg.utils.HtmlConverter
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides the converter that turns message HTML into styled text.
|
||||||
|
*
|
||||||
|
* The converter depends on the current theme and typography, so [Update] must be composed before [provide] is called.
|
||||||
|
*/
|
||||||
interface HtmlConverterProvider {
|
interface HtmlConverterProvider {
|
||||||
|
/** Rebuilds the converter from the current Compose theme; call this once, high in the composition of a screen that renders messages. */
|
||||||
@Composable
|
@Composable
|
||||||
fun Update()
|
fun Update()
|
||||||
|
|
||||||
|
/** Returns the converter built by the last [Update] call. */
|
||||||
fun provide(): HtmlConverter
|
fun provide(): HtmlConverter
|
||||||
}
|
}
|
||||||
|
|||||||
+6
@@ -12,7 +12,13 @@ import io.element.android.libraries.architecture.Presenter
|
|||||||
import io.element.android.libraries.matrix.api.timeline.Timeline
|
import io.element.android.libraries.matrix.api.timeline.Timeline
|
||||||
|
|
||||||
fun interface VoiceMessageComposerPresenter : Presenter<VoiceMessageComposerState> {
|
fun interface VoiceMessageComposerPresenter : Presenter<VoiceMessageComposerState> {
|
||||||
|
/**
|
||||||
|
* Creates a presenter for one voice message composer.
|
||||||
|
*/
|
||||||
interface Factory {
|
interface Factory {
|
||||||
|
/**
|
||||||
|
* @param timelineMode the timeline the recording will be sent to, which matters for threads in particular.
|
||||||
|
*/
|
||||||
fun create(timelineMode: Timeline.Mode): VoiceMessageComposerPresenter
|
fun create(timelineMode: Timeline.Mode): VoiceMessageComposerPresenter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user