import { lazy, Suspense, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react"; import type { ReactNode, TextareaHTMLAttributes } from "react"; import { BodyPortal, useOverlayLayer } from "./OverlaySurface"; /** * ⭐ WAVE-27 item 20 (R5 / contract C10) — the embedded grid a Details section renders. * * ⛔ LAZY BECAUSE THE IMPORT IS A CYCLE, not because it is big. `CustomerGrid` mounts * `RecordDetail`; a static import back the other way is `A -> B -> A`, which bundlers resolve by * leaving one side `undefined` at module-evaluation time — a crash that appears only on whichever * module happens to evaluate first, i.e. the kind that survives every local test and lands in * production. `React.lazy` defers the resolution to first RENDER, by which point both modules * exist. It also composes with item 34's route-level splitting instead of fighting it: a reader * who never opens a Details tab never downloads a second copy of anything. */ const LinkedGrid = lazy(() => import("./CustomerGrid")); import { automationDetail, automationState, automationStateLabel, checkboxOn, formatDisplay, codePreview, jsonPreview, } from "./cells"; // The ONE scheme guard, shared with the kanban card since wave 26 (item 11). From `display` // rather than `cells` because `cells` re-exports only the handful the canvas needed. import { actionHref } from "./display"; import JsonViewer, { CodeViewer } from "./JsonViewer"; import { StarRow, StarIcon } from "./Stars"; import { codeLanguageOf, isPickType, mayEditField, ratingMax } from "./types"; import type { CustomerDoc, DisplaySpec, Field, Row, Viewer } from "./types"; // Item 9 (wave 14) — the pure value round-trip. Everything that could silently // LOSE a stored value moving it into an editor and back lives there, gated by // `web/verify_record_fields.py`; this file is dispatch and markup. import { choiceEntries, composeDateValue, composeNumberValue, composeRatingValue, dateInputValue, multiParts, numberInputValue, ratingValue, rawText, toggleMulti, userInitials, } from "./recordFields"; /** * ⭐⭐ WAVE-29 T24 (owner item 13, and D-121's class) — the record panel READS THE OPTION COLOURS. * * The canvas has honoured them since wave 14 (`cells.optionTint`) and so has the kanban card * (`viewModes.tsx`), while this panel painted every chosen chip the same fixed blue and every * single-select as an unstyled native `