Observation-class finding, noticed while implementing #4614 (mirroring this exact fork onto DashboardGridLayout). Dormant code, no user-visible symptom today — filed so the next person to mirror this shape does not copy the dead limb. Duplicate-searched (keyword + DashboardRenderer path): nothing open covers it.
The observation
DashboardRenderer.tsx decides the self-contained (card-less) rendering with:
const isSelfContained = widget.type === 'metric' && !datasetBound; // :782
and then, inside the isSelfContained arm of renderedNode, forks on datasetBound again:
{datasetBound // :820-822
? < div … >< DatasetWidget widget={effectiveWidget} dataSource={dataSource} / >< /div >
: < SchemaRenderer schema={componentSchema} … / >}
isSelfContained already requires !datasetBound, so the datasetBound arm at :821 is unreachable. The reachable fork is the one in the Card branch (:849-851).
Why it is harmless today, and why it is still worth recording
Nothing renders wrongly — the unreachable arm simply never runs, and the reachable fork is correct. The cost is to readers: :777-781's comment explains that a dataset-bound metric must take the Card wrapper precisely so DatasetWidget gets title + border chrome, which is the same fact that makes :821 dead. The shape reads as "both branches handle dataset-bound widgets" when only one can.
It most likely became dead rather than being born dead: isSelfContained gaining its && !datasetBound clause is what stranded the arm that was written when the condition was just widget.type === 'metric'.
Where it already cost something
PR #4619 (#4614) mirrors this fork onto DashboardGridLayout. Deciding whether to copy the second arm took a reachability argument that the sibling's shape actively suggests against; that PR mirrors only the reachable mechanics and states why in a code comment. Anyone mirroring this to a third surface pays the same toll.
Suggested disposition (not prescriptive)
Delete the unreachable arm at :820-822, leaving the self-contained branch rendering SchemaRenderer unconditionally — with a one-line comment naming the invariant (isSelfContained implies !datasetBound) so it does not get re-added. A test is not obviously needed for removing code that cannot execute; the existing dataset-bound-metric coverage already pins that such a widget takes the Card path.
Not fixed in #4619: out of that card's scope, which is DashboardGridLayout's missing dataset path.
Generated by Claude Code
Observation-class finding, noticed while implementing #4614 (mirroring this exact fork onto
DashboardGridLayout). Dormant code, no user-visible symptom today — filed so the next person to mirror this shape does not copy the dead limb. Duplicate-searched (keyword +DashboardRendererpath): nothing open covers it.The observation
DashboardRenderer.tsxdecides the self-contained (card-less) rendering with:and then, inside the
isSelfContainedarm ofrenderedNode, forks ondatasetBoundagain:isSelfContainedalready requires!datasetBound, so thedatasetBoundarm at:821is unreachable. The reachable fork is the one in the Card branch (:849-851).Why it is harmless today, and why it is still worth recording
Nothing renders wrongly — the unreachable arm simply never runs, and the reachable fork is correct. The cost is to readers:
:777-781's comment explains that a dataset-bound metric must take the Card wrapper precisely soDatasetWidgetgets title + border chrome, which is the same fact that makes:821dead. The shape reads as "both branches handle dataset-bound widgets" when only one can.It most likely became dead rather than being born dead:
isSelfContainedgaining its&& !datasetBoundclause is what stranded the arm that was written when the condition was justwidget.type === 'metric'.Where it already cost something
PR #4619 (#4614) mirrors this fork onto
DashboardGridLayout. Deciding whether to copy the second arm took a reachability argument that the sibling's shape actively suggests against; that PR mirrors only the reachable mechanics and states why in a code comment. Anyone mirroring this to a third surface pays the same toll.Suggested disposition (not prescriptive)
Delete the unreachable arm at
:820-822, leaving the self-contained branch renderingSchemaRendererunconditionally — with a one-line comment naming the invariant (isSelfContainedimplies!datasetBound) so it does not get re-added. A test is not obviously needed for removing code that cannot execute; the existing dataset-bound-metric coverage already pins that such a widget takes the Card path.Not fixed in #4619: out of that card's scope, which is
DashboardGridLayout's missing dataset path.Generated by Claude Code