feat: expand firmware sections on search

This commit is contained in:
2025-10-23 11:48:43 +02:00
parent 531ddbee85
commit 61f8c8aa2a

View File

@@ -154,8 +154,10 @@ class FirmwareComponent extends Component {
`;
return;
}
const firmwareHTML = filteredGroups.map(group => this.renderFirmwareGroup(group)).join('');
// Auto-expand groups when search is active to show results
const autoExpand = searchQuery.trim().length > 0;
const firmwareHTML = filteredGroups.map(group => this.renderFirmwareGroup(group, autoExpand)).join('');
container.innerHTML = `
<div class="firmware-groups">
@@ -167,11 +169,14 @@ class FirmwareComponent extends Component {
this.setupFirmwareItemListeners();
}
renderFirmwareGroup(group) {
renderFirmwareGroup(group, autoExpand = false) {
const versionsHTML = group.firmware.map(firmware => this.renderFirmwareVersion(firmware)).join('');
// Add 'expanded' class if autoExpand is true (e.g., when search results are shown)
const expandedClass = autoExpand ? 'expanded' : '';
return `
<div class="firmware-group">
<div class="firmware-group ${expandedClass}">
<div class="firmware-group-header">
<div class="firmware-group-header-content">
<h3 class="firmware-group-name">${this.escapeHtml(group.name)}</h3>