From 6dc234bbe96c5df82b9beaf957a1c57c48168002 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89mile=20R=C3=A9?= Date: Mon, 20 Apr 2026 17:20:48 +0400 Subject: [PATCH] Fix review issues: clipboard error handling, merge conflicts, mutation error checks, and category ranking MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Émile Ré --- .../_components/CategoryDialog.tsx | 4 +++- .../_components/CategoryList.tsx | 1 + .../cookies/_components/CategorySection.tsx | 11 +++++++++- .../snippet/_components/CodeSnippets.tsx | 22 ++++++++++++++----- contrib/claude/app-arborescence.md | 6 ----- 5 files changed, 30 insertions(+), 14 deletions(-) diff --git a/apps/console/src/pages/organizations/cookie-banners/configuration/_components/CategoryDialog.tsx b/apps/console/src/pages/organizations/cookie-banners/configuration/_components/CategoryDialog.tsx index adb278f84..32e62a1b3 100644 --- a/apps/console/src/pages/organizations/cookie-banners/configuration/_components/CategoryDialog.tsx +++ b/apps/console/src/pages/organizations/cookie-banners/configuration/_components/CategoryDialog.tsx @@ -67,12 +67,14 @@ const createMutation = graphql` interface CategoryDialogProps { cookieBannerId: string; connectionId: string; + nextRank: number; onOpenChange: (open: boolean) => void; } export function CategoryDialog({ cookieBannerId, connectionId, + nextRank, onOpenChange, }: CategoryDialogProps) { const { __ } = useTranslate(); @@ -93,7 +95,7 @@ export function CategoryDialog({ name, description, required: false, - rank: 0, + rank: nextRank, }, connections: [connectionId], }, diff --git a/apps/console/src/pages/organizations/cookie-banners/configuration/_components/CategoryList.tsx b/apps/console/src/pages/organizations/cookie-banners/configuration/_components/CategoryList.tsx index c8dce8b1b..80fe2cbe0 100644 --- a/apps/console/src/pages/organizations/cookie-banners/configuration/_components/CategoryList.tsx +++ b/apps/console/src/pages/organizations/cookie-banners/configuration/_components/CategoryList.tsx @@ -195,6 +195,7 @@ export function CategoryList({ cookieBannerKey }: CategoryListProps) { 0 ? sorted[sorted.length - 1].rank + 1 : 0} onOpenChange={setShowCreateDialog} /> )} diff --git a/apps/console/src/pages/organizations/cookie-banners/configuration/cookies/_components/CategorySection.tsx b/apps/console/src/pages/organizations/cookie-banners/configuration/cookies/_components/CategorySection.tsx index 7afd9e9cb..440cedddb 100644 --- a/apps/console/src/pages/organizations/cookie-banners/configuration/cookies/_components/CategorySection.tsx +++ b/apps/console/src/pages/organizations/cookie-banners/configuration/cookies/_components/CategorySection.tsx @@ -123,7 +123,15 @@ export function CategorySection({ categoryKey }: CategorySectionProps) { ...input, }, }, - onCompleted() { + onCompleted(_response, errors) { + if (errors?.length) { + toast({ + title: __("Error"), + description: errors[0].message, + variant: "error", + }); + return; + } toast({ title: __("Success"), description: __("Category updated"), @@ -169,6 +177,7 @@ export function CategorySection({ categoryKey }: CategorySectionProps) { const handleSaveEditCookie = () => { if (editingCookieIndex === null) return; + if (!cookieForm.name.trim()) return; const newCookies = category.cookies.map((c, i) => i === editingCookieIndex ? { ...cookieForm } diff --git a/apps/console/src/pages/organizations/cookie-banners/configuration/snippet/_components/CodeSnippets.tsx b/apps/console/src/pages/organizations/cookie-banners/configuration/snippet/_components/CodeSnippets.tsx index 0d58b248f..0262498c9 100644 --- a/apps/console/src/pages/organizations/cookie-banners/configuration/snippet/_components/CodeSnippets.tsx +++ b/apps/console/src/pages/organizations/cookie-banners/configuration/snippet/_components/CodeSnippets.tsx @@ -31,12 +31,22 @@ export function CodeSnippets() { >`; const handleCopy = () => { - void navigator.clipboard.writeText(code); - toast({ - title: __("Copied"), - description: __("Code copied to clipboard"), - variant: "success", - }); + navigator.clipboard.writeText(code).then( + () => { + toast({ + title: __("Copied"), + description: __("Code copied to clipboard"), + variant: "success", + }); + }, + () => { + toast({ + title: __("Error"), + description: __("Failed to copy to clipboard"), + variant: "error", + }); + }, + ); }; return ( diff --git a/contrib/claude/app-arborescence.md b/contrib/claude/app-arborescence.md index f1cbd4177..e62b05243 100644 --- a/contrib/claude/app-arborescence.md +++ b/contrib/claude/app-arborescence.md @@ -326,16 +326,10 @@ pages/organizations/vendors/ VendorsPageLoader.tsx # lazy entry — providers + Suspense + query loader VendorsPage.tsx # page component (usePreloadedQuery) VendorsPageSkeleton.tsx # loading fallback -<<<<<<< HEAD - VendorDetailPageLoader.tsx # lazy entry for detail view - VendorDetailPage.tsx # detail page component - VendorDetailPageSkeleton.tsx # detail loading fallback -======= VendorDetailLayoutLoader.tsx # lazy entry for detail layout VendorDetailLayout.tsx # layout — breadcrumbs, tabs, VendorDetailLayoutSkeleton.tsx # detail loading fallback NewVendorPage.tsx # mutation-only page — default export, wraps itself in the Relay provider ->>>>>>> 4dcc034f7 (Update contrib guides) _components/ # sub-components used only by vendor pages VendorContactRow.tsx VendorRiskSummary.tsx