From 61a6ac8323ed5e80af1dd4a0781796a140715b65 Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Sat, 19 Jul 2025 16:15:26 +0000 Subject: feat(web): Slightly nicer looking tags page --- apps/web/app/dashboard/tags/page.tsx | 12 +- apps/web/components/dashboard/tags/AllTagsView.tsx | 157 ++++++++++++--------- .../components/dashboard/tags/BulkTagAction.tsx | 5 +- 3 files changed, 94 insertions(+), 80 deletions(-) diff --git a/apps/web/app/dashboard/tags/page.tsx b/apps/web/app/dashboard/tags/page.tsx index 9108d6ba..f8e4d8ea 100644 --- a/apps/web/app/dashboard/tags/page.tsx +++ b/apps/web/app/dashboard/tags/page.tsx @@ -1,18 +1,8 @@ import AllTagsView from "@/components/dashboard/tags/AllTagsView"; -import { Separator } from "@/components/ui/separator"; -import { useTranslation } from "@/lib/i18n/server"; import { api } from "@/server/api/client"; export default async function TagsPage() { - // oxlint-disable-next-line rules-of-hooks - const { t } = await useTranslation(); const allTags = (await api.tags.list()).tags; - return ( -
- {t("tags.all_tags")} - - -
- ); + return ; } diff --git a/apps/web/components/dashboard/tags/AllTagsView.tsx b/apps/web/components/dashboard/tags/AllTagsView.tsx index a1af5a56..965afa73 100644 --- a/apps/web/components/dashboard/tags/AllTagsView.tsx +++ b/apps/web/components/dashboard/tags/AllTagsView.tsx @@ -3,20 +3,27 @@ import React, { useEffect } from "react"; import { ActionButton } from "@/components/ui/action-button"; import ActionConfirmingDialog from "@/components/ui/action-confirming-dialog"; +import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; +import { + Card, + CardContent, + CardDescription, + CardHeader, + CardTitle, +} from "@/components/ui/card"; import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from "@/components/ui/collapsible"; import InfoTooltip from "@/components/ui/info-tooltip"; -import { Separator } from "@/components/ui/separator"; import { Toggle } from "@/components/ui/toggle"; import { toast } from "@/components/ui/use-toast"; import useBulkTagActionsStore from "@/lib/bulkTagActions"; import { useTranslation } from "@/lib/i18n/client"; import { api } from "@/lib/trpc"; -import { ArrowDownAZ, Combine } from "lucide-react"; +import { ArrowDownAZ, Combine, Tag } from "lucide-react"; import type { ZGetTagResponse, ZTagBasic } from "@karakeep/shared/types/tags"; import { useDeleteUnusedTags } from "@karakeep/shared-react/hooks/tags"; @@ -151,12 +158,17 @@ export default function AllTagsView({ ); } else { - tagPill = "No Tags"; + tagPill = ( +
+ +

No custom tags yet

+
+ ); } return tagPill; }; return ( - <> +
{selectedTag && ( )} -
- - - - {t("tags.drag_and_drop_merging")} - -

{t("tags.drag_and_drop_merging_info")}

-
-
- - {t("tags.sort_by_name")} - -
- -

{t("tags.your_tags")}

- -

{t("tags.your_tags_info")}

-
-
- {tagsToPill(humanTags, isBulkEditEnabled)} - - -

{t("tags.ai_tags")}

- -

{t("tags.ai_tags_info")}

-
-
- {tagsToPill(aiTags, isBulkEditEnabled)} - - -

{t("tags.unused_tags")}

- -

{t("tags.unused_tags_info")}

-
-
- -
- - - - {emptyTags.length > 0 && ( - - )} +
+ {t("tags.all_tags")} +
+ + + + {t("tags.drag_and_drop_merging")} + +

{t("tags.drag_and_drop_merging_info")}

+
+
+ + {t("tags.sort_by_name")} +
- - {tagsToPill(emptyTags, isBulkEditEnabled)} - - - +
+ + + + {t("tags.your_tags")} + {humanTags.length} + + {t("tags.your_tags_info")} + + {tagsToPill(humanTags, isBulkEditEnabled)} + + + + + {t("tags.ai_tags")} + {aiTags.length} + + {t("tags.ai_tags_info")} + + {tagsToPill(aiTags, isBulkEditEnabled)} + + + + {t("tags.unused_tags")} + {t("tags.unused_tags_info")} + + + +
+ + + + {emptyTags.length > 0 && ( + + )} +
+ + {tagsToPill(emptyTags, isBulkEditEnabled)} + +
+
+
+
); } diff --git a/apps/web/components/dashboard/tags/BulkTagAction.tsx b/apps/web/components/dashboard/tags/BulkTagAction.tsx index 95f7c46d..fbd044e0 100644 --- a/apps/web/components/dashboard/tags/BulkTagAction.tsx +++ b/apps/web/components/dashboard/tags/BulkTagAction.tsx @@ -115,6 +115,7 @@ export default function BulkTagAction() { {!isBulkEditEnabled ? ( ) : ( -
+
{actionList.map(({ name, icon, action, alwaysEnable }) => ( -- cgit v1.2.3-70-g09d2