refactor(ipc): add unit suffixes to numeric fields per ISO 80000 (#297)
2 months ago
76c60a8
Authored
Davy
* refactor(ipc): add unit suffixes to numeric fields per ISO 80000
Rename numeric fields that lacked unit suffixes to follow the
"Name numeric fields with their unit" constraint in the Language,
Terminology, and Data standard:
- sample_rate → sample_rate_hz
- bit_rate → bit_rate_bps
- file_size → file_size_bytes
- toolbar_height → toolbar_height_px
- sidebar_header_height → sidebar_header_height_px
- sidebar_width → sidebar_width_px
- AirPlayRoutePickerBounds: left/top/width/height → *_px
- AirPlayViewport: widthPx/heightPx/bottomInsetPx → width_px/height_px/bottom_inset_px (also fixes camelCase/snake_case inconsistency)
- RemoteObjectMetadata.size → size_bytes
- RepositoryManifest.database_size → database_size_bytes
- CommittedDatabaseProbe.database_size → database_size_bytes
- LrcLibLyrics.duration → duration_seconds (with serde rename to preserve external API compat)
- GoogleDriveFileMetadata/DropboxMetadata.size → size_bytes (with serde rename)
volume (dimensionless linear gain 0.0–1.0) and duration_ms (already
suffixed) are unchanged. No SQLite schema changes needed — none of
these fields are persisted. OpenKara ships as a single Tauri bundle
so IPC renames are safe within a release.
* test(coverage): cover file_size_bytes null/truthy branches in settings
Add tests for the file_size_bytes ternary branches in
SettingsModelVariantSection and SettingsDangerZoneSection that
Codecov flagged as uncovered after the field rename.