diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c92999..8ff17cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,10 @@ For LLeMbas server 2.0, and only for it. numbered lines; a long Markdown file is shown as text. **HTML is never rendered in the app**: it is shown as its source, and "Open in the browser" opens the web viewer, which draws it in its sealed frame. Copy takes the whole file. +- **Files**: the person's own files, read-only, from the folder button beside Settings. Browse + the tree as the web UI's explorer shows it (folders first, back goes up one), and open a file + in the same viewer as a shown one, under the same rules. A file the server does not hand over + as text -- an image, a binary, anything over 1 MB -- says why, and offers the web UI's viewer. - **A server older than 2.0 is refused** with a sentence, at sign-in and for an instance signed in to before: the device-link protocol must be 3 or newer, and the app API 2. diff --git a/app/src/main/java/eu/llembas/android/MainActivity.kt b/app/src/main/java/eu/llembas/android/MainActivity.kt index 4480886..6156431 100644 --- a/app/src/main/java/eu/llembas/android/MainActivity.kt +++ b/app/src/main/java/eu/llembas/android/MainActivity.kt @@ -28,6 +28,7 @@ import eu.llembas.android.auth.Prefs import eu.llembas.android.push.Notifications import eu.llembas.android.ui.chat.ChatScreen import eu.llembas.android.ui.chats.ChatsScreen +import eu.llembas.android.ui.files.FilesScreen import eu.llembas.android.ui.settings.SettingsScreen import eu.llembas.android.ui.signin.SignInScreen import eu.llembas.android.ui.theme.LembasTheme @@ -89,6 +90,7 @@ class MainActivity : ComponentActivity() { onOpen = { nav.navigate("chat/$it") }, onNew = { nav.navigate("new") }, onSettings = { nav.navigate("settings") }, + onFiles = { nav.navigate("files") }, ) } composable("new") { @@ -103,6 +105,7 @@ class MainActivity : ComponentActivity() { composable("chat/{id}") { entry -> ChatScreen(chatId = entry.arguments?.getString("id"), onBack = { nav.popBackStack() }) } + composable("files") { FilesScreen(onBack = { nav.popBackStack() }) } composable("settings") { SettingsScreen(onBack = { nav.popBackStack() }, onAddInstance = { nav.navigate("add") }) } diff --git a/app/src/main/java/eu/llembas/android/ui/chats/ChatsScreen.kt b/app/src/main/java/eu/llembas/android/ui/chats/ChatsScreen.kt index 0fc8742..78c9473 100644 --- a/app/src/main/java/eu/llembas/android/ui/chats/ChatsScreen.kt +++ b/app/src/main/java/eu/llembas/android/ui/chats/ChatsScreen.kt @@ -18,6 +18,7 @@ import androidx.compose.foundation.shape.CircleShape import androidx.compose.material.icons.Icons import androidx.compose.material.icons.automirrored.filled.Chat import androidx.compose.material.icons.filled.Add +import androidx.compose.material.icons.filled.Folder import androidx.compose.material.icons.filled.Settings import androidx.compose.material.icons.filled.Terminal import androidx.compose.material3.ExperimentalMaterial3Api @@ -132,7 +133,7 @@ class ChatsViewModel(app: Application) : AndroidViewModel(app) { @OptIn(ExperimentalMaterial3Api::class) @Composable -fun ChatsScreen(onOpen: (String) -> Unit, onNew: () -> Unit, onSettings: () -> Unit, model: ChatsViewModel = viewModel()) { +fun ChatsScreen(onOpen: (String) -> Unit, onNew: () -> Unit, onSettings: () -> Unit, onFiles: () -> Unit, model: ChatsViewModel = viewModel()) { val state by model.state.collectAsStateWithLifecycle() var tab by rememberSaveable { mutableIntStateOf(0) } val kind = if (tab == 0) "chat" else "agent" @@ -143,6 +144,9 @@ fun ChatsScreen(onOpen: (String) -> Unit, onNew: () -> Unit, onSettings: () -> U TopAppBar( title = { Text(stringResource(R.string.app_name)) }, actions = { + IconButton(onClick = onFiles) { + Icon(Icons.Filled.Folder, contentDescription = stringResource(R.string.files)) + } IconButton(onClick = onSettings) { Icon(Icons.Filled.Settings, contentDescription = stringResource(R.string.settings)) } diff --git a/app/src/main/java/eu/llembas/android/ui/files/FilesScreen.kt b/app/src/main/java/eu/llembas/android/ui/files/FilesScreen.kt new file mode 100644 index 0000000..83a9d5c --- /dev/null +++ b/app/src/main/java/eu/llembas/android/ui/files/FilesScreen.kt @@ -0,0 +1,195 @@ +@file:OptIn(androidx.compose.material3.ExperimentalMaterial3Api::class) + +package eu.llembas.android.ui.files + +import android.app.Application +import android.text.format.Formatter +import androidx.activity.compose.BackHandler +import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.foundation.lazy.items +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.automirrored.filled.ArrowBack +import androidx.compose.material.icons.filled.Description +import androidx.compose.material.icons.filled.Folder +import androidx.compose.material.icons.filled.FolderShared +import androidx.compose.material3.HorizontalDivider +import androidx.compose.material3.Icon +import androidx.compose.material3.IconButton +import androidx.compose.material3.ListItem +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Scaffold +import androidx.compose.material3.Text +import androidx.compose.material3.TopAppBar +import androidx.compose.material3.pulltorefresh.PullToRefreshBox +import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.saveable.rememberSaveable +import androidx.compose.runtime.setValue +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.unit.dp +import androidx.lifecycle.AndroidViewModel +import androidx.lifecycle.compose.collectAsStateWithLifecycle +import androidx.lifecycle.viewModelScope +import androidx.lifecycle.viewmodel.compose.viewModel +import eu.llembas.android.R +import eu.llembas.android.api.FileEntry +import eu.llembas.android.lembas +import eu.llembas.android.ui.theme.LocalPalette +import eu.llembas.android.ui.viewer.TreeFileViewer +import kotlinx.coroutines.Job +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.asStateFlow +import kotlinx.coroutines.flow.update +import kotlinx.coroutines.launch + +/** One directory of the person's tree, and whether it is on its way. */ +data class FilesState( + val path: String = "/", + val parent: String? = null, + val entries: List = emptyList(), + val loading: Boolean = false, + val error: String? = null, +) + +/** + * The person's files, read-only: `GET /api/v2/files` as the explorer's listing. The tree is read + * as the person, with no chat -- their own access, the same the web UI's explorer draws by. + */ +class FilesViewModel(app: Application) : AndroidViewModel(app) { + private val _state = MutableStateFlow(FilesState(loading = true)) + val state = _state.asStateFlow() + private var loading: Job? = null + + /** + * Opens a directory. A refusal (a path no longer readable, the server unreachable) keeps the + * directory already shown and says why above it, so the way back is never lost. + */ + fun open(path: String) { + loading?.cancel() + loading = viewModelScope.launch { + _state.update { it.copy(loading = true, error = null) } + try { + val api = getApplication().lembas.instances.client() + if (api == null) { + _state.update { it.copy(loading = false) } + return@launch + } + val listing = api.files(path) + _state.value = FilesState(path = listing.path, parent = listing.parent, entries = listing.entries) + } catch (e: Exception) { + if (e is kotlinx.coroutines.CancellationException) throw e + _state.update { it.copy(loading = false, error = e.message ?: e.javaClass.simpleName) } + } + } + } + + fun reload() = open(_state.value.path) + + fun up(): Boolean { + val parent = _state.value.parent ?: return false + open(parent) + return true + } +} + +@Composable +fun FilesScreen(onBack: () -> Unit, model: FilesViewModel = viewModel()) { + val state by model.state.collectAsStateWithLifecycle() + val palette = LocalPalette.current + var viewing by rememberSaveable { mutableStateOf(null) } + LaunchedEffect(Unit) { if (state.entries.isEmpty() && state.error == null) model.open(state.path) } + + // Back goes up one directory first, as a file manager's does; at the top it leaves. + BackHandler(enabled = state.parent != null) { model.up() } + + Scaffold( + topBar = { + TopAppBar( + navigationIcon = { + IconButton(onClick = { if (!model.up()) onBack() }) { + Icon(Icons.AutoMirrored.Filled.ArrowBack, contentDescription = stringResource(R.string.back)) + } + }, + title = { + Column { + Text(stringResource(R.string.files), maxLines = 1, overflow = TextOverflow.Ellipsis) + Text( + if (state.parent == null) stringResource(R.string.files_all) else state.path, + style = MaterialTheme.typography.labelSmall, + fontFamily = if (state.parent == null) null else FontFamily.Monospace, + color = palette.inkFaint, + maxLines = 1, + overflow = TextOverflow.StartEllipsis, + ) + } + }, + ) + }, + ) { padding -> + Column(Modifier.padding(padding).fillMaxSize()) { + state.error?.let { + Text(it, color = MaterialTheme.colorScheme.error, modifier = Modifier.padding(16.dp)) + } + PullToRefreshBox(isRefreshing = state.loading, onRefresh = { model.reload() }, modifier = Modifier.fillMaxSize()) { + if (state.entries.isEmpty() && !state.loading && state.error == null) { + Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center) { + Text( + stringResource(R.string.files_empty), + color = MaterialTheme.colorScheme.onSurfaceVariant, + modifier = Modifier.padding(32.dp), + ) + } + } + LazyColumn(Modifier.fillMaxSize()) { + items(state.entries, key = { it.path }) { entry -> + EntryRow(entry) { if (entry.isFolder) model.open(entry.path) else viewing = entry.path } + HorizontalDivider() + } + } + } + } + } + + viewing?.let { path -> TreeFileViewer(path, onClose = { viewing = null }) } +} + +@Composable +private fun EntryRow(entry: FileEntry, onOpen: () -> Unit) { + val context = LocalContext.current + ListItem( + modifier = Modifier.fillMaxWidth().clickable(onClick = onOpen), + leadingContent = { + Icon( + when (entry.kind) { + "mount" -> Icons.Filled.FolderShared + "dir" -> Icons.Filled.Folder + else -> Icons.Filled.Description + }, + contentDescription = null, + tint = MaterialTheme.colorScheme.onSurfaceVariant, + ) + }, + headlineContent = { Text(entry.name.ifBlank { entry.path }, maxLines = 1, overflow = TextOverflow.Ellipsis) }, + supportingContent = if (entry.isFolder) { + null + } else { + { + val line = listOfNotNull(Formatter.formatShortFileSize(context, entry.size), entry.mime.ifBlank { null }).joinToString(" · ") + Text(line, maxLines = 1, overflow = TextOverflow.Ellipsis) + } + }, + ) +} diff --git a/app/src/main/java/eu/llembas/android/ui/viewer/FileViewer.kt b/app/src/main/java/eu/llembas/android/ui/viewer/FileViewer.kt index 9da41ab..f3ba85f 100644 --- a/app/src/main/java/eu/llembas/android/ui/viewer/FileViewer.kt +++ b/app/src/main/java/eu/llembas/android/ui/viewer/FileViewer.kt @@ -55,6 +55,7 @@ import androidx.compose.ui.unit.sp import androidx.compose.ui.window.Dialog import androidx.compose.ui.window.DialogProperties import eu.llembas.android.R +import eu.llembas.android.api.ApiClient import eu.llembas.android.api.ApiException import eu.llembas.android.api.ShowCard import eu.llembas.android.lembas @@ -72,12 +73,16 @@ private const val MARKDOWN_MAX_CHARS = 200_000 private sealed interface Loaded { data object Loading : Loaded - data class Text(val text: String) : Loaded + /** [kind]: what the server said the file is, when it is only known once it came. */ + data class Text(val text: String, val kind: String? = null) : Loaded - /** [unavailable]: this server has no door for the app to read a shown file through. */ + /** [unavailable]: this server has no door for the app to read the file through. */ data class Failed(val message: String, val unavailable: Boolean = false) : Loaded } +/** What the viewer's title and body need to know before the text comes. */ +private data class Viewed(val name: String, val path: String, val line: Int, val kind: String) + /** * What a `show` card opens: the file, full screen, read-only, as the chat sees it now. * @@ -90,26 +95,64 @@ private sealed interface Loaded { */ @Composable fun FileViewer(chatId: String, show: ShowCard, onClose: () -> Unit) { + Viewer( + file = Viewed(show.name, show.path, show.line, show.viewKind), + key = chatId to show, + webUrl = { it.webViewer(chatId, show) }, + load = { api, _ -> Loaded.Text(api.shownText(chatId, show)) }, + onClose = onClose, + ) +} + +/** + * A file of the person's tree (the Files screen), in the same viewer and under the same rules: + * the person's own files are no more trusted than a model's, since a model may have written + * them. A file the server withholds (not text, over 1 MB) says why, and offers the web UI. + */ +@Composable +fun TreeFileViewer(path: String, onClose: () -> Unit) { + Viewer( + file = Viewed(path.substringAfterLast('/').ifBlank { path }, path, 0, "text"), + key = path, + webUrl = { it.webFile(path) }, + load = { api, context -> + val file = api.fileContent(path) + val withheld = file.withheld + when { + withheld == null -> Loaded.Text(file.text, file.viewKind) + withheld.message.isNotBlank() -> Loaded.Failed(withheld.message) + withheld.reason == "too_large" -> Loaded.Failed(context.getString(R.string.viewer_too_large)) + else -> Loaded.Failed(context.getString(R.string.viewer_not_text)) + } + }, + onClose = onClose, + ) +} + +@Composable +private fun Viewer(file: Viewed, key: Any, webUrl: (ApiClient) -> String?, load: suspend (ApiClient, Context) -> Loaded, onClose: () -> Unit) { val context = LocalContext.current val palette = LocalPalette.current - var loaded by remember(chatId, show) { mutableStateOf(Loaded.Loading) } - var web by remember(chatId, show) { mutableStateOf(null) } + var loaded by remember(key) { mutableStateOf(Loaded.Loading) } + var web by remember(key) { mutableStateOf(null) } - LaunchedEffect(chatId, show) { + LaunchedEffect(key) { val api = context.lembas.instances.client() if (api == null) { loaded = Loaded.Failed(context.getString(R.string.assist_signed_out)) return@LaunchedEffect } - web = api.webViewer(chatId, show) + web = webUrl(api) loaded = try { - Loaded.Text(api.shownText(chatId, show)) + load(api, context) } catch (e: ApiException) { when { e.status == 413 -> Loaded.Failed(context.getString(R.string.viewer_too_large)) + e.status == 415 -> Loaded.Failed(e.message?.ifBlank { null } ?: context.getString(R.string.viewer_not_text)) + // No such route at all (FastAPI's own "Not Found", or the wrong method): a - // server without the app's door to shown files. Its own 404 has a sentence. + // server without the app's door to the file. Its own 404 has a sentence. e.status == 405 || (e.status == 404 && e.message == "Not Found") -> Loaded.Failed(context.getString(R.string.viewer_unavailable), unavailable = true) @@ -131,9 +174,9 @@ fun FileViewer(chatId: String, show: ShowCard, onClose: () -> Unit) { }, title = { Column { - Text(show.name.ifBlank { show.path }, maxLines = 1, overflow = TextOverflow.Ellipsis) + Text(file.name.ifBlank { file.path }, maxLines = 1, overflow = TextOverflow.Ellipsis) Text( - show.path + if (show.line > 0) ":${show.line}" else "", + file.path + if (file.line > 0) ":${file.line}" else "", style = MaterialTheme.typography.labelSmall, fontFamily = FontFamily.Monospace, color = palette.inkFaint, @@ -144,7 +187,7 @@ fun FileViewer(chatId: String, show: ShowCard, onClose: () -> Unit) { }, actions = { (loaded as? Loaded.Text)?.let { done -> - IconButton(onClick = { copy(context, show.name, done.text) }) { + IconButton(onClick = { copy(context, file.name, done.text) }) { Icon(Icons.Filled.ContentCopy, contentDescription = stringResource(R.string.viewer_copy)) } } @@ -173,7 +216,7 @@ fun FileViewer(chatId: String, show: ShowCard, onClose: () -> Unit) { } } - is Loaded.Text -> Body(show, now.text) + is Loaded.Text -> Body(now.kind ?: file.kind, file.line, now.text) } } } @@ -181,9 +224,8 @@ fun FileViewer(chatId: String, show: ShowCard, onClose: () -> Unit) { } @Composable -private fun Body(show: ShowCard, text: String) { +private fun Body(kind: String, line: Int, text: String) { val palette = LocalPalette.current - val kind = show.viewKind if (kind == "markdown" && text.length <= MARKDOWN_MAX_CHARS) { Column(Modifier.fillMaxSize().verticalScroll(rememberScrollState()).padding(16.dp)) { MarkdownText(text, modifier = Modifier.fillMaxWidth()) @@ -204,7 +246,7 @@ private fun Body(show: ShowCard, text: String) { modifier = Modifier.fillMaxWidth().background(palette.bgSunken).padding(horizontal = 16.dp, vertical = 10.dp), ) } - Lines(text, show.line) + Lines(text, line) } } diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index e66495c..1d61a74 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -66,6 +66,10 @@ Dlouhý soubor, proto je zobrazen jako prostý text. Tento server zatím aplikaci soubor předat neumí. Otevřete ho v prohlížeči. Tento soubor je příliš velký na zobrazení; zobrazit lze nejvýše 1 MB. + Toto není textový soubor, proto se zde nezobrazuje. + Soubory + Všechny soubory + Zatím tu nic není. Ani hobití nora. Nastavení Instance Odhlásit se diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 138afee..c585f6e 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -66,6 +66,10 @@ Eine lange Datei, daher wird sie als reiner Text angezeigt. Dieser Server kann die Datei der App noch nicht übergeben. Öffnen Sie sie stattdessen im Browser. Diese Datei ist zu groß zum Anzeigen; höchstens 1 MB kann angezeigt werden. + Das ist keine Textdatei, deshalb wird sie hier nicht angezeigt. + Dateien + Alle Dateien + Hier ist noch nichts. Nicht einmal eine Hobbithöhle. Einstellungen Instanzen Abmelden diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 045c0f0..714e985 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -66,6 +66,10 @@ Un archivo largo, por eso se muestra como texto sin formato. Este servidor todavía no puede entregar el archivo a la aplicación. Ábralo en el navegador. Este archivo es demasiado grande para mostrarlo; se puede mostrar como máximo 1 MB. + No es un archivo de texto, así que no se muestra aquí. + Archivos + Todos los archivos + Aquí aún no hay nada. Ni siquiera un agujero hobbit. Ajustes Instancias Cerrar sesión diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 6d2296f..81d03c4 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -66,6 +66,10 @@ Un fichier long, il est donc affiché en texte brut. Ce serveur ne peut pas encore transmettre le fichier à l\'application. Ouvrez-le plutôt dans le navigateur. Ce fichier est trop volumineux pour être affiché ; 1 Mo au plus peut être affiché. + Ce n\'est pas un fichier texte, il n\'est donc pas affiché ici. + Fichiers + Tous les fichiers + Rien ici pour l\'instant. Pas même un trou de hobbit. Paramètres Instances Se déconnecter diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 5aacf8f..b1dbb9c 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -66,6 +66,10 @@ Hosszú fájl, ezért egyszerű szövegként jelenik meg. Ez a szerver még nem tudja átadni a fájlt az alkalmazásnak. Nyissa meg inkább a böngészőben. Ez a fájl túl nagy a megjelenítéshez; legfeljebb 1 MB jeleníthető meg. + Ez nem szövegfájl, ezért itt nem jelenik meg. + Fájlok + Minden fájl + Itt még nincs semmi. Még egy hobbitlyuk sem. Beállítások Példányok Kijelentkezés diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 7d0ddec..4f087fd 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -66,6 +66,10 @@ Un file lungo, quindi è mostrato come testo semplice. Questo server non può ancora passare il file all\'app. Aprilo invece nel browser. Questo file è troppo grande da mostrare; si può mostrare al massimo 1 MB. + Non è un file di testo, quindi non viene mostrato qui. + File + Tutti i file + Ancora niente qui. Nemmeno una caverna hobbit. Impostazioni Istanze Esci diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 6e3ce59..7cc8f19 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -66,6 +66,10 @@ Długi plik, dlatego jest pokazany jako zwykły tekst. Ten serwer nie potrafi jeszcze przekazać pliku aplikacji. Otwórz go w przeglądarce. Ten plik jest za duży, by go pokazać; można pokazać najwyżej 1 MB. + To nie jest plik tekstowy, więc nie jest tu pokazywany. + Pliki + Wszystkie pliki + Jeszcze nic tu nie ma. Nawet hobbiciej norki. Ustawienia Instancje Wyloguj się diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 1332871..6ccfb9e 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -66,6 +66,10 @@ Dlhý súbor, preto je zobrazený ako obyčajný text. Tento server zatiaľ nevie aplikácii súbor odovzdať. Otvorte ho v prehliadači. Tento súbor je príliš veľký na zobrazenie; zobraziť možno najviac 1 MB. + Toto nie je textový súbor, preto sa tu nezobrazuje. + Súbory + Všetky súbory + Zatiaľ tu nič nie je. Ani hobitia nora. Nastavenia Inštancie Odhlásiť sa diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 70fe2ee..54206a9 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -67,6 +67,10 @@ A long file, so it is shown as plain text. This server cannot hand the file to the app yet. Open it in the browser instead. This file is too large to show here; at most 1 MB can be shown. + This is not a text file, so it is not shown here. + Files + All files + Nothing here yet. Not even a hobbit hole. Settings Instances Sign out diff --git a/scripts/strings.py b/scripts/strings.py index 62ddce4..38ac9b5 100755 --- a/scripts/strings.py +++ b/scripts/strings.py @@ -81,6 +81,11 @@ STRINGS: dict[str, str] = { "viewer_long_markdown": "A long file, so it is shown as plain text.", "viewer_unavailable": "This server cannot hand the file to the app yet. Open it in the browser instead.", "viewer_too_large": "This file is too large to show here; at most 1 MB can be shown.", + "viewer_not_text": "This is not a text file, so it is not shown here.", + # Files (the person's tree, read-only) + "files": "Files", + "files_all": "All files", + "files_empty": "Nothing here yet. Not even a hobbit hole.", # Settings "settings": "Settings", "settings_instances": "Instances",