From 8c5dd1f49c1f9c9a3dc943ae6350044b48eeb6c2 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 5 Dec 2025 16:18:42 -0600 Subject: [PATCH] Remove labels preferences --- src/components/ProjectSidebar.tsx | 14 +++----- src/hooks/useLabels.ts | 22 ------------ src/locales/en.json | 7 +--- src/locales/ha.json | 7 +--- src/locales/ig.json | 7 +--- src/locales/pt.json | 7 +--- src/locales/yo.json | 7 +--- src/locales/zh.json | 7 +--- src/pages/Preferences.tsx | 56 ------------------------------- 9 files changed, 11 insertions(+), 123 deletions(-) diff --git a/src/components/ProjectSidebar.tsx b/src/components/ProjectSidebar.tsx index ff68dca7..2e20e61b 100644 --- a/src/components/ProjectSidebar.tsx +++ b/src/components/ProjectSidebar.tsx @@ -24,7 +24,6 @@ interface ProjectItemProps { onSelect: (project: Project) => void; isFavorite?: boolean; labelColor?: string; - showColoredIcon?: boolean; } const ProjectItem: React.FC = ({ @@ -33,7 +32,6 @@ const ProjectItem: React.FC = ({ onSelect, isFavorite, labelColor, - showColoredIcon = false, }) => { const navigate = useNavigate(); const { hasRunningSessions } = useProjectSessionStatus(project.id); @@ -43,9 +41,9 @@ const ProjectItem: React.FC = ({ navigate(`/project/${project.id}`); }; - // Determine folder icon color + // Determine folder icon color - always show colored icons when label exists const getFolderColorClass = () => { - if (showColoredIcon && labelColor) { + if (labelColor) { const colorConfig = getLabelColor(labelColor as Parameters[0]); return colorConfig.text; } @@ -151,14 +149,14 @@ export function ProjectSidebar({ const { data: projects = [], isLoading, error } = useProjects(); const [favorites] = useLocalStorage('project-favorites', []); const [searchQuery, setSearchQuery] = useState(''); - const { labels, displaySettings, toggleLabelCollapsed } = useLabels(); + const { labels, toggleLabelCollapsed } = useLabels(); const { getProjectLabels, hasAnyLabels } = useProjectLabels(); const isMobile = useIsMobile(); const navigate = useNavigate(); - // Determine if we should show grouped view - const showGroupedView = displaySettings.groupByLabel && labels.length > 0 && hasAnyLabels(); + // Always show grouped view when labels exist and projects have labels + const showGroupedView = labels.length > 0 && hasAnyLabels(); // Fast in-memory search filtering const filteredProjects = useMemo(() => { @@ -404,7 +402,6 @@ export function ProjectSidebar({ onSelect={onSelectProject} isFavorite={favorites.includes(project.id)} labelColor={label.color} - showColoredIcon={displaySettings.showColoredIcons} /> ))} @@ -444,7 +441,6 @@ export function ProjectSidebar({ onSelect={onSelectProject} isFavorite={favorites.includes(project.id)} labelColor={getProjectLabelColor(project.id)} - showColoredIcon={displaySettings.showColoredIcons} /> ))} diff --git a/src/hooks/useLabels.ts b/src/hooks/useLabels.ts index 3a97702b..d355175a 100644 --- a/src/hooks/useLabels.ts +++ b/src/hooks/useLabels.ts @@ -31,18 +31,6 @@ export interface Label { collapsed?: boolean; } -export interface LabelDisplaySettings { - /** Show colored folder icons for labeled projects */ - showColoredIcons: boolean; - /** Group projects by label in sidebar */ - groupByLabel: boolean; -} - -const DEFAULT_DISPLAY_SETTINGS: LabelDisplaySettings = { - showColoredIcons: false, - groupByLabel: false, -}; - /** Get the color config for a label color name */ export function getLabelColor(colorName: LabelColorName) { return LABEL_COLORS.find(c => c.name === colorName) || LABEL_COLORS[0]; @@ -58,10 +46,6 @@ function generateLabelId(): string { */ export function useLabels() { const [labels, setLabels] = useLocalStorage('project-labels', []); - const [displaySettings, setDisplaySettings] = useLocalStorage( - 'project-labels-display', - DEFAULT_DISPLAY_SETTINGS - ); const createLabel = (name: string, color: LabelColorName): Label => { const newLabel: Label = { @@ -96,18 +80,12 @@ export function useLabels() { )); }; - const updateDisplaySettings = (updates: Partial) => { - setDisplaySettings({ ...displaySettings, ...updates }); - }; - return { labels, - displaySettings, createLabel, updateLabel, deleteLabel, reorderLabels, toggleLabelCollapsed, - updateDisplaySettings, }; } diff --git a/src/locales/en.json b/src/locales/en.json index ec5de675..6ab9ec6d 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -539,10 +539,5 @@ "selectLabels": "Select labels", "noLabelsCreated": "No labels created yet", "createNewLabel": "Create new label", - "showColoredIcons": "Colored folder icons", - "showColoredIconsDescription": "Show the folder icon in the label's color for labeled projects.", - "groupByLabel": "Group by label", - "groupByLabelDescription": "Organize projects into collapsible groups based on their labels.", - "unlabeled": "Unlabeled", - "createLabelToEnableSettings": "Create a label to enable these settings" + "unlabeled": "Unlabeled" } diff --git a/src/locales/ha.json b/src/locales/ha.json index a4215d20..0e983052 100644 --- a/src/locales/ha.json +++ b/src/locales/ha.json @@ -446,10 +446,5 @@ "selectLabels": "Zaɓi lakabi", "noLabelsCreated": "Ba a ƙirƙiri lakabi tukuna ba", "createNewLabel": "Ƙirƙiri sabon lakabi", - "showColoredIcons": "Alamomin fayil masu launi", - "showColoredIconsDescription": "Nuna alamar fayil a launin lakabi don ayyukan da aka yi musu lakabi.", - "groupByLabel": "Haɗa da lakabi", - "groupByLabelDescription": "Tsara ayyuka cikin ƙungiyoyi masu rufewa dangane da lakabin su.", - "unlabeled": "Babu lakabi", - "createLabelToEnableSettings": "Ƙirƙiri lakabi don kunna waɗannan saituna" + "unlabeled": "Babu lakabi" } diff --git a/src/locales/ig.json b/src/locales/ig.json index 2d592def..bd42ceac 100644 --- a/src/locales/ig.json +++ b/src/locales/ig.json @@ -443,10 +443,5 @@ "selectLabels": "Họrọ akara", "noLabelsCreated": "Emepụtaghị akara ọ bụla", "createNewLabel": "Mepụta akara ọhụrụ", - "showColoredIcons": "Akara nchekwa nwere agba", - "showColoredIconsDescription": "Gosi akara nchekwa n'agba akara maka ọrụ nwere akara.", - "groupByLabel": "Kekọta site n'akara", - "groupByLabelDescription": "Hazie ọrụ n'ime otu ndị a pụrụ imechi dabere n'akara ha.", - "unlabeled": "Enweghị akara", - "createLabelToEnableSettings": "Mepụta akara iji mee ka ntọala ndị a rụọ ọrụ" + "unlabeled": "Enweghị akara" } diff --git a/src/locales/pt.json b/src/locales/pt.json index 08a612a0..9edf9a89 100644 --- a/src/locales/pt.json +++ b/src/locales/pt.json @@ -455,10 +455,5 @@ "selectLabels": "Selecionar etiquetas", "noLabelsCreated": "Nenhuma etiqueta criada ainda", "createNewLabel": "Criar nova etiqueta", - "showColoredIcons": "Ícones de pasta coloridos", - "showColoredIconsDescription": "Mostrar o ícone da pasta na cor da etiqueta para projetos etiquetados.", - "groupByLabel": "Agrupar por etiqueta", - "groupByLabelDescription": "Organizar projetos em grupos recolhíveis com base em suas etiquetas.", - "unlabeled": "Sem etiqueta", - "createLabelToEnableSettings": "Crie uma etiqueta para ativar estas configurações" + "unlabeled": "Sem etiqueta" } diff --git a/src/locales/yo.json b/src/locales/yo.json index a836d95d..4d8c5e22 100644 --- a/src/locales/yo.json +++ b/src/locales/yo.json @@ -443,10 +443,5 @@ "selectLabels": "Yan àmì", "noLabelsCreated": "A kò tí ì ṣẹ̀dá àmì kankan", "createNewLabel": "Ṣẹ̀dá àmì tuntun", - "showColoredIcons": "Àwọn ìkọ́ fáìlì oníàwọ̀", - "showColoredIconsDescription": "Fi ìkọ́ fáìlì hàn ní àwọ̀ àmì fún àwọn iṣẹ́ tí wọ́n ní àmì.", - "groupByLabel": "Ṣàkójọ nípa àmì", - "groupByLabelDescription": "Ṣètò àwọn iṣẹ́ sí ẹgbẹ́ tí wọ́n lè pa mọ́ dà lórí àmì wọn.", - "unlabeled": "Kò ní àmì", - "createLabelToEnableSettings": "Ṣẹ̀dá àmì láti mú àwọn ètò wọ̀nyí ṣiṣẹ́" + "unlabeled": "Kò ní àmì" } diff --git a/src/locales/zh.json b/src/locales/zh.json index 0ca640ee..8648fe71 100644 --- a/src/locales/zh.json +++ b/src/locales/zh.json @@ -455,10 +455,5 @@ "selectLabels": "选择标签", "noLabelsCreated": "尚未创建标签", "createNewLabel": "创建新标签", - "showColoredIcons": "彩色文件夹图标", - "showColoredIconsDescription": "为有标签的项目显示标签颜色的文件夹图标。", - "groupByLabel": "按标签分组", - "groupByLabelDescription": "根据标签将项目组织成可折叠的分组。", - "unlabeled": "无标签", - "createLabelToEnableSettings": "创建标签以启用这些设置" + "unlabeled": "无标签" } diff --git a/src/pages/Preferences.tsx b/src/pages/Preferences.tsx index 35bd4031..7073ebee 100644 --- a/src/pages/Preferences.tsx +++ b/src/pages/Preferences.tsx @@ -10,7 +10,6 @@ import { Label } from "@/components/ui/label"; import { useIsMobile } from "@/hooks/useIsMobile"; import { useNavigate } from "react-router-dom"; import { useAppContext } from "@/hooks/useAppContext"; -import { useLabels } from "@/hooks/useLabels"; import { LabelsManageDialog } from "@/components/labels/LabelsManageDialog"; export function Preferences() { @@ -18,12 +17,8 @@ export function Preferences() { const isMobile = useIsMobile(); const navigate = useNavigate(); const { config, updateConfig } = useAppContext(); - const { labels, displaySettings, updateDisplaySettings } = useLabels(); const [labelsDialogOpen, setLabelsDialogOpen] = useState(false); - // Settings are disabled until user creates at least one label - const hasLabels = labels.length > 0; - return (
{isMobile && ( @@ -120,52 +115,6 @@ export function Preferences() {
-
-
-
-
- -
- { - updateDisplaySettings({ showColoredIcons: checked }); - }} - disabled={!hasLabels} - /> -
-

- {t('showColoredIconsDescription')} -

-
-
- -
-
-
-
- -
- { - updateDisplaySettings({ groupByLabel: checked }); - }} - disabled={!hasLabels} - /> -
-

- {t('groupByLabelDescription')} -

-
-
-
- {!hasLabels && ( -

- {t('createLabelToEnableSettings')} -

- )}