Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
feat(sidebar): minimal icons option for the Projects section (#10638)
Jiayuan Zhang975aa7d0ff46
diff --git a/packages/core/api/schemas.ts b/packages/core/api/schemas.tsindex 519d03fdf9..3ded916410 100644--- a/packages/core/api/schemas.ts+++ b/packages/core/api/schemas.ts@@ -871,6 +871,7 @@ export const SidebarProjectPrefsDocSchema = z.object({onlyMine: z.boolean().optional().catch(undefined),showCount: z.boolean().optional().catch(undefined),showNoProject: z.boolean().optional().catch(undefined),+ minimalIcons: z.boolean().optional().catch(undefined),}).catch({}),issues: z.object({sortBy: z.enum(["updated_at", "created_at", "priority", "status", "title", "due_date"]).optional().catch(undefined),diff --git a/packages/core/issues/stores/sidebar-tree-store.ts b/packages/core/issues/stores/sidebar-tree-store.tsindex fa6aa552a1..e412d8da3d 100644--- a/packages/core/issues/stores/sidebar-tree-store.ts+++ b/packages/core/issues/stores/sidebar-tree-store.ts@@ -37,6 +37,8 @@ export interface SidebarProjectSettings {showCount: boolean;/** The row after the projects that lists issues outside every project. */showNoProject: boolean;+ /** Every project row shows the default folder icon instead of the project's own. */+ minimalIcons: boolean;}export const DEFAULT_SIDEBAR_PROJECT_SETTINGS: SidebarProjectSettings = {@@ -45,6 +47,7 @@ export const DEFAULT_SIDEBAR_PROJECT_SETTINGS: SidebarProjectSettings = {onlyMine: false,showCount: true,showNoProject: true,+ minimalIcons: false,};/** How many rows a capped sidebar section shows before "Show more". */diff --git a/packages/views/layout/panels/sidebar-settings.tsx b/packages/views/layout/panels/sidebar-settings.tsxindex f81dd2622a..c2f23d3842 100644--- a/packages/views/layout/panels/sidebar-settings.tsx+++ b/packages/views/layout/panels/sidebar-settings.tsx@@ -194,6 +194,11 @@ function ProjectsGroup({checked={settings.showCount}onChange={(showCount) => update({ showCount })}/>+ <SwitchField+ label={t(($) => $.panels.work.projects_minimal_icons)}+ checked={settings.minimalIcons}+ onChange={(minimalIcons) => update({ minimalIcons })}+ /></section>);}diff --git a/packages/views/layout/panels/work-tree.test.tsx b/packages/views/layout/panels/work-tree.test.tsxindex 7a6e229af8..5c00015b38 100644--- a/packages/views/layout/panels/work-tree.test.tsx+++ b/packages/views/layout/panels/work-tree.test.tsx@@ -153,6 +153,13 @@ describe("ProjectsSection", () => {expect(iconSlot("Mobile")?.querySelector("svg")).not.toBeNull();});+ it("shows the folder for every project when minimal icons are on", () => {+ renderSection([project("p1", "Desktop", "🚀")], { minimalIcons: true });+ const iconSlot = screen.getByRole("button", { name: "Issues in Desktop" }).previousElementSibling;+ expect(iconSlot).not.toHaveTextContent("🚀");+ expect(iconSlot?.querySelector("svg")).not.toBeNull();+ });+it("marks a private project with a lock inside its link", () => {renderSection([{ ...project("p1", "Desktop"), visibility: "private" }, { ...project("p2", "Mobile"), visibility: "workspace" }]);const lock = screen.getByRole("img", { name: "Visible to project members and workspace owners and admins" });diff --git a/packages/views/layout/panels/work-tree.tsx b/packages/views/layout/panels/work-tree.tsxindex 56d08f76be..5691503b72 100644--- a/packages/views/layout/panels/work-tree.tsx+++ b/packages/views/layout/panels/work-tree.tsx@@ -234,6 +234,7 @@ export function ProjectsSection({project={row}active={plainRowsLit && isPathWithin(pathname, p.projectDetail(row.id))}showCount={projectSettings.showCount}+ minimalIcon={projectSettings.minimalIcons}issueSettings={issueSettings}activeIssueId={litSource === projectSidebarSource(row.id) ? activeIssueId : null}openIssueId={activeIssueId}@@ -386,6 +387,7 @@ function ProjectTreeItem({project,active,showCount,+ minimalIcon,issueSettings,activeIssueId,openIssueId,@@ -396,6 +398,7 @@ function ProjectTreeItem({project: Project;active: boolean;showCount: boolean;+ minimalIcon: boolean;issueSettings: SidebarIssueSettings;activeIssueId: string | null;openIssueId: string | null;@@ -436,7 +439,11 @@ function ProjectTreeItem({href={p.projectDetail(project.id)}label={project.title}icon={- project.icon ? <ProjectIcon project={project} size="md" /> : <Folder className="size-4 shrink-0" />+ project.icon && !minimalIcon ? (+ <ProjectIcon project={project} size="md" />+ ) : (+ <Folder className="size-4 shrink-0" />+ )}active={active}located={located}diff --git a/packages/views/locales/en/layout.json b/packages/views/locales/en/layout.jsonindex 58787a476b..620e883209 100644--- a/packages/views/locales/en/layout.json+++ b/packages/views/locales/en/layout.json@@ -160,6 +160,7 @@"projects_only_mine": "Only projects I lead","projects_show_no_project": "Show “No project”","projects_show_count": "Open issue count",+ "projects_minimal_icons": "Default icons only","new_view": "New view","all_views": "All views","view_actions": "Actions for {{name}}",diff --git a/packages/views/locales/es/layout.json b/packages/views/locales/es/layout.jsonindex 6f73f1317b..6e3760e0ad 100644--- a/packages/views/locales/es/layout.json+++ b/packages/views/locales/es/layout.json@@ -160,6 +160,7 @@"projects_only_mine": "Solo los proyectos que dirijo","projects_show_no_project": "Mostrar «Sin proyecto»","projects_show_count": "Número de tareas abiertas",+ "projects_minimal_icons": "Solo iconos predeterminados","new_view": "Nueva vista","all_views": "Todas las vistas","view_actions": "Acciones de {{name}}",diff --git a/packages/views/locales/fr/layout.json b/packages/views/locales/fr/layout.jsonindex c350173346..63d21966ab 100644--- a/packages/views/locales/fr/layout.json+++ b/packages/views/locales/fr/layout.json@@ -160,6 +160,7 @@"projects_only_mine": "Seulement les projets que je dirige","projects_show_no_project": "Afficher « Aucun projet »","projects_show_count": "Nombre de tâches ouvertes",+ "projects_minimal_icons": "Icônes par défaut uniquement","new_view": "Nouvelle vue","all_views": "Toutes les vues","view_actions": "Actions pour {{name}}",diff --git a/packages/views/locales/ja/layout.json b/packages/views/locales/ja/layout.jsonindex 7728642fbb..612917ee9a 100644--- a/packages/views/locales/ja/layout.json+++ b/packages/views/locales/ja/layout.json@@ -156,6 +156,7 @@"projects_only_mine": "自分がリードするプロジェクトのみ","projects_show_no_project": "「プロジェクトなし」を表示","projects_show_count": "未完了タスク数",+ "projects_minimal_icons": "デフォルトのアイコンのみ","new_view": "新規ビュー","all_views": "すべてのビュー","view_actions": "{{name}} の操作",diff --git a/packages/views/locales/ko/layout.json b/packages/views/locales/ko/layout.jsonindex 8a8eab6247..816c75e084 100644--- a/packages/views/locales/ko/layout.json+++ b/packages/views/locales/ko/layout.json@@ -156,6 +156,7 @@"projects_only_mine": "내가 리드하는 프로젝트만","projects_show_no_project": "'프로젝트 없음' 표시","projects_show_count": "미완료 태스크 수",+ "projects_minimal_icons": "기본 아이콘만 표시","new_view": "새 뷰","all_views": "모든 뷰","view_actions": "{{name}} 작업",diff --git a/packages/views/locales/ru/layout.json b/packages/views/locales/ru/layout.jsonindex 926474c04e..9361751665 100644--- a/packages/views/locales/ru/layout.json+++ b/packages/views/locales/ru/layout.json@@ -133,6 +133,7 @@"projects_only_mine": "Только проекты, которыми я руковожу","projects_show_no_project": "Показывать «Нет проекта»","projects_show_count": "Число открытых задач",+ "projects_minimal_icons": "Только стандартные значки","new_view": "Новое представление","all_views": "Все представления","view_actions": "Действия с «{{name}}»",diff --git a/packages/views/locales/zh-Hans/layout.json b/packages/views/locales/zh-Hans/layout.jsonindex 029c04abcf..a76a41eaf4 100644--- a/packages/views/locales/zh-Hans/layout.json+++ b/packages/views/locales/zh-Hans/layout.json@@ -156,6 +156,7 @@"projects_only_mine": "只看我负责的项目","projects_show_no_project": "显示「无项目」","projects_show_count": "未完成任务数",+ "projects_minimal_icons": "仅显示默认图标","new_view": "新建视图","all_views": "全部视图","view_actions": "{{name}} 的操作",diff --git a/packages/views/locales/zh-Hant/layout.json b/packages/views/locales/zh-Hant/layout.jsonindex e72847d771..1ca3b01ba5 100644--- a/packages/views/locales/zh-Hant/layout.json+++ b/packages/views/locales/zh-Hant/layout.json@@ -156,6 +156,7 @@"projects_only_mine": "只看我負責的專案","projects_show_no_project": "顯示「無專案」","projects_show_count": "未完成任務數",+ "projects_minimal_icons": "僅顯示預設圖示","new_view": "新增檢視","all_views": "全部檢視","view_actions": "{{name}} 的操作",