From 2a7f922a0113ed0f013981c05d9d11716d46fe42 Mon Sep 17 00:00:00 2001 From: Matt Date: Wed, 3 Jun 2026 18:27:56 +0200 Subject: [PATCH] fix(uat): dashboard snapshots current-state, pulse-chip gate, phone display, chip width MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - pipeline funnel: count active interests by current stage (drop created_at window) — backfill had collapsed it to early stages (UAT 2026-06-03) - pipeline value tile: render current-state (don't thread the date range) - deal pulse chip: gate on the pulse_enabled master toggle (default ON) — was rendering even when admin turned it off; useFeatureFlag gains a default arg + the feature-flag endpoint a ?default= param (default-ON safe) - contact phone display: show international format + country flag (E164), not the bare national format that hid the country - berths: remove the dead row-density toggle; widen "Under offer to" chip on desktop so client names aren't truncated Co-Authored-By: Claude Opus 4.8 (1M context) --- src/app/api/v1/settings/feature-flag/route.ts | 8 +++- src/components/berths/berth-list.tsx | 44 ++++--------------- .../berths/berth-occupancy-chip.tsx | 4 +- src/components/dashboard/widget-registry.tsx | 5 ++- src/components/interests/deal-pulse-chip.tsx | 9 +++- src/components/shared/inline-phone-field.tsx | 13 +++++- src/hooks/use-feature-flag.ts | 14 ++++-- src/lib/services/analytics.service.ts | 10 ++++- 8 files changed, 59 insertions(+), 48 deletions(-) diff --git a/src/app/api/v1/settings/feature-flag/route.ts b/src/app/api/v1/settings/feature-flag/route.ts index a0fef610..e727a1bc 100644 --- a/src/app/api/v1/settings/feature-flag/route.ts +++ b/src/app/api/v1/settings/feature-flag/route.ts @@ -15,7 +15,13 @@ export const GET = withAuth(async (req, ctx) => { where: and(eq(systemSettings.key, key), eq(systemSettings.portId, ctx.portId)), }); - return NextResponse.json({ enabled: setting?.value === true }); + // `default` applies ONLY when the setting was never written for this + // port (row absent). An explicit stored `false` always disables. Lets + // default-ON settings (e.g. pulse_enabled) gate correctly via + // ?default=true while default-OFF flags keep the old behaviour. + const def = req.nextUrl.searchParams.get('default') === 'true'; + const enabled = setting ? setting.value === true : def; + return NextResponse.json({ enabled }); } catch (error) { return errorResponse(error); } diff --git a/src/components/berths/berth-list.tsx b/src/components/berths/berth-list.tsx index d9721620..71eca837 100644 --- a/src/components/berths/berth-list.tsx +++ b/src/components/berths/berth-list.tsx @@ -4,16 +4,7 @@ import { useEffect, useState } from 'react'; import Link from 'next/link'; import { useRouter, useParams } from 'next/navigation'; import { useMutation, useQueryClient } from '@tanstack/react-query'; -import { - Anchor, - Archive, - CircleDollarSign, - Plus, - Rows3, - Rows4, - Tag as TagIcon, - TagsIcon, -} from 'lucide-react'; +import { Anchor, Archive, CircleDollarSign, Plus, Tag as TagIcon, TagsIcon } from 'lucide-react'; import { toast } from 'sonner'; import { apiFetch } from '@/lib/api/client'; @@ -103,8 +94,10 @@ export function BerthList() { // Persisted column visibility + row density + dimension unit - same // pattern as ClientList / InterestList; density falls back to // 'comfortable' and dimensionUnit to 'ft' for users who haven't picked. - const { hidden, setHidden, density, setDensity, dimensionUnit, setDimensionUnit } = - useTablePreferences('berths', BERTH_DEFAULT_HIDDEN); + const { hidden, setHidden, dimensionUnit, setDimensionUnit } = useTablePreferences( + 'berths', + BERTH_DEFAULT_HIDDEN, + ); const columnVisibility = Object.fromEntries(hidden.map((id) => [id, false])); const berthColumns = getBerthColumns(dimensionUnit); @@ -187,29 +180,11 @@ export function BerthList() { applyView({ filters: savedFilters, sort: savedSort }); }} /> - {/* Table-only controls — hidden in card mode (