fix(android): cosmetic cleanup — admin badge, AdminLanding subtitle, NowPlaying clip
Three small audit v3 cleanups bundled:
* Bug-6 / §4.19 — AdminLanding Users card subtitle was stale
("Manage accounts") even though Invites shipped weeks ago.
Now: "Manage accounts and invites" to match Flutter.
* §4.22 — Account card never showed the admin badge. Flutter
appends " · admin" next to the username when isAdmin. Threaded
isAdmin through AccountCard and added the suffix.
* Bug-4 — NowPlayingBody used Column.Center with no scroll, so on
small-portrait or any landscape phone the cover + scrubber +
transport + actions row clip. Added verticalScroll so users on
small screens can scroll the body instead of losing affordances.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -177,7 +177,7 @@ private fun SectionList(counts: AdminCounts, navController: NavHostController) {
|
|||||||
SectionCard(
|
SectionCard(
|
||||||
icon = Lucide.Users,
|
icon = Lucide.Users,
|
||||||
title = "Users",
|
title = "Users",
|
||||||
subtitle = "Manage accounts",
|
subtitle = "Manage accounts and invites",
|
||||||
count = counts.users,
|
count = counts.users,
|
||||||
onClick = { navController.navigate(AdminUsers) },
|
onClick = { navController.navigate(AdminUsers) },
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ package com.fabledsword.minstrel.player.ui
|
|||||||
|
|
||||||
import androidx.compose.animation.ExperimentalSharedTransitionApi
|
import androidx.compose.animation.ExperimentalSharedTransitionApi
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
|
import androidx.compose.foundation.rememberScrollState
|
||||||
|
import androidx.compose.foundation.verticalScroll
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
@@ -211,6 +213,7 @@ private fun NowPlayingBody(
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
.padding(inner)
|
.padding(inner)
|
||||||
|
.verticalScroll(rememberScrollState())
|
||||||
.padding(horizontal = 24.dp),
|
.padding(horizontal = 24.dp),
|
||||||
verticalArrangement = Arrangement.Center,
|
verticalArrangement = Arrangement.Center,
|
||||||
horizontalAlignment = Alignment.CenterHorizontally,
|
horizontalAlignment = Alignment.CenterHorizontally,
|
||||||
|
|||||||
@@ -93,7 +93,11 @@ fun SettingsScreen(
|
|||||||
.padding(16.dp),
|
.padding(16.dp),
|
||||||
verticalArrangement = Arrangement.spacedBy(16.dp),
|
verticalArrangement = Arrangement.spacedBy(16.dp),
|
||||||
) {
|
) {
|
||||||
AccountCard(username = state.username, serverUrl = state.serverUrl)
|
AccountCard(
|
||||||
|
username = state.username,
|
||||||
|
isAdmin = state.isAdmin,
|
||||||
|
serverUrl = state.serverUrl,
|
||||||
|
)
|
||||||
NavTile(
|
NavTile(
|
||||||
icon = Lucide.ListMusic,
|
icon = Lucide.ListMusic,
|
||||||
title = "My requests",
|
title = "My requests",
|
||||||
@@ -163,7 +167,7 @@ private fun NavTile(
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun AccountCard(username: String, serverUrl: String) {
|
private fun AccountCard(username: String, isAdmin: Boolean, serverUrl: String) {
|
||||||
ElevatedCard(modifier = Modifier.fillMaxWidth()) {
|
ElevatedCard(modifier = Modifier.fillMaxWidth()) {
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier.padding(16.dp),
|
modifier = Modifier.padding(16.dp),
|
||||||
@@ -174,8 +178,12 @@ private fun AccountCard(username: String, serverUrl: String) {
|
|||||||
style = MaterialTheme.typography.titleMedium,
|
style = MaterialTheme.typography.titleMedium,
|
||||||
color = MaterialTheme.colorScheme.onSurface,
|
color = MaterialTheme.colorScheme.onSurface,
|
||||||
)
|
)
|
||||||
|
val adminTag = if (isAdmin) " · admin" else ""
|
||||||
Text(
|
Text(
|
||||||
text = if (username.isEmpty()) "Signed in" else "Signed in as $username",
|
text = when {
|
||||||
|
username.isEmpty() -> "Signed in"
|
||||||
|
else -> "Signed in as $username$adminTag"
|
||||||
|
},
|
||||||
style = MaterialTheme.typography.bodyMedium,
|
style = MaterialTheme.typography.bodyMedium,
|
||||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user