uicore-ts 1.1.310 → 1.1.315

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../scripts/UILayoutDebugger.ts"],
4
+ "sourcesContent": ["/// #if DEV\n\n/**\n * UILayoutDebugger\n *\n * A development-only utility for visualizing and debugging the UIView layout\n * system. Disabled entirely at runtime unless explicitly enabled.\n *\n * FEATURES\n * \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n *\n * 1. Record-and-replay step debugger\n * Every layout pass is recorded as an ordered sequence of steps. Each step\n * captures the view that was laid out, its frame before and after, and the\n * frames assigned to each of its subviews. After the pass completes you can\n * scrub through the steps one at a time in the overlay UI, seeing exactly\n * which view was processed at each point and how the frames changed.\n *\n * 2. Live breakpoint step-through\n * When breakpoint mode is enabled (UILayoutDebugger.enableBreakpoints()), a\n * special sentinel line is executed before each view's layoutIfNeeded() call.\n * Put a browser debugger breakpoint on that line and the JS debugger will\n * pause before every layout step \u2014 the full live JS stack and all object\n * state are available at that point, exactly as with any other breakpoint.\n *\n * The sentinel line is:\n * const breakpointOnThisLine = \"Add a breakpoint on this line to step through layout.\"\n * Search for that string in the Sources panel to find it quickly.\n *\n * 3. View-tree heat-map overlay\n * A floating panel renders the full view hierarchy as an indented tree.\n * Each node is coloured by how many times it was laid out in the most recent\n * pass: untouched (grey), once (green), twice (orange), three-or-more (red).\n * The node currently active in the step scrubber is highlighted in blue.\n * Hovering a node shows its class, elementID, and frame.\n *\n * INTEGRATION POINTS IN UIView.ts\n * \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n * Add the following calls alongside the existing UILayoutCycleTracer calls:\n *\n * layoutViewsIfNeeded():\n * window.UILayoutDebugger?.willBeginLayoutPass(UIView._viewsToLayout) // before the while loop\n * window.UILayoutDebugger?.willBeginIteration(iteration) // inside the while loop, top\n * window.UILayoutDebugger?.willLayoutView(view) // before view.layoutIfNeeded()\n * [breakpoint sentinel \u2014 see below]\n * view.layoutIfNeeded()\n * window.UILayoutDebugger?.didLayoutView(view) // after view.layoutIfNeeded()\n * window.UILayoutDebugger?.didFinishLayoutPass(iteration) // after the while loop\n *\n * layoutSubviews():\n * window.UILayoutDebugger?.willSetSubviewFrames(this) // before the subview loop\n * [existing subview loop]\n * window.UILayoutDebugger?.didSetSubviewFrames(this) // after the subview loop\n *\n * The breakpoint sentinel block (inside layoutViewsIfNeeded, before\n * view.layoutIfNeeded()):\n *\n * if (window.UILayoutDebugger?._shouldHitBreakpoint(view)) {\n * const breakpointOnThisLine = \"Add a breakpoint on this line to step through layout.\"\n * }\n *\n * USAGE\n * \u2500\u2500\u2500\u2500\u2500\n * UILayoutDebugger.enable() \u2014 record traces and show the overlay\n * UILayoutDebugger.disable() \u2014 hide overlay and stop recording\n * UILayoutDebugger.enableBreakpoints() \u2014 also pause at each layout step\n * UILayoutDebugger.stepForward() \u2014 advance the replay scrubber by one\n * UILayoutDebugger.stepBack() \u2014 retreat the replay scrubber by one\n * UILayoutDebugger.goToStep(n) \u2014 jump to step n (0-based)\n */\n\n\n// \u2500\u2500\u2500 Data model \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\ninterface UILayoutDebugFrame {\n top: number\n left: number\n width: number\n height: number\n}\n\n/** A snapshot of a view's intrinsic size cache at a point in time. */\ninterface UILayoutDebugCacheSnapshot {\n entryCount: number\n entries: Record<string, { width: number; height: number }>\n isShared: boolean\n sharedKey?: string\n /** Whether _frameCache was populated at snapshot time. */\n hasFrameCache: boolean\n /** Snapshot of _frameCache if populated; null if absent. */\n frameCache: UILayoutDebugFrame | null\n /** Whether _frameCacheForVirtualLayouting was populated at snapshot time. */\n hasVirtualFrameCache: boolean\n /** Snapshot of _frameCacheForVirtualLayouting if populated; null if absent. */\n virtualFrameCache: UILayoutDebugFrame | null\n}\n\n/**\n * Global UITextMeasurement cache sizes at a snapshot instant.\n * These are not per-view \u2014 they're attached to the snapshot as a whole.\n */\ninterface UILayoutDebugTextMeasurementSnapshot {\n preparedCacheSize: number\n styleCacheSize: number\n}\n\ninterface UILayoutDebugSubviewRecord {\n viewIndex: number // _UIViewIndex of the subview\n className: string\n elementID: string\n frameBefore: UILayoutDebugFrame | null\n frameAfter: UILayoutDebugFrame | null\n}\n\n/** What caused a view to enter the layout queue. */\ninterface UILayoutDebugTrigger {\n callerFunction: string // first application frame, e.g. \"MyView.layoutSubviews\"\n cleanStack: string // full cleaned stack string\n}\n\n/** One step = one call to layoutIfNeeded() on one view. */\ninterface UILayoutDebugStep {\n stepIndex: number\n iteration: number\n viewIndex: number // _UIViewIndex of the laid-out view\n className: string\n elementID: string\n frameBefore: UILayoutDebugFrame | null\n frameAfter: UILayoutDebugFrame | null\n cacheBefore: UILayoutDebugCacheSnapshot | null\n cacheAfter: UILayoutDebugCacheSnapshot | null\n subviewRecords: UILayoutDebugSubviewRecord[]\n trigger: UILayoutDebugTrigger | null // what called setNeedsLayout on this view\n}\n\ninterface UILayoutDebugTreeNode {\n viewIndex: number\n className: string\n elementID: string\n depth: number\n frame: UILayoutDebugFrame | null\n layoutCount: number // times laid out in the recorded pass\n cacheAfterPass: UILayoutDebugCacheSnapshot | null // intrinsic cache state after the pass\n children: UILayoutDebugTreeNode[]\n}\n\ninterface UILayoutDebugTrace {\n passIndex: number\n steps: UILayoutDebugStep[]\n roots: UILayoutDebugTreeNode[]\n totalIterations: number\n cacheChanges: UILayoutDebugCacheChangeEvent[]\n}\n\n/** A flat snapshot of every view's frame and intrinsic cache at a point in time. */\ninterface UILayoutDebugStateSnapshot {\n label: string\n takenAt: number // Date.now()\n views: Map<number, UILayoutDebugViewState>\n /** Global UITextMeasurement cache sizes at the instant this snapshot was taken. */\n textMeasurement: UILayoutDebugTextMeasurementSnapshot\n}\n\ninterface UILayoutDebugViewState {\n viewIndex: number\n className: string\n elementID: string\n frame: UILayoutDebugFrame | null\n cache: UILayoutDebugCacheSnapshot | null\n}\n\ntype UILayoutDebugDiffKind = \"appeared\" | \"disappeared\" | \"frame\" | \"cache\" | \"both\" | \"unchanged\"\n\ninterface UILayoutDebugViewDiff {\n kind: UILayoutDebugDiffKind\n viewIndex: number\n className: string\n elementID: string\n baselineFrame: UILayoutDebugFrame | null\n currentFrame: UILayoutDebugFrame | null\n baselineCache: UILayoutDebugCacheSnapshot | null\n currentCache: UILayoutDebugCacheSnapshot | null\n}\n\n/**\n * Fired when _getCachedIntrinsicSize returns a value that differs from the\n * last value we observed for that view+cacheKey combination.\n */\ninterface UILayoutDebugCacheChangeEvent {\n eventIndex: number\n stepIndex: number // which step was active when the write occurred (-1 = between steps)\n iteration: number\n viewIndex: number\n className: string\n elementID: string\n cacheKey: string // raw key, e.g. \"h_0__w_500\"\n newValue: { width: number; height: number }\n callerFunction: string // first app-code frame at point of write\n cleanStack: string\n}\n\n\n// \u2500\u2500\u2500 Main class \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport class UILayoutDebugger {\n \n // \u2500\u2500 Runtime guard \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n // The #if DEV preprocessor comment may not be present in every build.\n // This flag is the authoritative runtime gate. All hook methods check it\n // first and are no-ops unless _isEnabled is true.\n \n static _isEnabled: boolean = false\n static _breakpointsEnabled: boolean = false\n \n static get isEnabled(): boolean { return UILayoutDebugger._isEnabled }\n static get breakpointsEnabled(): boolean { return UILayoutDebugger._breakpointsEnabled }\n \n \n // \u2500\u2500 Recording state \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n \n static _passIndex: number = 0\n static _currentTrace: UILayoutDebugTrace | null = null\n static _currentIteration: number = 0\n \n // Pending step being built as a view is being laid out\n static _pendingStep: UILayoutDebugStep | null = null\n \n // Subview frames captured during layoutSubviews() of the pending step's view\n static _pendingSubviewsBefore: Map<number, UILayoutDebugFrame | null> = new Map()\n \n // Per-view layout counts for the current pass (used for tree colouring)\n static _layoutCountsThisPass: Map<number, number> = new Map()\n \n // Live view object references keyed by _UIViewIndex, populated during the\n // pass and used to build the subtree forest in didFinishLayoutPass.\n static _liveViewRegistry: Map<number, any> = new Map()\n \n // First setNeedsLayout trigger per view per pass. Only the first enqueue\n // is recorded \u2014 subsequent redundant calls on the same view are ignored.\n static _triggerMap: Map<number, UILayoutDebugTrigger> = new Map()\n \n // Stack frames belonging to framework internals that should be stripped\n // from the top of a captured stack so the first visible frame is always\n // application code.\n static _noiseFramePrefixes: string[] = [\n \"UILayoutDebugger\",\n \"UIView.setNeedsLayout\",\n \"setNeedsLayout\",\n \"UIView.didLayoutSubviews\",\n \"didLayoutSubviews\",\n \"UIView.layoutSubviews\",\n \"UIView.layoutIfNeeded\",\n \"layoutIfNeeded\",\n \"UIView.layoutViewsIfNeeded\",\n \"layoutViewsIfNeeded\",\n \"UIView._setCachedIntrinsicSize\",\n \"_setCachedIntrinsicSize\",\n ]\n \n // All completed traces, newest first\n static _traces: UILayoutDebugTrace[] = []\n static readonly maxStoredTraces = 20\n \n \n // \u2500\u2500 Replay state \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n \n static _replayTraceIndex: number = 0 // which trace is shown in left/single pane\n static _replayStepIndex: number = -1 // -1 = before any step\n \n // \u2500\u2500 Compare mode state \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n \n static _compareMode: boolean = false\n static _frameFilter: \"all\" | \"changed\" | \"unchanged\" = \"all\"\n \n /**\n * When true, frame comparisons ignore origin (x/y) and only consider size\n * (width/height) \u2014 i.e. they diff bounds rather than frames.\n * A position-only move does not trigger a layout recompute of content, so\n * bounds mode surfaces only the changes that actually matter for sizing.\n */\n static _boundsBasedDiff: boolean = false\n static _compareTraceIndex: number = 1 // which trace is shown in right pane\n static _compareStepIndex: number = -1\n \n // Shared expand/collapse state for the tree in compare mode, keyed by\n // viewIndex. When both trees render from the same map, toggling one node\n // collapses/expands the same node in both panes simultaneously.\n static _sharedExpandState: Map<number, boolean> = new Map()\n \n // Expand state for the single-column pass inspector. Kept persistent so\n // the live inspector can sync from it.\n static _singleExpandState: Map<number, boolean> = new Map()\n \n // Expand state for the live inspector panel.\n static _liveExpandState: Map<number, boolean> = new Map()\n \n \n // \u2500\u2500 Public API \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n \n static enable() {\n UILayoutDebugger._isEnabled = true\n UILayoutDebugger._ensureOverlay()\n UILayoutDebugger._renderOverlay()\n console.log(\n \"%c[UILayoutDebugger] ENABLED \u2014 recording layout traces and showing overlay.\",\n \"color: #4CAF50; font-weight: bold\"\n )\n }\n \n static disable() {\n UILayoutDebugger._isEnabled = false\n UILayoutDebugger._breakpointsEnabled = false\n UILayoutDebugger._removeOverlay()\n console.log(\n \"%c[UILayoutDebugger] DISABLED.\",\n \"color: #9E9E9E; font-weight: bold\"\n )\n }\n \n /**\n * Enable the breakpoint sentinel. Once enabled, _shouldHitBreakpoint()\n * returns true before every layoutIfNeeded() call so the browser debugger\n * can pause on the sentinel line in UIView.ts.\n */\n static enableBreakpoints() {\n if (!UILayoutDebugger._isEnabled) {\n UILayoutDebugger.enable()\n }\n UILayoutDebugger._breakpointsEnabled = true\n console.log(\n \"%c[UILayoutDebugger] Breakpoint mode ON. \" +\n \"Search for 'breakpointOnThisLine' in Sources to set your breakpoint.\",\n \"color: #FF9800; font-weight: bold\"\n )\n }\n \n static disableBreakpoints() {\n UILayoutDebugger._breakpointsEnabled = false\n console.log(\n \"%c[UILayoutDebugger] Breakpoint mode OFF.\",\n \"color: #9E9E9E\"\n )\n }\n \n // \u2500\u2500 Replay controls \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n \n static stepForward() {\n if (!UILayoutDebugger._isEnabled) { return }\n const trace = UILayoutDebugger._currentReplayTrace\n if (!trace) { return }\n const next = UILayoutDebugger._replayStepIndex + 1\n UILayoutDebugger.goToStep(Math.min(next, trace.steps.length - 1))\n }\n \n static stepBack() {\n if (!UILayoutDebugger._isEnabled) { return }\n UILayoutDebugger.goToStep(Math.max(UILayoutDebugger._replayStepIndex - 1, -1))\n }\n \n static goToStep(stepIndex: number) {\n if (!UILayoutDebugger._isEnabled) { return }\n UILayoutDebugger._replayStepIndex = stepIndex\n UILayoutDebugger._renderOverlay()\n }\n \n static goToCompareStep(stepIndex: number) {\n if (!UILayoutDebugger._isEnabled) { return }\n UILayoutDebugger._compareStepIndex = stepIndex\n UILayoutDebugger._renderOverlay()\n }\n \n static showTrace(traceIndex: number) {\n if (!UILayoutDebugger._isEnabled) { return }\n const clamped = Math.max(0, Math.min(traceIndex, UILayoutDebugger._traces.length - 1))\n UILayoutDebugger._replayTraceIndex = clamped\n UILayoutDebugger._replayStepIndex = -1\n UILayoutDebugger._singleExpandState = new Map()\n UILayoutDebugger._renderOverlay()\n }\n \n static showCompareTrace(traceIndex: number) {\n if (!UILayoutDebugger._isEnabled) { return }\n const clamped = Math.max(0, Math.min(traceIndex, UILayoutDebugger._traces.length - 1))\n UILayoutDebugger._compareTraceIndex = clamped\n UILayoutDebugger._compareStepIndex = -1\n UILayoutDebugger._renderOverlay()\n }\n \n static get _currentReplayTrace(): UILayoutDebugTrace | null {\n return UILayoutDebugger._traces[UILayoutDebugger._replayTraceIndex] ?? null\n }\n \n static get _currentCompareTrace(): UILayoutDebugTrace | null {\n return UILayoutDebugger._traces[UILayoutDebugger._compareTraceIndex] ?? null\n }\n \n \n // \u2500\u2500 Hook: called from layoutViewsIfNeeded() \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n \n static willBeginLayoutPass(viewsToLayout: any[]) {\n if (!UILayoutDebugger._isEnabled) { return }\n \n UILayoutDebugger._currentTrace = {\n passIndex: UILayoutDebugger._passIndex++,\n steps: [],\n roots: [],\n cacheChanges: [],\n totalIterations: 0,\n }\n UILayoutDebugger._currentIteration = 0\n UILayoutDebugger._layoutCountsThisPass = new Map()\n UILayoutDebugger._liveViewRegistry = new Map()\n UILayoutDebugger._pendingStep = null\n UILayoutDebugger._pendingSubviewsBefore = new Map()\n }\n \n static willBeginIteration(iteration: number) {\n if (!UILayoutDebugger._isEnabled) { return }\n UILayoutDebugger._currentIteration = iteration\n }\n \n /**\n * Called from setNeedsLayout() each time a view is enqueued.\n * Only the *first* enqueue per view per pass is recorded \u2014 that is the\n * call that actually caused the view to enter the queue. Subsequent calls\n * on the same view within the same pass are redundant and ignored.\n */\n static viewDidCallSetNeedsLayout(view: any) {\n if (!UILayoutDebugger._isEnabled) { return }\n \n const viewIdx: number = view?._UIViewIndex ?? -1\n if (viewIdx < 0) { return }\n \n // Only record the first enqueue per view per pass.\n if (UILayoutDebugger._triggerMap.has(viewIdx)) { return }\n \n const rawStack = new Error().stack ?? \"\"\n const cleanStack = UILayoutDebugger._cleanStack(rawStack)\n const callerFunction = UILayoutDebugger._extractCallerFunctionName(cleanStack)\n \n UILayoutDebugger._triggerMap.set(viewIdx, { callerFunction, cleanStack })\n }\n \n /**\n * Called from _setCachedIntrinsicSize() after the value is written.\n * Every write is a change by definition, so no history comparison is needed.\n *\n * Call site in UIView.ts, at the end of _setCachedIntrinsicSize():\n *\n * window.UILayoutDebugger?.didSetCachedIntrinsicSize(this, cacheKey, size)\n */\n static didSetCachedIntrinsicSize(view: any, cacheKey: string, value: any) {\n if (!UILayoutDebugger._isEnabled) { return }\n \n const trace = UILayoutDebugger._currentTrace\n if (!trace) { return }\n \n const viewIdx: number = view?._UIViewIndex ?? -1\n if (viewIdx < 0) { return }\n \n const rawStack = new Error().stack ?? \"\"\n const cleanStack = UILayoutDebugger._cleanStack(rawStack)\n const callerFunction = UILayoutDebugger._extractCallerFunctionName(cleanStack)\n \n const event: UILayoutDebugCacheChangeEvent = {\n eventIndex: trace.cacheChanges.length,\n stepIndex: UILayoutDebugger._pendingStep?.stepIndex ?? -1,\n iteration: UILayoutDebugger._currentIteration,\n viewIndex: viewIdx,\n className: view?.constructor?.name ?? \"UnknownView\",\n elementID: view?.elementID ?? String(viewIdx),\n cacheKey,\n newValue: { width: value?.width ?? 0, height: value?.height ?? 0 },\n callerFunction,\n cleanStack,\n }\n trace.cacheChanges.push(event)\n }\n static willLayoutView(view: any) {\n if (!UILayoutDebugger._isEnabled) { return }\n \n const stepIndex = UILayoutDebugger._currentTrace?.steps.length ?? 0\n const viewIdx: number = view?._UIViewIndex ?? -1\n \n // Keep a live reference so didFinishLayoutPass can reach .rootView.\n if (viewIdx >= 0) {\n UILayoutDebugger._liveViewRegistry.set(viewIdx, view)\n }\n \n UILayoutDebugger._pendingStep = {\n stepIndex,\n iteration: UILayoutDebugger._currentIteration,\n viewIndex: viewIdx,\n className: view?.constructor?.name ?? \"UnknownView\",\n elementID: view?.elementID ?? String(viewIdx),\n frameBefore: UILayoutDebugger._captureFrame(view),\n frameAfter: null,\n cacheBefore: UILayoutDebugger._captureCache(view),\n cacheAfter: null,\n subviewRecords: [],\n trigger: UILayoutDebugger._triggerMap.get(viewIdx) ?? null,\n }\n // Consume the trigger so it doesn't linger across future passes.\n UILayoutDebugger._triggerMap.delete(viewIdx)\n \n // Capture subview frames *before* layout. The post-layout capture\n // happens in didSetSubviewFrames() which is called from layoutSubviews().\n UILayoutDebugger._pendingSubviewsBefore = new Map()\n const subviews: any[] = view?.subviews ?? []\n for (let i = 0; i < subviews.length; i++) {\n const sv = subviews[i]\n const idx: number = sv?._UIViewIndex ?? -i\n UILayoutDebugger._pendingSubviewsBefore.set(idx, UILayoutDebugger._captureFrame(sv))\n }\n }\n \n /**\n * Called immediately after view.layoutIfNeeded(). Closes the pending step\n * with the post-layout frame.\n */\n static didLayoutView(view: any) {\n if (!UILayoutDebugger._isEnabled) { return }\n \n const step = UILayoutDebugger._pendingStep\n if (!step) { return }\n \n step.frameAfter = UILayoutDebugger._captureFrame(view)\n step.cacheAfter = UILayoutDebugger._captureCache(view)\n \n const viewIdx: number = view?._UIViewIndex ?? -1\n const prev = UILayoutDebugger._layoutCountsThisPass.get(viewIdx) ?? 0\n UILayoutDebugger._layoutCountsThisPass.set(viewIdx, prev + 1)\n \n UILayoutDebugger._currentTrace?.steps.push(step)\n UILayoutDebugger._pendingStep = null\n }\n \n static didFinishLayoutPass(iterationCount: number) {\n if (!UILayoutDebugger._isEnabled) { return }\n \n const trace = UILayoutDebugger._currentTrace\n if (!trace) { return }\n \n trace.totalIterations = iterationCount\n \n // Build a single full-tree snapshot by starting from the global root.\n // Any laid-out view has a .rootView property that walks to the top of\n // the hierarchy, giving full context around the affected views.\n const anyView = UILayoutDebugger._liveViewRegistry.values().next().value\n const rootView = anyView?.rootView\n if (rootView) {\n UILayoutDebugger._lastKnownRootView = rootView\n const visited = new Set<number>()\n const rootIdx: number = rootView._UIViewIndex ?? -1\n if (rootIdx >= 0) { visited.add(rootIdx) }\n trace.roots = [UILayoutDebugger._buildTreeSnapshot(rootView, 0, visited)]\n }\n \n // Prepend and evict old traces.\n UILayoutDebugger._traces.unshift(trace)\n if (UILayoutDebugger._traces.length > UILayoutDebugger.maxStoredTraces) {\n UILayoutDebugger._traces.length = UILayoutDebugger.maxStoredTraces\n }\n \n UILayoutDebugger._replayTraceIndex = 0\n UILayoutDebugger._replayStepIndex = -1\n UILayoutDebugger._currentTrace = null\n UILayoutDebugger._liveViewRegistry.clear()\n \n UILayoutDebugger._renderOverlay()\n }\n \n /** Discard all recorded traces and reset the replay state. */\n static clearTraces() {\n UILayoutDebugger._traces = []\n UILayoutDebugger._passIndex = 0\n UILayoutDebugger._replayTraceIndex = 0\n UILayoutDebugger._compareTraceIndex = 1\n UILayoutDebugger._replayStepIndex = -1\n UILayoutDebugger._compareStepIndex = -1\n UILayoutDebugger._renderOverlay()\n }\n \n // \u2500\u2500 Baseline / diff API \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n \n /** Capture the current view tree state as the baseline for future diffs. */\n static captureBaseline() {\n if (!UILayoutDebugger._isEnabled) { return }\n const snap = UILayoutDebugger._captureStateSnapshot(\"Baseline\")\n if (!snap) {\n console.warn(\"[UILayoutDebugger] captureBaseline: no root view found yet \u2014 trigger a layout pass first.\")\n return\n }\n UILayoutDebugger._baseline = snap\n UILayoutDebugger._diffSnapshot = null\n UILayoutDebugger._diffMode = false\n UILayoutDebugger._renderOverlay()\n console.log(\n `%c[UILayoutDebugger] Baseline captured \u2014 ${snap.views.size} views.`,\n \"color: #88ddff; font-weight: bold\"\n )\n }\n \n /** Capture the current state and diff it against the baseline. */\n static captureAndDiff() {\n if (!UILayoutDebugger._isEnabled) { return }\n if (!UILayoutDebugger._baseline) {\n console.warn(\"[UILayoutDebugger] captureAndDiff: no baseline set. Call captureBaseline() first.\")\n return\n }\n const snap = UILayoutDebugger._captureStateSnapshot(\"Current\")\n if (!snap) {\n console.warn(\"[UILayoutDebugger] captureAndDiff: could not find root view.\")\n return\n }\n UILayoutDebugger._diffSnapshot = snap\n UILayoutDebugger._diffMode = true\n UILayoutDebugger._renderOverlay()\n }\n \n static clearDiff() {\n UILayoutDebugger._baseline = null\n UILayoutDebugger._diffSnapshot = null\n UILayoutDebugger._diffMode = false\n UILayoutDebugger._renderOverlay()\n }\n \n /**\n * \u2622 Stale Layout Report\n *\n * The single authoritative way to discover missing cache invalidations.\n *\n * What this does, in order:\n * 1. Snapshots every view's frame and intrinsic cache right now (the\n * \"before\" state \u2014 potentially stale/incorrect).\n * 2. Calls performForcedSubtreeLayout() on the root view, which nukes all\n * caches and forces a complete cold remeasure of the entire tree.\n * 3. Snapshots again (\"after\" state \u2014 ground truth).\n * 4. Diffs the two snapshots. Any view that changed between before and\n * after had stale state that was never correctly invalidated.\n * 5. For each changed view, cross-references the cache writes from the\n * forced pass so you can see exactly which call path recomputed the\n * correct value \u2014 working backwards from that to find the missing\n * invalidation site.\n *\n * The result is shown in the \u2622 Stale panel to the right of the pass\n * inspector. Views corrected by the forced pass are also tinted amber in\n * the pass inspector tree on the subsequent pass.\n *\n * Limitations:\n * - Calls performForcedSubtreeLayout(), which is itself a nuclear option.\n * The tree will be left in its corrected state \u2014 not the buggy state.\n * Use this at the point where the bug is visible, not before.\n * - The forced layout will generate a new trace (the remeasure pass).\n * The \u2622 panel cross-references its cache writes automatically.\n * - Only intrinsic-size cache corrections are cross-referenced. Frame\n * corrections are shown as diffs but do not yet have a write-stack.\n */\n static captureStaleLayoutReport() {\n if (!UILayoutDebugger._isEnabled) { return }\n const rootView = UILayoutDebugger._lastKnownRootView\n if (!rootView) {\n console.warn(\n \"[UILayoutDebugger] captureStaleLayoutReport: no root view found yet \u2014 \" +\n \"trigger a layout pass first.\"\n )\n return\n }\n \n // Step 1 \u2014 snapshot before.\n // We pin rootView here and pass it directly to a targeted walk rather than\n // going through _lastKnownRootView, because performForcedSubtreeLayout\n // drives layoutViewsIfNeeded synchronously, which fires didFinishLayoutPass,\n // which may update _lastKnownRootView to a detached view that was temporarily\n // inserted into document.body for intrinsic-size measurement. If that\n // happened the \"after\" snapshot would walk from a completely different root\n // than \"before\", causing spurious diffs for every view in the real tree.\n const before = UILayoutDebugger._captureStateSnapshotFromRoot(rootView, \"Before (potentially stale)\")\n \n // Step 2 \u2014 nuclear reset\n rootView.performForcedSubtreeLayout?.()\n \n // Step 3 \u2014 snapshot after (ground truth), using the same pinned root.\n const after = UILayoutDebugger._captureStateSnapshotFromRoot(rootView, \"After (forced cold remeasure)\")\n \n // Step 4 \u2014 diff\n const diffs = UILayoutDebugger._diffSnapshots(before, after)\n .filter(d => d.kind !== \"unchanged\")\n \n // Step 5 \u2014 collect cache writes from the forced pass (the trace that was\n // just recorded by performForcedSubtreeLayout), keyed by viewIndex.\n const forcedPassCacheChanges = new Map<number, UILayoutDebugCacheChangeEvent[]>()\n const forcedTrace = UILayoutDebugger._traces[0] ?? null // newest = the forced pass\n const forcedPassIndex = forcedTrace?.passIndex ?? -1\n if (forcedTrace) {\n for (const ev of forcedTrace.cacheChanges) {\n let bucket = forcedPassCacheChanges.get(ev.viewIndex)\n if (!bucket) {\n bucket = []\n forcedPassCacheChanges.set(ev.viewIndex, bucket)\n }\n bucket.push(ev)\n }\n }\n \n UILayoutDebugger._staleReportResult = { before, after, diffs, forcedPassCacheChanges, passIndex: forcedPassIndex }\n UILayoutDebugger._staleReportMode = true\n UILayoutDebugger._renderOverlay()\n \n const correctedCount = diffs.length\n console.log(\n `%c[UILayoutDebugger] Stale layout report: ${correctedCount} view(s) had stale state corrected by forced layout.`,\n \"color: #ffaa55; font-weight: bold\"\n )\n }\n \n static clearStaleReport() {\n UILayoutDebugger._staleReportResult = null\n UILayoutDebugger._staleReportMode = false\n UILayoutDebugger._renderOverlay()\n }\n \n static toggleLiveInspector() {\n UILayoutDebugger._liveInspectorMode = !UILayoutDebugger._liveInspectorMode\n UILayoutDebugger._renderOverlay()\n }\n \n static _captureStateSnapshot(label: string): UILayoutDebugStateSnapshot | null {\n const rootView = UILayoutDebugger._lastKnownRootView\n if (!rootView) { return null }\n return UILayoutDebugger._captureStateSnapshotFromRoot(rootView, label)\n }\n \n /**\n * Like _captureStateSnapshot but walks from an explicit root rather than\n * _lastKnownRootView. Use this whenever the root must be pinned across a\n * call that may update _lastKnownRootView (e.g. captureStaleLayoutReport,\n * which drives a layout pass internally).\n */\n static _captureStateSnapshotFromRoot(rootView: any, label: string): UILayoutDebugStateSnapshot {\n const views = new Map<number, UILayoutDebugViewState>()\n UILayoutDebugger._walkViewTree(rootView, views, new Set())\n \n // Read UITextMeasurement global cache sizes. Both maps are private, but\n // accessible via the class reference on window if exposed, or via the\n // module-level import. We reach them defensively so the debugger never\n // throws if the import shape changes.\n const tm: any = (window as any).UITextMeasurement\n const textMeasurement: UILayoutDebugTextMeasurementSnapshot = {\n preparedCacheSize: tm?._preparedCache?.size ?? -1,\n styleCacheSize: tm?.globalStyleCache?.size ?? -1,\n }\n \n return { label, takenAt: Date.now(), views, textMeasurement }\n }\n \n static _walkViewTree(\n view: any,\n out: Map<number, UILayoutDebugViewState>,\n visited: Set<number>,\n ) {\n const idx: number = view?._UIViewIndex ?? -1\n if (idx < 0 || visited.has(idx)) { return }\n visited.add(idx)\n \n out.set(idx, {\n viewIndex: idx,\n className: view?.constructor?.name ?? \"UnknownView\",\n elementID: view?.elementID ?? String(idx),\n frame: UILayoutDebugger._captureFrame(view),\n cache: UILayoutDebugger._captureCache(view),\n })\n \n const subviews: any[] = view?.subviews ?? []\n for (const sv of subviews) { UILayoutDebugger._walkViewTree(sv, out, visited) }\n }\n \n static _diffSnapshots(\n baseline: UILayoutDebugStateSnapshot,\n current: UILayoutDebugStateSnapshot,\n ): UILayoutDebugViewDiff[] {\n const diffs: UILayoutDebugViewDiff[] = []\n const allKeys = new Set([...baseline.views.keys(), ...current.views.keys()])\n \n for (const idx of allKeys) {\n const b = baseline.views.get(idx) ?? null\n const c = current.views.get(idx) ?? null\n \n if (!b) {\n diffs.push({ kind: \"appeared\", viewIndex: idx,\n className: c!.className, elementID: c!.elementID,\n baselineFrame: null, currentFrame: c!.frame,\n baselineCache: null, currentCache: c!.cache })\n continue\n }\n if (!c) {\n diffs.push({ kind: \"disappeared\", viewIndex: idx,\n className: b.className, elementID: b.elementID,\n baselineFrame: b.frame, currentFrame: null,\n baselineCache: b.cache, currentCache: null })\n continue\n }\n \n const frameChanged = UILayoutDebugger._framesEqual(b.frame, c.frame) === false\n const cacheChanged = UILayoutDebugger._cachesEqual(b.cache, c.cache) === false\n const kind: UILayoutDebugDiffKind =\n frameChanged && cacheChanged ? \"both\"\n : frameChanged ? \"frame\"\n : cacheChanged ? \"cache\"\n : \"unchanged\"\n \n diffs.push({ kind, viewIndex: idx,\n className: c.className, elementID: c.elementID,\n baselineFrame: b.frame, currentFrame: c.frame,\n baselineCache: b.cache, currentCache: c.cache })\n }\n \n // Sort: appeared, disappeared, both, frame, cache, unchanged\n const order: Record<UILayoutDebugDiffKind, number> = {\n appeared: 0, disappeared: 1, both: 2, frame: 3, cache: 4, unchanged: 5,\n }\n diffs.sort((a, b) => order[a.kind] - order[b.kind])\n return diffs\n }\n \n static _framesEqual(a: UILayoutDebugFrame | null, b: UILayoutDebugFrame | null): boolean {\n if (!a && !b) { return true }\n if (!a || !b) { return false }\n if (UILayoutDebugger._boundsBasedDiff) {\n // Bounds mode: ignore origin, compare size only.\n return a.width === b.width && a.height === b.height\n }\n return a.left === b.left && a.top === b.top && a.width === b.width && a.height === b.height\n }\n \n static _cachesEqual(a: UILayoutDebugCacheSnapshot | null, b: UILayoutDebugCacheSnapshot | null): boolean {\n if (!a && !b) { return true }\n if (!a || !b) { return false }\n if (a.entryCount !== b.entryCount) { return false }\n for (const key of Object.keys(a.entries)) {\n const ae = a.entries[key]\n const be = b.entries[key]\n if (!be || ae.width !== be.width || ae.height !== be.height) { return false }\n }\n if (a.hasFrameCache !== b.hasFrameCache) { return false }\n if (a.hasFrameCache && b.hasFrameCache) {\n const af = a.frameCache, bf = b.frameCache\n if (!af || !bf || af.top !== bf.top || af.left !== bf.left || af.width !== bf.width || af.height !== bf.height) { return false }\n }\n if (a.hasVirtualFrameCache !== b.hasVirtualFrameCache) { return false }\n if (a.hasVirtualFrameCache && b.hasVirtualFrameCache) {\n const av = a.virtualFrameCache, bv = b.virtualFrameCache\n if (!av || !bv || av.top !== bv.top || av.left !== bv.left || av.width !== bv.width || av.height !== bv.height) { return false }\n }\n return true\n }\n \n \n // \u2500\u2500 Hook: called from layoutSubviews() \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n \n /**\n * Called at the top of layoutSubviews(), before the subview frame loop.\n * Nothing to do here \u2014 before-frames were already captured in willLayoutView().\n */\n static willSetSubviewFrames(_view: any) {\n // Reserved for future use; before-frames captured in willLayoutView().\n }\n \n /**\n * Called at the bottom of layoutSubviews(), after the subview frame loop.\n * Merges the before/after subview frames into the pending step.\n */\n static didSetSubviewFrames(view: any) {\n if (!UILayoutDebugger._isEnabled) { return }\n \n const step = UILayoutDebugger._pendingStep\n if (!step) { return }\n \n const subviews: any[] = view?.subviews ?? []\n for (let i = 0; i < subviews.length; i++) {\n const sv = subviews[i]\n const idx: number = sv?._UIViewIndex ?? -i\n const record: UILayoutDebugSubviewRecord = {\n viewIndex: idx,\n className: sv?.constructor?.name ?? \"UnknownView\",\n elementID: sv?.elementID ?? String(idx),\n frameBefore: UILayoutDebugger._pendingSubviewsBefore.get(idx) ?? null,\n frameAfter: UILayoutDebugger._captureFrame(sv),\n }\n step.subviewRecords.push(record)\n }\n }\n \n \n // \u2500\u2500 Breakpoint sentinel \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n \n /**\n * Returns true when breakpoints are enabled, causing the sentinel block\n * in UIView.ts to execute. Put a browser debugger breakpoint on the\n * `const breakpointOnThisLine` assignment inside that block.\n */\n static _shouldHitBreakpoint(_view: any): boolean {\n return UILayoutDebugger._isEnabled && UILayoutDebugger._breakpointsEnabled\n }\n \n \n // \u2500\u2500 Internal helpers \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n \n static _cleanStack(rawStack: string): string {\n const lines = rawStack.split(\"\\n\")\n let firstAppFrameIndex = 1 // skip the \"Error\" header on line 0\n \n for (let i = 1; i < lines.length; i++) {\n const trimmed = lines[i].trim()\n \n // V8 frame: \"at ClassName.methodName (file:line:col)\"\n // or: \"at methodName (file:line:col)\"\n // or: \"at file:line:col\"\n // Extract just the function/method name for noise matching.\n const atMatch = trimmed.match(/^at\\s+([\\w.<>$\\s]+?)\\s*(?:\\(|$)/)\n const frameName = atMatch ? atMatch[1].trim() : trimmed\n \n // The method name is the part after the last dot (if any).\n const methodName = frameName.includes(\".\")\n ? frameName.slice(frameName.lastIndexOf(\".\") + 1)\n : frameName\n \n const isNoise = UILayoutDebugger._noiseFramePrefixes.some(prefix => {\n // Match against the full qualified name OR just the method name,\n // so \"setNeedsLayout\" catches UITextField.setNeedsLayout too.\n return frameName === prefix || methodName === prefix || frameName.endsWith(\".\" + prefix)\n })\n \n if (!isNoise) {\n firstAppFrameIndex = i\n break\n }\n }\n return lines.slice(firstAppFrameIndex).join(\"\\n\")\n }\n \n static _extractCallerFunctionName(cleanStack: string): string {\n const firstLine = cleanStack.split(\"\\n\")[0]?.trim() ?? \"\"\n // V8: \"at ClassName.methodName (file:line:col)\"\n const atMatch = firstLine.match(/^at\\s+([\\w.<>$\\s]+?)\\s*(?:\\(|$)/)\n if (atMatch) { return atMatch[1].trim() }\n return firstLine.substring(0, 80) || \"(unknown)\"\n }\n \n static _captureFrame(view: any): UILayoutDebugFrame | null {\n const f = view?._frame\n if (!f) { return null }\n return {\n top: f.top ?? f.y ?? 0,\n left: f.left ?? f.x ?? 0,\n width: f.width ?? 0,\n height: f.height ?? 0,\n }\n }\n \n static _captureCache(view: any): UILayoutDebugCacheSnapshot | null {\n if (!view) { return null }\n const sharedKey: string | undefined = view.sharedIntrinsicSizeCacheIdentifier\n const isShared = !!sharedKey\n let rawEntries: Record<string, any>\n if (isShared) {\n rawEntries = (view.constructor?._sharedIntrinsicSizeCaches ?? view.__proto__?.constructor?._sharedIntrinsicSizeCaches)\n ?.get(sharedKey) ?? {}\n }\n else {\n rawEntries = view._intrinsicSizesCache ?? {}\n }\n const entries: Record<string, { width: number; height: number }> = {}\n for (const key of Object.keys(rawEntries)) {\n const r = rawEntries[key]\n entries[key] = { width: r?.width ?? 0, height: r?.height ?? 0 }\n }\n \n // Frame caches \u2014 these are per-instance UIRectangle | undefined fields.\n const rawFrameCache = view._frameCache\n const rawVirtualFrameCache = view._frameCacheForVirtualLayouting\n const frameCache: UILayoutDebugFrame | null = rawFrameCache\n ? { top: rawFrameCache.top ?? rawFrameCache.y ?? 0, left: rawFrameCache.left ?? rawFrameCache.x ?? 0, width: rawFrameCache.width ?? 0, height: rawFrameCache.height ?? 0 }\n : null\n const virtualFrameCache: UILayoutDebugFrame | null = rawVirtualFrameCache\n ? { top: rawVirtualFrameCache.top ?? rawVirtualFrameCache.y ?? 0, left: rawVirtualFrameCache.left ?? rawVirtualFrameCache.x ?? 0, width: rawVirtualFrameCache.width ?? 0, height: rawVirtualFrameCache.height ?? 0 }\n : null\n \n return {\n entryCount: Object.keys(entries).length,\n entries,\n isShared,\n sharedKey,\n hasFrameCache: rawFrameCache !== undefined,\n frameCache,\n hasVirtualFrameCache: rawVirtualFrameCache !== undefined,\n virtualFrameCache,\n }\n }\n \n static _buildTreeSnapshot(\n view: any,\n depth: number,\n visited: Set<number> = new Set(),\n ): UILayoutDebugTreeNode {\n const idx: number = view?._UIViewIndex ?? -1\n const node: UILayoutDebugTreeNode = {\n viewIndex: idx,\n className: view?.constructor?.name ?? \"UnknownView\",\n elementID: view?.elementID ?? String(idx),\n depth,\n frame: UILayoutDebugger._captureFrame(view),\n layoutCount: UILayoutDebugger._layoutCountsThisPass.get(idx) ?? 0,\n cacheAfterPass: UILayoutDebugger._captureCache(view),\n children: [],\n }\n const subviews: any[] = view?.subviews ?? []\n for (let i = 0; i < subviews.length; i++) {\n const sv = subviews[i]\n const svIdx: number = sv?._UIViewIndex ?? -1\n if (svIdx < 0 || visited.has(svIdx)) { continue }\n visited.add(svIdx)\n node.children.push(UILayoutDebugger._buildTreeSnapshot(sv, depth + 1, visited))\n }\n return node\n }\n \n \n // \u2500\u2500 Baseline / diff state \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n \n static _baseline: UILayoutDebugStateSnapshot | null = null\n static _diffSnapshot: UILayoutDebugStateSnapshot | null = null\n static _diffMode: boolean = false\n static _liveInspectorMode: boolean = false\n \n // \u2500\u2500 Stale layout report state \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n \n /** Result of the last captureStaleLayoutReport() run. */\n static _staleReportResult: {\n before: UILayoutDebugStateSnapshot\n after: UILayoutDebugStateSnapshot\n diffs: UILayoutDebugViewDiff[]\n /** viewIndex \u2192 cacheChanges from the forced-layout pass, for cross-referencing */\n forcedPassCacheChanges: Map<number, UILayoutDebugCacheChangeEvent[]>\n passIndex: number\n } | null = null\n \n /** Whether the stale report side-panel is open. */\n static _staleReportMode: boolean = false\n \n // Persists across passes so captureBaseline() works between passes.\n static _lastKnownRootView: any = null\n \n /**\n * Finds the first trace (chronologically) recorded after baselineTakenAt\n * that contains a step for the given viewIndex. Returns {traceIndex, stepIndex}\n * into _traces, or null if none found.\n */\n static _findCausingTrace(\n viewIndex: number,\n baselineTakenAt: number,\n ): { traceIndex: number; stepIndex: number; passIndex: number } | null {\n // _traces is newest-first, so iterate in reverse for chronological order\n for (let ti = UILayoutDebugger._traces.length - 1; ti >= 0; ti--) {\n const trace = UILayoutDebugger._traces[ti]\n // We don't store a timestamp on traces, but passIndex is monotonically\n // increasing. The baseline was taken at a wall-clock time; the closest\n // proxy is to find traces whose passIndex is greater than any pass that\n // completed before the baseline. Since we can't correlate exactly, we\n // just find the first trace (oldest) that touched the view and show it.\n const si = trace.steps.findIndex(s => s.viewIndex === viewIndex)\n if (si >= 0) {\n return { traceIndex: ti, stepIndex: si, passIndex: trace.passIndex }\n }\n }\n return null\n }\n \n // \u2500\u2500 Overlay UI \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n \n static _overlayRoot: HTMLElement | null = null\n static _overlayVisible: boolean = true\n static _helpMode: boolean = false\n \n static _ensureOverlay() {\n if (UILayoutDebugger._overlayRoot) { return }\n \n const root = document.createElement(\"div\")\n root.id = \"__UILayoutDebugger_overlay\"\n root.style.cssText = [\n \"position: fixed\",\n \"top: 8px\",\n \"right: 8px\",\n \"max-height: calc(100vh - 16px)\",\n \"background: rgba(15, 15, 20, 0.96)\",\n \"color: #e8e8e8\",\n \"font: 11px/1.4 'SF Mono', 'Menlo', 'Consolas', monospace\",\n \"border-radius: 8px\",\n \"border: 1px solid rgba(255,255,255,0.12)\",\n \"box-shadow: 0 8px 32px rgba(0,0,0,0.6)\",\n \"z-index: 2147483647\",\n \"display: flex\",\n \"flex-direction: column\",\n \"overflow: hidden\",\n \"user-select: none\",\n ].join(\"; \")\n \n document.body.appendChild(root)\n UILayoutDebugger._overlayRoot = root\n UILayoutDebugger._makeDraggable(root)\n }\n \n static _removeOverlay() {\n UILayoutDebugger._overlayRoot?.remove()\n UILayoutDebugger._overlayRoot = null\n }\n \n static _renderOverlay() {\n const root = UILayoutDebugger._overlayRoot\n if (!root) { return }\n \n const cmp = UILayoutDebugger._compareMode\n const diff = UILayoutDebugger._diffMode && !!UILayoutDebugger._baseline && !!UILayoutDebugger._diffSnapshot\n const live = UILayoutDebugger._liveInspectorMode && !!UILayoutDebugger._lastKnownRootView\n const stale = UILayoutDebugger._staleReportMode && !!UILayoutDebugger._staleReportResult\n const passWidth = cmp ? 1140 : 570\n const extraWidth = (diff ? 320 : 0) + (live ? 320 : 0) + (stale ? 360 : 0)\n root.style.width = (passWidth + extraWidth) + \"px\"\n root.innerHTML = \"\"\n \n // \u2500\u2500 Header \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n // \u2500\u2500 Header row 1: title + core controls \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n const headerRow1 = UILayoutDebugger._el(\"div\", [\n \"padding: 8px 10px 5px\",\n \"background: rgba(255,255,255,0.05)\",\n \"display: flex\",\n \"align-items: center\",\n \"gap: 6px\",\n \"cursor: move\",\n \"flex-shrink: 0\",\n ])\n headerRow1.dataset.dragHandle = \"1\"\n \n const title = UILayoutDebugger._el(\"span\", [\"flex: 1\", \"font-weight: bold\", \"font-size: 11px\", \"color: #c8d8ff\"])\n title.textContent = \"\u2699 UILayoutDebugger\"\n \n const helpBtn = UILayoutDebugger._el(\"button\", UILayoutDebugger._btnStyle(\n UILayoutDebugger._helpMode ? \"#ffcc88\" : \"#9090a8\"\n ))\n helpBtn.textContent = \"\u24D8\"\n helpBtn.title = \"Show help\"\n helpBtn.onclick = () => {\n UILayoutDebugger._helpMode = !UILayoutDebugger._helpMode\n UILayoutDebugger._renderOverlay()\n }\n \n const bpBtn = UILayoutDebugger._el(\"button\", UILayoutDebugger._btnStyle(\n UILayoutDebugger._breakpointsEnabled ? \"#ffaa33\" : \"#9090a8\"\n ))\n bpBtn.textContent = UILayoutDebugger._breakpointsEnabled ? \"\u23F8 BP ON\" : \"\u23F8 BP OFF\"\n bpBtn.title = \"Toggle breakpoint step-through\"\n bpBtn.onclick = () => {\n UILayoutDebugger._breakpointsEnabled\n ? UILayoutDebugger.disableBreakpoints()\n : UILayoutDebugger.enableBreakpoints()\n UILayoutDebugger._renderOverlay()\n }\n \n const cmpBtn = UILayoutDebugger._el(\"button\", UILayoutDebugger._btnStyle(cmp ? \"#7bc8ff\" : \"#9090a8\"))\n cmpBtn.textContent = cmp ? \"\u29C9 Compare ON\" : \"\u29C9 Compare\"\n cmpBtn.title = \"Toggle side-by-side pass comparison\"\n cmpBtn.onclick = () => {\n UILayoutDebugger._compareMode = !UILayoutDebugger._compareMode\n if (UILayoutDebugger._compareMode) {\n UILayoutDebugger._compareTraceIndex = Math.min(1, UILayoutDebugger._traces.length - 1)\n UILayoutDebugger._compareStepIndex = -1\n UILayoutDebugger._sharedExpandState = new Map()\n }\n UILayoutDebugger._renderOverlay()\n }\n \n const filterLabels: Record<string, string> = {\n all: \"\u2298 All\",\n changed: \"\u2298 Changed\",\n unchanged: \"\u2298 Unchanged\",\n }\n const filterColors: Record<string, string> = {\n all: \"#9090a8\",\n changed: \"#7bc8ff\",\n unchanged: \"#ffcc88\",\n }\n const filterCycle: Record<string, \"all\" | \"changed\" | \"unchanged\"> = {\n all: \"changed\", changed: \"unchanged\", unchanged: \"all\",\n }\n const filterBtn = UILayoutDebugger._el(\"button\", UILayoutDebugger._btnStyle(\n filterColors[UILayoutDebugger._frameFilter]\n ))\n filterBtn.textContent = filterLabels[UILayoutDebugger._frameFilter]\n filterBtn.title = \"Cycle: show all steps \u2192 only changed frames \u2192 only unchanged frames\"\n filterBtn.onclick = () => {\n UILayoutDebugger._frameFilter = filterCycle[UILayoutDebugger._frameFilter]\n UILayoutDebugger._replayStepIndex = -1\n UILayoutDebugger._compareStepIndex = -1\n UILayoutDebugger._renderOverlay()\n }\n \n const clearBtn = UILayoutDebugger._el(\"button\", UILayoutDebugger._btnStyle(\"#9090a8\"))\n clearBtn.textContent = \"\u232B Clear\"\n clearBtn.title = \"Clear all recorded traces and restart recording\"\n clearBtn.onclick = () => UILayoutDebugger.clearTraces()\n \n const toggleBtn = UILayoutDebugger._el(\"button\", UILayoutDebugger._btnStyle(\"#9090a8\"))\n toggleBtn.textContent = UILayoutDebugger._overlayVisible ? \"\u25BE\" : \"\u25B8\"\n toggleBtn.title = \"Collapse / expand\"\n toggleBtn.onclick = () => {\n UILayoutDebugger._overlayVisible = !UILayoutDebugger._overlayVisible\n UILayoutDebugger._renderOverlay()\n }\n \n const closeBtn = UILayoutDebugger._el(\"button\", UILayoutDebugger._btnStyle(\"#dd5555\"))\n closeBtn.textContent = \"\u2715\"\n closeBtn.title = \"Disable UILayoutDebugger\"\n closeBtn.onclick = () => UILayoutDebugger.disable()\n \n headerRow1.append(title, helpBtn, bpBtn, cmpBtn, filterBtn, clearBtn, toggleBtn, closeBtn)\n \n // \u2500\u2500 Header row 2: baseline / diff and future feature buttons \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n const headerRow2 = UILayoutDebugger._el(\"div\", [\n \"padding: 4px 10px 6px\",\n \"background: rgba(255,255,255,0.05)\",\n \"border-bottom: 1px solid rgba(255,255,255,0.10)\",\n \"display: flex\",\n \"align-items: center\",\n \"gap: 6px\",\n \"flex-shrink: 0\",\n \"flex-wrap: wrap\",\n ])\n headerRow2.dataset.dragHandle = \"1\"\n \n const hasBaseline = !!UILayoutDebugger._baseline\n const baselineBtn = UILayoutDebugger._el(\"button\", UILayoutDebugger._btnStyle(\n UILayoutDebugger._diffMode ? \"#88ddff\" : hasBaseline ? \"#ffcc88\" : \"#9090a8\"\n ))\n baselineBtn.textContent = UILayoutDebugger._diffMode\n ? \"\u2295 Diff ON\"\n : hasBaseline ? \"\uD83D\uDCCD Baseline set\" : \"\uD83D\uDCCD Baseline\"\n baselineBtn.title = hasBaseline\n ? \"Baseline captured \u2014 click to recapture, or use \u2295 to diff against it\"\n : \"Capture current view tree state as baseline\"\n baselineBtn.onclick = () => {\n if (UILayoutDebugger._diffMode) {\n UILayoutDebugger.clearDiff()\n } else {\n UILayoutDebugger.captureBaseline()\n }\n }\n \n const diffBtn = UILayoutDebugger._el(\"button\", UILayoutDebugger._btnStyle(\n hasBaseline ? \"#88ff99\" : \"#9090a8\"\n )) as HTMLButtonElement\n diffBtn.textContent = \"\u2295 Diff\"\n diffBtn.title = \"Capture current state and diff against baseline\"\n diffBtn.disabled = !hasBaseline\n diffBtn.onclick = () => UILayoutDebugger.captureAndDiff()\n \n const liveBtn = UILayoutDebugger._el(\"button\", UILayoutDebugger._btnStyle(\n live ? \"#88ff99\" : \"#9090a8\"\n ))\n liveBtn.textContent = live ? \"\uD83D\uDC41 Live ON\" : \"\uD83D\uDC41 Live\"\n liveBtn.title = \"Show live view tree with current frames and cache state\"\n liveBtn.onclick = () => UILayoutDebugger.toggleLiveInspector()\n \n const hasStaleResult = !!UILayoutDebugger._staleReportResult\n const staleBtn = UILayoutDebugger._el(\"button\", UILayoutDebugger._btnStyle(\n stale ? \"#ffaa55\" : hasStaleResult ? \"#a06030\" : \"#9090a8\"\n ))\n staleBtn.textContent = stale ? \"\u2622 Stale ON\" : \"\u2622 Stale\"\n staleBtn.title = hasStaleResult\n ? \"Stale layout report available \u2014 click to toggle the panel, or re-run to refresh\"\n : \"Run a forced full-tree remeasure and show which views had stale/missing invalidations\"\n staleBtn.onclick = () => {\n if (stale) {\n // Panel already open \u2014 toggle it off\n UILayoutDebugger._staleReportMode = false\n UILayoutDebugger._renderOverlay()\n }\n else if (hasStaleResult) {\n // Result exists but panel is closed \u2014 reopen it\n UILayoutDebugger._staleReportMode = true\n UILayoutDebugger._renderOverlay()\n }\n else {\n UILayoutDebugger.captureStaleLayoutReport()\n }\n }\n \n // Long-press / right-click to re-run even when a result already exists\n staleBtn.oncontextmenu = (e) => {\n e.preventDefault()\n UILayoutDebugger.captureStaleLayoutReport()\n }\n \n const boundsToggleBtn = UILayoutDebugger._el(\"button\", UILayoutDebugger._btnStyle(\n UILayoutDebugger._boundsBasedDiff ? \"#c8d8ff\" : \"#9090a8\"\n ))\n boundsToggleBtn.textContent = UILayoutDebugger._boundsBasedDiff ? \"\u2B1A Bounds\" : \"\u2B1A Frame\"\n boundsToggleBtn.title = UILayoutDebugger._boundsBasedDiff\n ? \"Diffing by bounds (size only \u2014 origin ignored). Click to switch to frame diffing (position + size).\"\n : \"Diffing by frame (position + size). Click to switch to bounds diffing (size only \u2014 position changes are ignored).\"\n boundsToggleBtn.onclick = () => {\n UILayoutDebugger._boundsBasedDiff = !UILayoutDebugger._boundsBasedDiff\n UILayoutDebugger._renderOverlay()\n }\n \n headerRow2.append(baselineBtn, diffBtn, liveBtn, staleBtn, boundsToggleBtn)\n \n // \u2500\u2500 Wrap both rows in the header container \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n const header = UILayoutDebugger._el(\"div\", [\"flex-shrink: 0\"])\n header.append(headerRow1, headerRow2)\n root.appendChild(header)\n \n if (!UILayoutDebugger._overlayVisible) { return }\n \n // \u2500\u2500 Help panel \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n if (UILayoutDebugger._helpMode) {\n root.appendChild(UILayoutDebugger._renderHelpPanel())\n return\n }\n \n // \u2500\u2500 Baseline captured but no diff yet \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n if (UILayoutDebugger._baseline && !diff) {\n const msg = UILayoutDebugger._el(\"div\", [\n \"padding: 8px 12px\",\n \"color: #ffcc88\",\n \"font-size: 10px\",\n \"border-bottom: 1px solid rgba(255,255,255,0.08)\",\n \"flex-shrink: 0\",\n ])\n const ts = new Date(UILayoutDebugger._baseline.takenAt)\n msg.textContent = `\uD83D\uDCCD Baseline set at ${ts.toLocaleTimeString()} \u2014 ${UILayoutDebugger._baseline.views.size} views. Hit \u2295 Diff to compare.`\n root.appendChild(msg)\n }\n \n if (UILayoutDebugger._traces.length === 0 && !diff) {\n const msg = UILayoutDebugger._el(\"div\", [\"padding: 10px 12px\", \"color: #9090a8\", \"font-size: 10px\"])\n msg.textContent = \"No layout pass recorded yet. Trigger a layout to begin.\"\n root.appendChild(msg)\n return\n }\n \n // \u2500\u2500 Main body: pass inspector + optional diff panel \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n const body = UILayoutDebugger._el(\"div\", [\n \"display: flex\",\n \"flex: 1\",\n \"overflow: hidden\",\n \"min-height: 0\",\n ])\n root.appendChild(body)\n \n // \u2500\u2500 Pass inspector (single or compare columns) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n if (UILayoutDebugger._traces.length > 0) {\n const passSection = UILayoutDebugger._el(\"div\", [\n \"display: flex\",\n \"flex: 1\",\n \"overflow: hidden\",\n \"min-height: 0\",\n ])\n \n if (cmp) {\n let leftTreeEl: HTMLElement | null = null\n let rightTreeEl: HTMLElement | null = null\n \n const leftCol = UILayoutDebugger._renderPassColumn(\n UILayoutDebugger._replayTraceIndex,\n UILayoutDebugger._replayStepIndex,\n (si) => { UILayoutDebugger._replayStepIndex = si; UILayoutDebugger._renderOverlay() },\n (ti) => { UILayoutDebugger._replayTraceIndex = ti; UILayoutDebugger._replayStepIndex = -1; UILayoutDebugger._renderOverlay() },\n UILayoutDebugger._sharedExpandState,\n (el) => { leftTreeEl = el },\n () => rightTreeEl,\n )\n const colDivider = UILayoutDebugger._el(\"div\", [\n \"width: 1px\", \"background: rgba(255,255,255,0.10)\", \"flex-shrink: 0\",\n ])\n const rightCol = UILayoutDebugger._renderPassColumn(\n UILayoutDebugger._compareTraceIndex,\n UILayoutDebugger._compareStepIndex,\n (si) => { UILayoutDebugger._compareStepIndex = si; UILayoutDebugger._renderOverlay() },\n (ti) => { UILayoutDebugger._compareTraceIndex = ti; UILayoutDebugger._compareStepIndex = -1; UILayoutDebugger._renderOverlay() },\n UILayoutDebugger._sharedExpandState,\n (el) => { rightTreeEl = el },\n () => leftTreeEl,\n )\n passSection.append(leftCol, colDivider, rightCol)\n }\n else {\n const col = UILayoutDebugger._renderPassColumn(\n UILayoutDebugger._replayTraceIndex,\n UILayoutDebugger._replayStepIndex,\n (si) => { UILayoutDebugger._replayStepIndex = si; UILayoutDebugger._renderOverlay() },\n (ti) => { UILayoutDebugger._replayTraceIndex = ti; UILayoutDebugger._replayStepIndex = -1; UILayoutDebugger._renderOverlay() },\n UILayoutDebugger._singleExpandState,\n () => {},\n () => null,\n )\n col.style.flex = \"1\"\n passSection.appendChild(col)\n }\n \n body.appendChild(passSection)\n }\n \n // \u2500\u2500 Diff panel \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n if (diff) {\n const divider = UILayoutDebugger._el(\"div\", [\n \"width: 1px\", \"background: rgba(255,255,255,0.10)\", \"flex-shrink: 0\",\n ])\n const diffPanel = UILayoutDebugger._renderDiffPanel(\n UILayoutDebugger._baseline!,\n UILayoutDebugger._diffSnapshot!,\n (viewIndex) => {\n for (let ti = 0; ti < UILayoutDebugger._traces.length; ti++) {\n const trace = UILayoutDebugger._traces[ti]\n const si = trace.steps.findIndex(s => s.viewIndex === viewIndex)\n if (si >= 0) {\n UILayoutDebugger._replayTraceIndex = ti\n UILayoutDebugger._replayStepIndex = si\n UILayoutDebugger._renderOverlay()\n return\n }\n }\n },\n UILayoutDebugger._baseline!.takenAt,\n )\n diffPanel.style.width = \"320px\"\n diffPanel.style.flexShrink = \"0\"\n body.append(divider, diffPanel)\n }\n \n // \u2500\u2500 Live inspector panel \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n if (live) {\n const divider = UILayoutDebugger._el(\"div\", [\n \"width: 1px\", \"background: rgba(255,255,255,0.10)\", \"flex-shrink: 0\",\n ])\n const livePanel = UILayoutDebugger._renderLiveInspectorPanel()\n livePanel.style.width = \"320px\"\n livePanel.style.flexShrink = \"0\"\n body.append(divider, livePanel)\n }\n \n // \u2500\u2500 Stale layout report panel \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n if (stale) {\n const divider = UILayoutDebugger._el(\"div\", [\n \"width: 1px\", \"background: rgba(255,255,255,0.10)\", \"flex-shrink: 0\",\n ])\n const stalePanel = UILayoutDebugger._renderStaleReportPanel(UILayoutDebugger._staleReportResult!)\n stalePanel.style.width = \"360px\"\n stalePanel.style.flexShrink = \"0\"\n body.append(divider, stalePanel)\n }\n }\n \n static _renderPassColumn(\n traceIndex: number,\n stepIndex: number,\n onStepChange: (si: number) => void,\n onTraceChange: (ti: number) => void,\n expandState: Map<number, boolean> | null,\n registerTree: (el: HTMLElement) => void,\n getPeerTree: () => HTMLElement | null,\n ): HTMLElement {\n const col = UILayoutDebugger._el(\"div\", [\n \"display: flex\",\n \"flex-direction: column\",\n \"flex: 1\",\n \"min-width: 0\",\n \"overflow: hidden\",\n ])\n \n const trace = UILayoutDebugger._traces[traceIndex] ?? null\n \n // \u2500\u2500 Trace picker \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n const pickerRow = UILayoutDebugger._el(\"div\", [\n \"padding: 5px 10px\",\n \"border-bottom: 1px solid rgba(255,255,255,0.08)\",\n \"display: flex\",\n \"align-items: center\",\n \"gap: 6px\",\n \"flex-shrink: 0\",\n \"font-size: 10px\",\n ])\n const pickerLabel = UILayoutDebugger._el(\"span\", [\"color: #a0a0b8\", \"flex-shrink: 0\"])\n pickerLabel.textContent = \"Pass:\"\n \n const sel = document.createElement(\"select\")\n sel.style.cssText = [\n \"flex: 1\",\n \"background: #1e1e2e\",\n \"color: #d8d8f0\",\n \"border: 1px solid #444\",\n \"border-radius: 3px\",\n \"font: inherit\",\n \"padding: 1px 4px\",\n ].join(\"; \")\n \n for (let i = 0; i < UILayoutDebugger._traces.length; i++) {\n const t = UILayoutDebugger._traces[i]\n const opt = document.createElement(\"option\")\n opt.value = String(i)\n opt.textContent = `#${t.passIndex} (${t.steps.length} steps, ${t.totalIterations} iter)`\n if (i === traceIndex) { opt.selected = true }\n sel.appendChild(opt)\n }\n sel.onchange = () => onTraceChange(parseInt(sel.value, 10))\n pickerRow.append(pickerLabel, sel)\n col.appendChild(pickerRow)\n \n if (!trace) { return col }\n \n // Apply frame filter to produce the visible step list.\n const frameFilter = UILayoutDebugger._frameFilter\n const visibleSteps = frameFilter === \"all\"\n ? trace.steps\n : trace.steps.filter(s => {\n const f = s.frameBefore\n const g = s.frameAfter\n const changed = !f || !g\n || f.left !== g.left || f.top !== g.top\n || f.width !== g.width || f.height !== g.height\n return frameFilter === \"changed\" ? changed : !changed\n })\n \n const clampedStep = Math.max(-1, Math.min(stepIndex, visibleSteps.length - 1))\n const activeStep = visibleSteps[clampedStep] ?? null\n const activeViewIndex = activeStep?.viewIndex ?? -1\n \n // countMap still uses all steps for heat colouring (unfiltered).\n // stepMap stores the last step per viewIndex for frame/cache delta display.\n const countMap = new Map<number, number>()\n const stepMap = new Map<number, UILayoutDebugStep>()\n for (const step of trace.steps) {\n countMap.set(step.viewIndex, (countMap.get(step.viewIndex) ?? 0) + 1)\n stepMap.set(step.viewIndex, step)\n }\n \n // \u2500\u2500 Step controls \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n const stepBar = UILayoutDebugger._el(\"div\", [\n \"padding: 5px 10px\",\n \"border-bottom: 1px solid rgba(255,255,255,0.08)\",\n \"display: flex\",\n \"align-items: center\",\n \"gap: 6px\",\n \"flex-shrink: 0\",\n ])\n \n const backBtn = UILayoutDebugger._el(\"button\", UILayoutDebugger._btnStyle(\"#59599b\")) as HTMLButtonElement\n backBtn.textContent = \"\u25C0\"\n backBtn.title = \"Step back\"\n backBtn.disabled = clampedStep <= -1\n backBtn.onclick = () => onStepChange(Math.max(clampedStep - 1, -1))\n \n const fwdBtn = UILayoutDebugger._el(\"button\", UILayoutDebugger._btnStyle(\"#59599b\")) as HTMLButtonElement\n fwdBtn.textContent = \"\u25B6\"\n fwdBtn.title = \"Step forward\"\n fwdBtn.disabled = clampedStep >= visibleSteps.length - 1\n fwdBtn.onclick = () => onStepChange(Math.min(clampedStep + 1, visibleSteps.length - 1))\n \n const slider = document.createElement(\"input\")\n slider.type = \"range\"\n slider.min = \"-1\"\n slider.max = String(visibleSteps.length - 1)\n slider.value = String(clampedStep)\n slider.style.cssText = \"flex: 1; cursor: pointer; accent-color: #59599b;\"\n slider.oninput = () => onStepChange(parseInt(slider.value, 10))\n \n const stepLabel = UILayoutDebugger._el(\"span\", [\"color: #b0b0c8\", \"font-size: 10px\", \"white-space: nowrap\"])\n const totalLabel = frameFilter === \"all\"\n ? String(visibleSteps.length)\n : `${visibleSteps.length}/${trace.steps.length}`\n stepLabel.textContent = clampedStep < 0\n ? `\u2014 / ${totalLabel}`\n : `${clampedStep + 1} / ${totalLabel}`\n \n stepBar.append(backBtn, slider, fwdBtn, stepLabel)\n col.appendChild(stepBar)\n \n // \u2500\u2500 Active step detail \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n if (activeStep) {\n col.appendChild(UILayoutDebugger._renderStepDetail(activeStep))\n }\n \n // \u2500\u2500 View tree \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n const treeContainer = UILayoutDebugger._el(\"div\", [\n \"overflow-y: scroll\",\n \"flex: 1\",\n \"padding: 4px 0\",\n \"min-height: 0\",\n \"position: relative\",\n ])\n registerTree(treeContainer)\n \n treeContainer.addEventListener(\"scroll\", () => {\n const peer = getPeerTree()\n if (peer && peer.scrollTop !== treeContainer.scrollTop) {\n peer.scrollTop = treeContainer.scrollTop\n }\n })\n \n if (trace.roots.length > 0) {\n let activeRow: HTMLElement | null = null\n for (const treeRoot of trace.roots) {\n const result = UILayoutDebugger._renderTreeNode(\n treeRoot, treeContainer, countMap, activeViewIndex, expandState, stepMap\n )\n if (result) { activeRow = result }\n }\n // Scroll the active row into view after the DOM is fully built.\n // Use a 0ms timeout so the browser has laid out the container first.\n if (activeRow) {\n const rowRef = activeRow\n const containerRef = treeContainer\n setTimeout(() => {\n const rowTop = rowRef.offsetTop\n const rowBottom = rowTop + rowRef.offsetHeight\n const visTop = containerRef.scrollTop\n const visBottom = visTop + containerRef.clientHeight\n if (rowTop < visTop || rowBottom > visBottom) {\n containerRef.scrollTop = rowTop - containerRef.clientHeight / 2\n }\n }, 0)\n }\n }\n else {\n const msg = UILayoutDebugger._el(\"div\", [\"padding: 8px 10px\", \"color: #6a6a80\"])\n msg.textContent = \"No steps recorded in this pass.\"\n treeContainer.appendChild(msg)\n }\n \n col.appendChild(treeContainer)\n \n // \u2500\u2500 Cache change events \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n if (trace.cacheChanges.length > 0) {\n let cacheListExpanded = false\n \n const cacheHeader = UILayoutDebugger._el(\"div\", [\n \"padding: 5px 10px\",\n \"border-top: 1px solid rgba(255,255,255,0.08)\",\n \"display: flex\",\n \"align-items: center\",\n \"gap: 5px\",\n \"flex-shrink: 0\",\n \"cursor: pointer\",\n \"font-size: 10px\",\n ])\n \n const cacheChevron = UILayoutDebugger._el(\"span\", [\"color: #7070a0\", \"font-size: 8px\", \"width: 10px\"])\n cacheChevron.textContent = \"\u25B8\"\n \n const cacheTitle = UILayoutDebugger._el(\"span\", [\"color: #a0a0b8\"])\n cacheTitle.textContent = `Cache writes (${trace.cacheChanges.length})`\n \n cacheHeader.append(cacheChevron, cacheTitle)\n col.appendChild(cacheHeader)\n \n const cacheList = UILayoutDebugger._el(\"div\", [\n \"display: none\",\n \"overflow-y: auto\",\n \"max-height: 180px\",\n \"flex-shrink: 0\",\n \"font-size: 10px\",\n \"padding: 2px 0\",\n ])\n \n for (const ev of trace.cacheChanges) {\n const evRow = UILayoutDebugger._el(\"div\", [\n \"padding: 2px 10px 2px 14px\",\n \"display: flex\",\n \"flex-direction: column\",\n \"gap: 1px\",\n \"border-bottom: 1px solid rgba(255,255,255,0.04)\",\n ])\n \n const topLine = UILayoutDebugger._el(\"div\", [\"display: flex\", \"gap: 5px\", \"align-items: baseline\"])\n \n const evIdx = UILayoutDebugger._el(\"span\", [\"color: #5a5a70\", \"flex-shrink: 0\"])\n evIdx.textContent = `#${ev.eventIndex}`\n \n const evClass = UILayoutDebugger._el(\"span\", [\"color: #ffcc88\", \"font-weight: bold\"])\n evClass.textContent = ev.className\n \n const evEid = UILayoutDebugger._el(\"span\", [\"color: #6a6a80\"])\n evEid.textContent = `#${ev.elementID}`\n \n const evKey = UILayoutDebugger._el(\"span\", [\"color: #9090a8\"])\n const match = ev.cacheKey.match(/h_(\\d+(?:\\.\\d+)?)__w_(\\d+(?:\\.\\d+)?)/)\n evKey.textContent = match\n ? (match[1] !== \"0\" && match[2] !== \"0\"\n ? `h\u2264${match[1]} w\u2264${match[2]}`\n : match[2] !== \"0\" ? `w\u2264${match[2]}` : `h\u2264${match[1]}`)\n : ev.cacheKey\n \n const evVal = UILayoutDebugger._el(\"span\", [\"color: #88ddff\", \"margin-left: auto\"])\n evVal.textContent = `${ev.newValue.width.toFixed(0)}\u00D7${ev.newValue.height.toFixed(0)}`\n \n topLine.append(evIdx, evClass, evEid, evKey, evVal)\n \n const callerLine = UILayoutDebugger._el(\"div\", [\n \"display: flex\", \"gap: 5px\", \"align-items: baseline\",\n ])\n const stepRef = UILayoutDebugger._el(\"span\", [\"color: #5a5a70\", \"flex-shrink: 0\"])\n stepRef.textContent = ev.stepIndex >= 0 ? `step ${ev.stepIndex}` : \"between steps\"\n \n const callerFn = UILayoutDebugger._el(\"span\", [\"color: #7878a0\", \"cursor: pointer\"])\n callerFn.textContent = ev.callerFunction + \"()\"\n callerFn.title = ev.cleanStack\n \n let stackExpanded = false\n const stackEl = UILayoutDebugger._el(\"div\", [\n \"display: none\",\n \"margin-top: 2px\",\n \"padding: 3px 6px\",\n \"background: rgba(255,255,255,0.04)\",\n \"border-radius: 3px\",\n \"color: #6060808\",\n \"font-size: 9px\",\n \"white-space: pre\",\n \"overflow-x: auto\",\n ])\n stackEl.textContent = ev.cleanStack\n callerFn.onclick = () => {\n stackExpanded = !stackExpanded\n stackEl.style.display = stackExpanded ? \"block\" : \"none\"\n }\n \n callerLine.append(stepRef, callerFn)\n evRow.append(topLine, callerLine, stackEl)\n cacheList.appendChild(evRow)\n }\n \n cacheHeader.onclick = () => {\n cacheListExpanded = !cacheListExpanded\n cacheList.style.display = cacheListExpanded ? \"block\" : \"none\"\n cacheChevron.textContent = cacheListExpanded ? \"\u25BE\" : \"\u25B8\"\n }\n \n col.appendChild(cacheList)\n }\n \n return col\n }\n \n static _renderStaleReportPanel(result: NonNullable<typeof UILayoutDebugger._staleReportResult>): HTMLElement {\n const panel = UILayoutDebugger._el(\"div\", [\n \"display: flex\",\n \"flex-direction: column\",\n \"flex: 1\",\n \"min-height: 0\",\n \"overflow: hidden\",\n ])\n \n // \u2500\u2500 Header bar \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n const bar = UILayoutDebugger._el(\"div\", [\n \"padding: 5px 10px\",\n \"border-bottom: 1px solid rgba(255,255,255,0.08)\",\n \"display: flex\",\n \"align-items: center\",\n \"gap: 6px\",\n \"flex-shrink: 0\",\n \"font-size: 10px\",\n ])\n \n const barTitle = UILayoutDebugger._el(\"span\", [\"color: #ffaa55\", \"flex: 1\", \"font-weight: bold\"])\n barTitle.textContent = \"\u2622 Stale Layout Report\"\n \n const rerunBtn = UILayoutDebugger._el(\"button\", UILayoutDebugger._btnStyle(\"#ffaa55\"))\n rerunBtn.textContent = \"\u21BA Re-run\"\n rerunBtn.title = \"Re-run performForcedSubtreeLayout and refresh the report\"\n rerunBtn.onclick = () => UILayoutDebugger.captureStaleLayoutReport()\n \n const closeBtn = UILayoutDebugger._el(\"button\", UILayoutDebugger._btnStyle(\"#9090a8\"))\n closeBtn.textContent = \"\u2715\"\n closeBtn.title = \"Close stale report panel\"\n closeBtn.onclick = () => {\n UILayoutDebugger._staleReportMode = false\n UILayoutDebugger._renderOverlay()\n }\n \n bar.append(barTitle, rerunBtn, closeBtn)\n panel.appendChild(bar)\n \n // \u2500\u2500 Summary bar \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n const { diffs, forcedPassCacheChanges, passIndex } = result\n \n const counts = { frame: 0, cache: 0, both: 0, appeared: 0, disappeared: 0 }\n for (const d of diffs) {\n if (d.kind === \"frame\") { counts.frame++ }\n else if (d.kind === \"cache\") { counts.cache++ }\n else if (d.kind === \"both\") { counts.both++ }\n else if (d.kind === \"appeared\") { counts.appeared++ }\n else if (d.kind === \"disappeared\") { counts.disappeared++ }\n }\n const totalCorrected = diffs.length\n \n const summaryBar = UILayoutDebugger._el(\"div\", [\n \"padding: 5px 10px\",\n \"border-bottom: 1px solid rgba(255,255,255,0.08)\",\n \"display: flex\",\n \"gap: 8px\",\n \"align-items: center\",\n \"flex-shrink: 0\",\n \"font-size: 10px\",\n \"flex-wrap: wrap\",\n ])\n \n if (totalCorrected === 0) {\n const clean = UILayoutDebugger._el(\"span\", [\"color: #88ff99\", \"font-weight: bold\"])\n clean.textContent = \"\u2713 No stale state detected \u2014 all views were already correct.\"\n summaryBar.appendChild(clean)\n }\n else {\n const total = UILayoutDebugger._el(\"span\", [\"color: #ffaa55\", \"font-weight: bold\"])\n total.textContent = `${totalCorrected} stale view${totalCorrected !== 1 ? \"s\" : \"\"} corrected`\n summaryBar.appendChild(total)\n \n const summaryItems: [string, number, string][] = [\n [\"frame+cache\", counts.both, \"#ffaa55\"],\n [\"frame\", counts.frame, \"#7bc8ff\"],\n [\"cache\", counts.cache, \"#ffcc88\"],\n [\"appeared\", counts.appeared, \"#88ff99\"],\n [\"disappeared\", counts.disappeared, \"#ff8888\"],\n ]\n for (const [label, count, color] of summaryItems) {\n if (count === 0) { continue }\n const chip = UILayoutDebugger._el(\"span\", [`color: ${color}`])\n chip.textContent = `${count} ${label}`\n summaryBar.appendChild(chip)\n }\n }\n \n const passTag = UILayoutDebugger._el(\"span\", [\"color: #5a5a70\", \"margin-left: auto\", \"white-space: nowrap\", \"flex-shrink: 0\"])\n passTag.textContent = passIndex >= 0 ? `forced pass #${passIndex}` : \"\"\n summaryBar.appendChild(passTag)\n panel.appendChild(summaryBar)\n \n // \u2500\u2500 UITextMeasurement global cache summary \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n const tmBefore = result.before.textMeasurement\n const tmAfter = result.after.textMeasurement\n const tmPreparedCleared = tmBefore.preparedCacheSize > 0 && tmAfter.preparedCacheSize === 0\n const tmStyleCleared = tmBefore.styleCacheSize > 0 && tmAfter.styleCacheSize === 0\n const tmKnown = tmBefore.preparedCacheSize >= 0\n \n if (tmKnown) {\n const tmBar = UILayoutDebugger._el(\"div\", [\n \"padding: 4px 10px\",\n \"border-bottom: 1px solid rgba(255,255,255,0.08)\",\n \"display: flex\",\n \"gap: 10px\",\n \"flex-shrink: 0\",\n \"font-size: 9px\",\n \"color: #7060a0\",\n \"flex-wrap: wrap\",\n ])\n const tmLabel = UILayoutDebugger._el(\"span\", [\"color: #7060a0\", \"font-weight: bold\", \"flex-shrink: 0\"])\n tmLabel.textContent = \"UITextMeasurement (global):\"\n tmBar.appendChild(tmLabel)\n \n const prepChip = UILayoutDebugger._el(\"span\", [\n \"color: \" + (tmPreparedCleared ? \"#ffaa55\" : \"#5a5a70\"),\n ])\n prepChip.textContent = `preparedCache ${tmBefore.preparedCacheSize} \u2192 ${tmAfter.preparedCacheSize}` +\n (tmPreparedCleared ? \" \u2713 cleared\" : \"\")\n tmBar.appendChild(prepChip)\n \n const styleChip = UILayoutDebugger._el(\"span\", [\n \"color: \" + (tmStyleCleared ? \"#ffaa55\" : \"#5a5a70\"),\n ])\n styleChip.textContent = `styleCache ${tmBefore.styleCacheSize} \u2192 ${tmAfter.styleCacheSize}` +\n (tmStyleCleared ? \" \u2713 cleared\" : \"\")\n tmBar.appendChild(styleChip)\n \n panel.appendChild(tmBar)\n }\n \n // \u2500\u2500 Filter tabs \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n type StaleFilter = \"all\" | \"frame\" | \"cache\"\n let staleFilter: StaleFilter = totalCorrected > 0 ? \"all\" : \"all\"\n \n const tabBar = UILayoutDebugger._el(\"div\", [\n \"display: flex\",\n \"border-bottom: 1px solid rgba(255,255,255,0.08)\",\n \"flex-shrink: 0\",\n \"font-size: 10px\",\n ])\n \n const list = UILayoutDebugger._el(\"div\", [\n \"overflow-y: auto\",\n \"flex: 1\",\n \"padding: 4px 0\",\n ])\n \n const renderList = (filter: StaleFilter) => {\n list.innerHTML = \"\"\n \n if (diffs.length === 0) {\n const msg = UILayoutDebugger._el(\"div\", [\"padding: 10px 12px\", \"color: #88ff99\", \"font-size: 10px\"])\n msg.textContent = \"\u2713 Nothing was corrected \u2014 no missing invalidations detected.\"\n list.appendChild(msg)\n return\n }\n \n const visible = filter === \"all\"\n ? diffs\n : filter === \"frame\"\n ? diffs.filter(d => d.kind === \"frame\" || d.kind === \"both\")\n : diffs.filter(d => d.kind === \"cache\" || d.kind === \"both\")\n \n if (visible.length === 0) {\n const msg = UILayoutDebugger._el(\"div\", [\"padding: 8px 12px\", \"color: #5a5a70\", \"font-size: 10px\"])\n msg.textContent = \"No items.\"\n list.appendChild(msg)\n return\n }\n \n for (const d of visible) {\n const cacheWrites = forcedPassCacheChanges.get(d.viewIndex) ?? []\n \n const row = UILayoutDebugger._el(\"div\", [\n \"padding: 5px 10px\",\n \"border-bottom: 1px solid rgba(255,255,255,0.05)\",\n \"font-size: 10px\",\n ])\n \n // \u2500\u2500 Top line: kind tag + class + elementID \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n const topLine = UILayoutDebugger._el(\"div\", [\"display: flex\", \"gap: 6px\", \"align-items: baseline\", \"margin-bottom: 2px\"])\n \n const kindColors: Record<UILayoutDebugDiffKind, string> = {\n appeared: \"#88ff99\", disappeared: \"#ff8888\",\n both: \"#ffaa55\", frame: \"#7bc8ff\", cache: \"#ffcc88\", unchanged: \"#5a5a70\",\n }\n const kindTag = UILayoutDebugger._el(\"span\", [\n `color: ${kindColors[d.kind]}`,\n \"flex-shrink: 0\",\n \"font-size: 9px\",\n \"font-weight: bold\",\n \"min-width: 70px\",\n ])\n kindTag.textContent = d.kind.toUpperCase()\n \n const cls = UILayoutDebugger._el(\"span\", [\"color: #ffcc88\", \"font-weight: bold\"])\n cls.textContent = d.className\n \n const eid = UILayoutDebugger._el(\"span\", [\"color: #6a6a80\"])\n eid.textContent = ` #${d.elementID}`\n \n // Jump to the forced pass in the pass inspector\n const jumpBtn = UILayoutDebugger._el(\"span\", [\n \"color: #59599b\",\n \"margin-left: auto\",\n \"font-size: 9px\",\n \"cursor: pointer\",\n \"flex-shrink: 0\",\n ])\n jumpBtn.textContent = `pass #${passIndex} \u2197`\n jumpBtn.title = \"Jump to this view in the forced-layout pass\"\n jumpBtn.onclick = () => {\n const trace = UILayoutDebugger._traces.find(t => t.passIndex === passIndex)\n if (!trace) { return }\n const ti = UILayoutDebugger._traces.indexOf(trace)\n const si = trace.steps.findIndex(s => s.viewIndex === d.viewIndex)\n if (si < 0) { return }\n UILayoutDebugger._replayTraceIndex = ti\n UILayoutDebugger._replayStepIndex = si\n UILayoutDebugger._renderOverlay()\n }\n \n topLine.append(kindTag, cls, eid, jumpBtn)\n row.appendChild(topLine)\n \n // \u2500\u2500 Frame correction \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n if (d.kind === \"frame\" || d.kind === \"both\") {\n const frameLine = UILayoutDebugger._el(\"div\", [\"padding-left: 76px\", \"color: #b0b0c8\", \"font-size: 9px\", \"margin-bottom: 1px\"])\n frameLine.textContent = \"frame: \" + UILayoutDebugger._formatFrameDiff(d.baselineFrame, d.currentFrame)\n row.appendChild(frameLine)\n }\n \n // \u2500\u2500 Cache correction + write cross-reference \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n if (d.kind === \"cache\" || d.kind === \"both\") {\n const cacheLine = UILayoutDebugger._el(\"div\", [\"padding-left: 76px\", \"color: #a0a090\", \"font-size: 9px\", \"margin-bottom: 1px\"])\n cacheLine.textContent = \"cache: \" + UILayoutDebugger._formatCacheDiff(d.baselineCache, d.currentCache)\n row.appendChild(cacheLine)\n \n // Cross-reference: which call paths recomputed the correct value?\n if (cacheWrites.length > 0) {\n const xrefHeader = UILayoutDebugger._el(\"div\", [\n \"padding-left: 76px\",\n \"color: #7060a0\",\n \"font-size: 9px\",\n \"margin-top: 3px\",\n \"margin-bottom: 1px\",\n \"font-weight: bold\",\n ])\n xrefHeader.textContent = `\u21B3 recomputed by (${cacheWrites.length} write${cacheWrites.length !== 1 ? \"s\" : \"\"} in forced pass):`\n row.appendChild(xrefHeader)\n \n for (const ev of cacheWrites) {\n const writeRow = UILayoutDebugger._el(\"div\", [\n \"padding-left: 84px\",\n \"display: flex\",\n \"gap: 5px\",\n \"align-items: baseline\",\n \"font-size: 9px\",\n ])\n \n const keyMatch = ev.cacheKey.match(/h_(\\d+(?:\\.\\d+)?)__w_(\\d+(?:\\.\\d+)?)/)\n const keyLabel = keyMatch\n ? (keyMatch[1] !== \"0\" && keyMatch[2] !== \"0\"\n ? `h\u2264${keyMatch[1]} w\u2264${keyMatch[2]}`\n : keyMatch[2] !== \"0\" ? `w\u2264${keyMatch[2]}` : `h\u2264${keyMatch[1]}`)\n : ev.cacheKey\n \n const keySpan = UILayoutDebugger._el(\"span\", [\"color: #6060808\", \"flex-shrink: 0\"])\n keySpan.textContent = keyLabel\n \n const valSpan = UILayoutDebugger._el(\"span\", [\"color: #88ddff\", \"flex-shrink: 0\"])\n valSpan.textContent = `\u2192 ${ev.newValue.width.toFixed(0)}\u00D7${ev.newValue.height.toFixed(0)}`\n \n const callerSpan = UILayoutDebugger._el(\"span\", [\"color: #7070a8\", \"cursor: pointer\"])\n callerSpan.textContent = ev.callerFunction + \"()\"\n callerSpan.title = ev.cleanStack\n \n let stackOpen = false\n const stackEl = UILayoutDebugger._el(\"div\", [\n \"display: none\",\n \"margin-top: 2px\",\n \"padding: 3px 6px\",\n \"background: rgba(255,255,255,0.04)\",\n \"border-radius: 3px\",\n \"color: #6060808\",\n \"font-size: 9px\",\n \"white-space: pre\",\n \"overflow-x: auto\",\n ])\n stackEl.textContent = ev.cleanStack\n callerSpan.onclick = () => {\n stackOpen = !stackOpen\n stackEl.style.display = stackOpen ? \"block\" : \"none\"\n }\n \n writeRow.append(keySpan, valSpan, callerSpan)\n row.appendChild(writeRow)\n row.appendChild(stackEl)\n }\n }\n }\n \n list.appendChild(row)\n }\n }\n \n const filterTabs: [string, StaleFilter, number, string][] = [\n [\"All\", \"all\", diffs.length, \"#ffaa55\"],\n [\"Frame\", \"frame\", counts.frame + counts.both, \"#7bc8ff\"],\n [\"Cache\", \"cache\", counts.cache + counts.both, \"#ffcc88\"],\n ]\n \n const buildTabs = () => {\n tabBar.innerHTML = \"\"\n for (const [label, filter, count, color] of filterTabs) {\n if (count === 0 && filter !== \"all\") { continue }\n const tab = UILayoutDebugger._el(\"div\", [\n \"padding: 4px 8px\",\n \"cursor: pointer\",\n \"border-bottom: 2px solid \" + (staleFilter === filter ? color : \"transparent\"),\n `color: ${staleFilter === filter ? color : \"#6a6a80\"}`,\n \"white-space: nowrap\",\n \"font-size: 10px\",\n ])\n tab.textContent = `${label} (${count})`\n tab.onclick = () => {\n staleFilter = filter\n buildTabs()\n renderList(staleFilter)\n }\n tabBar.appendChild(tab)\n }\n }\n \n buildTabs()\n panel.appendChild(tabBar)\n panel.appendChild(list)\n renderList(staleFilter)\n \n return panel\n }\n \n \n static _renderHelpPanel(): HTMLElement {\n const panel = UILayoutDebugger._el(\"div\", [\n \"overflow-y: auto\",\n \"flex: 1\",\n \"padding: 14px 16px\",\n \"font-size: 11px\",\n \"line-height: 1.6\",\n \"color: #c0c0d8\",\n ])\n \n const section = (heading: string, body: string) => {\n const h = UILayoutDebugger._el(\"div\", [\n \"font-weight: bold\",\n \"color: #c8d8ff\",\n \"margin-top: 14px\",\n \"margin-bottom: 4px\",\n \"font-size: 11px\",\n \"border-bottom: 1px solid rgba(255,255,255,0.08)\",\n \"padding-bottom: 3px\",\n ])\n h.textContent = heading\n const b = UILayoutDebugger._el(\"div\", [\"color: #a0a0b8\", \"white-space: pre-wrap\"])\n b.textContent = body\n panel.appendChild(h)\n panel.appendChild(b)\n }\n \n const kv = (key: string, value: string) => {\n const row = UILayoutDebugger._el(\"div\", [\"display: flex\", \"gap: 8px\", \"margin-bottom: 4px\"])\n const k = UILayoutDebugger._el(\"span\", [\n \"color: #ffcc88\",\n \"font-weight: bold\",\n \"flex-shrink: 0\",\n \"min-width: 110px\",\n ])\n k.textContent = key\n const v = UILayoutDebugger._el(\"span\", [\"color: #a0a0b8\"])\n v.textContent = value\n row.append(k, v)\n panel.appendChild(row)\n }\n \n // \u2500\u2500 Concepts \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n \n section(\"Core concepts\", \"\")\n \n kv(\"Pass\",\n \"One full run of layoutViewsIfNeeded(). The scheduler collects every \" +\n \"view that called setNeedsLayout() and works through them all. A single \" +\n \"user action typically triggers one pass.\")\n \n kv(\"Iteration\",\n \"One loop of the while-loop inside a pass. Laying out a view can call \" +\n \"setNeedsLayout() on another view, adding it to the queue mid-pass. \" +\n \"The loop repeats until the queue is empty. Most passes have 1 iteration; \" +\n \"more than 1 signals that layout is triggering further layout.\")\n \n kv(\"Step\",\n \"One view being laid out within a pass \u2014 one call to layoutIfNeeded(). \" +\n \"A pass with 8 steps means 8 views had their layout computed. Steps are \" +\n \"the atomic unit you step through in the scrubber.\")\n \n kv(\"Trigger\",\n \"The call stack at the moment setNeedsLayout() was called on a view. \" +\n \"Tells you what caused the view to enter the layout queue.\")\n \n kv(\"Heat colour\",\n \"Green = laid out once. Orange = laid out twice (possible unnecessary work). \" +\n \"Red = laid out 3+ times (likely a layout cycle or redundant invalidation).\")\n \n // \u2500\u2500 Pass inspector \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n \n section(\"Pass inspector\", \"\")\n \n kv(\"Pass picker\",\n \"Selects which recorded pass to inspect. The most recent pass is shown \" +\n \"first. Up to 20 passes are stored.\")\n \n kv(\"\u25C0 \u25B6 scrubber\",\n \"Steps through the views laid out in the selected pass one at a time. \" +\n \"The active view is highlighted in the tree and its frame diff, intrinsic \" +\n \"cache diff, trigger stack, and subview changes are shown above.\")\n \n kv(\"Frame filter\",\n \"All: show every step. Changed: only steps where the frame actually moved \" +\n \"or resized. Unchanged: only no-ops. The counter shows n/total when filtered.\")\n \n kv(\"Compare \u29C9\",\n \"Splits the panel into two columns, each showing an independent pass. \" +\n \"The tree expands and collapses in sync between both columns.\")\n \n kv(\"Cache writes\",\n \"Collapsible section at the bottom of each column. Every write to a \" +\n \"view's intrinsic size cache during that pass is listed, with the value \" +\n \"written and the caller that triggered the measurement.\")\n \n // \u2500\u2500 Baseline / diff \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n \n section(\"Baseline & diff\", \"\")\n \n kv(\"\uD83D\uDCCD Baseline\",\n \"Captures a flat snapshot of every view's frame and intrinsic cache right \" +\n \"now. Requires at least one layout pass to have run so the root view is \" +\n \"known. Click again to recapture.\")\n \n kv(\"\u2295 Diff\",\n \"Captures a second snapshot and shows what changed since the baseline. \" +\n \"Changes are sorted: appeared, disappeared, frame+cache, frame-only, \" +\n \"cache-only. Click any row to jump to the pass that caused that change.\")\n \n kv(\"pass #N tag\",\n \"Shown on each diff row. Indicates the first recorded pass (by pass \" +\n \"number) in which that view was laid out after the baseline was taken.\")\n \n kv(\"\u2B1A Frame / Bounds\",\n \"Toggles how frame comparisons are made across all diff panels. \" +\n \"Frame mode (default): a view is considered changed if its position or \" +\n \"size changed. Bounds mode: only size changes are counted \u2014 origin (x/y) \" +\n \"is ignored. Use bounds mode when you care only about content-affecting \" +\n \"size changes and want to suppress noise from views that merely moved.\")\n \n // \u2500\u2500 Stale layout report \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n \n section(\"Stale layout report \u2622\", \"\")\n \n kv(\"\u2622 Stale\",\n \"The primary tool for finding missing cache invalidations. Click once to \" +\n \"snapshot the current tree state, then immediately call \" +\n \"performForcedSubtreeLayout() for a complete cold remeasure, then diff the \" +\n \"two snapshots. Any view that changed was holding stale/incorrect state \u2014 \" +\n \"its invalidation was missed somewhere.\")\n \n kv(\"Corrected views\",\n \"Each row in the \u2622 panel is a view the forced pass corrected. The kind \" +\n \"tag shows whether the frame, intrinsic cache, or both were stale.\")\n \n kv(\"\u21B3 recomputed by\",\n \"For cache corrections, the exact call path(s) that recomputed the correct \" +\n \"value during the forced pass are listed below each row, with expandable \" +\n \"stack traces. Work backwards from that call site to find where the \" +\n \"corresponding invalidation should have been triggered but wasn't.\")\n \n kv(\"pass #N \u2197\",\n \"Each row has a jump link to the forced-layout pass in the pass inspector \" +\n \"so you can step through the remeasure for that view in full detail.\")\n \n kv(\"Re-run\",\n \"Right-click the \u2622 Stale button (or use \u21BA Re-run in the panel) to re-run \" +\n \"the report without closing and reopening. Useful after you've applied a fix \" +\n \"and want to verify the stale count drops to zero.\")\n \n kv(\"When to use it\",\n \"Reproduce the bug, then immediately click \u2622 Stale before triggering any \" +\n \"other layout. The tree must be in its incorrect state at the moment you \" +\n \"click. The forced layout will correct it, which is visible in the UI after \" +\n \"the report runs.\")\n \n // \u2500\u2500 Live inspector \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n \n section(\"Live inspector \uD83D\uDC41\", \"\")\n \n kv(\"\uD83D\uDC41 Live\",\n \"Shows the current view tree as it exists right now \u2014 not a recorded \" +\n \"snapshot. Frames and cache entries reflect the live DOM state. \" +\n \"Use \u21BA Refresh to re-read after triggering layout manually.\")\n \n // \u2500\u2500 Breakpoints \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n \n section(\"Breakpoint mode \u23F8\", \"\")\n \n kv(\"\u23F8 BP\",\n \"When enabled, a sentinel line executes before every layoutIfNeeded() \" +\n \"call. Set a browser debugger breakpoint on that line to pause before \" +\n \"each step with the full live JS stack in scope.\")\n \n kv(\"Finding the line\",\n \"In Chrome DevTools Sources, press Cmd+Opt+F (Mac) or Ctrl+Shift+F \" +\n \"(Windows) and search for: breakpointOnThisLine\")\n \n // \u2500\u2500 Console API \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n \n section(\"Console API\", \"All methods are on the global UILayoutDebugger object.\")\n \n kv(\"UILayoutDebugger.enable()\", \"Start or stop recording and show/hide the overlay.\")\n kv(\"UILayoutDebugger.disable()\", \"Stop recording and hide the overlay.\")\n kv(\"UILayoutDebugger.enableBreakpoints()\", \"Turn on breakpoint step-through mode.\")\n kv(\"UILayoutDebugger.captureBaseline()\", \"Snapshot current state as baseline.\")\n kv(\"UILayoutDebugger.captureAndDiff()\", \"Snapshot and diff against baseline.\")\n kv(\"UILayoutDebugger.captureStaleLayoutReport()\", \"Snapshot \u2192 forced remeasure \u2192 diff. Primary cache-staleness diagnostic.\")\n kv(\"UILayoutDebugger.clearStaleReport()\", \"Clear the stale report result and close the panel.\")\n kv(\"UILayoutDebugger.clearTraces()\", \"Discard all recorded passes and reset the counter.\")\n kv(\"UILayoutDebugger.goToStep(n)\", \"Jump to step n (0-based) in the current pass.\")\n kv(\"UILayoutDebugger.toggleLiveInspector()\", \"Show or hide the live view tree panel.\")\n kv(\"UILayoutDebugger._boundsBasedDiff = true\", \"Switch all frame diffs to size-only (bounds) mode from the console.\")\n \n return panel\n }\n \n static _renderLiveInspectorPanel(): HTMLElement {\n const panel = UILayoutDebugger._el(\"div\", [\n \"display: flex\",\n \"flex-direction: column\",\n \"flex: 1\",\n \"min-height: 0\",\n \"overflow: hidden\",\n ])\n \n // \u2500\u2500 Header bar \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n const bar = UILayoutDebugger._el(\"div\", [\n \"padding: 5px 10px\",\n \"border-bottom: 1px solid rgba(255,255,255,0.08)\",\n \"display: flex\",\n \"align-items: center\",\n \"gap: 6px\",\n \"flex-shrink: 0\",\n \"font-size: 10px\",\n ])\n \n const barTitle = UILayoutDebugger._el(\"span\", [\"color: #a0a0b8\", \"flex: 1\", \"font-weight: bold\"])\n barTitle.textContent = \"\uD83D\uDC41 Live View Tree\"\n \n const refreshBtn = UILayoutDebugger._el(\"button\", UILayoutDebugger._btnStyle(\"#9090a8\"))\n refreshBtn.textContent = \"\u21BA Refresh\"\n refreshBtn.title = \"Re-capture current state\"\n refreshBtn.onclick = () => UILayoutDebugger._renderOverlay()\n \n const syncBtn = UILayoutDebugger._el(\"button\", UILayoutDebugger._btnStyle(\"#9090a8\"))\n syncBtn.textContent = \"\u21C4 Sync\"\n syncBtn.title = \"Sync collapse/expand state from pass inspector. Views not in the pass inspector are kept collapsed.\"\n syncBtn.onclick = () => {\n // Read the active pass expand state\n const source = UILayoutDebugger._compareMode\n ? UILayoutDebugger._sharedExpandState\n : UILayoutDebugger._singleExpandState\n \n // Build a set of all viewIndices that appear in any recorded trace step\n const tracedViews = new Set<number>()\n for (const trace of UILayoutDebugger._traces) {\n for (const step of trace.steps) { tracedViews.add(step.viewIndex) }\n }\n \n // Copy source state; any viewIndex not in source and not in traced\n // views defaults to collapsed\n const newState = new Map<number, boolean>()\n for (const [idx, expanded] of source) {\n newState.set(idx, expanded)\n }\n // For views present in the live tree but absent from pass inspector\n // state, collapse them unless they appear in a trace\n UILayoutDebugger._walkViewTree(\n UILayoutDebugger._lastKnownRootView,\n new Map(), // discard \u2014 we only need the side effect of visiting indices\n new Set(),\n )\n // Actually walk to collect all live view indices\n const liveIndices = new Set<number>()\n const collectIndices = (view: any, visited: Set<number>) => {\n const idx: number = view?._UIViewIndex ?? -1\n if (idx < 0 || visited.has(idx)) { return }\n visited.add(idx)\n liveIndices.add(idx)\n for (const sv of view?.subviews ?? []) { collectIndices(sv, visited) }\n }\n collectIndices(UILayoutDebugger._lastKnownRootView, new Set())\n \n for (const idx of liveIndices) {\n if (!newState.has(idx)) {\n // Not in pass expand state: expand only if it appears in a trace\n newState.set(idx, tracedViews.has(idx))\n }\n }\n \n UILayoutDebugger._liveExpandState = newState\n UILayoutDebugger._renderOverlay()\n }\n \n bar.append(barTitle, refreshBtn, syncBtn)\n panel.appendChild(bar)\n \n const root = UILayoutDebugger._lastKnownRootView\n if (!root) {\n const msg = UILayoutDebugger._el(\"div\", [\"padding: 10px 12px\", \"color: #6a6a80\", \"font-size: 10px\"])\n msg.textContent = \"No root view found yet \u2014 trigger a layout pass first.\"\n panel.appendChild(msg)\n return panel\n }\n \n // \u2500\u2500 Tree \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n const treeContainer = UILayoutDebugger._el(\"div\", [\n \"overflow-y: auto\",\n \"flex: 1\",\n \"padding: 4px 0\",\n \"position: relative\",\n ])\n \n UILayoutDebugger._renderLiveNode(\n root, treeContainer, 0, new Set(), UILayoutDebugger._liveExpandState\n )\n panel.appendChild(treeContainer)\n return panel\n }\n \n static _renderLiveNode(\n view: any,\n container: HTMLElement,\n depth: number,\n visited: Set<number>,\n expandState: Map<number, boolean>,\n ) {\n const idx: number = view?._UIViewIndex ?? -1\n if (idx < 0 || visited.has(idx)) { return }\n visited.add(idx)\n \n const frame = UILayoutDebugger._captureFrame(view)\n const cache = UILayoutDebugger._captureCache(view)\n const className: string = view?.constructor?.name ?? \"UnknownView\"\n const elementID: string = view?.elementID ?? String(idx)\n const subviews: any[] = view?.subviews ?? []\n const hasChildren = subviews.length > 0\n \n // Default to expanded if not in state map yet\n if (!expandState.has(idx)) { expandState.set(idx, true) }\n let expanded = expandState.get(idx)!\n \n const row = UILayoutDebugger._el(\"div\", [\n \"display: flex\",\n \"align-items: baseline\",\n \"padding: 1px 10px 1px \" + (10 + depth * 12) + \"px\",\n \"cursor: \" + (hasChildren ? \"pointer\" : \"default\"),\n \"border-radius: 3px\",\n \"margin: 0 4px\",\n ])\n \n const chevron = UILayoutDebugger._el(\"span\", [\n \"display: inline-block\", \"width: 10px\", \"flex-shrink: 0\",\n \"color: #7070a0\", \"font-size: 8px\", \"margin-right: 2px\", \"text-align: center\",\n ])\n chevron.textContent = !hasChildren ? \"\" : expanded ? \"\u25BE\" : \"\u25B8\"\n \n const dot = UILayoutDebugger._el(\"span\", [\n \"display: inline-block\", \"width: 7px\", \"height: 7px\",\n \"border-radius: 50%\", \"margin-right: 5px\", \"flex-shrink: 0\",\n \"background: #4a4a5a\",\n ])\n \n const classSpan = UILayoutDebugger._el(\"span\", [\"color: #9090a8\"])\n classSpan.textContent = className\n \n const eidSpan = UILayoutDebugger._el(\"span\", [\"color: #6a6a80\", \"margin-left: 4px\"])\n eidSpan.textContent = `#${elementID}`\n \n const frameSpan = UILayoutDebugger._el(\"span\", [\"color: #55556a\", \"margin-left: 4px\", \"font-size: 9px\"])\n frameSpan.textContent = frame\n ? `${frame.left.toFixed(0)},${frame.top.toFixed(0)} ${frame.width.toFixed(0)}\u00D7${frame.height.toFixed(0)}`\n : \"\"\n \n row.append(chevron, dot, classSpan, eidSpan, frameSpan)\n \n row.title = [\n `${className} #${elementID}`,\n frame\n ? `frame: ${frame.left.toFixed(1)},${frame.top.toFixed(1)} ${frame.width.toFixed(1)}\u00D7${frame.height.toFixed(1)}`\n : \"frame: (none)\",\n \"cache: \" + UILayoutDebugger._formatCacheSnapshot(cache),\n ].join(\"\\n\")\n \n container.appendChild(row)\n \n if (!hasChildren) { return }\n \n const childContainer = UILayoutDebugger._el(\"div\", [\n \"display: \" + (expanded ? \"block\" : \"none\"),\n ])\n container.appendChild(childContainer)\n \n for (const sv of subviews) {\n UILayoutDebugger._renderLiveNode(sv, childContainer, depth + 1, visited, expandState)\n }\n \n row.onclick = () => {\n expanded = !expanded\n expandState.set(idx, expanded)\n childContainer.style.display = expanded ? \"block\" : \"none\"\n chevron.textContent = expanded ? \"\u25BE\" : \"\u25B8\"\n }\n }\n \n static _renderDiffPanel(\n baseline: UILayoutDebugStateSnapshot,\n current: UILayoutDebugStateSnapshot,\n onNavigate: (viewIndex: number) => void,\n baselineTakenAt: number,\n ): HTMLElement {\n const panel = UILayoutDebugger._el(\"div\", [\n \"display: flex\",\n \"flex-direction: column\",\n \"flex: 1\",\n \"min-height: 0\",\n \"overflow: hidden\",\n ])\n \n // \u2500\u2500 Summary bar \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n const diffs = UILayoutDebugger._diffSnapshots(baseline, current)\n const counts = { appeared: 0, disappeared: 0, frame: 0, cache: 0, both: 0, unchanged: 0 }\n for (const d of diffs) { counts[d.kind]++ }\n const changed = counts.appeared + counts.disappeared + counts.frame + counts.cache + counts.both\n \n const summaryBar = UILayoutDebugger._el(\"div\", [\n \"padding: 5px 10px\",\n \"border-bottom: 1px solid rgba(255,255,255,0.08)\",\n \"display: flex\",\n \"gap: 8px\",\n \"align-items: center\",\n \"flex-shrink: 0\",\n \"font-size: 10px\",\n \"flex-wrap: wrap\",\n ])\n \n const summaryItems: [string, number, string][] = [\n [\"appeared\", counts.appeared, \"#88ff99\"],\n [\"disappeared\", counts.disappeared, \"#ff8888\"],\n [\"frame+cache\", counts.both, \"#ffaa55\"],\n [\"frame\", counts.frame, \"#7bc8ff\"],\n [\"cache\", counts.cache, \"#ffcc88\"],\n [\"unchanged\", counts.unchanged, \"#5a5a70\"],\n ]\n for (const [label, count, color] of summaryItems) {\n if (count === 0) { continue }\n const chip = UILayoutDebugger._el(\"span\", [`color: ${color}`])\n chip.textContent = `${count} ${label}`\n summaryBar.appendChild(chip)\n }\n if (changed === 0) {\n const chip = UILayoutDebugger._el(\"span\", [\"color: #9090a8\"])\n chip.textContent = \"No changes\"\n summaryBar.appendChild(chip)\n }\n \n const ts = UILayoutDebugger._el(\"span\", [\"color: #5a5a70\", \"margin-left: auto\", \"white-space: nowrap\"])\n const elapsed = ((current.takenAt - baseline.takenAt) / 1000).toFixed(1)\n ts.textContent = `+${elapsed}s`\n summaryBar.appendChild(ts)\n \n panel.appendChild(summaryBar)\n \n // \u2500\u2500 Filter tabs \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n let diffFilter: UILayoutDebugDiffKind | \"all\" = changed > 0 ? \"frame\" : \"all\"\n \n const tabBar = UILayoutDebugger._el(\"div\", [\n \"display: flex\",\n \"border-bottom: 1px solid rgba(255,255,255,0.08)\",\n \"flex-shrink: 0\",\n \"font-size: 10px\",\n ])\n \n const list = UILayoutDebugger._el(\"div\", [\n \"overflow-y: auto\",\n \"flex: 1\",\n \"padding: 4px 0\",\n ])\n \n const renderList = (filter: UILayoutDebugDiffKind | \"all\") => {\n list.innerHTML = \"\"\n const visible = filter === \"all\"\n ? diffs\n : diffs.filter(d => d.kind === filter || (filter === \"frame\" && d.kind === \"both\"))\n \n if (visible.length === 0) {\n const msg = UILayoutDebugger._el(\"div\", [\"padding: 8px 12px\", \"color: #5a5a70\"])\n msg.textContent = \"No items.\"\n list.appendChild(msg)\n return\n }\n \n for (const d of visible) {\n const kindColors: Record<UILayoutDebugDiffKind, string> = {\n appeared: \"#88ff99\", disappeared: \"#ff8888\",\n both: \"#ffaa55\", frame: \"#7bc8ff\", cache: \"#ffcc88\", unchanged: \"#5a5a70\",\n }\n \n // Find which pass first changed this view after the baseline\n const causingTrace = d.kind !== \"disappeared\"\n ? UILayoutDebugger._findCausingTrace(d.viewIndex, baselineTakenAt)\n : null\n const hasTrace = !!causingTrace\n \n const row = UILayoutDebugger._el(\"div\", [\n \"padding: 3px 10px\",\n \"border-bottom: 1px solid rgba(255,255,255,0.04)\",\n \"font-size: 10px\",\n hasTrace ? \"cursor: pointer\" : \"cursor: default\",\n ])\n if (hasTrace) {\n row.title = `Click to jump to pass #${causingTrace!.passIndex} in the pass inspector`\n row.onmouseenter = () => { row.style.background = \"rgba(255,255,255,0.06)\" }\n row.onmouseleave = () => { row.style.background = \"\" }\n row.onclick = () => onNavigate(d.viewIndex)\n }\n \n const topLine = UILayoutDebugger._el(\"div\", [\"display: flex\", \"gap: 6px\", \"align-items: baseline\"])\n \n const kindTag = UILayoutDebugger._el(\"span\", [\n `color: ${kindColors[d.kind]}`,\n \"flex-shrink: 0\",\n \"font-size: 9px\",\n \"font-weight: bold\",\n \"min-width: 70px\",\n ])\n kindTag.textContent = d.kind.toUpperCase()\n \n const cls = UILayoutDebugger._el(\"span\", [\"color: #ffcc88\", \"font-weight: bold\"])\n cls.textContent = d.className\n \n const eid = UILayoutDebugger._el(\"span\", [\"color: #6a6a80\"])\n eid.textContent = `#${d.elementID}`\n \n if (causingTrace) {\n const passTag = UILayoutDebugger._el(\"span\", [\n \"color: #59599b\",\n \"margin-left: auto\",\n \"font-size: 9px\",\n \"flex-shrink: 0\",\n ])\n passTag.textContent = `pass #${causingTrace.passIndex}`\n topLine.append(kindTag, cls, eid, passTag)\n }\n else {\n topLine.append(kindTag, cls, eid)\n }\n row.appendChild(topLine)\n \n if (d.kind !== \"appeared\" && d.kind !== \"disappeared\") {\n if (d.kind === \"frame\" || d.kind === \"both\") {\n const frameLine = UILayoutDebugger._el(\"div\", [\"padding-left: 76px\", \"color: #b0b0c8\", \"font-size: 9px\"])\n frameLine.textContent = \"frame: \" + UILayoutDebugger._formatFrameDiff(d.baselineFrame, d.currentFrame)\n row.appendChild(frameLine)\n }\n if (d.kind === \"cache\" || d.kind === \"both\") {\n const cacheLine = UILayoutDebugger._el(\"div\", [\"padding-left: 76px\", \"color: #a0a090\", \"font-size: 9px\"])\n cacheLine.textContent = \"cache: \" + UILayoutDebugger._formatCacheDiff(d.baselineCache, d.currentCache)\n row.appendChild(cacheLine)\n }\n }\n else {\n const frameLine = UILayoutDebugger._el(\"div\", [\"padding-left: 76px\", \"color: #b0b0c8\", \"font-size: 9px\"])\n frameLine.textContent = \"frame: \" + UILayoutDebugger._formatFrame(\n d.kind === \"appeared\" ? d.currentFrame : d.baselineFrame\n )\n row.appendChild(frameLine)\n }\n \n list.appendChild(row)\n }\n }\n \n const tabs: [string, UILayoutDebugDiffKind | \"all\", number, string][] = [\n [\"All\", \"all\", diffs.length, \"#9090a8\"],\n [\"Frame\", \"frame\", counts.frame + counts.both, \"#7bc8ff\"],\n [\"Cache\", \"cache\", counts.cache + counts.both, \"#ffcc88\"],\n [\"Appeared\", \"appeared\", counts.appeared, \"#88ff99\"],\n [\"Disappeared\", \"disappeared\", counts.disappeared, \"#ff8888\"],\n ]\n \n const buildTabs = () => {\n tabBar.innerHTML = \"\"\n for (const [label, filter, count, color] of tabs) {\n if (count === 0 && filter !== \"all\") { continue }\n const tab = UILayoutDebugger._el(\"div\", [\n \"padding: 4px 8px\",\n \"cursor: pointer\",\n \"border-bottom: 2px solid \" + (diffFilter === filter ? color : \"transparent\"),\n `color: ${diffFilter === filter ? color : \"#6a6a80\"}`,\n \"white-space: nowrap\",\n \"font-size: 10px\",\n ])\n tab.textContent = `${label} (${count})`\n tab.onclick = () => {\n diffFilter = filter\n buildTabs()\n renderList(diffFilter)\n }\n tabBar.appendChild(tab)\n }\n }\n \n buildTabs()\n panel.appendChild(tabBar)\n panel.appendChild(list)\n renderList(diffFilter)\n \n return panel\n }\n \n static _renderStepDetail(activeStep: UILayoutDebugStep): HTMLElement {\n const detail = UILayoutDebugger._el(\"div\", [\n \"padding: 6px 10px\",\n \"border-bottom: 1px solid rgba(255,255,255,0.08)\",\n \"flex-shrink: 0\",\n \"font-size: 10px\",\n ])\n \n const titleRow = UILayoutDebugger._el(\"div\", [\"margin-bottom: 3px\"])\n \n const stepTag = UILayoutDebugger._el(\"span\", [\n \"background: #2a2a44\",\n \"border-radius: 3px\",\n \"padding: 0 4px\",\n \"margin-right: 5px\",\n \"color: #aac8ff\",\n \"font-weight: bold\",\n ])\n stepTag.textContent = `step ${activeStep.stepIndex}`\n \n const iterTag = UILayoutDebugger._el(\"span\", [\"color: #9090a8\", \"margin-right: 6px\"])\n iterTag.textContent = `iter ${activeStep.iteration + 1}`\n \n const className = UILayoutDebugger._el(\"span\", [\"color: #ffcc88\", \"font-weight: bold\"])\n className.textContent = activeStep.className\n \n const eid = UILayoutDebugger._el(\"span\", [\"color: #9090a8\", \"margin-left: 4px\"])\n eid.textContent = `#${activeStep.elementID}`\n \n titleRow.append(stepTag, iterTag, className, eid)\n detail.appendChild(titleRow)\n \n const frameRow = UILayoutDebugger._el(\"div\", [\"color: #c0c0d8\", \"margin-bottom: 2px\"])\n frameRow.textContent = \"frame: \" + UILayoutDebugger._formatFrameDiff(activeStep.frameBefore, activeStep.frameAfter)\n detail.appendChild(frameRow)\n \n // \u2500\u2500 Intrinsic cache diff \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n const cacheDiffStr = UILayoutDebugger._formatCacheDiff(activeStep.cacheBefore, activeStep.cacheAfter)\n const cacheRow = UILayoutDebugger._el(\"div\", [\"margin-bottom: 3px\"])\n \n const cacheLabel = UILayoutDebugger._el(\"span\", [\"color: #8888a0\", \"margin-right: 4px\"])\n cacheLabel.textContent = \"cache:\"\n \n const cacheChanged =\n (activeStep.cacheBefore?.entryCount ?? 0) !== (activeStep.cacheAfter?.entryCount ?? 0) ||\n cacheDiffStr.includes(\"~\") || cacheDiffStr.includes(\"+\") || cacheDiffStr.includes(\"-\")\n \n const cacheSummary = UILayoutDebugger._el(\"span\", [\n \"color: \" + (cacheChanged ? \"#ffcc88\" : \"#7878a0\"),\n \"cursor: pointer\",\n \"font-weight: \" + (cacheChanged ? \"bold\" : \"normal\"),\n ])\n const bCount = activeStep.cacheBefore?.entryCount ?? 0\n const aCount = activeStep.cacheAfter?.entryCount ?? 0\n cacheSummary.textContent = bCount === aCount\n ? `${aCount} entr${aCount === 1 ? \"y\" : \"ies\"}${cacheChanged ? \" (changed)\" : \"\"}`\n : `${bCount} \u2192 ${aCount} entries`\n \n let cacheExpanded = false\n const cacheDetail = UILayoutDebugger._el(\"div\", [\n \"display: none\",\n \"margin-top: 2px\",\n \"padding: 4px 6px\",\n \"background: rgba(255,255,255,0.04)\",\n \"border-radius: 3px\",\n \"color: #9090a8\",\n \"font-size: 9px\",\n \"line-height: 1.6\",\n \"white-space: pre\",\n ])\n cacheDetail.textContent = cacheDiffStr\n \n cacheSummary.onclick = () => {\n cacheExpanded = !cacheExpanded\n cacheDetail.style.display = cacheExpanded ? \"block\" : \"none\"\n }\n \n cacheRow.append(cacheLabel, cacheSummary)\n detail.appendChild(cacheRow)\n detail.appendChild(cacheDetail)\n \n const trigger = activeStep.trigger\n const triggerRow = UILayoutDebugger._el(\"div\", [\"margin-top: 4px\", \"margin-bottom: 2px\"])\n if (trigger) {\n const triggerLabel = UILayoutDebugger._el(\"span\", [\"color: #8888a0\", \"margin-right: 4px\"])\n triggerLabel.textContent = \"setNeedsLayout from\"\n \n const triggerFn = UILayoutDebugger._el(\"span\", [\"color: #88ddff\", \"font-weight: bold\", \"cursor: pointer\"])\n triggerFn.textContent = trigger.callerFunction + \"()\"\n triggerFn.title = trigger.cleanStack\n \n let stackExpanded = false\n const stackEl = UILayoutDebugger._el(\"div\", [\n \"display: none\",\n \"margin-top: 3px\",\n \"padding: 4px 6px\",\n \"background: rgba(255,255,255,0.04)\",\n \"border-radius: 3px\",\n \"color: #7878a0\",\n \"font-size: 9px\",\n \"line-height: 1.5\",\n \"white-space: pre\",\n \"overflow-x: auto\",\n ])\n stackEl.textContent = trigger.cleanStack\n \n triggerFn.onclick = () => {\n stackExpanded = !stackExpanded\n stackEl.style.display = stackExpanded ? \"block\" : \"none\"\n }\n \n triggerRow.append(triggerLabel, triggerFn)\n detail.appendChild(triggerRow)\n detail.appendChild(stackEl)\n }\n else {\n const triggerLabel = UILayoutDebugger._el(\"span\", [\"color: #5a5a70\"])\n triggerLabel.textContent = \"setNeedsLayout trigger not captured\"\n triggerRow.appendChild(triggerLabel)\n detail.appendChild(triggerRow)\n }\n \n if (activeStep.subviewRecords.length > 0) {\n const svHeader = UILayoutDebugger._el(\"div\", [\"color: #8888a0\", \"margin-top: 4px\", \"margin-bottom: 2px\"])\n svHeader.textContent = `Subviews set (${activeStep.subviewRecords.length}):`\n detail.appendChild(svHeader)\n \n for (const sv of activeStep.subviewRecords) {\n const svRow = UILayoutDebugger._el(\"div\", [\"padding-left: 8px\", \"color: #a0a0b8\"])\n const svClass = UILayoutDebugger._el(\"span\", [\"color: #d8aacc\"])\n svClass.textContent = sv.className\n const svEid = UILayoutDebugger._el(\"span\", [\"color: #6a6a80\"])\n svEid.textContent = ` #${sv.elementID} `\n const svFrames = UILayoutDebugger._el(\"span\", [\"color: #9090a8\"])\n svFrames.textContent = UILayoutDebugger._formatFrameDiff(sv.frameBefore, sv.frameAfter)\n svRow.append(svClass, svEid, svFrames)\n detail.appendChild(svRow)\n }\n }\n \n return detail\n }\n \n static _subtreeHasTouched(node: UILayoutDebugTreeNode, countMap: Map<number, number>): boolean {\n if ((countMap.get(node.viewIndex) ?? 0) > 0) { return true }\n for (const child of node.children) {\n if (UILayoutDebugger._subtreeHasTouched(child, countMap)) { return true }\n }\n return false\n }\n \n static _subtreeContains(node: UILayoutDebugTreeNode, viewIndex: number): boolean {\n if (node.viewIndex === viewIndex) { return true }\n for (const child of node.children) {\n if (UILayoutDebugger._subtreeContains(child, viewIndex)) { return true }\n }\n return false\n }\n \n static _renderTreeNode(\n node: UILayoutDebugTreeNode,\n container: HTMLElement,\n countMap: Map<number, number>,\n activeViewIndex: number,\n expandState: Map<number, boolean> | null,\n stepMap: Map<number, UILayoutDebugStep>,\n ): HTMLElement | null {\n const count = countMap.get(node.viewIndex) ?? 0\n const isActive = node.viewIndex === activeViewIndex && activeViewIndex >= 0\n const hasChildren = node.children.length > 0\n \n // Expand only if this node is on the path to the active view.\n // If there is no active view, fall back to \"has touched descendants\"\n // so the tree isn't entirely collapsed before any step is selected.\n const isAncestorOfActive = activeViewIndex >= 0\n ? UILayoutDebugger._subtreeContains(node, activeViewIndex)\n : node.children.some(c => UILayoutDebugger._subtreeHasTouched(c, countMap))\n const defaultExpanded = isAncestorOfActive || isActive\n \n let childrenExpanded: boolean\n if (expandState !== null) {\n if (!expandState.has(node.viewIndex)) {\n expandState.set(node.viewIndex, defaultExpanded)\n }\n childrenExpanded = expandState.get(node.viewIndex)!\n }\n else {\n childrenExpanded = defaultExpanded\n }\n \n // \u2500\u2500 Row \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n const row = UILayoutDebugger._el(\"div\", [\n \"display: flex\",\n \"align-items: baseline\",\n \"padding: 1px 10px 1px \" + (10 + node.depth * 12) + \"px\",\n \"cursor: \" + (hasChildren ? \"pointer\" : \"default\"),\n \"border-radius: 3px\",\n \"margin: 0 4px\",\n isActive\n ? \"background: rgba(100,120,220,0.35); outline: 1px solid #59599b\"\n : \"background: transparent\",\n ])\n \n // Expand/collapse chevron\n const chevron = UILayoutDebugger._el(\"span\", [\n \"display: inline-block\",\n \"width: 10px\",\n \"flex-shrink: 0\",\n \"color: #7070a0\",\n \"font-size: 8px\",\n \"margin-right: 2px\",\n \"text-align: center\",\n ])\n chevron.textContent = !hasChildren ? \"\" : childrenExpanded ? \"\u25BE\" : \"\u25B8\"\n \n // Heat dot\n const dot = UILayoutDebugger._el(\"span\", [\n \"display: inline-block\",\n \"width: 7px\",\n \"height: 7px\",\n \"border-radius: 50%\",\n \"margin-right: 5px\",\n \"flex-shrink: 0\",\n \"background: \" + UILayoutDebugger._heatColor(count),\n ])\n \n // Untouched nodes are muted; touched nodes are bright\n const untouchedColor = count === 0 ? \"#9090a8\" : \"#ffcc88\"\n const className = UILayoutDebugger._el(\"span\", [\n \"color: \" + untouchedColor,\n \"font-weight: \" + (count > 0 ? \"bold\" : \"normal\"),\n ])\n className.textContent = node.className\n \n const eid = UILayoutDebugger._el(\"span\", [\n \"color: \" + (count === 0 ? \"#6a6a80\" : \"#a0a0b8\"),\n \"margin-left: 4px\",\n ])\n eid.textContent = `#${node.elementID}`\n \n const frameStr = node.frame\n ? ` ${node.frame.left.toFixed(0)},${node.frame.top.toFixed(0)} ${node.frame.width.toFixed(0)}\u00D7${node.frame.height.toFixed(0)}`\n : \"\"\n const frameSpan = UILayoutDebugger._el(\"span\", [\n \"color: \" + (count === 0 ? \"#55556a\" : \"#7878a0\"),\n \"margin-left: 4px\",\n ])\n frameSpan.textContent = frameStr\n \n // For touched nodes, show what changed in this pass inline\n const step = stepMap.get(node.viewIndex)\n const frameChanged = step\n ? !UILayoutDebugger._framesEqual(step.frameBefore, step.frameAfter)\n : false\n const cacheChanged = step\n ? !UILayoutDebugger._cachesEqual(step.cacheBefore, step.cacheAfter)\n : false\n \n const deltaSpan = UILayoutDebugger._el(\"span\", [\n \"margin-left: 5px\",\n \"font-size: 9px\",\n \"flex-shrink: 0\",\n ])\n if (frameChanged && cacheChanged) {\n deltaSpan.style.color = \"#ffaa55\"\n deltaSpan.textContent = \"frame+cache\"\n }\n else if (frameChanged) {\n deltaSpan.style.color = \"#7bc8ff\"\n deltaSpan.textContent = UILayoutDebugger._formatFrameDiff(step!.frameBefore, step!.frameAfter)\n }\n else if (cacheChanged) {\n deltaSpan.style.color = \"#ffcc88\"\n deltaSpan.textContent = \"cache changed\"\n }\n \n if (count > 0) {\n const countBadge = UILayoutDebugger._el(\"span\", [\n \"margin-left: 5px\",\n \"background: \" + UILayoutDebugger._heatColor(count),\n \"color: #000\",\n \"border-radius: 8px\",\n \"padding: 0 4px\",\n \"font-size: 9px\",\n \"font-weight: bold\",\n ])\n countBadge.textContent = String(count) + \"\u00D7\"\n if (frameChanged || cacheChanged) {\n row.append(chevron, dot, className, eid, frameSpan, deltaSpan, countBadge)\n }\n else {\n row.append(chevron, dot, className, eid, frameSpan, countBadge)\n }\n }\n else {\n row.append(chevron, dot, className, eid, frameSpan)\n }\n \n // Tooltip on hover\n const cacheStr = UILayoutDebugger._formatCacheSnapshot(node.cacheAfterPass)\n const tooltipLines = [\n node.className + \" #\" + node.elementID,\n \"viewIndex: \" + node.viewIndex,\n node.frame\n ? `frame: ${node.frame.left.toFixed(1)}, ${node.frame.top.toFixed(1)} ${node.frame.width.toFixed(1)}\u00D7${node.frame.height.toFixed(1)}`\n : \"frame: (none)\",\n \"laid out: \" + count + \"\u00D7\",\n \"intrinsic cache (post-pass): \" + cacheStr,\n ]\n if (step && frameChanged) {\n tooltipLines.push(\"frame \u0394: \" + UILayoutDebugger._formatFrameDiff(step.frameBefore, step.frameAfter))\n }\n if (step && cacheChanged) {\n tooltipLines.push(\"cache \u0394: \" + UILayoutDebugger._formatCacheDiff(step.cacheBefore, step.cacheAfter))\n }\n row.title = tooltipLines.join(\"\\n\")\n \n container.appendChild(row)\n \n // \u2500\u2500 Children container \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n if (!hasChildren) { return isActive ? row : null }\n \n const childContainer = UILayoutDebugger._el(\"div\", [\n \"display: \" + (childrenExpanded ? \"block\" : \"none\"),\n ])\n container.appendChild(childContainer)\n \n let activeRow: HTMLElement | null = isActive ? row : null\n \n for (const child of node.children) {\n const result = UILayoutDebugger._renderTreeNode(\n child, childContainer, countMap, activeViewIndex, expandState, stepMap\n )\n if (result) { activeRow = result }\n }\n \n // Toggle expand/collapse on row click.\n row.onclick = () => {\n childrenExpanded = !childrenExpanded\n if (expandState !== null) {\n expandState.set(node.viewIndex, childrenExpanded)\n }\n childContainer.style.display = childrenExpanded ? \"block\" : \"none\"\n chevron.textContent = childrenExpanded ? \"\u25BE\" : \"\u25B8\"\n }\n \n return activeRow\n }\n \n \n // \u2500\u2500 Formatting helpers \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n \n static _formatFrame(f: UILayoutDebugFrame | null): string {\n if (!f) { return \"(none)\" }\n return `${f.left.toFixed(0)},${f.top.toFixed(0)} ${f.width.toFixed(0)}\u00D7${f.height.toFixed(0)}`\n }\n \n static _formatFrameDiff(\n before: UILayoutDebugFrame | null,\n after: UILayoutDebugFrame | null\n ): string {\n if (!before && !after) { return \"(no frame data)\" }\n const bounds = UILayoutDebugger._boundsBasedDiff\n const fmt = (f: UILayoutDebugFrame | null) => {\n if (!f) { return \"(none)\" }\n return bounds\n ? `${f.width.toFixed(0)}\u00D7${f.height.toFixed(0)}`\n : UILayoutDebugger._formatFrame(f)\n }\n if (!before) { return `\u2192 ${fmt(after)}` }\n if (!after) { return `${fmt(before)} \u2192 (none)` }\n const changed = bounds\n ? (before.width !== after.width || before.height !== after.height)\n : (before.left !== after.left || before.top !== after.top ||\n before.width !== after.width || before.height !== after.height)\n if (!changed) {\n return `= ${fmt(after)}`\n }\n return `${fmt(before)} \u2192 ${fmt(after)}`\n }\n \n static _formatCacheSnapshot(c: UILayoutDebugCacheSnapshot | null): string {\n if (!c) { return \"(none)\" }\n const lines: string[] = []\n if (c.entryCount === 0) {\n lines.push(\"intrinsic: empty\")\n }\n else {\n const intrinsicLines = Object.entries(c.entries).map(([key, val]) => {\n const match = key.match(/h_(\\d+(?:\\.\\d+)?)__w_(\\d+(?:\\.\\d+)?)/)\n const label = match\n ? (match[1] !== \"0\" && match[2] !== \"0\"\n ? `h\u2264${match[1]} w\u2264${match[2]}`\n : match[2] !== \"0\" ? `w\u2264${match[2]}` : `h\u2264${match[1]}`)\n : key\n return ` ${label}: ${val.width.toFixed(0)}\u00D7${val.height.toFixed(0)}`\n })\n const prefix = c.isShared ? `shared(${c.sharedKey}) ` : \"\"\n lines.push(`${prefix}${c.entryCount} entr${c.entryCount === 1 ? \"y\" : \"ies\"}`)\n lines.push(...intrinsicLines)\n }\n lines.push(c.hasFrameCache\n ? `frameCache: ${UILayoutDebugger._formatFrame(c.frameCache)}`\n : \"frameCache: (empty)\")\n lines.push(c.hasVirtualFrameCache\n ? `virtualFrameCache: ${UILayoutDebugger._formatFrame(c.virtualFrameCache)}`\n : \"virtualFrameCache: (empty)\")\n return lines.join(\"\\n\")\n }\n \n static _formatCacheDiff(\n before: UILayoutDebugCacheSnapshot | null,\n after: UILayoutDebugCacheSnapshot | null\n ): string {\n if (!before && !after) { return \"(no cache data)\" }\n const bCount = before?.entryCount ?? 0\n const aCount = after?.entryCount ?? 0\n if (bCount === 0 && aCount === 0 && !before?.hasFrameCache && !after?.hasFrameCache && !before?.hasVirtualFrameCache && !after?.hasVirtualFrameCache) { return \"empty \u2192 empty\" }\n \n const lines: string[] = []\n const allKeys = new Set([\n ...Object.keys(before?.entries ?? {}),\n ...Object.keys(after?.entries ?? {}),\n ])\n for (const key of allKeys) {\n const b = before?.entries[key]\n const a = after?.entries[key]\n const match = key.match(/h_(\\d+(?:\\.\\d+)?)__w_(\\d+(?:\\.\\d+)?)/)\n const label = match\n ? (match[1] !== \"0\" && match[2] !== \"0\"\n ? `h\u2264${match[1]} w\u2264${match[2]}`\n : match[2] !== \"0\" ? `w\u2264${match[2]}` : `h\u2264${match[1]}`)\n : key\n if (!b) {\n lines.push(` + ${label}: ${a!.width.toFixed(0)}\u00D7${a!.height.toFixed(0)}`)\n }\n else if (!a) {\n lines.push(` - ${label}: ${b.width.toFixed(0)}\u00D7${b.height.toFixed(0)}`)\n }\n else if (b.width !== a.width || b.height !== a.height) {\n lines.push(` ~ ${label}: ${b.width.toFixed(0)}\u00D7${b.height.toFixed(0)} \u2192 ${a.width.toFixed(0)}\u00D7${a.height.toFixed(0)}`)\n }\n else {\n lines.push(` = ${label}: ${a.width.toFixed(0)}\u00D7${a.height.toFixed(0)}`)\n }\n }\n \n // Frame cache diff\n const bHasF = before?.hasFrameCache ?? false\n const aHasF = after?.hasFrameCache ?? false\n if (bHasF || aHasF) {\n if (bHasF && !aHasF) {\n lines.push(` - frameCache: ${UILayoutDebugger._formatFrame(before!.frameCache)}`)\n }\n else if (!bHasF && aHasF) {\n lines.push(` + frameCache: ${UILayoutDebugger._formatFrame(after!.frameCache)}`)\n }\n else {\n const bf = before!.frameCache, af = after!.frameCache\n const changed = !bf || !af || bf.top !== af.top || bf.left !== af.left || bf.width !== af.width || bf.height !== af.height\n lines.push(changed\n ? ` ~ frameCache: ${UILayoutDebugger._formatFrame(bf)} \u2192 ${UILayoutDebugger._formatFrame(af)}`\n : ` = frameCache: ${UILayoutDebugger._formatFrame(af)}`)\n }\n }\n else {\n lines.push(\" = frameCache: (empty)\")\n }\n \n // Virtual frame cache diff\n const bHasV = before?.hasVirtualFrameCache ?? false\n const aHasV = after?.hasVirtualFrameCache ?? false\n if (bHasV || aHasV) {\n if (bHasV && !aHasV) {\n lines.push(` - virtualFrameCache: ${UILayoutDebugger._formatFrame(before!.virtualFrameCache)}`)\n }\n else if (!bHasV && aHasV) {\n lines.push(` + virtualFrameCache: ${UILayoutDebugger._formatFrame(after!.virtualFrameCache)}`)\n }\n else {\n const bv = before!.virtualFrameCache, av = after!.virtualFrameCache\n const changed = !bv || !av || bv.top !== av.top || bv.left !== av.left || bv.width !== av.width || bv.height !== av.height\n lines.push(changed\n ? ` ~ virtualFrameCache: ${UILayoutDebugger._formatFrame(bv)} \u2192 ${UILayoutDebugger._formatFrame(av)}`\n : ` = virtualFrameCache: ${UILayoutDebugger._formatFrame(av)}`)\n }\n }\n \n const header = bCount === aCount\n ? `${aCount} entr${aCount === 1 ? \"y\" : \"ies\"}`\n : `${bCount} \u2192 ${aCount} entries`\n return lines.length ? `${header}\\n${lines.join(\"\\n\")}` : header\n }\n \n static _heatColor(count: number): string {\n if (count === 0) { return \"#4a4a5a\" }\n if (count === 1) { return \"#3a8\" }\n if (count === 2) { return \"#e80\" }\n return \"#d33\"\n }\n \n static _el(tag: string, styles: string[]): HTMLElement {\n const el = document.createElement(tag)\n el.style.cssText = styles.join(\"; \")\n return el\n }\n \n static _btnStyle(color: string): string[] {\n return [\n `color: ${color}`,\n \"background: rgba(255,255,255,0.06)\",\n \"border: 1px solid rgba(255,255,255,0.1)\",\n \"border-radius: 4px\",\n \"padding: 1px 6px\",\n \"font: inherit\",\n \"cursor: pointer\",\n \"flex-shrink: 0\",\n ]\n }\n \n \n // \u2500\u2500 Drag-to-move \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n \n static _makeDraggable(panel: HTMLElement) {\n let dragging = false\n let startX = 0, startY = 0, origRight = 8, origTop = 8\n \n panel.addEventListener(\"mousedown\", (e: MouseEvent) => {\n const target = e.target as HTMLElement\n if (!target.closest(\"[data-drag-handle]\")) { return }\n dragging = true\n startX = e.clientX\n startY = e.clientY\n origRight = parseInt(panel.style.right, 10) || 8\n origTop = parseInt(panel.style.top, 10) || 8\n e.preventDefault()\n })\n \n document.addEventListener(\"mousemove\", (e: MouseEvent) => {\n if (!dragging) { return }\n const dx = e.clientX - startX\n const dy = e.clientY - startY\n panel.style.right = (origRight - dx) + \"px\"\n panel.style.top = (origTop + dy) + \"px\"\n })\n \n document.addEventListener(\"mouseup\", () => { dragging = false })\n }\n \n}\n\n\n// \u2500\u2500 Window registration & global helpers \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nwindow.UILayoutDebugger = UILayoutDebugger\n\ndeclare global {\n interface Window {\n UILayoutDebugger?: typeof UILayoutDebugger\n }\n}\n\n/// #endif\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA4MO,MAAM,oBAAN,MAAuB;AAAA,EAU1B,WAAW,YAAqB;AAAE,WAAO,kBAAiB;AAAA,EAAW;AAAA,EACrE,WAAW,qBAA8B;AAAE,WAAO,kBAAiB;AAAA,EAAoB;AAAA,EAoFvF,OAAO,SAAS;AACZ,sBAAiB,aAAa;AAC9B,sBAAiB,eAAe;AAChC,sBAAiB,eAAe;AAChC,YAAQ;AAAA,MACJ;AAAA,MACA;AAAA,IACJ;AAAA,EACJ;AAAA,EAEA,OAAO,UAAU;AACb,sBAAiB,aAAa;AAC9B,sBAAiB,sBAAsB;AACvC,s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40BF,mBAA4B;AA50B1B,iBA+0BF,qBAA0B;AA/0BxB,iBA42BF,eAAmC;AA52BjC,iBA62BF,kBAA2B;AA72BzB,iBA82BF,YAAqB;AAinEhC,OAAO,mBAAmB;",
6
+ "names": []
7
+ }
@@ -6,6 +6,20 @@ import { UIView, UIViewBroadcastEvent } from "./UIView";
6
6
  export declare class UITextView extends UIView {
7
7
  static defaultTextColor: UIColor;
8
8
  static notificationTextColor: UIColor;
9
+ static attentionRequiredColor: UIColor;
10
+ /**
11
+ * Override this to customise the attention indicator HTML that is appended
12
+ * to a label's text when `attentionRequired` is `true`.
13
+ *
14
+ * The default renders an amber `●` dot:
15
+ * ```
16
+ * UITextView.renderAttentionIndicator = () =>
17
+ * `<span style="color: #f59e0b; margin-left: 4px;">●</span>`
18
+ * ```
19
+ * Call sites never need to change — only this one function needs to be
20
+ * replaced at app startup to restyle every attention indicator globally.
21
+ */
22
+ static renderAttentionIndicator: () => string;
9
23
  static _intrinsicHeightCache: {
10
24
  [x: string]: {
11
25
  [x: string]: number;
@@ -74,6 +88,8 @@ export declare class UITextView extends UIView {
74
88
  get notificationAmount(): number;
75
89
  set notificationAmount(notificationAmount: number);
76
90
  notificationAmountDidChange(notificationAmount: number): void;
91
+ get attentionRequired(): boolean;
92
+ set attentionRequired(attentionRequired: boolean);
77
93
  get text(): string;
78
94
  set text(text: string);
79
95
  /**
@@ -105,6 +121,7 @@ export declare class UITextView extends UIView {
105
121
  textPrefix: string;
106
122
  textSuffix: string;
107
123
  _notificationAmount: number;
124
+ _attentionRequired: boolean;
108
125
  _thousandsSeparator: string | null;
109
126
  get thousandsSeparator(): string | null;
110
127
  set thousandsSeparator(value: string | null);