-
Notifications
You must be signed in to change notification settings - Fork 33.3k
Task terminal icon has color glitch #249580
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
base: main
Are you sure you want to change the base?
Conversation
export const FAILED_TASK_STATUS: ITerminalStatus = { id: TASK_TERMINAL_STATUS_ID, icon: { ...Codicon.error, color: { id: problemsErrorIconForeground } }, severity: Severity.Error, tooltip: nls.localize('taskTerminalStatus.errors', "Task has errors") }; | ||
const FAILED_INACTIVE_TASK_STATUS: ITerminalStatus = { id: TASK_TERMINAL_STATUS_ID, icon: { ...Codicon.error, color: { id: problemsErrorIconForeground } }, severity: Severity.Error, tooltip: nls.localize('taskTerminalStatus.errorsInactive', "Task has errors and is waiting...") }; | ||
const WARNING_TASK_STATUS: ITerminalStatus = { id: TASK_TERMINAL_STATUS_ID, icon: { ...Codicon.warning, color: { id: problemsWarningIconForeground } }, severity: Severity.Warning, tooltip: nls.localize('taskTerminalStatus.warnings', "Task has warnings") }; | ||
const WARNING_INACTIVE_TASK_STATUS: ITerminalStatus = { id: TASK_TERMINAL_STATUS_ID, icon: { ...Codicon.warning, color: { id: problemsWarningIconForeground } }, severity: Severity.Warning, tooltip: nls.localize('taskTerminalStatus.warningsInactive', "Task has warnings and is waiting...") }; |
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.
dont think these had effect, but the terminalData.terminal.changeColor?.(problemsErrorIconForeground, true);
was what allowed me to really change the color of the icon.
Trying to figure out how I can change the red -> white on user focusing the failed terminal tab.
It seems like it does for the other x icon and the terminal title itself.
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.
Pull Request Overview
This PR ensures that task terminal status icons use the appropriate problem-theme colors for error and warning states.
- Imports
problemsErrorIconForeground
andproblemsWarningIconForeground
and applies them to the status icon definitions. - Adds runtime calls to
terminal.changeColor
in active and inactive branches to override icon colors.
@@ -125,8 +132,16 @@ export class TaskTerminalStatus extends Disposable { | |||
} else if (terminalData.problemMatcher.maxMarkerSeverity === MarkerSeverity.Error) { | |||
this._accessibilitySignalService.playSignal(AccessibilitySignal.taskFailed); | |||
terminalData.terminal.statusList.add(FAILED_INACTIVE_TASK_STATUS); | |||
terminalData.terminal.changeColor?.(problemsErrorIconForeground, true); // works but stays red even when focused/hover |
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.
Calling changeColor
here without a corresponding revert or reset means the icon may never return to its default color. Introduce logic on blur/unhover or theme change to restore the original color.
terminalData.terminal.changeColor?.(problemsErrorIconForeground, true); // works but stays red even when focused/hover | |
terminalData.terminal.changeColor?.(problemsErrorIconForeground, true); // works but stays red even when focused/hover | |
terminalData.terminal.onBlur(() => terminalData.terminal.resetColor?.()); | |
terminalData.terminal.onUnhover(() => terminalData.terminal.resetColor?.()); |
Copilot uses AI. Check for mistakes.
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.
completely irrelevant. terminalData.terminal.onUnhover(() => terminalData.terminal.resetColor?.());
doesnt exist in real life
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.
Pull Request Overview
This PR addresses the issue where task terminal status icons remained white by assigning theme colors to error and warning icons and programmatically updating the icon color on focus/inactive states.
- Import and apply
problemsErrorIconForeground
andproblemsWarningIconForeground
to error/warning status icons - Updated
FAILED_*
andWARNING_*
statuses to include acolor
property - Added
terminal.changeColor
calls in theTaskTerminalStatus
class to enforce the themed colors
Comments suppressed due to low confidence (1)
src/vs/workbench/contrib/tasks/browser/taskTerminalStatus.ts:111
- Consider adding automated tests to verify that
changeColor
correctly applies and resets icon colors on focus and hover, preventing regressions of the color glitch.
terminalData.terminal.changeColor?.(problemsErrorIconForeground, true);
@anthonykim1 we want the icon to stay red for as long as the task has errors -- is that what happens via this PR? |
Resolves: #234602
For me, the icon is always white color (regardless of hover&focused), even when task terminal is in failed/error state.
I made some changes in the
taskTerminalStatus.ts
file, but then this makes the icon ALWAYS red for failed/error state task terminal.I'm thinking there may be some focused/hover related thing I might be missing @meganrogge