Skip to content

[JEWEL-1258] Add missing remember keys in Markdown renderers#3432

Open
rock3r wants to merge 1 commit intoJetBrains:masterfrom
rock3r:sebp/fix-remember-keys-markdown
Open

[JEWEL-1258] Add missing remember keys in Markdown renderers#3432
rock3r wants to merge 1 commit intoJetBrains:masterfrom
rock3r:sebp/fix-remember-keys-markdown

Conversation

@rock3r
Copy link
Collaborator

@rock3r rock3r commented Feb 19, 2026

Summary

Fixed missing remember keys in DefaultMarkdownBlockRenderer and GitHubTableBlockRenderer that caused stale cached values when onUrlClick or enabled changed. Also extracted shared test infrastructure into a new markdown-testing module to reduce boilerplate duplication across markdown test classes.

Fixes JEWEL-1258

Changes

  • Added onUrlClick to the remember keys in DefaultMarkdownBlockRenderer.renderAsAnnotatedString()
  • Added enabled and onUrlClick to the remember keys in GitHubTableBlockRenderer's table rows computation
  • Created markdown-testing module with shared MarkdownTestTheme, createMarkdownTestStyling(), and related test helpers
  • Added Compose UI tests for both renderers verifying callback and enabled-state reactivity
  • Migrated ScrollingSynchronizerTest to use the shared test infrastructure

Release notes

Bug fixes

  • [JEWEL-1258] Fixed missing remember keys in DefaultMarkdownBlockRenderer and GitHubTableBlockRenderer that caused stale onUrlClick callbacks and enabled state when these values changed

@@ -752,7 +752,7 @@ public open class DefaultMarkdownBlockRenderer(
enabled: Boolean,
onUrlClick: ((String) -> Unit)? = null,
) =
remember(block.inlineContent, styling, enabled) {
remember(block.inlineContent, styling, enabled, onUrlClick) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Core fix here :)

@@ -74,7 +74,7 @@ internal class GitHubTableBlockRenderer(
val headerRenderer = remember(headerRootStyling) { blockRenderer.createCopy(rootStyling = headerRootStyling) }

val rows =
remember(tableBlock, blockRenderer, inlineRenderer, tableStyling) {
remember(tableBlock, blockRenderer, inlineRenderer, tableStyling, enabled, onUrlClick) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other core fix here :)

@rock3r
Copy link
Collaborator Author

rock3r commented Feb 23, 2026

Ready to merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants