Repository navigation
Conversation
|
The following comment was made by an LLM, it may be inaccurate: |
There was a problem hiding this comment.
This fixes the list colors in mini mode (opencode run), but it does not fix #55735 as reported. I ran the issue's reproduction script on the base and with this PR. In both runs, after switching from light to dark, the list text and - markers kept their light-mode colors in the normal session view (screenshots below). The reported bug happens there: packages/tui/src/routes/session/message-parts.tsx (and routes/session/index.tsx) render <markdown internalBlockMode="top-level"> directly, and they never use RunScrollbackStream.
The mini-mode change looks sound. It reuses the rebuild that setMono already does, your new test fails on the base and passes here, all 22 tests in scrollback.surface.test.ts pass, and typecheck is clean. To close #55735, the session view needs a fix too. That could be a remount or clearCache() of the markdown component when the theme changes, or a fix in opentui's MarkdownRenderable so a style refresh also refreshes list items, which would fix both places at once. Otherwise, please change Fixes #55735 to a reference and describe this as the mini-mode part.
The test reads opentui internals (_blockStates, child index paths), so it may break on opentui upgrades. A smaller check through the rendered frame would hold up better.
Public API: unchanged.
| return | ||
| } | ||
|
|
||
| if (active.renderable instanceof MarkdownRenderable) { |
There was a problem hiding this comment.
This only covers the mini (opencode run) scrollback. The session view where #55735 was reproduced renders markdown in routes/session/message-parts.tsx. With this PR, the issue's reproduction there still shows stale list colors after a light/dark switch. The cause you describe (style refresh skipping unchanged list items) is in opentui's MarkdownRenderable, so fixing it there, or adding a rebuild on theme change in the session view as well, would be needed to close the issue.
There was a problem hiding this comment.
Thanks — right, the issue reproduces in the session view. Added the session-view fix: message-parts.tsx now remounts the markdown element when the syntax style changes (<Show keyed>), so the tree is rebuilt against the new theme the same way the mini scrollback now rebuilds its active entry. New component test covers it: the list marker keeps the previous theme color without the keyed remount and switches with it. Kept the mini fix as well since it had the same failure.
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
There was a problem hiding this comment.
My earlier concern is resolved: the session view is now fixed. I reran the #55735 reproduction on this head. List text and markers now follow light→dark and back to light, matching the paragraph (before = base, after = this PR). The remount only fires when the theme's syntax style changes, and streamed content comes back after a remount through the same content/streaming props. markdown-streaming and scrollback.surface tests pass (25), and typecheck is clean.
One gap: the compaction summary in routes/session/index.tsx (around line 2082) and feature-plugins/prompt/btw.tsx still render <markdown internalBlockMode="top-level"> directly. They will likely keep stale list colors after a theme swap. Switching them to ThemedMarkdown would cover the rest of the session UI.
Public API: unchanged.
|
Switched both remaining sites to the same component: the compaction summary in |



Issue for this PR
Closes #55735
Type of change
What does this PR do?
A theme swap left list items on the previous theme's colors. opentui's
MarkdownRenderableresolves each block's colors when the block is built, and its own style refresh skips list items whose raw text did not change, so reassigningsyntaxStylere-colors paragraphs, bold and inline code but not list markers or list item text.opencode run): rebuild the active Markdown tree on theme change, the same waysetMonoalready does.routes/session/message-parts.tsx): remount the markdown element when the syntax style changes, which rebuilds the tree against the new theme.How did you verify your code works?
theme swaps restyle streamed markdown lists(mini) fails on base, with the marker retaining the previous theme color, and passes with the fix.rebuilds the markdown tree when the syntax style changes(session component) fails without the keyed remount and passes with it.bun test test/markdown-streaming.test.tsx test/mini/scrollback.surface.test.ts— 23 pass, 1 pre-existing skip;bun run typecheckclean.Screenshots / recordings
N/A (covered by the tests above).
Checklist