Skip to content

Hide markdown markers in the Jetchat message input - #1736

Merged
srikrishnasakunia merged 5 commits into
mainfrom
sri/remove_markdown_markers
Oct 23, 2026
Merged

srikrishnasakunia merged 5 commits into
mainfrom
sri/remove_markdown_markers

Conversation

@srikrishnasakunia

Copy link
Copy Markdown
Contributor

No description provided.

@compose-devrel-github-bot

Copy link
Copy Markdown
Contributor

⚡ Jetpack Compose Performance Review

No Jetpack Compose performance issues were found in the changed code.

Audit Summary

The newly introduced and modified code across the touched Kotlin files follows Jetpack Compose performance best practices:

  • Jetchat/app/src/main/java/com/example/compose/jetchat/conversation/UserInput.kt:

    • SkipHiddenMarkers is correctly hoisted as a top-level singleton property (private val SkipHiddenMarkers = InputTransformation { ... }), completely preventing unnecessary lambda allocations across composition passes.
    • The markdownStyling OutputTransformation correctly uses remember(codeBackground) with explicit calculation keys, ensuring it is only recomputed when the surface theme color changes.
  • Jetchat/app/src/main/java/com/example/compose/jetchat/conversation/RichTextState.kt:

    • The inputTransformation parameter addition in FormattedTextField delegates directly to BasicTextField and chains state.inputTransformation without introducing backwards writes or snapshot overhead.
  • Jetchat/app/src/androidTest/java/com/example/compose/jetchat/UserInputTest.kt:

    • Contains Android UI tests verifying text transformations and semantics actions, introducing no composables or UI rendering overhead.

@compose-devrel-github-bot

Copy link
Copy Markdown
Contributor

⚡ Jetpack Compose Performance Review

No Jetpack Compose performance issues were found in the changed code.

Summary of Reviewed Changes

  1. Jetchat/app/src/main/java/com/example/compose/jetchat/conversation/RichTextState.kt:

    • Added an optional inputTransformation: InputTransformation? = null parameter to FormattedTextField and chained it via inputTransformation?.let { state.inputTransformation.then(it) } ?: state.inputTransformation.
    • The operation avoids unnecessary slot-table and remember overhead for lightweight transformations and defaults cleanly to the pre-existing transformation reference when null.
  2. Jetchat/app/src/main/java/com/example/compose/jetchat/conversation/UserInput.kt:

    • markdownStyling: Updated OutputTransformation logic executes during text buffer evaluation outside of the Compose composition pass, and the enclosing OutputTransformation remains properly cached with remember(codeBackground).
    • SkipHiddenMarkers: Implemented and hoisted as a top-level singleton val, preventing allocations and lambda captures during composition passes when passed to FormattedTextField.
  3. Jetchat/app/src/androidTest/java/com/example/compose/jetchat/UserInputTest.kt:

    • Instrumented Android UI tests validating rich-text marker visibility and cursor behavior; contains no production Compose UI rendering code.

@srikrishnasakunia
srikrishnasakunia merged commit 25631e8 into main Oct 23, 2026
11 checks passed
@srikrishnasakunia
srikrishnasakunia deleted the sri/remove_markdown_markers branch October 23, 2026 07:30
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.

4 participants