From 8e44541c4c53cfdf6bb149dc7dc4524eff24405a Mon Sep 17 00:00:00 2001 From: Ramzi <79337754+heyramzi@users.noreply.github.com> Date: Mon, 27 Apr 2026 00:01:16 +0100 Subject: [PATCH] Add task provider icon setting (#1128) --- .../runtime-home-service.test.ts | 1 + src/main/codex-accounts/service.test.ts | 1 + src/main/persistence.test.ts | 2 + .../components/settings/AppearancePane.tsx | 48 ++++++++++++++- .../src/components/sidebar/SidebarNav.tsx | 61 ++++++++++--------- src/shared/constants.ts | 1 + src/shared/types.ts | 3 + 7 files changed, 87 insertions(+), 30 deletions(-) diff --git a/src/main/codex-accounts/runtime-home-service.test.ts b/src/main/codex-accounts/runtime-home-service.test.ts index 0d2d3dec09d..d5b62e9ffe9 100644 --- a/src/main/codex-accounts/runtime-home-service.test.ts +++ b/src/main/codex-accounts/runtime-home-service.test.ts @@ -64,6 +64,7 @@ function createSettings(overrides: Partial = {}): GlobalSettings openLinksInApp: false, rightSidebarOpenByDefault: true, showTitlebarAgentActivity: true, + showTaskProviderIcons: true, diffDefaultView: 'inline', notifications: { enabled: true, diff --git a/src/main/codex-accounts/service.test.ts b/src/main/codex-accounts/service.test.ts index d4707bbd4f2..98338cc244c 100644 --- a/src/main/codex-accounts/service.test.ts +++ b/src/main/codex-accounts/service.test.ts @@ -58,6 +58,7 @@ function createSettings(overrides: Partial = {}): GlobalSettings openLinksInApp: false, rightSidebarOpenByDefault: true, showTitlebarAgentActivity: true, + showTaskProviderIcons: true, diffDefaultView: 'inline', notifications: { enabled: true, diff --git a/src/main/persistence.test.ts b/src/main/persistence.test.ts index a8281f5fc77..a34b96c85d9 100644 --- a/src/main/persistence.test.ts +++ b/src/main/persistence.test.ts @@ -77,6 +77,7 @@ describe('Store', () => { expect(settings.terminalFontSize).toBe(14) expect(settings.terminalFontWeight).toBe(500) expect(settings.rightSidebarOpenByDefault).toBe(true) + expect(settings.showTaskProviderIcons).toBe(true) }) it('returns default UI state when no data file exists', async () => { @@ -144,6 +145,7 @@ describe('Store', () => { expect(store.getSettings().editorAutoSaveDelayMs).toBe(1000) expect(store.getSettings().refreshLocalBaseRefOnWorktreeCreate).toBe(false) expect(store.getSettings().rightSidebarOpenByDefault).toBe(true) + expect(store.getSettings().showTaskProviderIcons).toBe(true) // repos should be loaded expect(store.getRepos()).toHaveLength(1) }) diff --git a/src/renderer/src/components/settings/AppearancePane.tsx b/src/renderer/src/components/settings/AppearancePane.tsx index ab854434b9c..63588e83039 100644 --- a/src/renderer/src/components/settings/AppearancePane.tsx +++ b/src/renderer/src/components/settings/AppearancePane.tsx @@ -32,6 +32,11 @@ export const APPEARANCE_PANE_SEARCH_ENTRIES: SettingsSearchEntry[] = [ title: 'Titlebar Agent Activity', description: 'Show the number of active agents in the titlebar.', keywords: ['titlebar', 'agent', 'badge', 'active', 'count', 'status'] + }, + { + title: 'Task Provider Icons', + description: 'Show GitHub and Linear icons in the Tasks sidebar button.', + keywords: ['tasks', 'sidebar', 'github', 'linear', 'icons', 'badges'] } ] @@ -47,7 +52,8 @@ export function AppearancePane({ const themeEntries = APPEARANCE_PANE_SEARCH_ENTRIES.slice(0, 1) const zoomEntries = APPEARANCE_PANE_SEARCH_ENTRIES.slice(1, 2) const layoutEntries = APPEARANCE_PANE_SEARCH_ENTRIES.slice(2, 3) - const titlebarEntries = APPEARANCE_PANE_SEARCH_ENTRIES.slice(3) + const titlebarEntries = APPEARANCE_PANE_SEARCH_ENTRIES.slice(3, 4) + const sidebarEntries = APPEARANCE_PANE_SEARCH_ENTRIES.slice(4) const visibleSections = [ matchesSettingsSearch(searchQuery, themeEntries) ? ( @@ -187,6 +193,46 @@ export function AppearancePane({ + ) : null, + matchesSettingsSearch(searchQuery, sidebarEntries) ? ( +
+
+

Sidebar

+

Tune the left sidebar chrome.

+
+ + +
+ +

+ Show GitHub and Linear icons next to the Tasks button. +

+
+ +
+
) : null ].filter(Boolean) diff --git a/src/renderer/src/components/sidebar/SidebarNav.tsx b/src/renderer/src/components/sidebar/SidebarNav.tsx index bd2a46c6fbb..85aa69e514d 100644 --- a/src/renderer/src/components/sidebar/SidebarNav.tsx +++ b/src/renderer/src/components/sidebar/SidebarNav.tsx @@ -20,6 +20,7 @@ const SidebarNav = React.memo(function SidebarNav() { const repos = useAppStore((s) => s.repos) const repoMap = useRepoMap() const canBrowseTasks = repos.some((repo) => isGitRepoKind(repo)) + const showTaskProviderIcons = useAppStore((s) => s.settings?.showTaskProviderIcons !== false) // Why: warm the GitHub work-item cache on hover/focus so by the time the // user's click finishes the round-trip has either completed or is already @@ -74,36 +75,38 @@ const SidebarNav = React.memo(function SidebarNav() { > Tasks - - { - e.stopPropagation() - if (!canBrowseTasks) { - return - } - openTaskPage({ taskSource: 'github' }) - }} - className="rounded p-0.5 text-muted-foreground/70 transition-colors hover:text-foreground" - > - + {showTaskProviderIcons ? ( + + { + e.stopPropagation() + if (!canBrowseTasks) { + return + } + openTaskPage({ taskSource: 'github' }) + }} + className="rounded p-0.5 text-muted-foreground/70 transition-colors hover:text-foreground" + > + + + { + e.stopPropagation() + if (!canBrowseTasks) { + return + } + openTaskPage({ taskSource: 'linear' }) + }} + className="rounded p-0.5 text-muted-foreground/70 transition-colors hover:text-foreground" + > + + - { - e.stopPropagation() - if (!canBrowseTasks) { - return - } - openTaskPage({ taskSource: 'linear' }) - }} - className="rounded p-0.5 text-muted-foreground/70 transition-colors hover:text-foreground" - > - - - + ) : null} ) diff --git a/src/shared/constants.ts b/src/shared/constants.ts index 66de5304582..d9cab8ecd9e 100644 --- a/src/shared/constants.ts +++ b/src/shared/constants.ts @@ -150,6 +150,7 @@ export function getDefaultSettings(homedir: string): GlobalSettings { openLinksInApp: true, rightSidebarOpenByDefault: true, showTitlebarAgentActivity: true, + showTaskProviderIcons: true, notifications: getDefaultNotificationSettings(), diffDefaultView: 'inline', promptCacheTimerEnabled: false, diff --git a/src/shared/types.ts b/src/shared/types.ts index 8965d232c97..3cc07c42cd2 100644 --- a/src/shared/types.ts +++ b/src/shared/types.ts @@ -811,6 +811,9 @@ export type GlobalSettings = { rightSidebarOpenByDefault: boolean /** Whether to show the live agent activity count badge in the titlebar. */ showTitlebarAgentActivity: boolean + /** Why: the Tasks sidebar label can be kept cleaner for users who do not + * actively use the GitHub/Linear integrations behind it. */ + showTaskProviderIcons: boolean diffDefaultView: 'inline' | 'side-by-side' notifications: NotificationSettings /** When true, a countdown timer is shown after a Claude agent becomes idle,