Skip to content

Modern Docker Management, Designed for Everyone

fix: dashboard tables height cutting off rows

Kyle Mendell10f0d85f6cbc
diff --git a/frontend/src/routes/dashboard/dash-container-table.svelte b/frontend/src/routes/dashboard/dash-container-table.svelte
index a3c39dc33..14cef86ee 100644
--- a/frontend/src/routes/dashboard/dash-container-table.svelte
+++ b/frontend/src/routes/dashboard/dash-container-table.svelte
@@ -29,23 +29,34 @@
// Estimate row height: ~57px per row (including borders/padding), plus ~145px for header
const ROW_HEIGHT = 57;
const HEADER_HEIGHT = 145;
+ const FOOTER_HEIGHT = 48; // Reserve space for the "showing" footer overlay
const MIN_ROWS = 3;
const MAX_ROWS = 50;
+ let requestOptions = $state<SearchPaginationSortRequest>({
+ pagination: { page: 1, limit: 5 },
+ sort: { column: 'created', direction: 'desc' }
+ });
+
+ const shouldReserveFooter = $derived.by(() => {
+ const limit = requestOptions.pagination?.limit ?? containers.pagination?.itemsPerPage ?? MIN_ROWS;
+ const dataLength = containers.data?.length ?? 0;
+ const totalItems = containers.pagination?.totalItems ?? 0;
+ return dataLength >= limit && totalItems > limit;
+ });
+
const calculatedLimit = $derived.by(() => {
if (contentHeight <= 0) return 5;
- const availableHeight = contentHeight - HEADER_HEIGHT;
- const rows = Math.floor(availableHeight / ROW_HEIGHT);
+ let availableHeight = contentHeight - HEADER_HEIGHT;
+ if (shouldReserveFooter) {
+ availableHeight -= FOOTER_HEIGHT;
+ }
+ const rows = Math.floor(Math.max(0, availableHeight) / ROW_HEIGHT);
return Math.max(MIN_ROWS, Math.min(MAX_ROWS, rows));
});
let lastFetchedLimit = $state(5);
- let requestOptions = $state<SearchPaginationSortRequest>({
- pagination: { page: 1, limit: 5 },
- sort: { column: 'created', direction: 'desc' }
- });
-
$effect(() => {
if (calculatedLimit !== lastFetchedLimit && requestOptions.pagination) {
lastFetchedLimit = calculatedLimit;
diff --git a/frontend/src/routes/dashboard/dash-image-table.svelte b/frontend/src/routes/dashboard/dash-image-table.svelte
index 0a77bde0c..317227516 100644
--- a/frontend/src/routes/dashboard/dash-image-table.svelte
+++ b/frontend/src/routes/dashboard/dash-image-table.svelte
@@ -27,24 +27,35 @@
// Estimate row height: ~57px per row (including borders/padding), plus ~145px for header
const ROW_HEIGHT = 57;
const HEADER_HEIGHT = 145;
+ const FOOTER_HEIGHT = 48; // Reserve space for the "showing" footer overlay
const MIN_ROWS = 3;
const MAX_ROWS = 50;
+ let requestOptions = $state<SearchPaginationSortRequest>({
+ pagination: { page: 1, limit: 5 },
+ sort: { column: 'size', direction: 'desc' }
+ });
+
+ const shouldReserveFooter = $derived.by(() => {
+ const limit = requestOptions.pagination?.limit ?? images.pagination?.itemsPerPage ?? MIN_ROWS;
+ const dataLength = images.data?.length ?? 0;
+ const totalItems = images.pagination?.totalItems ?? 0;
+ return dataLength >= limit && totalItems > limit;
+ });
+
const calculatedLimit = $derived.by(() => {
if (contentHeight <= 0) return 5;
- const availableHeight = contentHeight - HEADER_HEIGHT;
- const rows = Math.floor(availableHeight / ROW_HEIGHT);
+ let availableHeight = contentHeight - HEADER_HEIGHT;
+ if (shouldReserveFooter) {
+ availableHeight -= FOOTER_HEIGHT;
+ }
+ const rows = Math.floor(Math.max(0, availableHeight) / ROW_HEIGHT);
return Math.max(MIN_ROWS, Math.min(MAX_ROWS, rows));
});
let selectedIds = $state<string[]>([]);
let lastFetchedLimit = $state(5);
- let requestOptions = $state<SearchPaginationSortRequest>({
- pagination: { page: 1, limit: 5 },
- sort: { column: 'size', direction: 'desc' }
- });
-
$effect(() => {
if (calculatedLimit !== lastFetchedLimit && requestOptions.pagination) {
lastFetchedLimit = calculatedLimit;