diff --git a/ui/src/views/Forecast.jsx b/ui/src/views/Forecast.jsx index ec204f4..99b9fb8 100644 --- a/ui/src/views/Forecast.jsx +++ b/ui/src/views/Forecast.jsx @@ -119,8 +119,11 @@ export default function Forecast() { const unitsCol = colMetaRef.current.find(c => c.role === 'units')?.cname if (!valueCol && !unitsCol) return try { + const dimNames = new Set(colMetaRef.current.filter(c => c.role === 'dimension').map(c => c.cname)) const filters = [ - ...Object.entries(sliceObj).map(([col, val]) => [col, '==', val]), + ...Object.entries(sliceObj) + .filter(([col]) => dimNames.has(col)) + .map(([col, val]) => [col, '==', val]), ['pf_iter', '!=', 'reference'], ] const view = await tableRef.current.view({ filter: filters }) @@ -402,68 +405,79 @@ export default function Forecast() { )} - {msg && ( - - {msg.text} - - )} - {/* Layout / depth bar */} -
- Layouts + {/* Toolbar */} +
- {layouts.map(l => ( -
applyLayout(l)} - className={`flex items-center gap-1 text-xs rounded px-2 py-0.5 cursor-pointer border transition-colors - ${activeLayoutId === l.id ? 'bg-blue-50 border-blue-300 text-blue-700' : 'bg-white border-gray-200 text-gray-600 hover:border-gray-400'}`}> - {l.name} - -
- ))} + {/* Layout group */} +
+ Layout + {layouts.map(l => ( +
applyLayout(l)} + className={`flex items-center gap-1 rounded px-2 py-0.5 cursor-pointer border transition-colors + ${activeLayoutId === l.id ? 'bg-blue-50 border-blue-300 text-blue-700' : 'bg-white border-gray-200 text-gray-600 hover:border-gray-400'}`}> + {l.name} + +
+ ))} + {showSaveAs ? ( +
+ setSaveAsName(e.target.value)} + onKeyDown={e => { if (e.key === 'Enter') handleSaveAs(); if (e.key === 'Escape') { setShowSaveAs(false); setSaveAsName('') } }} + placeholder="Layout name…" className="border border-gray-300 rounded px-2 py-0.5 w-32 focus:outline-none focus:border-blue-400" /> + + +
+ ) : ( + <> + {activeLayoutId !== null && ( + + )} + + {activeLayoutId !== null && ( + + )} + + )} +
- {activeLayoutId !== null && !showSaveAs && ( - - )} +
- {showSaveAs ? ( -
- setSaveAsName(e.target.value)} - onKeyDown={e => { if (e.key === 'Enter') handleSaveAs(); if (e.key === 'Escape') { setShowSaveAs(false); setSaveAsName('') } }} - placeholder="Layout name…" className="text-xs border border-gray-300 rounded px-2 py-0.5 w-32 focus:outline-none focus:border-blue-400" /> - - -
- ) : ( - - )} - - {activeLayoutId !== null && ( - - )} - - - - {/* Depth controls */} -
- depth + {/* Expand group */} +
+ Expand {[0, 1, 2, 3].map(d => ( ))} +
+ +
+ + {/* Data group */} +
+
+ + {msg && ( + + {msg.text} + + )} +
{/* History modal */}