fix(12-02): move scan buttons above library list, default to none selected
Scan and Full Rescan buttons now sit above the library list for easier access. Libraries start unchecked — both buttons are disabled until at least one library is selected.
This commit is contained in:
@@ -1173,12 +1173,8 @@ export class ConfigPage extends LitElement {
|
|||||||
this.libraries = libs ?? [];
|
this.libraries = libs ?? [];
|
||||||
this.concurrencyMode = mode;
|
this.concurrencyMode = mode;
|
||||||
|
|
||||||
// Auto-select all libraries on initial load so scan
|
// Prune selections for libraries that no longer exist.
|
||||||
// buttons default to operating on everything.
|
if (this.selectedLibraryIds.size > 0) {
|
||||||
if (this.selectedLibraryIds.size === 0 && this.libraries.length > 0) {
|
|
||||||
this.selectedLibraryIds = new Set(this.libraries.map((l) => l.id));
|
|
||||||
} else {
|
|
||||||
// Prune selections for libraries that no longer exist.
|
|
||||||
const validIds = new Set(this.libraries.map((l) => l.id));
|
const validIds = new Set(this.libraries.map((l) => l.id));
|
||||||
const pruned = new Set([...this.selectedLibraryIds].filter((id) => validIds.has(id)));
|
const pruned = new Set([...this.selectedLibraryIds].filter((id) => validIds.has(id)));
|
||||||
|
|
||||||
@@ -2271,6 +2267,49 @@ export class ConfigPage extends LitElement {
|
|||||||
heading="Libraries"
|
heading="Libraries"
|
||||||
description="Manage your music library folders. Select libraries to scan."
|
description="Manage your music library folders. Select libraries to scan."
|
||||||
>
|
>
|
||||||
|
<div class="scan-actions">
|
||||||
|
${this.scanning
|
||||||
|
? html`
|
||||||
|
${this.scanPaused
|
||||||
|
? html`<button
|
||||||
|
class="btn-warning"
|
||||||
|
@click=${this.handleResumeScan}
|
||||||
|
>
|
||||||
|
Resume
|
||||||
|
</button>`
|
||||||
|
: html`<button
|
||||||
|
class="btn-warning"
|
||||||
|
@click=${this.handlePauseScan}
|
||||||
|
>
|
||||||
|
Pause
|
||||||
|
</button>`}
|
||||||
|
<button
|
||||||
|
class="btn-danger"
|
||||||
|
@click=${this.handleCancelScan}
|
||||||
|
>
|
||||||
|
Cancel Scan
|
||||||
|
</button>
|
||||||
|
`
|
||||||
|
: html`
|
||||||
|
<button
|
||||||
|
class="btn-primary"
|
||||||
|
@click=${this.handleSoftScan}
|
||||||
|
?disabled=${selectionCount === 0}
|
||||||
|
>
|
||||||
|
Scan${selectionCount > 0 && selectionCount < this.libraries.length
|
||||||
|
? ` (${selectionCount})`
|
||||||
|
: ''}
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
class="btn-danger"
|
||||||
|
@click=${this.handleFullRescan}
|
||||||
|
?disabled=${selectionCount === 0}
|
||||||
|
>
|
||||||
|
Full Rescan
|
||||||
|
</button>
|
||||||
|
`}
|
||||||
|
</div>
|
||||||
|
|
||||||
${this.libraries.length > 0
|
${this.libraries.length > 0
|
||||||
? html`
|
? html`
|
||||||
<div class="library-list">
|
<div class="library-list">
|
||||||
@@ -2395,48 +2434,6 @@ export class ConfigPage extends LitElement {
|
|||||||
@config-change=${this.handleConcurrencyChange}
|
@config-change=${this.handleConcurrencyChange}
|
||||||
></config-field>
|
></config-field>
|
||||||
|
|
||||||
<div class="scan-actions">
|
|
||||||
${this.scanning
|
|
||||||
? html`
|
|
||||||
${this.scanPaused
|
|
||||||
? html`<button
|
|
||||||
class="btn-warning"
|
|
||||||
@click=${this.handleResumeScan}
|
|
||||||
>
|
|
||||||
Resume
|
|
||||||
</button>`
|
|
||||||
: html`<button
|
|
||||||
class="btn-warning"
|
|
||||||
@click=${this.handlePauseScan}
|
|
||||||
>
|
|
||||||
Pause
|
|
||||||
</button>`}
|
|
||||||
<button
|
|
||||||
class="btn-danger"
|
|
||||||
@click=${this.handleCancelScan}
|
|
||||||
>
|
|
||||||
Cancel Scan
|
|
||||||
</button>
|
|
||||||
`
|
|
||||||
: html`
|
|
||||||
<button
|
|
||||||
class="btn-primary"
|
|
||||||
@click=${this.handleSoftScan}
|
|
||||||
?disabled=${selectionCount === 0}
|
|
||||||
>
|
|
||||||
Scan${selectionCount > 0 && selectionCount < this.libraries.length
|
|
||||||
? ` (${selectionCount})`
|
|
||||||
: ''}
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
class="btn-danger"
|
|
||||||
@click=${this.handleFullRescan}
|
|
||||||
>
|
|
||||||
Full Rescan
|
|
||||||
</button>
|
|
||||||
`}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="status-bar ${this.scanning ? 'active' : ''} ${this.scanPaused ? 'paused' : ''}"
|
class="status-bar ${this.scanning ? 'active' : ''} ${this.scanPaused ? 'paused' : ''}"
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user