Polish UI screens: fix critical visual issues, improve consistency and professionalism
- Fix frozen spinner: use indeterminate CircularProgressIndicator instead of static 0.7f - Fix invisible disabled Approve button: add explicit disabledContainerColor - Fix invisible empty code boxes: use visible white borders with cursor indicator - Fix teal button on red error card: use proper error-colored Retry button - Replace checkboxes with status icons (CheckCircle/RadioButtonUnchecked) in Health Connect settings - Add icons to all cert banner states (Sync, ErrorOutline, Schedule, Build) - Replace raw unicode onboarding steps with proper step indicators - Fix Revoke button: use error color instead of teal for destructive action - Fix status badge: add pill-shaped background in IntegrationManage TopAppBar - Add card wrapper for activity rows on dashboard and manage screens - Swap activity row layout: tool name left (primary), time right (secondary) - Remove raw "args:" prefix from audit history entries - Add icon to audit history empty state - Style Clear History as destructive (error-colored border) - Fix audit section headers: add teal color accent - Remove ghost "Soon" button, replace with "Coming soon" label - Remove redundant Cancel button from integration picker (back arrow suffices) - Re-enable button now uses filled style matching Set Up button - Welcome screen: amber icon (108dp), weighted vertical layout, constrained text width - Connection Confirmed: 96dp icon, headlineLarge, button anchored to bottom - IntegrationEnabled: larger waiting spinner (24dp), "Done" instead of "Cancel" - SettingUp: rate-limited uses amber Schedule icon (64dp), "Dismiss" button, split refreshing text - Extract magic warning colors to theme tokens (WarningContainer, OnWarningContainer) - Add amber BorderStroke to battery "Fix this" button - Add verticalScroll to HealthConnectSettings, add footer text - Unify section header style across settings screens - Standardize horizontal padding (16dp) across notification preferences - Bump spinner track alpha to 0.35 for visibility - Fix onboarding step text colors: completed steps now bright, pending steps muted Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 71 KiB |
|
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 65 KiB |
|
Before Width: | Height: | Size: 93 KiB After Width: | Height: | Size: 95 KiB |
|
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 72 KiB |
|
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 69 KiB |
|
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 81 KiB |
|
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 86 KiB |
|
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 65 KiB |
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 65 KiB |
|
Before Width: | Height: | Size: 87 KiB After Width: | Height: | Size: 88 KiB |
|
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 55 KiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 82 KiB |
|
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 110 KiB |
|
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 79 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 114 KiB After Width: | Height: | Size: 110 KiB |
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 69 KiB |
|
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 122 KiB After Width: | Height: | Size: 122 KiB |
|
Before Width: | Height: | Size: 97 KiB After Width: | Height: | Size: 96 KiB |
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 71 KiB |
|
|
@ -14,18 +14,14 @@ import androidx.compose.material3.Button
|
|||
import androidx.compose.material3.Card
|
||||
import androidx.compose.material3.CardDefaults
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.HorizontalDivider
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.IconButton
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.OutlinedButton
|
||||
import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextButton
|
||||
import androidx.compose.material3.TopAppBar
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.Immutable
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
|
|
@ -67,7 +63,7 @@ fun AddIntegrationPickerScreen(
|
|||
.padding(padding)
|
||||
.padding(horizontal = 16.dp)
|
||||
) {
|
||||
LazyColumn(modifier = Modifier.weight(1f)) {
|
||||
LazyColumn(modifier = Modifier.fillMaxSize()) {
|
||||
items(integrations) { integration ->
|
||||
Card(
|
||||
modifier = Modifier
|
||||
|
|
@ -87,11 +83,7 @@ fun AddIntegrationPickerScreen(
|
|||
val isUnavailable =
|
||||
integration.state == PickerIntegrationState.UNAVAILABLE
|
||||
Text(
|
||||
text = if (isUnavailable) {
|
||||
"${integration.name} (coming soon)"
|
||||
} else {
|
||||
integration.name
|
||||
},
|
||||
text = integration.name,
|
||||
style = MaterialTheme.typography.titleMedium,
|
||||
color = if (isUnavailable) {
|
||||
MaterialTheme.colorScheme.onSurfaceVariant
|
||||
|
|
@ -113,33 +105,22 @@ fun AddIntegrationPickerScreen(
|
|||
}
|
||||
}
|
||||
PickerIntegrationState.DISABLED -> {
|
||||
OutlinedButton(onClick = { onReEnable(integration.id) }) {
|
||||
Button(onClick = { onReEnable(integration.id) }) {
|
||||
Text("Re-enable")
|
||||
}
|
||||
}
|
||||
PickerIntegrationState.UNAVAILABLE -> {
|
||||
OutlinedButton(onClick = {}, enabled = false) {
|
||||
Text("Soon")
|
||||
}
|
||||
Text(
|
||||
text = "Coming soon",
|
||||
style = MaterialTheme.typography.labelMedium,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (integration != integrations.last()) {
|
||||
HorizontalDivider(modifier = Modifier.padding(vertical = 4.dp))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TextButton(
|
||||
onClick = onCancel,
|
||||
modifier = Modifier
|
||||
.align(Alignment.End)
|
||||
.padding(bottom = 16.dp)
|
||||
) {
|
||||
Text("Cancel")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.rousecontext.app.ui.screens
|
||||
|
||||
import androidx.compose.foundation.BorderStroke
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
|
|
@ -8,12 +9,14 @@ import androidx.compose.foundation.layout.fillMaxSize
|
|||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.History
|
||||
import androidx.compose.material.icons.filled.Home
|
||||
import androidx.compose.material.icons.filled.Settings
|
||||
import androidx.compose.material3.ButtonDefaults
|
||||
import androidx.compose.material3.Card
|
||||
import androidx.compose.material3.DropdownMenuItem
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
|
|
@ -38,6 +41,7 @@ import androidx.compose.runtime.remember
|
|||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
|
|
@ -140,15 +144,22 @@ fun AuditHistoryScreen(
|
|||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
verticalArrangement = Arrangement.Center
|
||||
) {
|
||||
Icon(
|
||||
Icons.Default.History,
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(48.dp),
|
||||
tint = MaterialTheme.colorScheme.onSurfaceVariant
|
||||
)
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
Text(
|
||||
text = "No audit entries yet.",
|
||||
text = "No audit entries yet",
|
||||
style = MaterialTheme.typography.bodyLarge,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
textAlign = TextAlign.Center
|
||||
)
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
Text(
|
||||
text = "Activity will appear here after AI clients access your data.",
|
||||
text = "Activity will appear here after\nAI clients access your data.",
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
textAlign = TextAlign.Center
|
||||
|
|
@ -161,45 +172,59 @@ fun AuditHistoryScreen(
|
|||
Text(
|
||||
text = group.dateLabel,
|
||||
style = MaterialTheme.typography.titleSmall,
|
||||
modifier = Modifier.padding(top = 12.dp, bottom = 8.dp)
|
||||
color = MaterialTheme.colorScheme.primary,
|
||||
modifier = Modifier.padding(top = 16.dp, bottom = 4.dp)
|
||||
)
|
||||
}
|
||||
item {
|
||||
Card(modifier = Modifier.fillMaxWidth()) {
|
||||
Column {
|
||||
group.entries.forEachIndexed { index, entry ->
|
||||
Column(modifier = Modifier.padding(16.dp)) {
|
||||
Column(
|
||||
modifier = Modifier.padding(
|
||||
horizontal = 16.dp,
|
||||
vertical = 12.dp
|
||||
)
|
||||
) {
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
horizontalArrangement = Arrangement.SpaceBetween
|
||||
horizontalArrangement = Arrangement.SpaceBetween,
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
Text(
|
||||
entry.time,
|
||||
style = MaterialTheme.typography.bodySmall
|
||||
)
|
||||
Text(
|
||||
entry.toolName,
|
||||
style = MaterialTheme.typography.bodyMedium
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
fontWeight = FontWeight.Medium,
|
||||
modifier = Modifier.weight(1f)
|
||||
)
|
||||
}
|
||||
Row {
|
||||
Text(
|
||||
"${entry.durationMs}ms",
|
||||
entry.time,
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = MaterialTheme
|
||||
.colorScheme.onSurfaceVariant
|
||||
)
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
}
|
||||
Spacer(modifier = Modifier.height(2.dp))
|
||||
Row {
|
||||
Text(
|
||||
"args: ${entry.arguments}",
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
"${entry.durationMs}ms",
|
||||
style = MaterialTheme.typography.labelSmall,
|
||||
color = MaterialTheme
|
||||
.colorScheme.onSurfaceVariant
|
||||
)
|
||||
Spacer(modifier = Modifier.width(12.dp))
|
||||
Text(
|
||||
entry.arguments,
|
||||
style = MaterialTheme.typography.labelSmall,
|
||||
color = MaterialTheme
|
||||
.colorScheme.onSurfaceVariant
|
||||
)
|
||||
}
|
||||
}
|
||||
if (index < group.entries.lastIndex) {
|
||||
HorizontalDivider()
|
||||
HorizontalDivider(
|
||||
modifier = Modifier.padding(horizontal = 16.dp)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -212,7 +237,14 @@ fun AuditHistoryScreen(
|
|||
onClick = onClearHistory,
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(vertical = 16.dp)
|
||||
.padding(vertical = 16.dp),
|
||||
colors = ButtonDefaults.outlinedButtonColors(
|
||||
contentColor = MaterialTheme.colorScheme.error
|
||||
),
|
||||
border = BorderStroke(
|
||||
1.dp,
|
||||
MaterialTheme.colorScheme.error.copy(alpha = 0.5f)
|
||||
)
|
||||
) {
|
||||
Text("Clear history")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
package com.rousecontext.app.ui.screens
|
||||
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
|
|
@ -28,13 +28,14 @@ fun ConnectionConfirmedScreen(onBackToHome: () -> Unit = {}) {
|
|||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.padding(32.dp),
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
verticalArrangement = Arrangement.Center
|
||||
horizontalAlignment = Alignment.CenterHorizontally
|
||||
) {
|
||||
Spacer(modifier = Modifier.weight(1f))
|
||||
|
||||
Icon(
|
||||
imageVector = Icons.Default.CheckCircle,
|
||||
contentDescription = "Connected",
|
||||
modifier = Modifier.size(72.dp),
|
||||
modifier = Modifier.size(96.dp),
|
||||
tint = MaterialTheme.colorScheme.primary
|
||||
)
|
||||
|
||||
|
|
@ -42,22 +43,26 @@ fun ConnectionConfirmedScreen(onBackToHome: () -> Unit = {}) {
|
|||
|
||||
Text(
|
||||
text = "Connected",
|
||||
style = MaterialTheme.typography.headlineMedium
|
||||
style = MaterialTheme.typography.headlineLarge
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.height(12.dp))
|
||||
|
||||
Text(
|
||||
text = "Your AI client is now authorized.",
|
||||
style = MaterialTheme.typography.bodyLarge,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||
style = MaterialTheme.typography.bodyLarge
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.height(48.dp))
|
||||
Spacer(modifier = Modifier.weight(1f))
|
||||
|
||||
Button(onClick = onBackToHome) {
|
||||
Button(
|
||||
onClick = onBackToHome,
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
) {
|
||||
Text("Back to Home")
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.height(24.dp))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.rousecontext.app.ui.screens
|
||||
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.border
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
|
|
@ -29,6 +30,7 @@ import androidx.compose.runtime.remember
|
|||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.text.input.KeyboardType
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
|
|
@ -102,18 +104,29 @@ fun DeviceCodeApprovalScreen(
|
|||
onClick = onApprove,
|
||||
enabled = code.length == state.codeLength && !state.isApproving,
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
colors = ButtonDefaults.buttonColors(containerColor = TealPrimary)
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
containerColor = TealPrimary,
|
||||
disabledContainerColor = TealPrimary.copy(alpha = 0.25f),
|
||||
disabledContentColor = Color.White.copy(alpha = 0.5f)
|
||||
)
|
||||
) {
|
||||
Text("Approve", modifier = Modifier.padding(vertical = 4.dp))
|
||||
Text("Approve")
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.height(12.dp))
|
||||
|
||||
OutlinedButton(
|
||||
onClick = onDeny,
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
colors = ButtonDefaults.outlinedButtonColors(
|
||||
contentColor = MaterialTheme.colorScheme.error
|
||||
),
|
||||
border = androidx.compose.foundation.BorderStroke(
|
||||
1.dp,
|
||||
MaterialTheme.colorScheme.error.copy(alpha = 0.5f)
|
||||
)
|
||||
) {
|
||||
Text("Deny", modifier = Modifier.padding(vertical = 4.dp))
|
||||
Text("Deny")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -131,16 +144,22 @@ private fun CodeInputRow(code: String, length: Int, onCodeChanged: (String) -> U
|
|||
decorationBox = {
|
||||
Column(horizontalAlignment = Alignment.CenterHorizontally) {
|
||||
// First row (4 boxes)
|
||||
Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
|
||||
Row(horizontalArrangement = Arrangement.spacedBy(10.dp)) {
|
||||
for (i in 0 until length / 2) {
|
||||
CodeBox(char = code.getOrNull(i))
|
||||
CodeBox(
|
||||
char = code.getOrNull(i),
|
||||
isNext = i == code.length
|
||||
)
|
||||
}
|
||||
}
|
||||
Spacer(modifier = Modifier.height(12.dp))
|
||||
Spacer(modifier = Modifier.height(10.dp))
|
||||
// Second row (4 boxes)
|
||||
Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
|
||||
Row(horizontalArrangement = Arrangement.spacedBy(10.dp)) {
|
||||
for (i in length / 2 until length) {
|
||||
CodeBox(char = code.getOrNull(i))
|
||||
CodeBox(
|
||||
char = code.getOrNull(i),
|
||||
isNext = i == code.length
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -149,25 +168,33 @@ private fun CodeInputRow(code: String, length: Int, onCodeChanged: (String) -> U
|
|||
}
|
||||
|
||||
@Composable
|
||||
private fun CodeBox(char: Char?) {
|
||||
private fun CodeBox(char: Char?, isNext: Boolean = false) {
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.size(56.dp)
|
||||
.border(
|
||||
width = 2.dp,
|
||||
color = if (char != null) {
|
||||
TealPrimary
|
||||
} else {
|
||||
MaterialTheme.colorScheme.outline
|
||||
color = when {
|
||||
char != null -> TealPrimary
|
||||
isNext -> TealPrimary.copy(alpha = 0.5f)
|
||||
else -> Color.White.copy(alpha = 0.2f)
|
||||
},
|
||||
shape = RoundedCornerShape(12.dp)
|
||||
),
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
Text(
|
||||
text = char?.toString() ?: "",
|
||||
style = MaterialTheme.typography.headlineMedium
|
||||
)
|
||||
if (char != null) {
|
||||
Text(
|
||||
text = char.toString(),
|
||||
style = MaterialTheme.typography.headlineMedium
|
||||
)
|
||||
} else if (isNext) {
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.size(width = 2.dp, height = 24.dp)
|
||||
.background(TealPrimary.copy(alpha = 0.6f))
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,10 +7,15 @@ import androidx.compose.foundation.layout.fillMaxSize
|
|||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.rememberScrollState
|
||||
import androidx.compose.foundation.verticalScroll
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.automirrored.filled.ArrowBack
|
||||
import androidx.compose.material.icons.filled.CheckCircle
|
||||
import androidx.compose.material.icons.filled.RadioButtonUnchecked
|
||||
import androidx.compose.material3.Card
|
||||
import androidx.compose.material3.Checkbox
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.HorizontalDivider
|
||||
import androidx.compose.material3.Icon
|
||||
|
|
@ -63,36 +68,49 @@ fun HealthConnectSettingsScreen(
|
|||
.fillMaxSize()
|
||||
.padding(padding)
|
||||
.padding(horizontal = 16.dp)
|
||||
.verticalScroll(rememberScrollState())
|
||||
) {
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
|
||||
Text(
|
||||
text = "Permissions",
|
||||
style = MaterialTheme.typography.titleMedium
|
||||
style = MaterialTheme.typography.titleSmall,
|
||||
color = MaterialTheme.colorScheme.primary,
|
||||
modifier = Modifier.padding(vertical = 8.dp)
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
|
||||
Card(modifier = Modifier.fillMaxWidth()) {
|
||||
Column {
|
||||
state.permissions.forEachIndexed { index, permission ->
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 16.dp, vertical = 8.dp),
|
||||
.padding(horizontal = 16.dp, vertical = 12.dp),
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
Checkbox(
|
||||
checked = permission.granted,
|
||||
onCheckedChange = null,
|
||||
enabled = false
|
||||
Icon(
|
||||
imageVector = if (permission.granted) {
|
||||
Icons.Default.CheckCircle
|
||||
} else {
|
||||
Icons.Default.RadioButtonUnchecked
|
||||
},
|
||||
contentDescription = if (permission.granted) {
|
||||
"Granted"
|
||||
} else {
|
||||
"Not granted"
|
||||
},
|
||||
modifier = Modifier.size(20.dp),
|
||||
tint = if (permission.granted) {
|
||||
MaterialTheme.colorScheme.primary
|
||||
} else {
|
||||
MaterialTheme.colorScheme.outline
|
||||
}
|
||||
)
|
||||
Spacer(modifier = Modifier.width(12.dp))
|
||||
Text(
|
||||
text = permission.name,
|
||||
style = MaterialTheme.typography.bodyLarge,
|
||||
modifier = Modifier
|
||||
.weight(1f)
|
||||
.padding(start = 8.dp)
|
||||
modifier = Modifier.weight(1f)
|
||||
)
|
||||
if (!permission.granted) {
|
||||
TextButton(
|
||||
|
|
@ -103,11 +121,23 @@ fun HealthConnectSettingsScreen(
|
|||
}
|
||||
}
|
||||
if (index < state.permissions.lastIndex) {
|
||||
HorizontalDivider()
|
||||
HorizontalDivider(modifier = Modifier.padding(horizontal = 16.dp))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.height(24.dp))
|
||||
|
||||
Text(
|
||||
text = "Permissions are enforced per session. " +
|
||||
"Revoking access takes effect immediately.",
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
modifier = Modifier.padding(horizontal = 4.dp)
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.height(24.dp))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ fun HealthConnectSetupScreen(onGrantAccess: () -> Unit = {}, onCancel: () -> Uni
|
|||
|
||||
Text(
|
||||
text = "We'll request access to:",
|
||||
style = MaterialTheme.typography.bodyLarge
|
||||
style = MaterialTheme.typography.titleSmall
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.height(12.dp))
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ fun IntegrationEnabledScreen(
|
|||
Icon(
|
||||
imageVector = Icons.Default.CheckCircle,
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(48.dp),
|
||||
modifier = Modifier.size(64.dp),
|
||||
tint = MaterialTheme.colorScheme.primary
|
||||
)
|
||||
|
||||
|
|
@ -127,11 +127,11 @@ fun IntegrationEnabledScreen(
|
|||
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
CircularProgressIndicator(
|
||||
modifier = Modifier.size(16.dp),
|
||||
modifier = Modifier.size(24.dp),
|
||||
color = TealPrimary,
|
||||
strokeWidth = 2.dp
|
||||
strokeWidth = 2.5.dp
|
||||
)
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Spacer(modifier = Modifier.width(10.dp))
|
||||
Text(
|
||||
text = "Waiting for connection...",
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
|
|
@ -142,7 +142,7 @@ fun IntegrationEnabledScreen(
|
|||
Spacer(modifier = Modifier.weight(1f))
|
||||
|
||||
TextButton(onClick = onCancel) {
|
||||
Text("Cancel")
|
||||
Text("Done")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package com.rousecontext.app.ui.screens
|
||||
|
||||
import androidx.compose.foundation.BorderStroke
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
|
|
@ -10,11 +12,11 @@ import androidx.compose.foundation.layout.height
|
|||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.lazy.items
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.automirrored.filled.ArrowBack
|
||||
import androidx.compose.material.icons.filled.ContentCopy
|
||||
import androidx.compose.material3.Button
|
||||
import androidx.compose.material3.ButtonDefaults
|
||||
import androidx.compose.material3.Card
|
||||
import androidx.compose.material3.CardDefaults
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
|
|
@ -31,6 +33,7 @@ import androidx.compose.runtime.Composable
|
|||
import androidx.compose.runtime.Immutable
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.rousecontext.app.ui.theme.RouseContextTheme
|
||||
|
|
@ -69,16 +72,23 @@ fun IntegrationManageScreen(
|
|||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
Text(state.integrationName)
|
||||
Spacer(modifier = Modifier.width(12.dp))
|
||||
val badgeColor = when (state.status) {
|
||||
IntegrationStatus.ACTIVE -> MaterialTheme.colorScheme.primary
|
||||
IntegrationStatus.PENDING -> MaterialTheme.colorScheme.tertiary
|
||||
}
|
||||
Text(
|
||||
text = when (state.status) {
|
||||
IntegrationStatus.ACTIVE -> "Active"
|
||||
IntegrationStatus.PENDING -> "Pending"
|
||||
},
|
||||
style = MaterialTheme.typography.labelMedium,
|
||||
color = when (state.status) {
|
||||
IntegrationStatus.ACTIVE -> MaterialTheme.colorScheme.primary
|
||||
IntegrationStatus.PENDING -> MaterialTheme.colorScheme.tertiary
|
||||
}
|
||||
color = badgeColor,
|
||||
modifier = Modifier
|
||||
.background(
|
||||
color = badgeColor.copy(alpha = 0.15f),
|
||||
shape = RoundedCornerShape(4.dp)
|
||||
)
|
||||
.padding(horizontal = 8.dp, vertical = 2.dp)
|
||||
)
|
||||
}
|
||||
},
|
||||
|
|
@ -131,10 +141,12 @@ fun IntegrationManageScreen(
|
|||
Text(
|
||||
text = "Waiting for first client...",
|
||||
style = MaterialTheme.typography.bodyLarge,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||
fontWeight = FontWeight.SemiBold
|
||||
)
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
Text(
|
||||
text = "Add the URL above to your AI client to get started.",
|
||||
text = "To connect, add the URL above to your AI client. " +
|
||||
"This screen will update automatically once a client connects.",
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||
)
|
||||
|
|
@ -148,22 +160,52 @@ fun IntegrationManageScreen(
|
|||
)
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
}
|
||||
items(state.recentActivity) { entry ->
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(vertical = 4.dp),
|
||||
horizontalArrangement = Arrangement.SpaceBetween
|
||||
) {
|
||||
Text(entry.time, style = MaterialTheme.typography.bodySmall)
|
||||
Text(entry.toolName, style = MaterialTheme.typography.bodySmall)
|
||||
Text("${entry.durationMs}ms", style = MaterialTheme.typography.bodySmall)
|
||||
}
|
||||
}
|
||||
if (state.recentActivity.isNotEmpty()) {
|
||||
item {
|
||||
TextButton(onClick = onViewAllActivity) {
|
||||
Text("View all")
|
||||
Card(modifier = Modifier.fillMaxWidth()) {
|
||||
Column {
|
||||
state.recentActivity.forEachIndexed { index, entry ->
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 16.dp, vertical = 12.dp),
|
||||
horizontalArrangement = Arrangement.SpaceBetween,
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
Text(
|
||||
entry.toolName,
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
fontWeight = FontWeight.Medium,
|
||||
modifier = Modifier.weight(1f)
|
||||
)
|
||||
Text(
|
||||
entry.time,
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||
)
|
||||
Spacer(modifier = Modifier.width(12.dp))
|
||||
Text(
|
||||
"${entry.durationMs}ms",
|
||||
style = MaterialTheme.typography.labelSmall,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||
)
|
||||
}
|
||||
if (index < state.recentActivity.lastIndex) {
|
||||
HorizontalDivider(
|
||||
modifier = Modifier.padding(horizontal = 16.dp)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Spacer(modifier = Modifier.height(4.dp))
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
horizontalArrangement = Arrangement.End
|
||||
) {
|
||||
TextButton(onClick = onViewAllActivity) {
|
||||
Text("View all")
|
||||
}
|
||||
}
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
}
|
||||
|
|
@ -182,7 +224,7 @@ fun IntegrationManageScreen(
|
|||
if (state.authorizedClients.isEmpty()) {
|
||||
item {
|
||||
Text(
|
||||
text = "(none yet)",
|
||||
text = "No clients authorized yet",
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||
)
|
||||
|
|
@ -190,7 +232,12 @@ fun IntegrationManageScreen(
|
|||
}
|
||||
} else {
|
||||
item {
|
||||
Card(modifier = Modifier.fillMaxWidth()) {
|
||||
Card(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
colors = CardDefaults.cardColors(
|
||||
containerColor = MaterialTheme.colorScheme.surfaceVariant
|
||||
)
|
||||
) {
|
||||
Column {
|
||||
state.authorizedClients.forEachIndexed { index, client ->
|
||||
Row(
|
||||
|
|
@ -211,12 +258,19 @@ fun IntegrationManageScreen(
|
|||
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||
)
|
||||
}
|
||||
TextButton(onClick = { onRevokeClient(client.name) }) {
|
||||
Text("Revoke")
|
||||
TextButton(
|
||||
onClick = { onRevokeClient(client.name) }
|
||||
) {
|
||||
Text(
|
||||
"Revoke",
|
||||
color = MaterialTheme.colorScheme.error
|
||||
)
|
||||
}
|
||||
}
|
||||
if (index < state.authorizedClients.lastIndex) {
|
||||
HorizontalDivider()
|
||||
HorizontalDivider(
|
||||
modifier = Modifier.padding(horizontal = 16.dp)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -227,7 +281,7 @@ fun IntegrationManageScreen(
|
|||
|
||||
// Action buttons
|
||||
item {
|
||||
Button(
|
||||
OutlinedButton(
|
||||
onClick = onSettings,
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
) {
|
||||
|
|
@ -236,9 +290,22 @@ fun IntegrationManageScreen(
|
|||
Spacer(modifier = Modifier.height(8.dp))
|
||||
OutlinedButton(
|
||||
onClick = onDisable,
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
colors = ButtonDefaults.outlinedButtonColors(
|
||||
contentColor = MaterialTheme.colorScheme.error
|
||||
),
|
||||
border = BorderStroke(
|
||||
1.dp,
|
||||
MaterialTheme.colorScheme.error.copy(alpha = 0.5f)
|
||||
)
|
||||
) {
|
||||
Text("Disable Integration")
|
||||
Text(
|
||||
if (state.status == IntegrationStatus.PENDING) {
|
||||
"Cancel Setup"
|
||||
} else {
|
||||
"Disable Integration"
|
||||
}
|
||||
)
|
||||
}
|
||||
Spacer(modifier = Modifier.height(24.dp))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,16 +12,22 @@ import androidx.compose.foundation.layout.padding
|
|||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.lazy.items
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.Add
|
||||
import androidx.compose.material.icons.filled.Build
|
||||
import androidx.compose.material.icons.filled.Circle
|
||||
import androidx.compose.material.icons.filled.ContentCopy
|
||||
import androidx.compose.material.icons.filled.ErrorOutline
|
||||
import androidx.compose.material.icons.filled.History
|
||||
import androidx.compose.material.icons.filled.Home
|
||||
import androidx.compose.material.icons.filled.Schedule
|
||||
import androidx.compose.material.icons.filled.Settings
|
||||
import androidx.compose.material.icons.filled.Sync
|
||||
import androidx.compose.material3.Button
|
||||
import androidx.compose.material3.ButtonDefaults
|
||||
import androidx.compose.material3.Card
|
||||
import androidx.compose.material3.CardDefaults
|
||||
import androidx.compose.material3.CircularProgressIndicator
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.HorizontalDivider
|
||||
import androidx.compose.material3.Icon
|
||||
|
|
@ -29,7 +35,6 @@ import androidx.compose.material3.IconButton
|
|||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.NavigationBar
|
||||
import androidx.compose.material3.NavigationBarItem
|
||||
import androidx.compose.material3.OutlinedButton
|
||||
import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextButton
|
||||
|
|
@ -38,6 +43,8 @@ import androidx.compose.runtime.Composable
|
|||
import androidx.compose.runtime.Immutable
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.rousecontext.app.ui.theme.RouseContextTheme
|
||||
|
|
@ -129,20 +136,21 @@ fun MainDashboardScreen(
|
|||
.padding(padding)
|
||||
.padding(horizontal = 16.dp)
|
||||
) {
|
||||
// Cert banner (most urgent — show first)
|
||||
state.certBanner?.let { banner ->
|
||||
item {
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
CertBannerCard(banner, onRetryRenewal)
|
||||
Spacer(modifier = Modifier.height(12.dp))
|
||||
}
|
||||
}
|
||||
|
||||
// Connection status
|
||||
item {
|
||||
ConnectionStatusRow(state.connectionStatus, state.activeSessionCount)
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
}
|
||||
|
||||
// Cert banner
|
||||
state.certBanner?.let { banner ->
|
||||
item {
|
||||
CertBannerCard(banner, onRetryRenewal)
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
}
|
||||
}
|
||||
|
||||
// Integrations header
|
||||
item {
|
||||
Row(
|
||||
|
|
@ -195,13 +203,26 @@ fun MainDashboardScreen(
|
|||
style = MaterialTheme.typography.titleMedium
|
||||
)
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
}
|
||||
items(state.recentActivity) { entry ->
|
||||
ActivityRow(entry)
|
||||
}
|
||||
item {
|
||||
TextButton(onClick = onViewAllActivity) {
|
||||
Text("View all")
|
||||
Card(modifier = Modifier.fillMaxWidth()) {
|
||||
Column {
|
||||
state.recentActivity.forEachIndexed { index, entry ->
|
||||
ActivityRow(entry)
|
||||
if (index < state.recentActivity.lastIndex) {
|
||||
HorizontalDivider(
|
||||
modifier = Modifier.padding(horizontal = 16.dp)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Spacer(modifier = Modifier.height(4.dp))
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
horizontalArrangement = Arrangement.End
|
||||
) {
|
||||
TextButton(onClick = onViewAllActivity) {
|
||||
Text("View all")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -243,7 +264,7 @@ private fun CertBannerCard(banner: CertBanner, onRetry: () -> Unit) {
|
|||
} else {
|
||||
MaterialTheme.colorScheme.secondaryContainer
|
||||
}
|
||||
is CertBanner.RateLimited -> MaterialTheme.colorScheme.tertiaryContainer
|
||||
is CertBanner.RateLimited -> MaterialTheme.colorScheme.secondaryContainer
|
||||
is CertBanner.Renewing -> MaterialTheme.colorScheme.secondaryContainer
|
||||
is CertBanner.Onboarding -> MaterialTheme.colorScheme.secondaryContainer
|
||||
}
|
||||
|
|
@ -252,82 +273,176 @@ private fun CertBannerCard(banner: CertBanner, onRetry: () -> Unit) {
|
|||
modifier = Modifier.fillMaxWidth(),
|
||||
colors = CardDefaults.cardColors(containerColor = containerColor)
|
||||
) {
|
||||
Column(modifier = Modifier.padding(16.dp)) {
|
||||
Row(
|
||||
modifier = Modifier.padding(16.dp),
|
||||
verticalAlignment = Alignment.Top
|
||||
) {
|
||||
when (banner) {
|
||||
is CertBanner.Renewing -> {
|
||||
Text(
|
||||
"Refreshing your certificate...",
|
||||
style = MaterialTheme.typography.bodyMedium
|
||||
)
|
||||
Text(
|
||||
"Integrations may be briefly unavailable.",
|
||||
style = MaterialTheme.typography.bodySmall
|
||||
)
|
||||
}
|
||||
is CertBanner.Renewing -> Icon(
|
||||
Icons.Default.Sync,
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(20.dp)
|
||||
)
|
||||
is CertBanner.Expired -> if (banner.renewalInProgress) {
|
||||
Text(
|
||||
"Certificate expired. Renewing...",
|
||||
style = MaterialTheme.typography.bodyMedium
|
||||
)
|
||||
Text(
|
||||
"Integrations are offline until this completes.",
|
||||
style = MaterialTheme.typography.bodySmall
|
||||
Icon(
|
||||
Icons.Default.Sync,
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(20.dp)
|
||||
)
|
||||
} else {
|
||||
Text(
|
||||
"Certificate expired. Renewal failed — check your connection.",
|
||||
style = MaterialTheme.typography.bodyMedium
|
||||
)
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
OutlinedButton(onClick = onRetry) { Text("Retry") }
|
||||
}
|
||||
is CertBanner.RateLimited -> {
|
||||
Text(
|
||||
"Certificate issuance delayed.",
|
||||
style = MaterialTheme.typography.bodyMedium
|
||||
)
|
||||
Text(
|
||||
"Will retry automatically on ${banner.retryDate}.",
|
||||
style = MaterialTheme.typography.bodySmall
|
||||
Icon(
|
||||
Icons.Default.ErrorOutline,
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(20.dp),
|
||||
tint = MaterialTheme.colorScheme.onErrorContainer
|
||||
)
|
||||
}
|
||||
is CertBanner.Onboarding -> {
|
||||
Text("Setting up your device...", style = MaterialTheme.typography.bodyMedium)
|
||||
Spacer(modifier = Modifier.height(4.dp))
|
||||
val checkMark = "\u2713"
|
||||
val dots = "..."
|
||||
val genStatus = if (banner.generatingKeysDone) checkMark else dots
|
||||
Text(
|
||||
text = "Generating keys $genStatus",
|
||||
style = MaterialTheme.typography.bodySmall
|
||||
)
|
||||
Text(
|
||||
text = "Registering ${if (banner.registeringDone) checkMark else dots}",
|
||||
style = MaterialTheme.typography.bodySmall
|
||||
)
|
||||
Text(
|
||||
text = "Issuing certificate${if (banner.issuingCert) dots else ""}",
|
||||
style = MaterialTheme.typography.bodySmall
|
||||
)
|
||||
is CertBanner.RateLimited -> Icon(
|
||||
Icons.Default.Schedule,
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(20.dp)
|
||||
)
|
||||
is CertBanner.Onboarding -> Icon(
|
||||
Icons.Default.Build,
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(20.dp)
|
||||
)
|
||||
}
|
||||
Spacer(modifier = Modifier.width(12.dp))
|
||||
Column(modifier = Modifier.weight(1f)) {
|
||||
when (banner) {
|
||||
is CertBanner.Renewing -> {
|
||||
Text(
|
||||
"Refreshing your certificate...",
|
||||
style = MaterialTheme.typography.titleSmall
|
||||
)
|
||||
Spacer(modifier = Modifier.height(2.dp))
|
||||
Text(
|
||||
"Integrations may be briefly unavailable.",
|
||||
style = MaterialTheme.typography.bodySmall
|
||||
)
|
||||
}
|
||||
is CertBanner.Expired -> if (banner.renewalInProgress) {
|
||||
Text(
|
||||
"Certificate expired. Renewing...",
|
||||
style = MaterialTheme.typography.titleSmall
|
||||
)
|
||||
Spacer(modifier = Modifier.height(2.dp))
|
||||
Text(
|
||||
"Integrations are offline until this completes.",
|
||||
style = MaterialTheme.typography.bodySmall
|
||||
)
|
||||
} else {
|
||||
Text(
|
||||
"Certificate expired",
|
||||
style = MaterialTheme.typography.titleSmall
|
||||
)
|
||||
Spacer(modifier = Modifier.height(2.dp))
|
||||
Text(
|
||||
"Renewal failed \u2014 check your connection.",
|
||||
style = MaterialTheme.typography.bodySmall
|
||||
)
|
||||
Spacer(modifier = Modifier.height(12.dp))
|
||||
Button(
|
||||
onClick = onRetry,
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
containerColor = MaterialTheme.colorScheme.onErrorContainer,
|
||||
contentColor = MaterialTheme.colorScheme.errorContainer
|
||||
)
|
||||
) { Text("Retry") }
|
||||
}
|
||||
is CertBanner.RateLimited -> {
|
||||
Text(
|
||||
"Certificate issuance delayed",
|
||||
style = MaterialTheme.typography.titleSmall
|
||||
)
|
||||
Spacer(modifier = Modifier.height(2.dp))
|
||||
Text(
|
||||
"Will retry automatically on ${banner.retryDate}.",
|
||||
style = MaterialTheme.typography.bodySmall
|
||||
)
|
||||
}
|
||||
is CertBanner.Onboarding -> {
|
||||
Text(
|
||||
"Setting up your device...",
|
||||
style = MaterialTheme.typography.titleSmall
|
||||
)
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
OnboardingStep("Generating keys", banner.generatingKeysDone)
|
||||
Spacer(modifier = Modifier.height(4.dp))
|
||||
OnboardingStep("Registering", banner.registeringDone)
|
||||
Spacer(modifier = Modifier.height(4.dp))
|
||||
OnboardingStep(
|
||||
"Issuing certificate",
|
||||
done = false,
|
||||
active = banner.issuingCert
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun OnboardingStep(label: String, done: Boolean, active: Boolean = false) {
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
when {
|
||||
done -> Icon(
|
||||
Icons.Default.Circle,
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(8.dp),
|
||||
tint = MaterialTheme.colorScheme.primary
|
||||
)
|
||||
active -> CircularProgressIndicator(
|
||||
modifier = Modifier.size(10.dp),
|
||||
strokeWidth = 2.dp
|
||||
)
|
||||
else -> Icon(
|
||||
Icons.Default.Circle,
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(8.dp),
|
||||
tint = MaterialTheme.colorScheme.outline
|
||||
)
|
||||
}
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Text(
|
||||
text = label,
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = if (done) {
|
||||
MaterialTheme.colorScheme.onSecondaryContainer
|
||||
} else if (active) {
|
||||
MaterialTheme.colorScheme.onSecondaryContainer
|
||||
} else {
|
||||
MaterialTheme.colorScheme.onSurfaceVariant
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun EmptyIntegrationsCard(onAdd: () -> Unit) {
|
||||
Card(modifier = Modifier.fillMaxWidth()) {
|
||||
Column(
|
||||
modifier = Modifier.padding(24.dp),
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(24.dp),
|
||||
horizontalAlignment = Alignment.CenterHorizontally
|
||||
) {
|
||||
Text(
|
||||
text = "No integrations enabled yet.",
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
textAlign = TextAlign.Center
|
||||
)
|
||||
Spacer(modifier = Modifier.height(12.dp))
|
||||
Spacer(modifier = Modifier.height(4.dp))
|
||||
Text(
|
||||
text = "Connect AI assistants to your phone's data.",
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
textAlign = TextAlign.Center
|
||||
)
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
Button(onClick = onAdd) {
|
||||
Icon(Icons.Default.Add, contentDescription = null)
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
|
|
@ -381,9 +496,13 @@ private fun IntegrationRow(integration: IntegrationItem, onClick: () -> Unit, on
|
|||
IntegrationStatus.PENDING -> MaterialTheme.colorScheme.tertiary
|
||||
}
|
||||
)
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
TextButton(onClick = onCopy) {
|
||||
Text("Copy")
|
||||
Spacer(modifier = Modifier.width(4.dp))
|
||||
IconButton(onClick = onCopy) {
|
||||
Icon(
|
||||
Icons.Default.ContentCopy,
|
||||
contentDescription = "Copy URL",
|
||||
modifier = Modifier.size(18.dp)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -394,12 +513,27 @@ private fun ActivityRow(entry: AuditEntry) {
|
|||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(vertical = 4.dp),
|
||||
horizontalArrangement = Arrangement.SpaceBetween
|
||||
.padding(horizontal = 16.dp, vertical = 12.dp),
|
||||
horizontalArrangement = Arrangement.SpaceBetween,
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
Text(entry.time, style = MaterialTheme.typography.bodySmall)
|
||||
Text(entry.toolName, style = MaterialTheme.typography.bodySmall)
|
||||
Text("${entry.durationMs}ms", style = MaterialTheme.typography.bodySmall)
|
||||
Text(
|
||||
text = entry.toolName,
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
fontWeight = FontWeight.Medium,
|
||||
modifier = Modifier.weight(1f)
|
||||
)
|
||||
Text(
|
||||
text = entry.time,
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||
)
|
||||
Spacer(modifier = Modifier.width(12.dp))
|
||||
Text(
|
||||
text = "${entry.durationMs}ms",
|
||||
style = MaterialTheme.typography.labelSmall,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ fun NotificationPreferencesScreen(
|
|||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.padding(padding)
|
||||
.padding(horizontal = 24.dp)
|
||||
.padding(horizontal = 16.dp)
|
||||
) {
|
||||
Spacer(modifier = Modifier.height(24.dp))
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import androidx.compose.foundation.layout.height
|
|||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.HourglassEmpty
|
||||
import androidx.compose.material.icons.filled.Schedule
|
||||
import androidx.compose.material3.CircularProgressIndicator
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.Icon
|
||||
|
|
@ -25,6 +25,7 @@ import androidx.compose.ui.Modifier
|
|||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.rousecontext.app.ui.theme.AmberAccent
|
||||
import com.rousecontext.app.ui.theme.RouseContextTheme
|
||||
import com.rousecontext.app.ui.theme.TealPrimary
|
||||
|
||||
|
|
@ -62,19 +63,18 @@ fun SettingUpScreen(state: SettingUpState = SettingUpState(), onCancel: () -> Un
|
|||
when (state.variant) {
|
||||
is SettingUpVariant.FirstTime, is SettingUpVariant.Refreshing -> {
|
||||
CircularProgressIndicator(
|
||||
progress = { 0.7f },
|
||||
color = TealPrimary,
|
||||
trackColor = TealPrimary.copy(alpha = 0.2f),
|
||||
trackColor = TealPrimary.copy(alpha = 0.35f),
|
||||
modifier = Modifier.size(64.dp),
|
||||
strokeWidth = 5.dp,
|
||||
strokeWidth = 5.dp
|
||||
)
|
||||
}
|
||||
is SettingUpVariant.RateLimited -> {
|
||||
Icon(
|
||||
imageVector = Icons.Default.HourglassEmpty,
|
||||
imageVector = Icons.Default.Schedule,
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(48.dp),
|
||||
tint = MaterialTheme.colorScheme.tertiary
|
||||
modifier = Modifier.size(64.dp),
|
||||
tint = AmberAccent
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -86,8 +86,7 @@ fun SettingUpScreen(state: SettingUpState = SettingUpState(), onCancel: () -> Un
|
|||
is SettingUpVariant.FirstTime ->
|
||||
"We're issuing a secure certificate for your device."
|
||||
is SettingUpVariant.Refreshing ->
|
||||
"Your certificate is being refreshed. " +
|
||||
"This usually takes about 30 seconds."
|
||||
"Your certificate is being refreshed."
|
||||
is SettingUpVariant.RateLimited ->
|
||||
"Certificate issuance is temporarily delayed."
|
||||
},
|
||||
|
|
@ -95,7 +94,7 @@ fun SettingUpScreen(state: SettingUpState = SettingUpState(), onCancel: () -> Un
|
|||
textAlign = TextAlign.Center
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
|
||||
when (state.variant) {
|
||||
is SettingUpVariant.FirstTime -> {
|
||||
|
|
@ -106,18 +105,24 @@ fun SettingUpScreen(state: SettingUpState = SettingUpState(), onCancel: () -> Un
|
|||
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||
)
|
||||
}
|
||||
is SettingUpVariant.Refreshing -> { /* no extra text */ }
|
||||
is SettingUpVariant.RateLimited -> {
|
||||
is SettingUpVariant.Refreshing -> {
|
||||
Text(
|
||||
text = "Expected: ${state.variant.expectedDate}.",
|
||||
text = "This usually takes about 30 seconds.",
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
textAlign = TextAlign.Center,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||
)
|
||||
}
|
||||
is SettingUpVariant.RateLimited -> {
|
||||
Text(
|
||||
text = "Will retry on ${state.variant.expectedDate}.",
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
textAlign = TextAlign.Center
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
|
||||
Text(
|
||||
text = "We'll notify you when it's ready.",
|
||||
|
|
@ -129,7 +134,12 @@ fun SettingUpScreen(state: SettingUpState = SettingUpState(), onCancel: () -> Un
|
|||
Spacer(modifier = Modifier.height(32.dp))
|
||||
|
||||
TextButton(onClick = onCancel) {
|
||||
Text("Cancel")
|
||||
Text(
|
||||
when (state.variant) {
|
||||
is SettingUpVariant.RateLimited -> "Dismiss"
|
||||
else -> "Cancel"
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.rousecontext.app.ui.screens
|
||||
|
||||
import androidx.compose.foundation.BorderStroke
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
|
|
@ -43,12 +44,13 @@ import androidx.compose.runtime.remember
|
|||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.rousecontext.app.ui.theme.AmberAccent
|
||||
import com.rousecontext.app.ui.theme.OnWarningContainer
|
||||
import com.rousecontext.app.ui.theme.RouseContextTheme
|
||||
import com.rousecontext.app.ui.theme.TealPrimary
|
||||
import com.rousecontext.app.ui.theme.WarningContainer
|
||||
|
||||
@Immutable
|
||||
data class SettingsState(
|
||||
|
|
@ -198,7 +200,7 @@ fun SettingsScreen(
|
|||
Card(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
colors = CardDefaults.cardColors(
|
||||
containerColor = Color(0xFF3A2800)
|
||||
containerColor = WarningContainer
|
||||
)
|
||||
) {
|
||||
Row(
|
||||
|
|
@ -220,14 +222,15 @@ fun SettingsScreen(
|
|||
Text(
|
||||
"Disable to ensure reliable wake-ups.",
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = Color(0xFFFFE0A0)
|
||||
color = OnWarningContainer
|
||||
)
|
||||
}
|
||||
OutlinedButton(
|
||||
onClick = onFixBatteryOptimization,
|
||||
colors = ButtonDefaults.outlinedButtonColors(
|
||||
contentColor = AmberAccent
|
||||
)
|
||||
),
|
||||
border = BorderStroke(1.dp, AmberAccent)
|
||||
) {
|
||||
Text("Fix this")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package com.rousecontext.app.ui.screens
|
||||
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
|
|
@ -8,6 +7,7 @@ import androidx.compose.foundation.layout.fillMaxWidth
|
|||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.layout.widthIn
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.Hub
|
||||
import androidx.compose.material3.Button
|
||||
|
|
@ -18,9 +18,11 @@ import androidx.compose.material3.Text
|
|||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.rousecontext.app.ui.theme.AmberAccent
|
||||
import com.rousecontext.app.ui.theme.RouseContextTheme
|
||||
|
||||
@Composable
|
||||
|
|
@ -30,35 +32,38 @@ fun WelcomeScreen(onGetStarted: () -> Unit = {}) {
|
|||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.padding(32.dp),
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
verticalArrangement = Arrangement.Center
|
||||
horizontalAlignment = Alignment.CenterHorizontally
|
||||
) {
|
||||
Spacer(modifier = Modifier.weight(1f))
|
||||
|
||||
Icon(
|
||||
imageVector = Icons.Default.Hub,
|
||||
contentDescription = "Rouse Context",
|
||||
modifier = Modifier.size(80.dp),
|
||||
tint = MaterialTheme.colorScheme.primary
|
||||
modifier = Modifier.size(108.dp),
|
||||
tint = AmberAccent
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.height(32.dp))
|
||||
|
||||
Text(
|
||||
text = "Rouse Context",
|
||||
style = MaterialTheme.typography.headlineLarge
|
||||
style = MaterialTheme.typography.headlineLarge,
|
||||
fontWeight = FontWeight.SemiBold
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
|
||||
Text(
|
||||
text = "Turn your phone into a secure AI context server. " +
|
||||
"Your data stays on your device — AI clients connect " +
|
||||
"Your data stays on your device \u2014 AI clients connect " +
|
||||
"through an encrypted tunnel.",
|
||||
style = MaterialTheme.typography.bodyLarge,
|
||||
textAlign = TextAlign.Center,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
modifier = Modifier.widthIn(max = 280.dp)
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.height(48.dp))
|
||||
Spacer(modifier = Modifier.weight(0.6f))
|
||||
|
||||
Button(
|
||||
onClick = onGetStarted,
|
||||
|
|
@ -66,6 +71,8 @@ fun WelcomeScreen(onGetStarted: () -> Unit = {}) {
|
|||
) {
|
||||
Text("Get Started")
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.height(24.dp))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,14 +8,16 @@ import androidx.compose.runtime.Composable
|
|||
import androidx.compose.ui.graphics.Color
|
||||
|
||||
// Brand colors
|
||||
val TealPrimary = Color(0xFF1D9E75) // interactive/action color
|
||||
val TealPrimary = Color(0xFF1D9E75) // interactive/action color
|
||||
val TealLight = Color(0xFF5DCAA5)
|
||||
val TealDeep = Color(0xFF0F6E56)
|
||||
val AmberAccent = Color(0xFFEF9F27) // brand accent, highlights, indicators
|
||||
val AmberAccent = Color(0xFFEF9F27) // brand accent, highlights, indicators
|
||||
val AmberDark = Color(0xFFBA7517)
|
||||
val BackgroundNavy = Color(0xFF0A1628) // primary dark surface
|
||||
val BackgroundNavy = Color(0xFF0A1628) // primary dark surface
|
||||
val BackgroundBlack = Color(0xFF111111)
|
||||
val WarmWhite = Color(0xFFFAF8F4) // light mode background
|
||||
val WarmWhite = Color(0xFFFAF8F4) // light mode background
|
||||
val WarningContainer = Color(0xFF3A2800) // dark warning card background
|
||||
val OnWarningContainer = Color(0xFFFFE0A0) // warning card text
|
||||
|
||||
private val DarkColorScheme = darkColorScheme(
|
||||
primary = TealPrimary,
|
||||
|
|
@ -37,7 +39,7 @@ private val DarkColorScheme = darkColorScheme(
|
|||
error = Color(0xFFFF6B6B),
|
||||
onError = Color.Black,
|
||||
outline = Color(0xFF3A4A5A),
|
||||
outlineVariant = Color(0xFF2A3A4A),
|
||||
outlineVariant = Color(0xFF2A3A4A)
|
||||
)
|
||||
|
||||
private val LightColorScheme = lightColorScheme(
|
||||
|
|
@ -60,7 +62,7 @@ private val LightColorScheme = lightColorScheme(
|
|||
error = Color(0xFFBA1A1A),
|
||||
onError = Color.White,
|
||||
outline = Color(0xFF6F7973),
|
||||
outlineVariant = Color(0xFFBFC9C2),
|
||||
outlineVariant = Color(0xFFBFC9C2)
|
||||
)
|
||||
|
||||
@Composable
|
||||
|
|
@ -69,6 +71,6 @@ fun RouseContextTheme(darkTheme: Boolean = isSystemInDarkTheme(), content: @Comp
|
|||
|
||||
MaterialTheme(
|
||||
colorScheme = colorScheme,
|
||||
content = content,
|
||||
content = content
|
||||
)
|
||||
}
|
||||
|
|
|
|||