Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import androidx.compose.material3.SuggestionChip
import androidx.compose.material3.SuggestionChipDefaults
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
Expand Down Expand Up @@ -87,7 +88,13 @@ fun DatabaseScreen(
val tables by viewModel.dbTables.collectAsState()
val queryResult by viewModel.queryResult.collectAsState()

var sqlInput by remember { mutableStateOf("SELECT * FROM tasks LIMIT 25") }
// Follows the query the view model runs when a database loads. It used to be hardcoded to
// "SELECT * FROM tasks LIMIT 25", so the box showed a query that was never executed — and
// in any project without a `tasks` table, pressing Execute SQL failed.
var sqlInput by remember { mutableStateOf("") }
LaunchedEffect(selectedDb, tables) {
tables.firstOrNull()?.let { first -> sqlInput = "SELECT * FROM `${first.name}` LIMIT 25" }
}
var dbDropdownExpanded by remember { mutableStateOf(false) }

Column(
Expand Down
15 changes: 12 additions & 3 deletions app/src/main/java/com/runcode/app/ui/screens/HealthScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.runcode.app.mcp.McpTools
Expand Down Expand Up @@ -474,10 +475,18 @@ fun HealthRow(label: String, value: String) {
modifier = Modifier
.fillMaxWidth()
.padding(vertical = 4.dp),
horizontalArrangement = Arrangement.SpaceBetween
horizontalArrangement = Arrangement.spacedBy(12.dp)
) {
Text(label, fontSize = 12.sp, color = TextSecondary)
Text(value, fontFamily = FontFamily.Monospace, fontSize = 12.sp, fontWeight = FontWeight.Medium, color = TextPrimary)
Text(label, fontSize = 12.sp, color = TextSecondary, modifier = Modifier.weight(1f))
Text(
value,
fontFamily = FontFamily.Monospace,
fontSize = 12.sp,
fontWeight = FontWeight.Medium,
color = TextPrimary,
textAlign = TextAlign.End,
modifier = Modifier.weight(1f)
)
}
Divider(color = DarkBorder.copy(alpha = 0.5f), modifier = Modifier.padding(vertical = 2.dp))
}
Expand Down
9 changes: 8 additions & 1 deletion app/src/main/java/com/runcode/app/ui/screens/HomeScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,13 @@ fun ProfileBadge(profile: ProjectProfile) {
.background(bgColor)
.padding(horizontal = 6.dp, vertical = 2.dp)
) {
Text(profile.displayName, fontSize = 9.sp, fontWeight = FontWeight.Bold, color = textColor)
Text(
profile.displayName,
fontSize = 9.sp,
fontWeight = FontWeight.Bold,
color = textColor,
maxLines = 1,
softWrap = false
)
}
}
11 changes: 10 additions & 1 deletion app/src/main/java/com/runcode/app/ui/screens/ProjectsScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.runcode.app.domain.models.Project
Expand Down Expand Up @@ -197,7 +198,15 @@ fun ProjectsScreen(
) {
Column(modifier = Modifier.weight(1f)) {
Row(verticalAlignment = Alignment.CenterVertically) {
Text(project.name, fontWeight = FontWeight.Bold, fontSize = 16.sp, color = TextPrimary)
Text(
project.name,
fontWeight = FontWeight.Bold,
fontSize = 16.sp,
color = TextPrimary,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
modifier = Modifier.weight(1f, fill = false)
)
Spacer(modifier = Modifier.width(8.dp))
ProfileBadge(project.profile)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import android.content.ClipData
import android.content.ClipboardManager
import android.content.Context
import androidx.compose.foundation.background
import androidx.compose.foundation.horizontalScroll
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
Expand Down Expand Up @@ -114,7 +116,7 @@ fun ServicesScreen(
horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.CenterVertically
) {
Column {
Column(modifier = Modifier.weight(1f).padding(end = 12.dp)) {
Text("Service Supervisor", style = MaterialTheme.typography.titleLarge, color = TextPrimary)
Text("Local process runtime, health & log stream", fontSize = 12.sp, color = TextSecondary)
}
Expand All @@ -128,7 +130,7 @@ fun ServicesScreen(
},
shape = RoundedCornerShape(8.dp)
) {
Text("Stop All", color = AccentRed)
Text("Stop All", color = AccentRed, maxLines = 1, softWrap = false)
}
}
}
Expand Down Expand Up @@ -226,6 +228,7 @@ fun ServicesScreen(
modifier = Modifier
.fillMaxWidth()
.background(DarkSurfaceElevated)
.horizontalScroll(rememberScrollState())
.padding(horizontal = 8.dp, vertical = 4.dp),
horizontalArrangement = Arrangement.spacedBy(6.dp),
verticalAlignment = Alignment.CenterVertically
Expand Down
Loading