Skip to content

feat: add locked badge and disable selection for write-protected devices#97

Merged
SuperKali merged 1 commit intomainfrom
feat/device-write-protection-badge
Feb 10, 2026
Merged

feat: add locked badge and disable selection for write-protected devices#97
SuperKali merged 1 commit intomainfrom
feat/device-write-protection-badge

Conversation

@SuperKali
Copy link
Member

@SuperKali SuperKali commented Feb 10, 2026

Summary

Add visual indicator and selection blocking for write-protected storage devices (SD cards with physical lock switch).

Changes

  • Backend: Detect write-protection status on all platforms
    • macOS: via diskutil info (MediaWritable property)
    • Linux: via sysfs /sys/block/{device}/ro
    • Windows: via IOCTL_STORAGE_GET_MEDIA_TYPES_EX (MEDIA_WRITE_PROTECTED flag)
  • Frontend: Display "Locked" badge for read-only devices
  • UX: Disable selection of system and write-protected devices with visual feedback
  • Fix: Improved SD card detection for SDXC/SDHC readers
  • i18n: Added device.locked translation key in all 18 languages

Screenshot

image

Test Plan

  • Insert SD card with lock switch ON → should show "Locked" badge and be non-selectable
  • Insert SD card with lock switch OFF → should be selectable normally
  • Toggle "Show system drives" → system drives appear faded and non-selectable
  • Verify on macOS, Linux, Windows

Technical Notes

Windows Write-Protection Detection

Uses IOCTL_STORAGE_GET_MEDIA_TYPES_EX instead of IOCTL_DISK_IS_WRITABLE because:

  • IOCTL_DISK_IS_WRITABLE only checks driver capability, not physical lock state
  • IOCTL_STORAGE_GET_MEDIA_TYPES_EX exposes MediaCharacteristics with MEDIA_WRITE_PROTECTED flag (0x100)

Note: Some cheap USB card readers may not report lock switch status to the OS (hardware limitation).

@SuperKali SuperKali added enhancement New feature or request component: ui User interface related component: modal-device Device selection modal component: backend Rust backend related component: device-detection Device detection issues labels Feb 10, 2026
@github-actions
Copy link

github-actions bot commented Feb 10, 2026

🧪 Test Builds

Version: 0.0.0-pr.97 | PR: #97 | Status: ready for testing

Platform Download
Linux x64 📦 .deb / .AppImage
Windows x64 📦 .exe
macOS ARM64 📦 .dmg
ℹ️ About these builds
  • 🔓 Public downloads via nightly.link (no GitHub login required)
  • ⚠️ Unsigned builds for testing purposes only
  • Expires in 7 days
  • 🔄 Updated on every push to this PR

@github-actions github-actions bot added the status: ready for review Ready to be reviewed label Feb 10, 2026
- Detect write-protection status on all platforms (macOS, Linux, Windows)
- Display locked badge in device modal for read-only devices
- Disable selection of system and write-protected devices
- Improve SD card detection for SDXC/SDHC readers
- Add translations for locked badge in all 18 languages
@SuperKali SuperKali force-pushed the feat/device-write-protection-badge branch from 5f69946 to a5b18f5 Compare February 10, 2026 21:45
@SuperKali SuperKali merged commit 8020b65 into main Feb 10, 2026
9 checks passed
@SuperKali SuperKali deleted the feat/device-write-protection-badge branch February 10, 2026 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: backend Rust backend related component: device-detection Device detection issues component: modal-device Device selection modal component: ui User interface related enhancement New feature or request status: ready for review Ready to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant