Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui-bc): use matrixindex timesteps for row display #2262

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading