From 18d088660f431e50959c20ee1afd8ff4f356d599 Mon Sep 17 00:00:00 2001 From: MK Fain Date: Wed, 3 Dec 2025 13:49:16 -0600 Subject: [PATCH] Show labels settings always, disabled until labels exist - Project Labels section now always visible in Preferences - Toggle switches are grayed out and disabled when no labels exist - Added helper text "Create a label to enable these settings" - Users can still click "Manage Labels" to create their first label - Added translations for new helper text in all 6 languages --- src/locales/en.json | 3 +- src/locales/ha.json | 3 +- src/locales/ig.json | 3 +- src/locales/pt.json | 3 +- src/locales/yo.json | 3 +- src/locales/zh.json | 3 +- src/pages/Preferences.tsx | 63 ++++++++++++++++++++++----------------- 7 files changed, 47 insertions(+), 34 deletions(-) diff --git a/src/locales/en.json b/src/locales/en.json index b29fa215..ec5de675 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -543,5 +543,6 @@ "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" + "unlabeled": "Unlabeled", + "createLabelToEnableSettings": "Create a label to enable these settings" } diff --git a/src/locales/ha.json b/src/locales/ha.json index 1ea6f6e2..a4215d20 100644 --- a/src/locales/ha.json +++ b/src/locales/ha.json @@ -450,5 +450,6 @@ "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" + "unlabeled": "Babu lakabi", + "createLabelToEnableSettings": "Ƙirƙiri lakabi don kunna waɗannan saituna" } diff --git a/src/locales/ig.json b/src/locales/ig.json index 9447e0c1..2d592def 100644 --- a/src/locales/ig.json +++ b/src/locales/ig.json @@ -447,5 +447,6 @@ "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" + "unlabeled": "Enweghị akara", + "createLabelToEnableSettings": "Mepụta akara iji mee ka ntọala ndị a rụọ ọrụ" } diff --git a/src/locales/pt.json b/src/locales/pt.json index 0623c62b..08a612a0 100644 --- a/src/locales/pt.json +++ b/src/locales/pt.json @@ -459,5 +459,6 @@ "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" + "unlabeled": "Sem etiqueta", + "createLabelToEnableSettings": "Crie uma etiqueta para ativar estas configurações" } diff --git a/src/locales/yo.json b/src/locales/yo.json index d3c28ec1..a836d95d 100644 --- a/src/locales/yo.json +++ b/src/locales/yo.json @@ -447,5 +447,6 @@ "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ì" + "unlabeled": "Kò ní àmì", + "createLabelToEnableSettings": "Ṣẹ̀dá àmì láti mú àwọn ètò wọ̀nyí ṣiṣẹ́" } diff --git a/src/locales/zh.json b/src/locales/zh.json index 6f7c984b..0ca640ee 100644 --- a/src/locales/zh.json +++ b/src/locales/zh.json @@ -459,5 +459,6 @@ "showColoredIconsDescription": "为有标签的项目显示标签颜色的文件夹图标。", "groupByLabel": "按标签分组", "groupByLabelDescription": "根据标签将项目组织成可折叠的分组。", - "unlabeled": "无标签" + "unlabeled": "无标签", + "createLabelToEnableSettings": "创建标签以启用这些设置" } diff --git a/src/pages/Preferences.tsx b/src/pages/Preferences.tsx index c2d2e5cf..35bd4031 100644 --- a/src/pages/Preferences.tsx +++ b/src/pages/Preferences.tsx @@ -11,7 +11,6 @@ import { useIsMobile } from "@/hooks/useIsMobile"; import { useNavigate } from "react-router-dom"; import { useAppContext } from "@/hooks/useAppContext"; import { useLabels } from "@/hooks/useLabels"; -import { useProjectLabels } from "@/hooks/useProjectLabels"; import { LabelsManageDialog } from "@/components/labels/LabelsManageDialog"; export function Preferences() { @@ -20,11 +19,10 @@ export function Preferences() { const navigate = useNavigate(); const { config, updateConfig } = useAppContext(); const { labels, displaySettings, updateDisplaySettings } = useLabels(); - const { hasAnyLabels } = useProjectLabels(); const [labelsDialogOpen, setLabelsDialogOpen] = useState(false); - // Only show label settings if user has created labels or assigned labels to projects - const showLabelSettings = labels.length > 0 || hasAnyLabels(); + // Settings are disabled until user creates at least one label + const hasLabels = labels.length > 0; return (
@@ -112,17 +110,17 @@ export function Preferences() { - {/* Labels Settings - Only shown when user has labels */} - {showLabelSettings && ( - - - - - {t('projectLabels')} - - - -
+ {/* Labels Settings */} + + + + + {t('projectLabels')} + + + +
+
@@ -136,13 +134,16 @@ export function Preferences() { onCheckedChange={(checked) => { updateDisplaySettings({ showColoredIcons: checked }); }} + disabled={!hasLabels} />

{t('showColoredIconsDescription')}

+
+
@@ -156,26 +157,32 @@ export function Preferences() { onCheckedChange={(checked) => { updateDisplaySettings({ groupByLabel: checked }); }} + disabled={!hasLabels} />

{t('groupByLabelDescription')}

- -
- -
- - - )} + +
+ + {!hasLabels && ( +

+ {t('createLabelToEnableSettings')} +

+ )} +
+
+ +