Fix cell inventory: clickable entries navigate to component; use display name
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1193,13 +1193,20 @@ function open_cell_inventory(grid, row, col, e) {
|
||||
entries.forEach(entry => {
|
||||
const comp = component_by_id(entry.component_id);
|
||||
const item = document.createElement('div');
|
||||
item.className = 'cell-inv-item';
|
||||
item.className = 'cell-inv-item cell-inv-item-link';
|
||||
const name_span = document.createElement('span');
|
||||
name_span.textContent = comp?.name ?? '?';
|
||||
name_span.textContent = comp ? component_display_name(comp) : '?';
|
||||
const qty_span = document.createElement('span');
|
||||
qty_span.className = 'cell-inv-qty';
|
||||
qty_span.textContent = entry.quantity || '';
|
||||
item.append(name_span, qty_span);
|
||||
if (comp) {
|
||||
item.addEventListener('click', () => {
|
||||
overlay.remove();
|
||||
selected_component_id = comp.id;
|
||||
navigate('/components');
|
||||
});
|
||||
}
|
||||
list_el.appendChild(item);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user