Grid viewer: improve cell labels and add green inventory count badge
Labels now overlay image with gradient background and visible colour. Green badge top-right shows number of inventory entries for that cell. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1294,6 +1294,18 @@ function render_grid_viewer() {
|
||||
cell.classList.add('empty');
|
||||
}
|
||||
set_text(cell, '.grid-cell-label', `R${row + 1}C${col + 1}`);
|
||||
|
||||
const count = all_inventory.filter(inv =>
|
||||
inv.location_type === 'grid' && inv.grid_id === grid.id &&
|
||||
inv.grid_row === row && inv.grid_col === col
|
||||
).length;
|
||||
if (count > 0) {
|
||||
const badge = document.createElement('span');
|
||||
badge.className = 'grid-cell-count';
|
||||
badge.textContent = count;
|
||||
qs(cell, '.grid-cell-img-wrap').appendChild(badge);
|
||||
}
|
||||
|
||||
cell.addEventListener('click', (e) => open_cell_inventory(grid, row, col, e));
|
||||
return cell;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user