From ee0902ac1375b16ab856620a4307de27103654aa Mon Sep 17 00:00:00 2001 From: pqhuy1987 Date: Fri, 15 May 2026 17:32:21 +0700 Subject: [PATCH] =?UTF-8?q?[CLAUDE]=20FE-User=20FE-Admin:=20Plan=20AA=20wr?= =?UTF-8?q?ap=20fix=20-=20sidebar=20label=20d=C3=A0i=20wrap=20v=E1=BB=81?= =?UTF-8?q?=20=C4=91=E1=BA=A7u=20h=C3=A0ng=20+=20text=20smaller?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit UAT feedback 2026-05-15 sau Run #213 deploy: bro screenshot sidebar label custom Mig 27 dài "1. Duyệt Nhà Cung Cấp - Thầu phụ (NCC -TP)" wrap 2 dòng, dòng 2 "(NCC -TP)" indent SAU icon thay vì về đầu hàng. Root cause: flex container [items-center, gap-2] + inner span chứa Icon + label text → text wraps within INNER span (đã indent past icon area). Pattern phù hợp cho 1-dòng label, KHÔNG phù hợp khi multi-line. Fix pattern (3 sites fe-user + 2 sites fe-admin mirror rule §3.9): - MenuGroup button: flex → relative block + inline-block icon + inline text + absolute ChevronDown right. Text wrap về left edge button (under icon). - MenuLeaf NavLink: flex → block + inline-block icon + inline text. - StaticLeaf NavLink (fe-user only): mirror MenuLeaf pattern. Smaller text: - text-[13px] → text-[12px] (medium label group + leaf) - text-sm (14px) → text-[12px] (MenuLeaf top level) - text-[12px] → text-[11px] (MenuLeaf deep level) - leading-snug (1.375) compact 2-line height Icon adjust: -mt-0.5 align with inline text baseline. Button px-3 pr-7: pad right 28px reserve cho absolute ChevronDown (KHÔNG bị đẩy xuống khi label wrap). Verify: - npm run build fe-user PASS clean 432ms - npm run build fe-admin PASS clean 494ms Em main solo CSS polish < 30 min (criteria #6 REFUSE Implementer). Co-Authored-By: Claude Opus 4.7 (1M context) --- fe-admin/src/components/Layout.tsx | 34 ++++++++++---------- fe-user/src/components/Layout.tsx | 50 +++++++++++++++--------------- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/fe-admin/src/components/Layout.tsx b/fe-admin/src/components/Layout.tsx index 6830e47..6f7c2d8 100644 --- a/fe-admin/src/components/Layout.tsx +++ b/fe-admin/src/components/Layout.tsx @@ -135,21 +135,21 @@ function MenuGroup({ node, depth }: { node: MenuNode; depth: number }) { {open && (
- - {/* [Plan AA S24 t1] Revert truncate Plan U S23 t11 — mirror fe-user. */} - {node.label} + {/* [Plan AA S24 t2 wrap fix] inline-block icon + inline text → mirror fe-user. */} + + {node.label} ) } diff --git a/fe-user/src/components/Layout.tsx b/fe-user/src/components/Layout.tsx index 32f3914..c3b800e 100644 --- a/fe-user/src/components/Layout.tsx +++ b/fe-user/src/components/Layout.tsx @@ -176,24 +176,25 @@ function MenuGroup({ node, depth }: { node: MenuNode; depth: number }) { {open && (
- - {/* [Plan AA S24 t1] Revert truncate Plan U S23 t11 — fit full label hoặc - wrap natural. NavLink `title` (line 241) giữ tooltip accessibility. */} - {effectiveLabel(node)} + {/* [Plan AA S24 t2 wrap fix] inline-block icon + inline text → label dài + wrap về đầu hàng (under icon, KHÔNG indent sau icon). */} + + {effectiveLabel(node)} ) } @@ -283,16 +284,15 @@ function StaticLeaf({ node }: { node: MenuNode }) { title={effectiveLabel(node)} className={({ isActive }) => cn( - 'flex min-w-0 items-center gap-2.5 rounded-md px-3 py-2 text-sm font-medium transition', + 'block rounded-md px-3 py-2 text-[12px] font-medium leading-snug transition', isActive ? 'bg-brand-50 text-brand-700' : 'text-slate-600 hover:bg-slate-100 hover:text-slate-900', ) } > - - {/* [Plan AA S24 t1] Revert truncate Plan U S23 t11 — StaticLeaf "Hộp thư" - label ngắn (7 chars) không bao giờ overflow, drop truncate cho - consistent với MenuLeaf + MenuGroup. */} - {effectiveLabel(node)} + {/* [Plan AA S24 t2 wrap fix] inline-block icon + inline text — consistent + với MenuLeaf + MenuGroup. */} + + {effectiveLabel(node)} ) }