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:
Benoit Marty
2026-08-14 10:02:48 +02:00
parent 7f3d896a3e
commit 186d5b65b9
5 changed files with 28 additions and 0 deletions
@@ -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.
*/
interface MessageComposerContext {
/** What the composer is currently doing: writing a new message, editing one, replying, or composing in a thread. */
val composerMode: MessageComposerMode
}
@@ -50,7 +50,16 @@ interface MessagesEntryPoint : FeatureEntryPoint {
callback: Callback,
): Node
/**
* Lets callers outside this feature drive an already created messages node, for navigation that has to happen after it is attached.
*/
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?)
}
}
@@ -10,4 +10,9 @@ package io.element.android.features.messages.api.pinned
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
@@ -11,9 +11,16 @@ package io.element.android.features.messages.api.timeline
import androidx.compose.runtime.Composable
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 {
/** Rebuilds the converter from the current Compose theme; call this once, high in the composition of a screen that renders messages. */
@Composable
fun Update()
/** Returns the converter built by the last [Update] call. */
fun provide(): HtmlConverter
}
@@ -12,7 +12,13 @@ import io.element.android.libraries.architecture.Presenter
import io.element.android.libraries.matrix.api.timeline.Timeline
fun interface VoiceMessageComposerPresenter : Presenter<VoiceMessageComposerState> {
/**
* Creates a presenter for one voice message composer.
*/
interface Factory {
/**
* @param timelineMode the timeline the recording will be sent to, which matters for threads in particular.
*/
fun create(timelineMode: Timeline.Mode): VoiceMessageComposerPresenter
}
}