Skip to content

feat: add HEADUNIT form factor with dedicated Now Playing layout#61

Merged
chrisuthe merged 1 commit intomainfrom
task/add-headunit-layout
Mar 8, 2026
Merged

feat: add HEADUNIT form factor with dedicated Now Playing layout#61
chrisuthe merged 1 commit intomainfrom
task/add-headunit-layout

Conversation

@chrisuthe
Copy link
Copy Markdown
Owner

Summary

  • Adds a new HEADUNIT form factor optimized for large portrait car touchscreens (13.6" Phoenix Automotive)
  • Dedicated NowPlayingHeadUnit composable with 5 oversized inline controls: shuffle, prev, play/pause, next, favorite
  • Up Next queue peek showing the next 3 tracks below the controls
  • New Layout Mode setting (Auto / Head Unit) in Settings with reactive observation via SharedPreferences listener
  • Forces bottom navigation bar for HEADUNIT (instead of the rail that tablets normally get)
  • Wraps all MusicAssistantManager.resolveQueueId() callers with runCatching to prevent crashes when queue ID resolution fails

Files changed

File Change
NowPlayingHeadUnit.kt New dedicated head unit layout with custom controls and Up Next queue peek
MainActivity.kt Reactive layout mode observation via DisposableEffect + mutableStateOf
UserSettings.kt LayoutMode enum (AUTO, HEADUNIT) and KEY_LAYOUT_MODE constant
AppShell.kt Bottom nav override for HEADUNIT; include HEADUNIT in queueViewModel condition
AdaptiveDefaults.kt HEADUNIT-specific sizing (album art, text, padding)
FormFactor.kt New HEADUNIT enum value
NowPlayingScreen.kt Route HEADUNIT form factor to NowPlayingHeadUnit
SettingsScreen.kt Layout Mode dropdown in Settings
SettingsViewModel.kt Layout mode preference read/write
MusicAssistantManager.kt runCatching wraps around resolveQueueId() in 8 callers
strings.xml New string resources for head unit UI

Test plan

  • Set Layout Mode to "Head Unit" in Settings and verify the Now Playing screen switches to the head unit layout immediately
  • Verify 5 inline controls render: shuffle, prev, play/pause, next, favorite
  • Verify Up Next queue peek shows next 3 tracks when connected to Music Assistant
  • Verify bottom navigation bar appears (not left rail)
  • Set Layout Mode back to "Auto" and verify standard layout returns
  • Test on phone-sized device to ensure Auto mode is unaffected
  • Verify no crash when queue ID resolution fails (disconnect from MA mid-playback)

@chrisuthe chrisuthe merged commit cf5a21c into main Mar 8, 2026
Add a new HEADUNIT form factor for large portrait car touchscreens
(e.g., 13.6" Phoenix Automotive displays). Includes:

- HEADUNIT FormFactor with oversized touch targets for car use
- Dedicated NowPlayingHeadUnit composable with 5-button inline controls
  (shuffle, prev, play/pause, next, favorite)
- Up Next queue peek showing next 3 tracks below controls
- Layout Mode setting (Auto / Head Unit) with reactive observation
- Bottom navigation bar override for HEADUNIT (instead of rail)
- Wrap MusicAssistantManager.resolveQueueId() callers with runCatching
  to prevent crashes when queue ID resolution fails
@chrisuthe chrisuthe deleted the task/add-headunit-layout branch March 8, 2026 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant