Line

You are reading the unreleased docs (next). See latest (v0.9)

ui/client/features/pages-editor/hooks/useFindingPins

Cockpit client (features), next. Source: ui/client/features/pages-editor/hooks/useFindingPins.tsx.

Functions#

useFindingPins()#

useFindingPins(findings, relPath, requestRects, active): LivePreviewPin[]

Defined in: ui/client/features/pages-editor/hooks/useFindingPins.tsx:14

-- numbered pins for findings that carry a line (today, only the rule-regressions indicator does; a finding with no line simply gets no pin -- an honest limitation of what Finding carries, not a bug here). Re-measured on a short poll, not a resize observer: the preview is a cross-origin iframe, so the Cockpit cannot observe its content directly -- only ask the bridge, which is what requestRects already does. This keeps a pin roughly in place as the preview resizes or the app re-renders.

Parameters#

findings

Finding[]

relPath

string | null

requestRects

(queries) => Promise<Record<string, PreviewRect | null>>

active

boolean

Returns#

LivePreviewPin[]