fix: show dismissed question content in chat history - #12043
Conversation
| const i18n = useI18n() | ||
| const questions = createMemo(() => (props.input.questions ?? []) as QuestionInfo[]) | ||
| const answers = createMemo(() => (props.metadata.answers ?? []) as QuestionAnswer[]) | ||
| const dismissed = createMemo(() => props.metadata.dismissed === true || props.status === "error") |
There was a problem hiding this comment.
SUGGESTION: Dismissed detection relies on implicit caller-side gating
dismissed() treats any status === "error" as a dismissal without inspecting the error text. That's only safe today because the caller (ToolPartDisplay above, via isDismissedQuestionError()) only routes an error-status question part into this renderer when the message already contains "dismissed this question" — any other error takes the Card fallback and never reaches this component. If that caller-side gating ever changes, a genuine tool error could silently render as "Dismissed" here instead of as an error. Consider checking the error text directly (e.g. a shared helper) rather than relying on status === "error" alone, so this renderer is correct independent of the caller.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
| const dismissed = createMemo( | ||
| () => | ||
| props.metadata.dismissed === true || | ||
| (props.part.state.status === "error" && String(props.part.state.error ?? "").includes("dismissed")), |
There was a problem hiding this comment.
SUGGESTION: Looser/inconsistent dismissal match vs. the webview renderer
This matches the substring "dismissed", while the equivalent check in packages/kilo-ui/src/components/message-part.tsx (isDismissedQuestionError) matches the more specific "dismissed this question". The same loose "dismissed" match is duplicated in session-v2.tsx. A broader match here could flag an unrelated tool error as dismissed if its message happens to contain that word, and the three separate implementations can drift over time. Consider extracting one shared predicate (or at least aligning the substring) used by all three renderers.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
Code Review SummaryStatus: 2 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (10 files)
Verified the fix reaches the actual VS Code webview and web UI (both re-export Fix these issues in Kilo Cloud Reviewed by claude-sonnet-5-20260630 · Input: 124 · Output: 42.9K · Cached: 7.7M Review guidance: REVIEW.md from base branch |
…uestion-visibility-vr2 fix: show dismissed question content in chat history
Supersedes #11951 by @Githubguy132010. Full credit to Thomas Brugman for the original work — the commit is cherry-picked with Thomas preserved as the author.
This org-owned branch lets the visual regression workflow commit screenshot baselines for the new kilo-ui stories (
QuestionDismissed,QuestionDismissedExpanded), which cannot be pushed back to the contributor's fork.Fixes #10361
When a question prompt is dismissed (manually via "Dismiss" or automatically when a new prompt arrives), the question content becomes invisible in the chat history. The question tool renderers gate content visibility on
answers.length > 0, and dismissed questions have empty answers, so the question text is hidden.This makes dismissed questions always show their content, with a "Dismissed" label and muted visual treatment.
VSCode/Web UI (
packages/kilo-ui/src/components/message-part.tsx):Show when={completed()}gate. Whenmetadata.dismissed === trueorstatus === "error", shows the question content with "Dismissed" labels and "N dismissed" subtitleui.question.subtitle.dismissed,ui.question.answer.dismissedTUI main view (
packages/opencode/src/cli/cmd/tui/routes/session/index.tsx):metadata.dismissedis true or error contains "dismissed", shows "Dismissed" labels and updated title "(dismissed)"TUI v2 view (
packages/opencode/src/cli/cmd/tui/feature-plugins/system/session-v2.tsx):Visual regression stories (
packages/kilo-ui/src/stories/message-part.stories.tsx):QuestionAnswered/QuestionAnsweredExpanded— reference rendering of answered questionsQuestionDismissed/QuestionDismissedExpanded— dismissed questions with collapsed and expanded states