Revert "feat: enhance navigation behavior in MainApp and add log export functionality in LogsScreen"

This reverts commit 29540cad8f.
This commit is contained in:
2025-11-11 20:54:49 +01:00
parent 8b311bcf95
commit 99b570f0bd
2 changed files with 10 additions and 37 deletions
@@ -73,33 +73,23 @@ fun MainApp() {
NavigationBarItem(
selected = currentRoute == Routes.Tables || currentRoute?.startsWith("list/") == true,
onClick = {
if (currentRoute?.startsWith("list/") == true) {
// Behave like back from details to tables overview
navController.popBackStack()
} else {
navController.navigate(Routes.Tables) {
popUpTo(navController.graph.findStartDestination().id) { saveState = true }
launchSingleTop = true
restoreState = true
}
}
},
icon = { androidx.compose.material3.Icon(Icons.Default.Home, contentDescription = null) },
label = { Text("Tables") },
)
NavigationBarItem(
selected = currentRoute == Routes.Settings || currentRoute == Routes.Logs,
selected = currentRoute == Routes.Settings,
onClick = {
if (currentRoute == Routes.Logs) {
// Behave like back from logs to settings screen
navController.popBackStack()
} else {
navController.navigate(Routes.Settings) {
popUpTo(navController.graph.findStartDestination().id) { saveState = true }
launchSingleTop = true
restoreState = true
}
}
},
icon = { androidx.compose.material3.Icon(Icons.Default.Settings, contentDescription = null) },
label = { Text("Settings") },
@@ -20,7 +20,6 @@ import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.ArrowBack
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material.icons.filled.Delete
import androidx.compose.material.icons.filled.Share
import androidx.compose.material.icons.filled.FilterList
import androidx.compose.material3.Badge
import androidx.compose.material3.Button
@@ -55,8 +54,6 @@ import androidx.compose.ui.unit.sp
import com.collabtable.app.utils.LogEntry
import com.collabtable.app.utils.LogLevel
import com.collabtable.app.utils.Logger
import android.content.Intent
import androidx.compose.ui.platform.LocalContext
enum class TimeRange(val label: String, val milliseconds: Long) {
LAST_10_SECONDS("Last 10 seconds", 10_000),
@@ -129,20 +126,6 @@ fun LogsScreen(onNavigateBack: () -> Unit) {
}
},
actions = {
// Export logs via share intent
val ctx = LocalContext.current
IconButton(onClick = {
val all = logs.joinToString(separator = "\n") { it.toFormattedString() }
val sendIntent = Intent(Intent.ACTION_SEND).apply {
type = "text/plain"
putExtra(Intent.EXTRA_TEXT, all)
putExtra(Intent.EXTRA_SUBJECT, "CollabTable Logs")
}
val chooser = Intent.createChooser(sendIntent, "Export logs")
ctx.startActivity(chooser)
}) {
Icon(Icons.Default.Share, contentDescription = "Export logs")
}
IconButton(onClick = { showFilterSheet = true }) {
Badge(
containerColor =
@@ -261,7 +244,7 @@ fun LogsScreen(onNavigateBack: () -> Unit) {
modifier =
Modifier
.fillMaxSize()
.background(MaterialTheme.colorScheme.background),
.background(Color(0xFF1E1E1E)),
contentPadding = PaddingValues(8.dp),
) {
items(filteredLogs) { log ->