Pivot: show all row metrics in inspector, highlight clicked cell

Always display all non-null metric columns from the clicked row.
When a specific cell can be identified (split_by in use, cell mode),
highlight that row in blue/bold. Fixes row mode showing only one value.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Paul Trowbridge 2026-04-14 23:02:04 -04:00
parent ec0cc73f31
commit c98efe58d1

View File

@ -254,24 +254,18 @@ export default function Pivot({ source }) {
{cellCoords.join(' ')}
</div>
)}
{/* Specific cell value if we can identify it, otherwise all non-null metrics */}
{cellKey != null ? (
cellValue != null && (
<div className="flex justify-between py-0.5 gap-2">
<span className="text-xs text-gray-400 font-mono shrink-0">{metrics.join(', ')}</span>
<span className="text-xs text-gray-700 font-mono text-right">{formatVal(cellValue)}</span>
{/* All non-null metrics for the row; highlight the specific clicked cell if known */}
{Object.entries(clickDetail.row)
.filter(([k, v]) => k !== '__ROW_PATH__' && v != null)
.map(([k, v]) => {
const isSelected = cellKey != null && k === cellKey
return (
<div key={k} className={`flex justify-between py-0.5 gap-2 ${isSelected ? 'font-semibold' : ''}`}>
<span className={`text-xs font-mono shrink-0 ${isSelected ? 'text-gray-700' : 'text-gray-400'}`}>{k}</span>
<span className={`text-xs font-mono text-right ${isSelected ? 'text-blue-600' : 'text-gray-700'}`}>{formatVal(v)}</span>
</div>
)
) : (
Object.entries(clickDetail.row)
.filter(([k, v]) => k !== '__ROW_PATH__' && v != null)
.map(([k, v]) => (
<div key={k} className="flex justify-between py-0.5 gap-2">
<span className="text-xs text-gray-400 font-mono shrink-0">{k}</span>
<span className="text-xs text-gray-700 font-mono text-right">{formatVal(v)}</span>
</div>
))
)}
})}
</div>
{/* User-set filters (exclude cell-coordinate filters) */}