Fix device card rendering - disable legacy code and fix CSS

- Disable legacy addBtDeviceCard when BluetoothMode is active
- Clear device container when starting scan to remove legacy cards
- Fix grid CSS with explicit auto height and align-items: start
- Add visibility rules for all card body elements
- Reset devices map when clearing container

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Smittix
2026-01-21 17:47:09 +00:00
parent bb660d02f5
commit bac7f8d55c
3 changed files with 39 additions and 12 deletions

View File

@@ -213,12 +213,10 @@ const BluetoothMode = (function() {
if (startBtn) startBtn.style.display = scanning ? 'none' : 'block';
if (stopBtn) stopBtn.style.display = scanning ? 'block' : 'none';
// Clear placeholder when starting scan
// Clear container when starting scan (removes legacy cards and placeholder)
if (scanning && deviceContainer) {
const placeholder = deviceContainer.querySelector('div[style*="text-align: center"]');
if (placeholder && placeholder.textContent.includes('Start scanning')) {
deviceContainer.innerHTML = '';
}
deviceContainer.innerHTML = '';
devices.clear(); // Also clear our device map
}
// Update global status if available