From 077e1c5836e54b63c893bf3062d00c450ffc5ec3 Mon Sep 17 00:00:00 2001 From: moh Date: Sun, 20 Sep 2026 17:30:44 +0200 Subject: [PATCH] STYLED - Flatten media picker and use a two-column media layout Fix the deeply nested cards in the project form (screenshot: Cover Media > Cover > preview card, with duplicate labels): - MediaFieldPicker no longer wraps itself in AppCards. It renders one flat bordered box laid out in two columns (preview | controls), dropping two nested card layers and the duplicate title. - Cover Media and Assets now sit side by side in a two-column grid instead of stacked with a separator. All 375 tests pass; tsc and eslint clean. --- components/admin/media-field-picker.tsx | 68 ++++++++++----------- components/admin/portfolio-project-form.tsx | 11 ++-- 2 files changed, 37 insertions(+), 42 deletions(-) diff --git a/components/admin/media-field-picker.tsx b/components/admin/media-field-picker.tsx index 2c67ea3..3f8dc13 100644 --- a/components/admin/media-field-picker.tsx +++ b/components/admin/media-field-picker.tsx @@ -6,7 +6,6 @@ import type { MediaKind } from "@/lib/db/enums"; import { Check, ImageIcon, Search, Trash2 } from "lucide-react"; import { useEffect, useMemo, useRef, useState } from "react"; -import { AppCard } from "@/components/ui/app-card"; import { Button } from "@/components/ui/button"; import { Dialog, @@ -17,7 +16,6 @@ import { DialogTitle, } from "@/components/ui/dialog"; import { Input } from "@/components/ui/input"; -import { Label } from "@/components/ui/label"; import type { MediaOption } from "@/lib/media"; import { cn } from "@/lib/utils"; @@ -89,29 +87,45 @@ export function MediaFieldPicker({ }, [serializedValue]); return ( - +
-
-
- -

- Media must be selected from the - {" "} - Media Library - . -

+
+
+ {selectedOption ? ( + <> + {selectedOption.label} +
+

{selectedOption.label}

+

{selectedOption.source}

+
+ + ) : ( +
+
+ +
+ Kein Medium ausgewählt +
+ )}
-
- {canClear ? ( ) : null}
- - {selectedOption ? ( -
- {selectedOption.label} -
-

{selectedOption.label}

-

{selectedOption.source}

-
-
- ) : ( -
- No media selected. -
- )} -
- @@ -215,6 +209,6 @@ export function MediaFieldPicker({ - +
); } diff --git a/components/admin/portfolio-project-form.tsx b/components/admin/portfolio-project-form.tsx index 98b0fd4..5218648 100644 --- a/components/admin/portfolio-project-form.tsx +++ b/components/admin/portfolio-project-form.tsx @@ -36,7 +36,6 @@ import { Button } from "@/components/ui/button"; import { Checkbox } from "@/components/ui/checkbox"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; -import { Separator } from "@/components/ui/separator"; import { Select, SelectContent, @@ -1072,7 +1071,8 @@ export function PortfolioProjectForm({
-
+
+
+
- - +
)} -
+
+