Skip to content

Commit 20dc954

Browse files
zknprclaude
andcommitted
fix(grid): Dynamic row number column width for large datasets
The row number column was fixed at 50px, which caused the pin icon to overflow/disappear when row numbers exceeded 99 (3+ digits). Fix: - Calculate row number width dynamically based on max row number - Formula: 36px base + 8px per digit - Examples: 50 (rows 1-99), 52 (100-999), 60 (1000-9999) This ensures the pin icon remains visible and clickable regardless of how many rows are displayed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c11366b commit 20dc954

3 files changed

Lines changed: 31 additions & 26 deletions

File tree

core/ui/modules/grid.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,12 @@ export async function loadTableData(showSpinner = true, saveScrollPosition = tru
350350
export function renderDataGrid(savedScrollTop = null, savedScrollLeft = null) {
351351
const headerHeight = 52;
352352
const rowHeight = 26;
353-
const rowNumWidth = 50;
353+
354+
// Calculate row number column width based on the largest row number that will be displayed
355+
// Base width: 50px for up to 2 digits, add ~8px per additional digit
356+
const maxRowNum = state.currentPageIndex * state.rowsPerPage + state.gridData.length;
357+
const digitCount = Math.max(2, String(maxRowNum).length);
358+
const rowNumWidth = 36 + (digitCount * 8); // Base 36px + 8px per digit
354359

355360
const container = document.getElementById('gridContainer');
356361
if (!container) return;

0 commit comments

Comments
 (0)