Pivot: clean up click inspector upper pane display
Show row path prominently, filter to non-null metric values, use group_by › split_by as section header. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
1631dbd2cc
commit
f7d73ad821
@ -218,12 +218,23 @@ export default function Pivot({ source }) {
|
|||||||
{/* Click context — row values from Perspective */}
|
{/* Click context — row values from Perspective */}
|
||||||
<div className="px-3 py-2 border-b border-gray-100">
|
<div className="px-3 py-2 border-b border-gray-100">
|
||||||
<div className="text-xs text-gray-400 uppercase tracking-wide mb-1">
|
<div className="text-xs text-gray-400 uppercase tracking-wide mb-1">
|
||||||
{clickDetail.column_names?.join(', ') || 'Cell'}
|
{[...(clickDetail.config?.group_by || []), ...(clickDetail.config?.split_by || [])].join(' › ') || clickDetail.column_names?.join(', ') || 'Cell'}
|
||||||
</div>
|
</div>
|
||||||
{Object.entries(clickDetail.row).map(([k, v]) => (
|
{/* Row path */}
|
||||||
|
{clickDetail.row['__ROW_PATH__'] && (
|
||||||
|
<div className="text-xs text-gray-700 font-mono font-semibold mb-1">
|
||||||
|
{Array.isArray(clickDetail.row['__ROW_PATH__'])
|
||||||
|
? clickDetail.row['__ROW_PATH__'].join(' › ')
|
||||||
|
: String(clickDetail.row['__ROW_PATH__'])}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{/* Non-null metric values only */}
|
||||||
|
{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">
|
<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-400 font-mono shrink-0">{k}</span>
|
||||||
<span className="text-xs text-gray-700 font-mono text-right truncate">{formatVal(v) ?? '—'}</span>
|
<span className="text-xs text-gray-700 font-mono text-right">{formatVal(v)}</span>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user