Home

dev / openkara

publicthedavidweng/OpenKara· sync paused
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

refactor(ipc): add unit suffixes to numeric fields per ISO 80000 (#297)

2 months ago

76c60a8
Authored
Davy7/28/2026, 12:45:53 PM
* 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.

Parent25ffb95

78 files changed
  • docs/references/contracts/model-bootstrap.md+2−2
  • docs/references/contracts/playback.md+1−1
  • docs/references/contracts/presentation-output-contract.md+7−7
  • docs/references/contracts/spectral.md+1−1
  • docs/references/contracts/window-shell-contract.md+6−6
  • src-tauri/src/airplay_stream.rs+4−4
  • src-tauri/src/audio/chunked_cache.rs+19−15
src-tauri/src/audio/coordinator.rs
+4
−4
  • src-tauri/src/audio/decode.rs+3−3
  • src-tauri/src/audio/encode.rs+2−1
  • src-tauri/src/audio/eq.rs+7−7
  • src-tauri/src/audio/output.rs+31−31
  • src-tauri/src/audio/output_format.rs+4−4
  • src-tauri/src/audio/playback.rs+34−34
  • src-tauri/src/audio/streaming.rs+40−37
  • src-tauri/src/audio/waveform.rs+2−2
  • src-tauri/src/cache/stems.rs+14−14
  • src-tauri/src/commands/airplay.rs+8−10
  • src-tauri/src/commands/bootstrap.rs+2−2
  • src-tauri/src/library/import/preview.rs+2−2
  • src-tauri/src/library/import/types.rs+5−5
  • src-tauri/src/library/songs.rs+3−3
  • src-tauri/src/lyrics/lrclib.rs+2−1
  • src-tauri/src/remote/bootstrap.rs+2−2
  • src-tauri/src/remote/dropbox.rs+5−5
  • src-tauri/src/remote/errors.rs+1−1
  • src-tauri/src/remote/executor.rs+16−16
  • src-tauri/src/remote/fault_injection.rs+4−4
  • src-tauri/src/remote/google_drive.rs+4−4
  • src-tauri/src/remote/manifest.rs+4−4
  • src-tauri/src/remote/provider.rs+4−1
  • src-tauri/src/remote/sync/publish.rs+4−1
  • src-tauri/src/remote/sync/revision.rs+1−1
  • src-tauri/src/remote/types.rs+8−4
  • src-tauri/src/remote/webdav.rs+7−4
  • src-tauri/src/separator/bootstrap.rs+4−4
  • src-tauri/src/separator/job.rs+1−1
  • src-tauri/src/separator/preprocess.rs+4−4
  • src-tauri/src/separator/verified_manifest.rs+2−2
  • src-tauri/src/services/next_track.rs+10−10
  • src-tauri/src/services/playback.rs+1−1
  • src-tauri/src/services/playback_source.rs+6−6
  • src-tauri/src/services/waveform.rs+1−1
  • src-tauri/src/window_shell.rs+19−19
  • src-tauri/tests/airplay_infra_contract.rs+3−3
  • src-tauri/tests/airplay_stream_contract.rs+3−3
  • src-tauri/tests/phase2_decode.rs+4−4
  • src-tauri/tests/phase2_encode.rs+1−1
  • src-tauri/tests/phase3_inference.rs+4−4
  • src-tauri/tests/phase3_playback_mode.rs+1−1
  • src-tauri/tests/phase3_preprocess.rs+3−3
  • src-tauri/tests/phase3_stems_cache.rs+1−1
  • src-tauri/tests/phase7_spectral_bench.rs+9−3
  • src-tauri/tests/phase7_spectral_session.rs+2−2
  • src/components/Library/ImportCdgChoiceDialog.tsx+3−3
  • src/components/Library/SongPropertiesDialog.tsx+5−5
  • src/components/Player/AirPlayRouteButton.test.tsx+8−8
  • src/components/Player/AirPlayRouteButton.tsx+4−4
  • src/components/Player/MonitorPicker.tsx+3−3
  • src/components/Settings/SettingsDangerZoneSection.tsx+3−1
  • src/components/Settings/SettingsModelVariantSection.test.tsx+56−1
  • src/components/Settings/SettingsModelVariantSection.tsx+5−3
  • src/components/Settings/SettingsOverlay.controller.test.ts+20−20
  • src/components/Settings/SettingsOverlay.state.test.ts+8−8
  • src/components/Settings/SettingsOverlay.state.ts+2−2
  • src/components/Settings/SettingsOverlay.test.tsx+39−8
  • src/components/Settings/settings-overlay.model-actions.test.ts+2−2
  • src/components/Settings/settings-overlay.types.ts+1−1
  • src/lib/tauri.test.ts+14−14
  • src/lib/tauri/tauri-wrappers.test.ts+2−2
  • src/lib/window-shell.hook.test.tsx+3−3
  • src/lib/window-shell.ts+3−3
  • src/mock/tauri-mock-data.ts+3−3
  • src/mock/tauri-mock-impl.ts+3−3
  • src/playback/audience-projector.ts+3−3
  • src/runtime/airplay-runtime.test.ts+18−18
  • src/types/ipc-contract.test.ts+6−6
  • src/types/ipc.ts+16−16