1package soy.iko.opencode.ui.chat
3import androidx.compose.foundation.layout.Arrangement
4import androidx.compose.foundation.layout.Column
5import androidx.compose.foundation.layout.Row
6import androidx.compose.foundation.layout.fillMaxHeight
7import androidx.compose.foundation.layout.fillMaxWidth
8import androidx.compose.foundation.layout.padding
9import androidx.compose.foundation.rememberScrollState
10import androidx.compose.foundation.text.selection.SelectionContainer
11import androidx.compose.foundation.verticalScroll
12import androidx.compose.material3.MaterialTheme
13import androidx.compose.material3.Surface
14import androidx.compose.material3.Text
15import androidx.compose.material3.TextButton
16import androidx.compose.runtime.Composable
17import androidx.compose.ui.Alignment
18import androidx.compose.ui.Modifier
19import androidx.compose.ui.text.font.FontFamily
20import androidx.compose.ui.res.stringResource
21import androidx.compose.ui.unit.dp
22import androidx.compose.ui.window.Dialog
23import androidx.compose.ui.window.DialogProperties
24import soy.iko.opencode.R
27 * A fullscreen-ish dialog showing the raw markdown source of a message's TextParts, so a user
28 * can inspect malformed tables/rendering or copy the exact source. The text is monospace,
29 * scrollable, and wrapped in a [SelectionContainer] so a portion can be selected and copied.
30 * Dismissed via the Close button, back, or an outside tap.
35 onDismiss: () -> Unit,
38 onDismissRequest = onDismiss,
39 properties = DialogProperties(usePlatformDefaultWidth = false),
42 shape = MaterialTheme.shapes.large,
43 color = MaterialTheme.colorScheme.surface,
44 tonalElevation = 6.dp,
45 modifier = Modifier.fillMaxHeight(0.9f).fillMaxWidth(),
48 modifier = Modifier.fillMaxWidth().padding(16.dp),
49 verticalArrangement = Arrangement.spacedBy(12.dp),
52 modifier = Modifier.fillMaxWidth(),
53 horizontalArrangement = Arrangement.SpaceBetween,
54 verticalAlignment = Alignment.CenterVertically,
57 stringResource(R.string.message_source),
58 style = MaterialTheme.typography.titleMedium,
60 TextButton(onClick = onDismiss) {
61 Text(stringResource(R.string.close))
67 style = MaterialTheme.typography.bodySmall.copy(fontFamily = FontFamily.Monospace),
70 .verticalScroll(rememberScrollState()),
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list