-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: make error display less jarring by matching diff_error style #6782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
ae8e4d8
eb4bd66
d303138
0f47482
aeb1ea6
8fcd218
a3b3446
001d38c
55f7053
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -118,6 +118,8 @@ export const ChatRowContent = ({ | |||||
| const [reasoningCollapsed, setReasoningCollapsed] = useState(true) | ||||||
| const [isDiffErrorExpanded, setIsDiffErrorExpanded] = useState(false) | ||||||
| const [showCopySuccess, setShowCopySuccess] = useState(false) | ||||||
| const [isErrorExpanded, setIsErrorExpanded] = useState(false) | ||||||
| const [showErrorCopySuccess, setShowErrorCopySuccess] = useState(false) | ||||||
| const [isEditing, setIsEditing] = useState(false) | ||||||
| const [editedContent, setEditedContent] = useState("") | ||||||
| const [editMode, setEditMode] = useState<Mode>(mode || "code") | ||||||
|
|
@@ -1132,15 +1134,96 @@ export const ChatRowContent = ({ | |||||
| ) | ||||||
| case "error": | ||||||
| return ( | ||||||
| <> | ||||||
| {title && ( | ||||||
| <div style={headerStyle}> | ||||||
| {icon} | ||||||
| {title} | ||||||
| <div> | ||||||
| <div | ||||||
| style={{ | ||||||
| marginTop: "0px", | ||||||
| overflow: "hidden", | ||||||
| marginBottom: "8px", | ||||||
| }}> | ||||||
| <div | ||||||
| style={{ | ||||||
| borderBottom: isErrorExpanded | ||||||
| ? "1px solid var(--vscode-editorGroup-border)" | ||||||
| : "none", | ||||||
| fontWeight: "normal", | ||||||
| fontSize: "var(--vscode-font-size)", | ||||||
| color: "var(--vscode-editor-foreground)", | ||||||
| display: "flex", | ||||||
| alignItems: "center", | ||||||
| justifyContent: "space-between", | ||||||
| cursor: "pointer", | ||||||
| }} | ||||||
| onClick={() => setIsErrorExpanded(!isErrorExpanded)}> | ||||||
|
||||||
| onClick={() => setIsErrorExpanded(!isErrorExpanded)}> | |
| onClick={() => setIsErrorExpanded(!isErrorExpanded)} role="button" tabIndex={0}> |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it intentional that the "Error" label uses color while the diff_error "Diff Error" label uses the default color? This creates a visual inconsistency between the two similar components. If this is meant to indicate severity (errors being more critical than diff errors), that's fine, but wanted to confirm this was deliberate.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For better accessibility, add an aria-label to the VSCodeButton (e.g. aria-label="Copy error message") so that its purpose is clear to screen readers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I notice there's significant code duplication between the error and diff_error implementations. Both share nearly identical structure for the collapsible UI, copy functionality, and expand/collapse behavior. Could we consider extracting a reusable component like to reduce this duplication and make future maintenance easier?