Skip to content

fix: icon color when idle#2266

Merged
setchy merged 2 commits intomainfrom
fix/icon-color-idle
Oct 3, 2025
Merged

fix: icon color when idle#2266
setchy merged 2 commits intomainfrom
fix/icon-color-idle

Conversation

@setchy
Copy link
Copy Markdown
Member

@setchy setchy commented Oct 2, 2025

No description provided.

Signed-off-by: Adam Setch <adam.setch@outlook.com>
@github-actions github-actions Bot added the bug Something isn't working label Oct 2, 2025
Signed-off-by: Adam Setch <adam.setch@outlook.com>
@setchy setchy merged commit 287f48b into main Oct 3, 2025
9 checks passed
@setchy setchy deleted the fix/icon-color-idle branch October 3, 2025 00:01
@github-actions github-actions Bot added this to the Release 6.9.1 milestone Oct 3, 2025
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Oct 3, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
35.9% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

Comment thread src/main/index.ts
Comment on lines 177 to 185

onMainEvent(EVENTS.ICON_ERROR, () => {
onMainEvent(EVENTS.UPDATE_ICON_COLOR, (_, notificationsCount: number) => {
if (!mb.tray.isDestroyed()) {
mb.tray.setImage(TrayIcons.error);
}
});
if (notificationsCount < 0) {
setErrorIcon();
return;
}

onMainEvent(EVENTS.ICON_ACTIVE, () => {
if (!mb.tray.isDestroyed() && shouldUseUnreadActiveIcon) {
}
});
if (notificationsCount > 0) {
setActiveIcon();
return;
}

onMainEvent(EVENTS.ICON_IDLE, () => {
if (!mb.tray.isDestroyed()) {
setIdleIcon();
}
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a naive quick skim of this code; but the logic around setErrorIcon looks weird. Is that correct?

Might just be the diff making things look more confusing; but currently it sort of looks like the error icon will be used if notificationsCount < 0?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, nevermind. Reading through the rest of it I see that -1 is used for an error state, so this makes sense.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking a look.

That's correct, at the moment a negative number is used to flag that the app is in error state.

Some further room for improvement

Comment thread package.json
"webpack-merge": "6.0.1"
},
"packageManager": "pnpm@10.18.0",
"packageManager": "pnpm@10.17.0",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was the downgrade intentional?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, timing issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Development

Successfully merging this pull request may close these issues.

3 participants