| … | … | @@ -0,0 +1,81 @@ | |
| 31 | + | for (const node of parser.parse(markdown).children) { | |
| 32 | + | if (node.type !== "html" || node.position?.start.offset === undefined) continue; | |
| 33 | + | const nodeStart = node.position.start.offset; | |
| 34 | + | for (const tag of node.value.matchAll(DETAILS_TAG)) { | |
đźź High lib/markdownDetails.ts:34
A </details> inside a fenced code example in an HTML block closes the fold early, leaving the remaining text outside the fold and splitting the code fence. node.value.matchAll(DETAILS_TAG) scans the entire HTML node, including code ranges that CommonMark keeps inside that node; exclude code ranges before matching tags.
🤖 Copy this AI Prompt to have your agent fix this:
| 1 | In file @apps/mobile/src/lib/markdownDetails.ts around line 34: |
| 2 | |
| 3 | A `</details>` inside a fenced code example in an HTML block closes the fold early, leaving the remaining text outside the fold and splitting the code fence. `node.value.matchAll(DETAILS_TAG)` scans the entire HTML node, including code ranges that CommonMark keeps inside that node; exclude code ranges before matching tags. |
Fixed in 043c2ecb31. Fold tags now come from markdownHtmlTags, which already skips fences and code spans inside HTML blocks. I added a test with </details> inside a fenced example in the fold.
| … | … | @@ -1204,21 +1205,87 @@ const AssistantMarkdownContent = memo(function AssistantMarkdownContent(props: { | |
| 1225 | + | readonly renderImage: MarkdownImageRenderer; | |
| 1226 | + | readonly skills?: ReadonlyArray<SelectableMarkdownSkill> | undefined; | |
| 1227 | + | }) { | |
| 1228 | + | const blocks = useMemo(() => splitMarkdownDetails(props.markdown), [props.markdown]); | |
đźź High threads/ThreadFeed.tsx:1228
A <details> fold stops hiding its content when it contains an artifact-template directive: the artifact card and subsequent body text render outside the fold, so tapping the summary cannot hide them. AssistantMarkdownContent splits artifact templates before AssistantMarkdownBlocks parses details, leaving the closing fold boundary in a later segment; parse details first and render artifact-aware content inside each fold.
🤖 Copy this AI Prompt to have your agent fix this:
| 1 | In file @apps/mobile/src/features/threads/ThreadFeed.tsx around line 1228: |
| 2 | |
| 3 | A `<details>` fold stops hiding its content when it contains an artifact-template directive: the artifact card and subsequent body text render outside the fold, so tapping the summary cannot hide them. `AssistantMarkdownContent` splits artifact templates before `AssistantMarkdownBlocks` parses details, leaving the closing fold boundary in a later segment; parse details first and render artifact-aware content inside each fold. |
Fixed in 043c2ecb31. Folds are now split first, and artifact templates are split inside each fold's body and each part between folds. A card inside a fold now stays hidden with it.
Sorry, I'm unable to act on this request because you do not have permissions within this repository.