Revert "feat: enhance navigation behavior in MainApp and add log export functionality in LogsScreen"
This reverts commit 29540cad8f.
This commit is contained in:
@@ -73,32 +73,22 @@ 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
|
||||
}
|
||||
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
|
||||
}
|
||||
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) },
|
||||
|
||||
@@ -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 ->
|
||||
|
||||
Reference in New Issue
Block a user