Skip to content

Commit

Permalink
fix(ui-bc): use matrixindex timesteps for row display
Browse files Browse the repository at this point in the history
  • Loading branch information
hdinia committed Dec 4, 2024
1 parent fe4bf0a commit f28999d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions webapp/src/components/common/Matrix/hooks/useMatrix/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,5 +320,9 @@ export function useMatrix(
canUndo: canUndoChanges,
canRedo,
reload: fetchMatrix,
// Use the matrix index 'steps' field to determine the number of rows
// This ensures consistent row display (8760 for hourly, 365 for daily/weekly)
// rather than using data.length which can vary for Binding Constraints (8784/366)
rowCount: index?.steps,
};
}
3 changes: 2 additions & 1 deletion webapp/src/components/common/Matrix/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ function Matrix({
canUndo,
canRedo,
reload,
rowCount,
} = useMatrix(
study.id,
url,
Expand Down Expand Up @@ -136,7 +137,7 @@ function Matrix({
data={data}
aggregates={aggregates}
columns={columns}
rows={data.length}
rows={rowCount ?? data.length}
rowHeaders={customRowHeaders}
dateTime={dateTime}
onCellEdit={handleCellEdit}
Expand Down

0 comments on commit f28999d

Please sign in to comment.