Skip to content

Commit cf4b16d

Browse files
committed
Fix LVM badge dark mode, add aria attributes, reject invalid log levels
- Use CSS variables for LVM badge colors with proper dark mode values - Add aria-expanded to error Details toggle button - Add aria-busy to loading spinners in DiskList and MountStatus - Reject unknown numeric log levels instead of silently defaulting to trace
1 parent 6cbd7f8 commit cf4b16d

4 files changed

Lines changed: 13 additions & 6 deletions

File tree

src-tauri/src/commands/config.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ where
4040
2 => "warn",
4141
3 => "info",
4242
4 => "debug",
43-
5 | _ => "trace",
43+
5 => "trace",
44+
_ => return Err(D::Error::custom(format!("invalid numeric log level: {}. Expected 0-5 (off=0, error=1, warn=2, info=3, debug=4, trace=5)", i))),
4445
};
4546
Ok(Some(level.to_string()))
4647
}

src/app.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@
5151

5252
--badge-bg: rgba(0, 0, 0, 0.06);
5353

54+
--lvm-bg: rgba(175, 82, 222, 0.12);
55+
--lvm-color: #af52de;
56+
5457
--button-secondary-bg: #ffffff;
5558
--button-secondary-hover: #f5f5f7;
5659

@@ -107,6 +110,9 @@
107110

108111
--badge-bg: rgba(255, 255, 255, 0.1);
109112

113+
--lvm-bg: rgba(175, 82, 222, 0.2);
114+
--lvm-color: #c084fc;
115+
110116
--button-secondary-bg: #3a3a3c;
111117
--button-secondary-hover: #48484a;
112118

src/components/DiskList.svelte

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
<span class="error-message">{summary}</span>
162162
<div class="error-actions">
163163
{#if details}
164-
<button class="details-btn" onclick={() => (showErrorDetails = !showErrorDetails)}>
164+
<button class="details-btn" aria-expanded={showErrorDetails} onclick={() => (showErrorDetails = !showErrorDetails)}>
165165
{showErrorDetails ? 'Less' : 'Details'}
166166
</button>
167167
{/if}
@@ -189,7 +189,7 @@
189189
{/if}
190190

191191
{#if $disks.loading && $disks.disks.length === 0}
192-
<div class="loading" role="status">
192+
<div class="loading" role="status" aria-busy="true">
193193
<span class="spinner large" aria-hidden="true"></span>
194194
<span>Scanning disks...</span>
195195
</div>
@@ -497,8 +497,8 @@
497497
}
498498
499499
.type-badge.lvm {
500-
background: rgba(175, 82, 222, 0.12);
501-
color: #af52de;
500+
background: var(--lvm-bg);
501+
color: var(--lvm-color);
502502
}
503503
504504
.disk-model {

src/components/MountStatus.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
</div>
8989
{:else if $disks.mountingDevice}
9090
<div class="mount-status mounting">
91-
<div class="status-icon" role="status">
91+
<div class="status-icon" role="status" aria-busy="true">
9292
<span class="spinner" aria-hidden="true"></span>
9393
<span class="sr-only">Loading</span>
9494
</div>

0 commit comments

Comments
 (0)