Reports, "notify when", report notifications, and a page as a card (spec 3.8.0)
CI / check (push) Canceled after 0s

Built against the provisional /api/v2 shapes of the round's brief; the
server's fixtures are pinned when its reports routes are on its dev.

- Reports in the drawer with an unread badge; routes reports and
  report/{id}. The list: unread first, title, the schedule's name, when,
  importance marked; pull to refresh; swipe to mark read or to delete (asks
  once). A report reads as a page (Markdown as the chat draws it) and is
  marked read on open; Share hands over its text; Reply asks the server for
  the report's chat and opens the ordinary chat screen entered from the
  report: "Report: <title>" in the bar, Back to the report, never added to
  the chats list.
- Scheduled: "Notify when" on the form -- Every run / When... (the default
  prefilled) / Never, each with its line; sent as notify and notify_when. A
  run shows its note and a row to its report; the run's chat stays openable.
- Push kind `report`: a Reports channel; unlocked the title and summary,
  on the lock screen only the app's name and "New report"; tap and Open go
  to the report, Mark read needs the phone unlocked. `schedule` and
  `schedule_failed` from an older server are handled as before.
- A page in an answer (an html-view fence, the server's "[page: Title]"
  line, or a `page` step) is one quiet card; no web view, never the source,
  in a chat and in a report. Copy and Share take the one-line projection.
- An id that may come as a string or as an object (a report's chat, a run's
  report) is read either way.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
HomerandClaude Fable 5.2 committed 2026-11-13 09:38:58 +00:00
1 parent 118b2aa764
commit adc1c4fe3e
32 files changed
+1816 -34

No files matched your search

+33
View File
@@ -3,6 +3,39 @@
What changed in each release of LLeMbas for Android. Versions follow SemVer; until 1.0.0 the app What changed in each release of LLeMbas for Android. Versions follow SemVer; until 1.0.0 the app
is in alpha and releases come off `main`. is in alpha and releases come off `main`.
## [Unreleased] — for 1.0.0-beta.9
For LLeMbas server 2.0.0-beta.12 (harness spec 3.8.0); an older instance works as before.
### Added
- **Reports.** A scheduled task no longer answers into a chat: it files a report when it has
something to tell you, or leaves a line in its history. *Reports* is in the drawer, with a
count of the unread. The list has the unread first -- title, the task it came from, when, and
a mark where the model called it important; pull to read it again, swipe a row one way to mark
it read and the other to delete it (which asks once). A report reads as a page and is marked
read when opened; **Share** hands its text to another app; **Reply** continues it as a
conversation that stays with the report -- its bar says *Report: …*, Back returns to the
report, and it is not among your chats.
- **Notify when** on a scheduled task's form: *Every run* (the model writes a report every
time, also when nothing was found), *When…* (only when your own words hold; "something needs
my attention" to start from) or *Never* (runs are kept in the task's history only).
- A task's runs show the run's own note -- what it found, or why it filed no report -- and a way
to its report when it filed one. The run's working chat can still be opened from the run.
### Changed
- **Notifications come from a report, not from a run**, on a *Reports* channel of their own:
unlocked, the report's title and summary; on the lock screen only "New report". A tap opens
the report; *Mark read* asks for the phone to be unlocked. A run that filed no report notifies
nothing; a failed run still says that it failed. An instance on 2.0.0-beta.11 keeps sending
its runs' notifications, and they work as before.
- **A page in an answer is not drawn on the phone** (LLeMbas 2.0.0-beta.12 can let a model add
HTML pages to an answer; the web and LLeMbas Desktop show them). The phone shows one quiet
card -- *This answer has a page: …*, and where to open it -- in a chat and in a report, never
the page's source. What you copy or share says `[page: …]` in its place. The phone's chat
settings do not offer the switch.
## [1.0.0-beta.8] — 2026-11-12 ## [1.0.0-beta.8] — 2026-11-12
For LLeMbas server 2.0.0-beta.11 or later. Three files now: the standard app, `-notifications` (the same app with notification summaries) and `-fdroid`. For LLeMbas server 2.0.0-beta.11 or later. Three files now: the standard app, `-notifications` (the same app with notification summaries) and `-fdroid`.
+5
View File
@@ -197,6 +197,11 @@
android:name=".push.CardActionReceiver" android:name=".push.CardActionReceiver"
android:exported="false" /> android:exported="false" />
<!-- A report's Mark read, from its notification. -->
<receiver
android:name=".push.ReportActionReceiver"
android:exported="false" />
<!-- A scheduled task's Pause, from its notification. --> <!-- A scheduled task's Pause, from its notification. -->
<receiver <receiver
android:name=".push.ScheduleActionReceiver" android:name=".push.ScheduleActionReceiver"
@@ -42,12 +42,13 @@ class LembasApp : Application() {
NotificationChannel(CHANNEL_ASKS, getString(R.string.channel_asks), NotificationManager.IMPORTANCE_HIGH), NotificationChannel(CHANNEL_ASKS, getString(R.string.channel_asks), NotificationManager.IMPORTANCE_HIGH),
NotificationChannel(CHANNEL_SCHEDULED, getString(R.string.channel_scheduled), NotificationManager.IMPORTANCE_DEFAULT), NotificationChannel(CHANNEL_SCHEDULED, getString(R.string.channel_scheduled), NotificationManager.IMPORTANCE_DEFAULT),
NotificationChannel(CHANNEL_SCHEDULED_FAILURES, getString(R.string.channel_scheduled_failures), NotificationManager.IMPORTANCE_HIGH), NotificationChannel(CHANNEL_SCHEDULED_FAILURES, getString(R.string.channel_scheduled_failures), NotificationManager.IMPORTANCE_HIGH),
NotificationChannel(CHANNEL_REPORTS, getString(R.string.channel_reports), NotificationManager.IMPORTANCE_DEFAULT),
).onEach { it.lockscreenVisibility = android.app.Notification.VISIBILITY_PRIVATE } + ).onEach { it.lockscreenVisibility = android.app.Notification.VISIBILITY_PRIVATE } +
// A new version of the app says nothing about the account. // A new version of the app says nothing about the account.
NotificationChannel(CHANNEL_UPDATES, getString(R.string.channel_updates), NotificationManager.IMPORTANCE_LOW), NotificationChannel(CHANNEL_UPDATES, getString(R.string.channel_updates), NotificationManager.IMPORTANCE_LOW),
) )
// LLeMbas 2.0 has no reports, so 0.1's channel for them goes rather than sit empty in // 0.1's channel for its reports goes rather than sit empty in the system's settings;
// the system's settings. // the reports of LLeMbas 2.0 have a channel of their own (CHANNEL_REPORTS).
manager.deleteNotificationChannel("reports") manager.deleteNotificationChannel("reports")
// The launcher's long-press shortcuts, in the app's language as it is now. // The launcher's long-press shortcuts, in the app's language as it is now.
eu.llembas.android.widget.Shortcuts.publish(this) eu.llembas.android.widget.Shortcuts.publish(this)
@@ -58,6 +59,7 @@ class LembasApp : Application() {
const val CHANNEL_ASKS = "asks" const val CHANNEL_ASKS = "asks"
const val CHANNEL_SCHEDULED = "scheduled_results" const val CHANNEL_SCHEDULED = "scheduled_results"
const val CHANNEL_SCHEDULED_FAILURES = "scheduled_failures" const val CHANNEL_SCHEDULED_FAILURES = "scheduled_failures"
const val CHANNEL_REPORTS = "reports_filed"
const val CHANNEL_UPDATES = "updates" const val CHANNEL_UPDATES = "updates"
} }
} }
@@ -20,6 +20,7 @@ import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
import androidx.compose.runtime.key import androidx.compose.runtime.key
import androidx.compose.runtime.mutableStateMapOf
import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.runtime.rememberCoroutineScope
@@ -45,6 +46,8 @@ import eu.llembas.android.ui.home.ChatsViewModel
import eu.llembas.android.ui.home.DrawerActions import eu.llembas.android.ui.home.DrawerActions
import eu.llembas.android.ui.home.DrawerContent import eu.llembas.android.ui.home.DrawerContent
import eu.llembas.android.ui.memory.MemoryScreen import eu.llembas.android.ui.memory.MemoryScreen
import eu.llembas.android.ui.reports.ReportScreen
import eu.llembas.android.ui.reports.ReportsScreen
import eu.llembas.android.ui.scheduled.RunScreen import eu.llembas.android.ui.scheduled.RunScreen
import eu.llembas.android.ui.scheduled.ScheduleEditScreen import eu.llembas.android.ui.scheduled.ScheduleEditScreen
import eu.llembas.android.ui.scheduled.ScheduleScreen import eu.llembas.android.ui.scheduled.ScheduleScreen
@@ -65,7 +68,7 @@ import kotlinx.coroutines.launch
private data class Loaded(val instance: Instance?) private data class Loaded(val instance: Instance?)
/** Where a notification (or the assistant, or a share) asked the app to open. */ /** Where a notification (or the assistant, or a share) asked the app to open. */
private data class Opening(val chat: String?, val schedule: String?, val run: String? = null, val instance: String? = null) private data class Opening(val chat: String?, val schedule: String?, val run: String? = null, val instance: String? = null, val report: String? = null)
class MainActivity : ComponentActivity() { class MainActivity : ComponentActivity() {
/** A chat or a schedule a notification, the assistant or a share asked to open; consumed once. */ /** A chat or a schedule a notification, the assistant or a share asked to open; consumed once. */
@@ -139,8 +142,9 @@ class MainActivity : ComponentActivity() {
val schedule = intent?.getStringExtra(Notifications.EXTRA_SCHEDULE) val schedule = intent?.getStringExtra(Notifications.EXTRA_SCHEDULE)
val run = intent?.getStringExtra(Notifications.EXTRA_RUN) val run = intent?.getStringExtra(Notifications.EXTRA_RUN)
val instance = intent?.getStringExtra(Notifications.EXTRA_INSTANCE) val instance = intent?.getStringExtra(Notifications.EXTRA_INSTANCE)
if (chat == null && schedule == null) return val report = intent?.getStringExtra(Notifications.EXTRA_REPORT)
opening.value = Opening(chat, schedule, run, instance) if (chat == null && schedule == null && report == null) return
opening.value = Opening(chat, schedule, run, instance, report)
// A notification from another of the person's instances: that one comes into use, and // A notification from another of the person's instances: that one comes into use, and
// its pages (keyed by the instance) open what was asked. // its pages (keyed by the instance) open what was asked.
if (instance != null) { if (instance != null) {
@@ -208,6 +212,8 @@ class MainActivity : ComponentActivity() {
when { when {
it.chat != null -> top("chat/${it.chat}") it.chat != null -> top("chat/${it.chat}")
it.report != null -> over("report/${it.report}")
it.schedule != null -> { it.schedule != null -> {
over("schedule/${it.schedule}") over("schedule/${it.schedule}")
it.run?.let { run -> over("schedule/${it.schedule}/run/$run") } it.run?.let { run -> over("schedule/${it.schedule}/run/$run") }
@@ -242,6 +248,8 @@ class MainActivity : ComponentActivity() {
override fun scheduled() = over("scheduled") override fun scheduled() = over("scheduled")
override fun reports() = over("reports")
override fun archived() = over("archived") override fun archived() = over("archived")
override fun memory() = over("memory") override fun memory() = over("memory")
@@ -255,6 +263,8 @@ class MainActivity : ComponentActivity() {
override fun search(query: String) = chats.search(query) override fun search(query: String) = chats.search(query)
} }
} }
// The title of each report whose conversation was opened, by its chat: what that chat's bar says.
val reportTitles = remember { mutableStateMapOf<String, String>() }
val menu: () -> Unit = { scope.launch { drawer.open() } } val menu: () -> Unit = { scope.launch { drawer.open() } }
ModalNavigationDrawer( ModalNavigationDrawer(
drawerState = drawer, drawerState = drawer,
@@ -299,6 +309,30 @@ class MainActivity : ComponentActivity() {
ArchivedScreen(onBack = { nav.popBackStack() }, onOpen = { top("chat/$it") }, onRestored = { chats.load() }) ArchivedScreen(onBack = { nav.popBackStack() }, onOpen = { top("chat/$it") }, onRestored = { chats.load() })
} }
composable("memory") { MemoryScreen(onBack = { nav.popBackStack() }) } composable("memory") { MemoryScreen(onBack = { nav.popBackStack() }) }
composable("reports") { ReportsScreen(onBack = { nav.popBackStack() }, onOpen = { over("report/$it") }) }
composable("report/{id}") { e ->
ReportScreen(
e.arguments?.getString("id").orEmpty(),
onBack = { nav.popBackStack() },
onReply = { chat, title ->
reportTitles[chat] = title
over("report-chat/$chat")
},
)
}
// A report's conversation: the ordinary chat screen, entered from the report and
// left back to it. It is not among the chats (the server keeps it under Reports),
// so nothing here puts it into the drawer's list either.
composable("report-chat/{id}") { e ->
val id = e.arguments?.getString("id")
ChatScreen(
chatId = id,
onMenu = { nav.popBackStack() },
onNewChat = { top("new") },
onLeave = { nav.popBackStack() },
report = reportTitles[id].orEmpty(),
)
}
composable("scheduled") { composable("scheduled") {
ScheduledScreen( ScheduledScreen(
onBack = { nav.popBackStack() }, onBack = { nav.popBackStack() },
@@ -317,6 +351,7 @@ class MainActivity : ComponentActivity() {
onBack = { nav.popBackStack() }, onBack = { nav.popBackStack() },
onEdit = { over("schedule-edit/$it") }, onEdit = { over("schedule-edit/$it") },
onOpenRun = { run -> over("schedule/$id/run/$run") }, onOpenRun = { run -> over("schedule/$id/run/$run") },
onOpenReport = { report -> over("report/$report") },
) )
} }
composable("schedule/{id}/run/{run}") { e -> composable("schedule/{id}/run/{run}") { e ->
@@ -325,6 +360,7 @@ class MainActivity : ComponentActivity() {
e.arguments?.getString("run").orEmpty(), e.arguments?.getString("run").orEmpty(),
onBack = { nav.popBackStack() }, onBack = { nav.popBackStack() },
onOpenChat = { top("chat/$it") }, onOpenChat = { top("chat/$it") },
onOpenReport = { over("report/$it") },
) )
} }
composable("schedule-new") { composable("schedule-new") {
@@ -291,8 +291,7 @@ class ApiClient(val base: String, private val token: String, val http: OkHttpCli
suspend fun deleteChat(chatId: String) = empty(authed("$v2/chats/$chatId").delete().build()) suspend fun deleteChat(chatId: String) = empty(authed("$v2/chats/$chatId").delete().build())
suspend fun stop(chatId: String, messageId: String) = suspend fun stop(chatId: String, messageId: String) = empty(authed("$v2/chats/$chatId/messages/$messageId/stop").post("{}".toRequestBody(JSON)).build())
empty(authed("$v2/chats/$chatId/messages/$messageId/stop").post(ByteArray(0).toRequestBody(null)).build())
suspend fun edit(chatId: String, messageId: String, text: String): Turn = suspend fun edit(chatId: String, messageId: String, text: String): Turn =
send("POST", "/chats/$chatId/messages/$messageId/edit", buildJsonObject { put("text", text) }) send("POST", "/chats/$chatId/messages/$messageId/edit", buildJsonObject { put("text", text) })
@@ -334,7 +333,7 @@ class ApiClient(val base: String, private val token: String, val http: OkHttpCli
* server refuses in its own words (409) while a reply is being written or with nothing to * server refuses in its own words (409) while a reply is being written or with nothing to
* summarise; the transcript is read again after, for the divider it leaves. * summarise; the transcript is read again after, for the divider it leaves.
*/ */
suspend fun compact(chatId: String) = empty(authed("$v2/chats/$chatId/compact").post(ByteArray(0).toRequestBody(null)).build()) suspend fun compact(chatId: String) = empty(authed("$v2/chats/$chatId/compact").post("{}".toRequestBody(JSON)).build())
suspend fun team(chatId: String, since: Int = 0): TeamView = get<TeamEnvelope>("/chats/$chatId/team?since=$since").team suspend fun team(chatId: String, since: Int = 0): TeamView = get<TeamEnvelope>("/chats/$chatId/team?since=$since").team
@@ -371,13 +370,18 @@ class ApiClient(val base: String, private val token: String, val http: OkHttpCli
* Save what the compile made of [words]: a new schedule (201), or with [id] the one being * Save what the compile made of [words]: a new schedule (201), or with [id] the one being
* edited. The words go along as the schedule's `request`, so editing starts from them. * edited. The words go along as the schedule's `request`, so editing starts from them.
*/ */
suspend fun saveSchedule(compiled: ScheduleCompiled, words: String, id: String? = null): Schedule { suspend fun saveSchedule(compiled: ScheduleCompiled, words: String, id: String? = null, notify: String? = null, notifyWhen: String = ""): Schedule {
val body = buildJsonObject { val body = buildJsonObject {
put("title", compiled.title) put("title", compiled.title)
put("instruction", compiled.instruction) put("instruction", compiled.instruction)
put("rule", compiled.rule) put("rule", compiled.rule)
put("target", compiled.target) put("target", compiled.target)
if (id == null) put("request", words) if (id == null) put("request", words)
// Notify when (spec 3.8.0): left out where the form did not say, so an older server is sent nothing new.
if (notify != null) {
put("notify", notify)
if (notify == "when") put("notify_when", notifyWhen.trim().ifBlank { NOTIFY_DEFAULT_CONDITION })
}
} }
return if (id == null) { return if (id == null) {
send<ScheduleEnvelope>("POST", "/schedules", body).schedule send<ScheduleEnvelope>("POST", "/schedules", body).schedule
@@ -386,6 +390,27 @@ class ApiClient(val base: String, private val token: String, val http: OkHttpCli
} }
} }
// --- Reports (`schedule.use`) ---------------------------------------------------------------
/** The reports, newest first; [unread] only those not read yet, [schedule] only one schedule's. */
suspend fun reports(unread: Boolean = false, schedule: String? = null): List<Report> {
val asked = listOfNotNull(if (unread) "unread=1" else null, schedule?.let { "schedule=" + segment(it) }).joinToString("&")
return get<ReportList>(if (asked.isEmpty()) "/reports" else "/reports?" + asked).reports
}
/** One report with its body. Read as the report itself, or as `{report: …}` around it. */
suspend fun report(id: String): Report {
val answer = get<JsonObject>("/reports/${segment(id)}")
return LembasJson.decodeFromJsonElement(Report.serializer(), answer["report"] as? JsonObject ?: answer)
}
suspend fun readReport(id: String) = empty(authed("$v2/reports/${segment(id)}/read").post("{}".toRequestBody(JSON)).build())
suspend fun deleteReport(id: String) = empty(authed("$v2/reports/${segment(id)}").delete().build())
/** Continue the report as a conversation: the chat it is in, which stays under Reports. */
suspend fun replyToReport(id: String): String? = send<ReportReply>("POST", "/reports/${segment(id)}/reply", null).chatId
suspend fun pauseSchedule(id: String, paused: Boolean): Schedule = suspend fun pauseSchedule(id: String, paused: Boolean): Schedule =
send<ScheduleEnvelope>("POST", "/schedules/${segment(id)}/" + if (paused) "pause" else "resume", null).schedule send<ScheduleEnvelope>("POST", "/schedules/${segment(id)}/" + if (paused) "pause" else "resume", null).schedule
@@ -512,7 +512,7 @@ data class FileContent(
@Serializable @Serializable
data class SteerNote(val id: String = "", val text: String = "") data class SteerNote(val id: String = "", val text: String = "")
/** One step of a reply: `thinking`, `text`, `tools` or `steer`. */ /** One step of a reply: `thinking`, `text`, `tools`, `steer` or `page`. */
@Serializable @Serializable
data class Step( data class Step(
val index: Int = 0, val index: Int = 0,
@@ -521,6 +521,8 @@ data class Step(
val text: String? = null, val text: String? = null,
val label: String? = null, val label: String? = null,
val markdown: String? = null, val markdown: String? = null,
/** A `page` step's title (spec 3.8.0): the page itself is not sent to a client that does not draw it. */
val title: String? = null,
val calls: List<ToolCall> = emptyList(), val calls: List<ToolCall> = emptyList(),
val messages: List<SteerNote> = emptyList(), val messages: List<SteerNote> = emptyList(),
) )
@@ -715,6 +717,10 @@ data class PushPayload(
*/ */
@SerialName("schedule_id") val scheduleId: String? = null, @SerialName("schedule_id") val scheduleId: String? = null,
@SerialName("run_id") val runId: String? = null, @SerialName("run_id") val runId: String? = null,
/** A report was filed (`kind` `report`, spec 3.8.0): its id; [title] and [body] are its title and summary, [url] `/reports/{id}`. */
@SerialName("report_id") val reportId: String? = null,
/** A report's `normal` or `high`. */
val importance: String? = null,
val status: String? = null, val status: String? = null,
val visibility: String? = null, val visibility: String? = null,
val actions: List<String> = emptyList(), val actions: List<String> = emptyList(),
@@ -0,0 +1,79 @@
package eu.llembas.android.api
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.Serializable
import kotlinx.serialization.json.JsonElement
import kotlinx.serialization.json.JsonNames
import kotlinx.serialization.json.JsonObject
import kotlinx.serialization.json.JsonPrimitive
import kotlinx.serialization.json.contentOrNull
// --- Reports (`/api/v2/reports`, harness spec 3.8.0 `reports.md`) -----------------------------
//
// A schedule's run does not answer into a chat: it files a report, or it does not. The server
// stores the reports and lists them; a report's body is Markdown, as a reply is.
//
// The shapes are read leniently where an id may come as a string or as an object carrying one
// ([chat], a run's `report`), so that a server that says a little more still parses; the
// contract fixtures (`contract/report*.json`) pin what it says.
/** The schedule a report came from: its id and its name. */
@Serializable
data class ReportSchedule(val id: String = "", val title: String = "")
/**
* One report: [title] a headline, [summary] a sentence or two for a list or a notification,
* [importance] `normal` or `high` (look now), the [schedule] that filed it, [created] when, and
* whether it is still [unread]. Read alone it also carries its [body] (Markdown a model wrote:
* untrusted) and the [chat] a reply continues in, once there is one.
*/
@OptIn(ExperimentalSerializationApi::class)
@Serializable
data class Report(
val id: String,
val title: String = "",
val summary: String = "",
val importance: String = "normal",
val schedule: ReportSchedule? = null,
@JsonNames("created_at") val created: String? = null,
val unread: Boolean = false,
val body: String? = null,
val chat: JsonElement? = null,
) {
val high: Boolean get() = importance == "high"
/** The chat a reply to this report continues in; null before the first reply. */
val chatId: String? get() = idOf(chat)
}
@Serializable
data class ReportList(val reports: List<Report> = emptyList(), val more: Boolean = false)
/** `POST /reports/{id}/reply`: the chat the conversation about the report is in. */
@Serializable
data class ReportReply(val chat: JsonElement? = null) {
val chatId: String? get() = idOf(chat)
}
/** An id that came as a string, or as an object with an `id`; null for anything else. */
internal fun idOf(element: JsonElement?): String? = when (element) {
is JsonPrimitive -> element.contentOrNull?.takeIf { element.isString && it.isNotBlank() }
is JsonObject -> idOf(element["id"])
else -> null
}
/** Reports as the list shows them: the unread first, then the newest first within each half. */
fun sortedReports(reports: List<Report>): List<Report> = reports.sortedWith(compareByDescending<Report> { it.unread }.thenByDescending { it.created.orEmpty() })
/**
* When a schedule's owner wants to hear from it (`loop.json` `scheduled.notify`): `always` (a
* report every run), `when` (only when the person's own words hold) or `never` (history only).
* A server before 3.8.0 said `matters` for what is now `when`; anything else is the default.
*/
fun notifyChoice(notify: String): String = when (notify) {
"always", "never" -> notify
else -> "when"
}
/** `scheduled.notify.default_condition`: what "When…" starts from, in the spec's words. */
const val NOTIFY_DEFAULT_CONDITION = "something needs my attention"
@@ -2,6 +2,7 @@ package eu.llembas.android.api
import kotlinx.serialization.SerialName import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.json.JsonElement
import kotlinx.serialization.json.JsonObject import kotlinx.serialization.json.JsonObject
// --- Scheduled tasks (`/api/v2/schedules`) ------------------------------------------------ // --- Scheduled tasks (`/api/v2/schedules`) ------------------------------------------------
@@ -67,13 +68,20 @@ data class ScheduleRun(
val notification: RunNotification? = null, val notification: RunNotification? = null,
/** A watching schedule's look at its address on this run (`unchanged` when nothing moved). */ /** A watching schedule's look at its address on this run (`unchanged` when nothing moved). */
val watch: RunWatch? = null, val watch: RunWatch? = null,
) /** The run's line in the history (spec 3.8.0): the answer's first line, or why no report was filed. */
val note: String = "",
/** The report this run filed, when it filed one: its id (or an object carrying it). */
val report: JsonElement? = null,
) {
val reportId: String? get() = idOf(report)
}
/** /**
* A scheduled task. [description] is the rule in words, as the server says it ("On the second * A scheduled task. [description] is the rule in words, as the server says it ("On the second
* Monday of each month at 07:30"), in [timezone]; [rule] the server's own form of it; [request] * Monday of each month at 07:30"), in [timezone]; [rule] the server's own form of it; [request]
* the person's words it was made from; [instruction] what the model is asked each time. * the person's words it was made from; [instruction] what the model is asked each time.
* [notify] is `always`, `matters` or `never`; [mode] `fresh` (a chat per run) or `continue`. * [notify] is `always`, `when` or `never` (spec 3.8.0; `matters` before it) and [notifyWhen] the
* person's own words for `when`; [mode] `fresh` (a chat per run) or `continue`.
*/ */
@Serializable @Serializable
data class Schedule( data class Schedule(
@@ -90,6 +98,7 @@ data class Schedule(
val target: String = "chat", val target: String = "chat",
val mode: String = "", val mode: String = "",
val notify: String = "", val notify: String = "",
@SerialName("notify_when") val notifyWhen: String = "",
@SerialName("catch_up") val catchUp: String = "", @SerialName("catch_up") val catchUp: String = "",
@SerialName("grace_minutes") val graceMinutes: Int? = null, @SerialName("grace_minutes") val graceMinutes: Int? = null,
val model: String? = null, val model: String? = null,
@@ -100,10 +100,12 @@ object Notifications {
const val EXTRA_SCHEDULE = "eu.llembas.android.SCHEDULE" const val EXTRA_SCHEDULE = "eu.llembas.android.SCHEDULE"
const val EXTRA_RUN = "eu.llembas.android.RUN" const val EXTRA_RUN = "eu.llembas.android.RUN"
const val EXTRA_REPORT = "eu.llembas.android.REPORT"
fun show(context: Context, instance: String, payload: PushPayload) { fun show(context: Context, instance: String, payload: PushPayload) {
if (ContextCompat.checkSelfPermission(context, Manifest.permission.POST_NOTIFICATIONS) != PackageManager.PERMISSION_GRANTED) return if (ContextCompat.checkSelfPermission(context, Manifest.permission.POST_NOTIFICATIONS) != PackageManager.PERMISSION_GRANTED) return
if (payload.kind == "schedule" || payload.kind == "schedule_failed") return scheduled(context, instance, payload) if (payload.kind == "schedule" || payload.kind == "schedule_failed") return scheduled(context, instance, payload)
if (payload.kind == ReportNotice.KIND) return report(context, instance, payload)
val chatId = payload.chatId ?: payload.url.removePrefix("/chat/").takeIf { payload.url.startsWith("/chat/") } val chatId = payload.chatId ?: payload.url.removePrefix("/chat/").takeIf { payload.url.startsWith("/chat/") }
val id = (chatId ?: payload.url).hashCode() val id = (chatId ?: payload.url).hashCode()
val open = opener(context, instance, id, chatId = chatId) val open = opener(context, instance, id, chatId = chatId)
@@ -176,12 +178,66 @@ object Notifications {
NotificationManagerCompat.from(context).notify(notice.id, builder.build()) NotificationManagerCompat.from(context).notify(notice.id, builder.build())
} }
/**
* A report was filed (spec 3.8.0): what a scheduled task has to tell, on the Reports channel.
* Unlocked: the report's title and its summary. On the lock screen only the public version:
* the app's name and "New report" -- nothing from the account (Working-notes rule 5). A tap
* and Open go to the report; Mark read marks it, once the phone is unlocked. A run that
* filed no report sends nothing, so there is nothing to show for it; a failed run still has
* its own notification ([scheduled]).
*/
private fun report(context: Context, instance: String, payload: PushPayload) {
val notice = ReportNotice.from(payload) ?: return
NotificationManagerCompat.from(context).notify(notice.id, reportNotification(context, instance, notice))
}
/** The report's notification, apart from posting it, so a test can read both of its faces. */
fun reportNotification(context: Context, instance: String, notice: ReportNotice): Notification {
val fixed = context.getString(R.string.report_new_public)
val open = opener(context, instance, notice.id, chatId = null, reportId = notice.reportId)
val public = NotificationCompat.Builder(context, LembasApp.CHANNEL_REPORTS)
.setSmallIcon(R.drawable.ic_notification)
.setContentTitle(context.getString(R.string.app_name))
.setContentText(fixed)
.build()
val read = PendingIntent.getBroadcast(
context,
("read" + notice.reportId).hashCode(),
Intent(context, ReportActionReceiver::class.java)
.putExtra("instance", instance)
.putExtra("report", notice.reportId)
.putExtra("notification", notice.id),
PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT,
)
return NotificationCompat.Builder(context, LembasApp.CHANNEL_REPORTS)
.setSmallIcon(R.drawable.ic_notification)
.setContentTitle(notice.title.ifBlank { fixed })
.setContentText(notice.summary)
.setStyle(NotificationCompat.BigTextStyle().bigText(notice.summary))
.setAutoCancel(true)
.setContentIntent(open)
.setCategory(Notification.CATEGORY_STATUS)
.setPriority(if (notice.high) NotificationCompat.PRIORITY_HIGH else NotificationCompat.PRIORITY_DEFAULT)
.setVisibility(NotificationCompat.VISIBILITY_PRIVATE)
.setPublicVersion(public)
.addAction(0, context.getString(R.string.viewer_open), open)
.addAction(unlocked(context.getString(R.string.report_mark_read), read))
.build()
}
/** A notification action Android runs only once the phone is unlocked. */ /** A notification action Android runs only once the phone is unlocked. */
private fun unlocked(title: String, intent: PendingIntent): NotificationCompat.Action = private fun unlocked(title: String, intent: PendingIntent): NotificationCompat.Action =
NotificationCompat.Action.Builder(0, title, intent).setAuthenticationRequired(true).build() NotificationCompat.Action.Builder(0, title, intent).setAuthenticationRequired(true).build()
private fun opener(context: Context, instance: String, id: Int, chatId: String?, scheduleId: String? = null, runId: String? = null): PendingIntent = private fun opener(
PendingIntent.getActivity( context: Context,
instance: String,
id: Int,
chatId: String?,
scheduleId: String? = null,
runId: String? = null,
reportId: String? = null,
): PendingIntent = PendingIntent.getActivity(
context, context,
id, id,
Intent(context, MainActivity::class.java) Intent(context, MainActivity::class.java)
@@ -189,6 +245,7 @@ object Notifications {
.putExtra(EXTRA_CHAT, chatId) .putExtra(EXTRA_CHAT, chatId)
.putExtra(EXTRA_SCHEDULE, scheduleId) .putExtra(EXTRA_SCHEDULE, scheduleId)
.putExtra(EXTRA_RUN, runId) .putExtra(EXTRA_RUN, runId)
.putExtra(EXTRA_REPORT, reportId)
.putExtra(EXTRA_INSTANCE, instance), .putExtra(EXTRA_INSTANCE, instance),
PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT, PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT,
) )
@@ -242,6 +299,24 @@ class CardActionReceiver : BroadcastReceiver() {
} }
} }
/** A report's Mark read, from its notification. */
class ReportActionReceiver : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
val pending = goAsync()
val instance = intent.getStringExtra("instance") ?: return pending.finish()
val report = intent.getStringExtra("report") ?: return pending.finish()
background.launch {
try {
// A report that is gone is as good as read; the notification goes either way.
Push.instance(context, instance)?.let { found -> runCatching { context.lembas.instances.clientFor(found).readReport(report) } }
NotificationManagerCompat.from(context).cancel(intent.getIntExtra("notification", 0))
} finally {
pending.finish()
}
}
}
}
/** A scheduled task's Pause or Run again, from its notification. */ /** A scheduled task's Pause or Run again, from its notification. */
class ScheduleActionReceiver : BroadcastReceiver() { class ScheduleActionReceiver : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) { override fun onReceive(context: Context, intent: Intent) {
@@ -0,0 +1,31 @@
package eu.llembas.android.push
import eu.llembas.android.api.PushPayload
/**
* What a filed report's push asks the app to show (harness spec 3.8.0, `reports.md` §4:
* notifications come from the report, not from the run). [title] and [summary] are a model's
* words about the person's own things: for an unlocked phone only. The lock screen gets the
* app's fixed words and nothing else. A payload without the id falls back to its `url`
* (`/reports/{id}`), as a browser would open it.
*/
data class ReportNotice(val reportId: String, val title: String, val summary: String, val high: Boolean) {
/** One notification per report: a later push about the same report replaces it. */
val id: Int get() = "report:$reportId".hashCode()
companion object {
const val KIND = "report"
fun from(payload: PushPayload): ReportNotice? {
if (payload.kind != KIND) return null
val id = payload.reportId?.takeIf { it.isNotBlank() } ?: fromUrl(payload.url) ?: return null
return ReportNotice(id, payload.title, payload.body, high = payload.importance == "high")
}
/** `/reports/{id}` → the id; null for anything else. */
fun fromUrl(url: String): String? {
if (!url.startsWith("/reports/")) return null
return url.removePrefix("/reports/").substringBefore('?').substringBefore('/').takeIf { it.isNotBlank() }
}
}
}
@@ -8,11 +8,45 @@ package eu.llembas.android.ui
* *
* A fence that is not closed yet runs to the end: while a reply is being written, the code it * A fence that is not closed yet runs to the end: while a reply is being written, the code it
* is in the middle of is already a code block, not markdown that changes shape when it closes. * is in the middle of is already a code block, not markdown that changes shape when it closes.
*
* **A page** (harness spec 3.8.0, `pages.md`: a whole HTML document in an `html-view` fence) is
* not drawn on a phone and its source is never shown: the fence becomes [Segment.Page] with its
* title, and so does the line the server puts in a page's place where a reply is read as text,
* `[page: Title]`. One still being written is a page already ([Segment.Page.closed] false).
*/ */
sealed interface Segment { sealed interface Segment {
data class Prose(val markdown: String) : Segment data class Prose(val markdown: String) : Segment
data class Code(val language: String, val code: String, val closed: Boolean = true) : Segment data class Code(val language: String, val code: String, val closed: Boolean = true) : Segment
data class Page(val title: String, val closed: Boolean = true) : Segment
}
/** `pages.fence`: the fence's word, exact. */
private const val PAGE_FENCE = "html-view"
/** `pages.title_max`. */
private const val PAGE_TITLE_MAX = 80
private val PAGE_OPENING = Regex("^ {0,3}(?:`{3,}|~{3,})$PAGE_FENCE(?:\\s+(.*))?$")
/** `pages.projection`, on a line of its own. */
private val PAGE_LINE = Regex("^\\s*\\[page: (.*)]\\s*$")
/** A page's title as written: white space collapsed, cut to the spec's length; empty when it has none. */
private fun pageTitle(raw: String?): String = raw.orEmpty().trim().replace(Regex("\\s+"), " ").take(PAGE_TITLE_MAX)
/**
* A reply's text with every page replaced by the spec's one line, `[page: Title]`: what Copy,
* Share and read-aloud take, so a page's source never leaves as "the answer". [untitled] names
* a page without a title.
*/
fun pageProjection(markdown: String, untitled: String): String = splitFences(markdown).joinToString("\n\n") { segment ->
when (segment) {
is Segment.Prose -> segment.markdown
is Segment.Code -> "```${segment.language}\n${segment.code}\n```"
is Segment.Page -> "[page: ${segment.title.ifBlank { untitled }}]"
}
} }
private val OPENING = Regex("^ {0,3}(`{3,}|~{3,})\\s*([^`\\s]*).*$") private val OPENING = Regex("^ {0,3}(`{3,}|~{3,})\\s*([^`\\s]*).*$")
@@ -32,13 +66,20 @@ fun splitFences(markdown: String): List<Segment> {
while (i < lines.size) { while (i < lines.size) {
val open = OPENING.matchEntire(lines[i]) val open = OPENING.matchEntire(lines[i])
if (open == null) { if (open == null) {
val page = PAGE_LINE.matchEntire(lines[i])
if (page != null) {
flushProse()
out += Segment.Page(pageTitle(page.groupValues[1]))
} else {
prose.append(lines[i]).append('\n') prose.append(lines[i]).append('\n')
}
i++ i++
continue continue
} }
flushProse() flushProse()
val fence = open.groupValues[1] val fence = open.groupValues[1]
val language = open.groupValues[2] val language = open.groupValues[2]
val page = PAGE_OPENING.matchEntire(lines[i])
val closing = Regex("^ {0,3}${Regex.escape(fence.substring(0, 1))}{${fence.length},}\\s*$") val closing = Regex("^ {0,3}${Regex.escape(fence.substring(0, 1))}{${fence.length},}\\s*$")
val code = mutableListOf<String>() val code = mutableListOf<String>()
i++ i++
@@ -52,7 +93,7 @@ fun splitFences(markdown: String): List<Segment> {
code += lines[i] code += lines[i]
i++ i++
} }
out += Segment.Code(language, code.joinToString("\n"), closed) out += if (page != null) Segment.Page(pageTitle(page.groupValues[1]), closed) else Segment.Code(language, code.joinToString("\n"), closed)
} }
flushProse() flushProse()
return out return out
@@ -35,6 +35,7 @@ import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.verticalScroll import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.ArrowBack
import androidx.compose.material.icons.filled.Archive import androidx.compose.material.icons.filled.Archive
import androidx.compose.material.icons.filled.Bolt import androidx.compose.material.icons.filled.Bolt
import androidx.compose.material.icons.filled.ChatBubbleOutline import androidx.compose.material.icons.filled.ChatBubbleOutline
@@ -112,6 +113,8 @@ fun ChatScreen(
onOpened: (String) -> Unit = {}, onOpened: (String) -> Unit = {},
agent: Boolean = false, agent: Boolean = false,
onKind: ((agent: Boolean) -> Unit)? = null, onKind: ((agent: Boolean) -> Unit)? = null,
/** Entered from a report (its Reply): the bar says "Report: title" and has Back, to the report, where the menu is. */
report: String? = null,
model: ChatViewModel = viewModel(key = chatId ?: if (agent) "new-agent" else "new"), model: ChatViewModel = viewModel(key = chatId ?: if (agent) "new-agent" else "new"),
) { ) {
val state by model.state.collectAsStateWithLifecycle() val state by model.state.collectAsStateWithLifecycle()
@@ -155,6 +158,7 @@ fun ChatScreen(
onActivity = { activityOpen = true }, onActivity = { activityOpen = true },
onShow = { showing = it }, onShow = { showing = it },
onKind = onKind, onKind = onKind,
report = report,
) )
} }
@@ -167,6 +171,10 @@ fun ChatScreen(
} }
} }
/** What the bar says of a chat entered from a report: "Report: title", or "Report" when the title is not known. */
@Composable
private fun reportTitle(title: String): String = if (title.isBlank()) stringResource(R.string.report) else stringResource(R.string.report_chat_title, title)
/** /**
* The chat as it is drawn, from [state] alone: what the screenshot tests render with fake data. * The chat as it is drawn, from [state] alone: what the screenshot tests render with fake data.
* Everything it does goes through [actions]. * Everything it does goes through [actions].
@@ -183,6 +191,7 @@ fun ChatContent(
onActivity: () -> Unit = {}, onActivity: () -> Unit = {},
onShow: (ShowCard) -> Unit = {}, onShow: (ShowCard) -> Unit = {},
onKind: ((agent: Boolean) -> Unit)? = null, onKind: ((agent: Boolean) -> Unit)? = null,
report: String? = null,
) { ) {
val palette = LocalPalette.current val palette = LocalPalette.current
val context = LocalContext.current val context = LocalContext.current
@@ -224,13 +233,18 @@ fun ChatContent(
TopAppBar( TopAppBar(
colors = TopAppBarDefaults.topAppBarColors(containerColor = palette.bg, scrolledContainerColor = palette.bg), colors = TopAppBarDefaults.topAppBarColors(containerColor = palette.bg, scrolledContainerColor = palette.bg),
navigationIcon = { navigationIcon = {
if (report != null) {
// A report's conversation is reached from the report, and Back returns there.
IconButton(onClick = onMenu) { Icon(Icons.AutoMirrored.Filled.ArrowBack, contentDescription = stringResource(R.string.back)) }
} else {
IconButton(onClick = onMenu) { Icon(Icons.Filled.Menu, contentDescription = stringResource(R.string.chats_open)) } IconButton(onClick = onMenu) { Icon(Icons.Filled.Menu, contentDescription = stringResource(R.string.chats_open)) }
}
}, },
title = { title = {
ModelTitle( ModelTitle(
model = info, model = info,
fallback = state.modelId ?: stringResource(R.string.app_name), fallback = state.modelId ?: stringResource(R.string.app_name),
subtitle = chat?.title?.ifBlank { null }, subtitle = if (report != null) reportTitle(report) else chat?.title?.ifBlank { null },
onClick = { picking = true }, onClick = { picking = true },
) )
}, },
@@ -45,6 +45,7 @@ import androidx.compose.material.icons.filled.Psychology
import androidx.compose.material.icons.filled.Refresh import androidx.compose.material.icons.filled.Refresh
import androidx.compose.material.icons.filled.SelectAll import androidx.compose.material.icons.filled.SelectAll
import androidx.compose.material.icons.filled.Stop import androidx.compose.material.icons.filled.Stop
import androidx.compose.material.icons.filled.Web
import androidx.compose.material3.AlertDialog import androidx.compose.material3.AlertDialog
import androidx.compose.material3.CircularProgressIndicator import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.DropdownMenu import androidx.compose.material3.DropdownMenu
@@ -90,6 +91,7 @@ import eu.llembas.android.lembas
import eu.llembas.android.ui.MarkdownText import eu.llembas.android.ui.MarkdownText
import eu.llembas.android.ui.Segment import eu.llembas.android.ui.Segment
import eu.llembas.android.ui.highlight import eu.llembas.android.ui.highlight
import eu.llembas.android.ui.pageProjection
import eu.llembas.android.ui.progressLineOf import eu.llembas.android.ui.progressLineOf
import eu.llembas.android.ui.splitFences import eu.llembas.android.ui.splitFences
import eu.llembas.android.ui.theme.LocalPalette import eu.llembas.android.ui.theme.LocalPalette
@@ -296,8 +298,19 @@ fun AssistantMessage(
} }
/** A reply's own words, as the person would copy them: its text steps, in order. */ /** A reply's own words, as the person would copy them: its text steps, in order. */
fun replyText(message: Message): String = fun replyText(message: Message): String = pageProjection(
message.steps.filter { it.kind == "text" }.mapNotNull { it.markdown }.joinToString("\n\n").ifBlank { message.text.orEmpty() } message.steps.mapNotNull { step ->
when (step.kind) {
"text" -> step.markdown
"page" -> "[page: ${step.title.orEmpty()}]"
else -> null
}
}.joinToString("\n\n").ifBlank { message.text.orEmpty() },
untitled = PAGE_UNTITLED,
)
/** `pages.untitled`, for the text that is copied or read aloud (the card says it in the app's language). */
private const val PAGE_UNTITLED = "Page"
/** What a finished reply cost, in one quiet line: model, tokens, speed. Null when nothing was counted. */ /** What a finished reply cost, in one quiet line: model, tokens, speed. Null when nothing was counted. */
private fun footLine(message: Message): String? { private fun footLine(message: Message): String? {
@@ -354,8 +367,14 @@ fun StepsCompact(steps: List<Step>, modifier: Modifier = Modifier, onShow: ((Sho
steps.forEach { step -> steps.forEach { step ->
when (step.kind) { when (step.kind) {
"thinking" -> ThinkingChip(step) "thinking" -> ThinkingChip(step)
"text" -> RichMarkdown(step.markdown.orEmpty(), onLongPress = onLongPress) "text" -> RichMarkdown(step.markdown.orEmpty(), onLongPress = onLongPress)
// A page the server took out of the text as a step of its own: the same card.
"page" -> PageCard(step.title.orEmpty())
"tools" -> ToolsChip(step, onShow) "tools" -> ToolsChip(step, onShow)
"steer" -> step.messages.forEach { Steered(it.text) } "steer" -> step.messages.forEach { Steered(it.text) }
} }
} }
@@ -371,11 +390,39 @@ fun RichMarkdown(markdown: String, modifier: Modifier = Modifier, onLongPress: (
when (segment) { when (segment) {
is Segment.Prose -> MarkdownText(segment.markdown, modifier = Modifier.fillMaxWidth(), onLongPress = onLongPress) is Segment.Prose -> MarkdownText(segment.markdown, modifier = Modifier.fillMaxWidth(), onLongPress = onLongPress)
is Segment.Code -> CodeBlock(segment.language, segment.code) is Segment.Code -> CodeBlock(segment.language, segment.code)
is Segment.Page -> PageCard(segment.title)
} }
} }
} }
} }
/**
* A page in an answer (harness spec 3.8.0, `pages.md`): not drawn on a phone -- no web view, and
* never its source. One quiet card says that there is one, by its title, and where it can be
* seen. The title is a model's: plain text.
*/
@Composable
fun PageCard(title: String, modifier: Modifier = Modifier) {
val palette = LocalPalette.current
Row(
modifier.fillMaxWidth().clip(Block).border(1.dp, palette.border, Block).padding(horizontal = 14.dp, vertical = 12.dp),
verticalAlignment = Alignment.CenterVertically,
) {
Icon(Icons.Filled.Web, contentDescription = null, tint = palette.inkMuted, modifier = Modifier.size(20.dp))
Spacer(Modifier.width(12.dp))
Column(Modifier.weight(1f)) {
Text(
stringResource(R.string.page_note, title.ifBlank { stringResource(R.string.page_untitled) }),
style = MaterialTheme.typography.bodyMedium,
color = palette.ink,
maxLines = 3,
overflow = TextOverflow.Ellipsis,
)
Text(stringResource(R.string.page_where), style = MaterialTheme.typography.bodySmall, color = palette.inkMuted)
}
}
}
/** A code block: its language and Copy above, the code below in its own sideways scroller. */ /** A code block: its language and Copy above, the code below in its own sideways scroller. */
@Composable @Composable
fun CodeBlock(language: String, code: String, modifier: Modifier = Modifier) { fun CodeBlock(language: String, code: String, modifier: Modifier = Modifier) {
@@ -37,6 +37,7 @@ import androidx.compose.material.icons.filled.PushPin
import androidx.compose.material.icons.filled.Schedule import androidx.compose.material.icons.filled.Schedule
import androidx.compose.material.icons.filled.Search import androidx.compose.material.icons.filled.Search
import androidx.compose.material.icons.filled.Settings import androidx.compose.material.icons.filled.Settings
import androidx.compose.material.icons.filled.Summarize
import androidx.compose.material.icons.filled.Terminal import androidx.compose.material.icons.filled.Terminal
import androidx.compose.material3.AlertDialog import androidx.compose.material3.AlertDialog
import androidx.compose.material3.DropdownMenu import androidx.compose.material3.DropdownMenu
@@ -103,6 +104,8 @@ data class ChatsState(
/** Chats whose messages hold the search words (`GET /search?in=chats`), and the words asked. */ /** Chats whose messages hold the search words (`GET /search?in=chats`), and the words asked. */
val found: List<SearchHit> = emptyList(), val found: List<SearchHit> = emptyList(),
val foundFor: String = "", val foundFor: String = "",
/** How many reports are unread: the badge on Reports. */
val unreadReports: Int = 0,
) )
/** The drawer's list: every chat of the instance in use, both kinds, newest first. */ /** The drawer's list: every chat of the instance in use, both kinds, newest first. */
@@ -135,7 +138,9 @@ class ChatsViewModel(app: Application) : AndroidViewModel(app) {
val page = api.chats() val page = api.chats()
// Folders are a side dish: the chats show without them if they cannot be read. // Folders are a side dish: the chats show without them if they cannot be read.
val folders = runCatching { api.folders() }.getOrDefault(_state.value.folders) val folders = runCatching { api.folders() }.getOrDefault(_state.value.folders)
_state.value = ChatsState(chats = page.chats, more = page.more, folders = folders) // So is the count of unread reports: an instance before Reports simply has none.
val unread = runCatching { api.reports(unread = true).size }.getOrDefault(0)
_state.value = ChatsState(chats = page.chats, more = page.more, folders = folders, unreadReports = unread)
} catch (e: Exception) { } catch (e: Exception) {
_state.update { it.copy(loading = false, error = getApplication<Application>().explain(e)) } _state.update { it.copy(loading = false, error = getApplication<Application>().explain(e)) }
} }
@@ -262,6 +267,7 @@ interface DrawerActions {
fun deleteFolder(folder: Folder) {} fun deleteFolder(folder: Folder) {}
fun files() {} fun files() {}
fun scheduled() {} fun scheduled() {}
fun reports() {}
fun archived() {} fun archived() {}
fun memory() {} fun memory() {}
fun settings() {} fun settings() {}
@@ -331,6 +337,7 @@ fun DrawerContent(
item { DrawerItem(Icons.Filled.EditNote, stringResource(R.string.new_chat), onClick = actions::newChat) } item { DrawerItem(Icons.Filled.EditNote, stringResource(R.string.new_chat), onClick = actions::newChat) }
item { DrawerItem(Icons.Filled.Terminal, stringResource(R.string.new_agent_chat), onClick = actions::newAgentChat) } item { DrawerItem(Icons.Filled.Terminal, stringResource(R.string.new_agent_chat), onClick = actions::newAgentChat) }
item { DrawerItem(Icons.Filled.Folder, stringResource(R.string.files), onClick = actions::files) } item { DrawerItem(Icons.Filled.Folder, stringResource(R.string.files), onClick = actions::files) }
item { DrawerItem(Icons.Filled.Summarize, stringResource(R.string.reports), badge = state.unreadReports, onClick = actions::reports) }
item { DrawerItem(Icons.Filled.Schedule, stringResource(R.string.scheduled), onClick = actions::scheduled) } item { DrawerItem(Icons.Filled.Schedule, stringResource(R.string.scheduled), onClick = actions::scheduled) }
item { DrawerItem(Icons.Filled.Inventory2, stringResource(R.string.archived), onClick = actions::archived) } item { DrawerItem(Icons.Filled.Inventory2, stringResource(R.string.archived), onClick = actions::archived) }
item { DrawerItem(Icons.Filled.Psychology, stringResource(R.string.memory), onClick = actions::memory) } item { DrawerItem(Icons.Filled.Psychology, stringResource(R.string.memory), onClick = actions::memory) }
@@ -613,7 +620,7 @@ private fun FolderNameDialog(initial: String, title: Int, onSave: (String) -> Un
} }
@Composable @Composable
private fun DrawerItem(icon: ImageVector, label: String, subtitle: String? = null, onClick: () -> Unit) { private fun DrawerItem(icon: ImageVector, label: String, subtitle: String? = null, badge: Int = 0, onClick: () -> Unit) {
val palette = LocalPalette.current val palette = LocalPalette.current
Surface( Surface(
onClick = onClick, onClick = onClick,
@@ -628,6 +635,13 @@ private fun DrawerItem(icon: ImageVector, label: String, subtitle: String? = nul
Text(label, style = MaterialTheme.typography.bodyLarge, maxLines = 1, overflow = TextOverflow.Ellipsis) Text(label, style = MaterialTheme.typography.bodyLarge, maxLines = 1, overflow = TextOverflow.Ellipsis)
subtitle?.let { Text(it, style = MaterialTheme.typography.bodySmall, color = palette.inkMuted, maxLines = 1, overflow = TextOverflow.Ellipsis) } subtitle?.let { Text(it, style = MaterialTheme.typography.bodySmall, color = palette.inkMuted, maxLines = 1, overflow = TextOverflow.Ellipsis) }
} }
// A count of what is new: the words give, the badge keeps its size.
if (badge > 0) {
Spacer(Modifier.width(12.dp))
Box(Modifier.background(palette.accent, RoundedCornerShape(50)).padding(horizontal = 8.dp, vertical = 2.dp)) {
Text(if (badge > 99) "99+" else badge.toString(), style = MaterialTheme.typography.labelMedium, color = palette.bg, maxLines = 1)
}
}
} }
} }
} }
@@ -0,0 +1,428 @@
@file:OptIn(ExperimentalMaterial3Api::class)
package eu.llembas.android.ui.reports
import android.app.Application
import android.content.Intent
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.heightIn
import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.Reply
import androidx.compose.material.icons.filled.Delete
import androidx.compose.material.icons.filled.DoneAll
import androidx.compose.material.icons.filled.PriorityHigh
import androidx.compose.material.icons.filled.Share
import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Button
import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
import androidx.compose.material3.SwipeToDismissBox
import androidx.compose.material3.SwipeToDismissBoxValue
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.material3.pulltorefresh.PullToRefreshBox
import androidx.compose.material3.rememberSwipeToDismissBoxState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
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.FontWeight
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.ApiClient
import eu.llembas.android.api.ApiException
import eu.llembas.android.api.Report
import eu.llembas.android.api.sortedReports
import eu.llembas.android.lembas
import eu.llembas.android.ui.chat.RichMarkdown
import eu.llembas.android.ui.explain
import eu.llembas.android.ui.pageProjection
import eu.llembas.android.ui.scheduled.BackBar
import eu.llembas.android.ui.scheduled.ScheduleLogic
import eu.llembas.android.ui.theme.LocalPalette
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.flow.update
import kotlinx.coroutines.launch
private suspend fun Application.api(): ApiClient = lembas.instances.client() ?: throw ApiException(401, "Not signed in.")
/** A server without the reports routes answers 404 (or 405): it is older, not broken. */
private fun Throwable.unsupported(): Boolean = this is ApiException && (status == 404 || status == 405)
// --- The list --------------------------------------------------------------------------------
data class ReportsState(
val reports: List<Report> = emptyList(),
val loading: Boolean = false,
val error: String? = null,
/** The instance is older than Reports: said plainly, instead of an error. */
val unsupported: Boolean = false,
)
class ReportsViewModel(app: Application) : AndroidViewModel(app) {
private val _state = MutableStateFlow(ReportsState())
val state = _state.asStateFlow()
fun load() {
viewModelScope.launch {
_state.update { it.copy(loading = true, error = null) }
try {
val reports = getApplication<Application>().api().reports()
_state.value = ReportsState(reports = sortedReports(reports))
} catch (e: Exception) {
_state.update {
it.copy(loading = false, unsupported = e.unsupported(), error = if (e.unsupported()) null else getApplication<Application>().explain(e))
}
}
}
}
/** Read: it stays in the list, among those read. A failure is put right by reading the list again. */
fun markRead(report: Report) {
_state.update { s -> s.copy(reports = sortedReports(s.reports.map { if (it.id == report.id) it.copy(unread = false) else it })) }
viewModelScope.launch { runCatching { getApplication<Application>().api().readReport(report.id) }.onFailure { fail(it) } }
}
fun delete(report: Report) {
_state.update { s -> s.copy(reports = s.reports.filterNot { it.id == report.id }) }
viewModelScope.launch { runCatching { getApplication<Application>().api().deleteReport(report.id) }.onFailure { fail(it) } }
}
private fun fail(e: Throwable) {
_state.update { it.copy(error = getApplication<Application>().explain(e)) }
load()
}
}
interface ReportsActions {
fun open(report: Report) {}
fun markRead(report: Report) {}
fun delete(report: Report) {}
fun reload() {}
}
@Composable
fun ReportsScreen(onBack: () -> Unit, onOpen: (String) -> Unit, model: ReportsViewModel = viewModel()) {
val state by model.state.collectAsStateWithLifecycle()
// Read again each time the page comes up: a report opened and read is no longer bold on the way back.
LaunchedEffect(Unit) { model.load() }
ReportsContent(
state,
object : ReportsActions {
override fun open(report: Report) = onOpen(report.id)
override fun markRead(report: Report) = model.markRead(report)
override fun delete(report: Report) = model.delete(report)
override fun reload() = model.load()
},
onBack,
)
}
/**
* Reports: what scheduled tasks had to tell. The unread first; each row its title, the task it
* came from and when, with a mark where the model called it important. Pull to read the list
* again; swipe a row one way to mark it read, the other to delete it (which asks once).
*/
@Composable
fun ReportsContent(state: ReportsState, actions: ReportsActions, onBack: () -> Unit = {}) {
val palette = LocalPalette.current
var deleting by remember { mutableStateOf<Report?>(null) }
deleting?.let { report ->
AlertDialog(
onDismissRequest = { deleting = null },
title = { Text(stringResource(R.string.report_delete_title)) },
text = { Text(stringResource(R.string.report_delete_line, report.title.ifBlank { stringResource(R.string.report_untitled) })) },
confirmButton = {
TextButton(onClick = {
deleting = null
actions.delete(report)
}) { Text(stringResource(R.string.delete), color = palette.danger) }
},
dismissButton = { TextButton(onClick = { deleting = null }) { Text(stringResource(R.string.cancel)) } },
)
}
Scaffold(containerColor = palette.bg, topBar = { BackBar(stringResource(R.string.reports), onBack) }) { padding ->
PullToRefreshBox(isRefreshing = state.loading, onRefresh = actions::reload, modifier = Modifier.fillMaxSize().padding(padding)) {
LazyColumn(
Modifier.fillMaxSize(),
contentPadding = PaddingValues(start = 16.dp, end = 16.dp, top = 8.dp, bottom = 24.dp),
verticalArrangement = Arrangement.spacedBy(8.dp),
) {
state.error?.let { error ->
item {
Row(verticalAlignment = Alignment.CenterVertically) {
Text(error, color = palette.danger, style = MaterialTheme.typography.bodyMedium, modifier = Modifier.weight(1f))
TextButton(onClick = actions::reload) { Text(stringResource(R.string.retry)) }
}
}
}
if (state.reports.isEmpty() && !state.loading && state.error == null) {
item {
Text(
stringResource(if (state.unsupported) R.string.reports_unsupported else R.string.reports_none),
color = palette.inkMuted,
style = MaterialTheme.typography.bodyMedium,
modifier = Modifier.padding(vertical = 16.dp),
)
}
}
items(state.reports, key = { it.id }) { report ->
ReportRow(report, onOpen = { actions.open(report) }, onRead = { actions.markRead(report) }, onDelete = { deleting = report })
}
}
}
}
}
/**
* One report in the list. Swiping never removes the row by itself: towards the end marks it read,
* towards the start asks whether to delete it, and either way the row comes back to rest.
*/
@Composable
private fun ReportRow(report: Report, onOpen: () -> Unit, onRead: () -> Unit, onDelete: () -> Unit) {
val palette = LocalPalette.current
val swipe = rememberSwipeToDismissBoxState(
confirmValueChange = { to ->
when (to) {
SwipeToDismissBoxValue.StartToEnd -> if (report.unread) onRead()
SwipeToDismissBoxValue.EndToStart -> onDelete()
SwipeToDismissBoxValue.Settled -> Unit
}
false
},
)
SwipeToDismissBox(
state = swipe,
enableDismissFromStartToEnd = report.unread,
backgroundContent = {
val deletes = swipe.dismissDirection == SwipeToDismissBoxValue.EndToStart
Row(
Modifier.fillMaxSize().background(
if (deletes) palette.dangerSoft else palette.surfaceActive,
RoundedCornerShape(16.dp),
).padding(horizontal = 20.dp),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = if (deletes) Arrangement.End else Arrangement.Start,
) {
Icon(
if (deletes) Icons.Filled.Delete else Icons.Filled.DoneAll,
contentDescription = stringResource(if (deletes) R.string.delete else R.string.report_mark_read),
tint = if (deletes) palette.danger else palette.inkMuted,
)
}
},
) {
Row(
Modifier
.fillMaxWidth()
.background(palette.surfaceRaised, RoundedCornerShape(16.dp))
.clickable(onClick = onOpen)
.heightIn(min = 72.dp)
.padding(horizontal = 14.dp, vertical = 12.dp),
verticalAlignment = Alignment.Top,
) {
// The unread dot's place is kept for a read row too, so the titles start on one line.
Box(Modifier.padding(top = 6.dp).size(10.dp).background(if (report.unread) palette.accent else palette.surfaceRaised, CircleShape))
Spacer(Modifier.width(12.dp))
Column(Modifier.weight(1f), verticalArrangement = Arrangement.spacedBy(2.dp)) {
Text(
report.title.ifBlank { stringResource(R.string.report_untitled) },
style = MaterialTheme.typography.bodyLarge,
fontWeight = if (report.unread) FontWeight.SemiBold else FontWeight.Normal,
maxLines = 2,
overflow = TextOverflow.Ellipsis,
)
ReportFacts(report)
if (report.summary.isNotBlank()) {
Text(report.summary, style = MaterialTheme.typography.bodySmall, color = palette.inkMuted, maxLines = 2, overflow = TextOverflow.Ellipsis)
}
}
if (report.high) {
Spacer(Modifier.width(8.dp))
Icon(
Icons.Filled.PriorityHigh,
contentDescription = stringResource(R.string.report_important),
tint = palette.warning,
modifier = Modifier.size(20.dp),
)
}
}
}
}
/** Under a report's title: the task it came from, and when. */
@Composable
private fun ReportFacts(report: Report) {
val palette = LocalPalette.current
val facts = listOfNotNull(report.schedule?.title?.ifBlank { null }, ScheduleLogic.moment(report.created)).joinToString(" · ")
if (facts.isNotBlank()) Text(facts, style = MaterialTheme.typography.bodySmall, color = palette.inkFaint, maxLines = 1, overflow = TextOverflow.Ellipsis)
}
// --- One report ------------------------------------------------------------------------------
data class ReportState(val report: Report? = null, val loading: Boolean = true, val error: String? = null, val replying: Boolean = false)
class ReportViewModel(app: Application) : AndroidViewModel(app) {
private val _state = MutableStateFlow(ReportState())
val state = _state.asStateFlow()
/** Read the report, and mark it read: opening it is reading it. */
fun load(id: String) {
viewModelScope.launch {
_state.update { it.copy(loading = true, error = null) }
try {
val api = getApplication<Application>().api()
val report = api.report(id)
_state.value = ReportState(report = report.copy(unread = false), loading = false)
if (report.unread) runCatching { api.readReport(id) }
} catch (e: Exception) {
_state.update { it.copy(loading = false, error = getApplication<Application>().explain(e)) }
}
}
}
/** Reply: the server continues the report as a conversation and says which chat it is. */
fun reply(then: (chat: String, title: String) -> Unit) {
val report = _state.value.report ?: return
// A reply that was begun before goes on in its chat: nothing is asked of the server.
report.chatId?.let { return then(it, report.title) }
viewModelScope.launch {
_state.update { it.copy(replying = true, error = null) }
try {
val chat = getApplication<Application>().api().replyToReport(report.id) ?: throw ApiException(502, "")
_state.update { it.copy(replying = false) }
then(chat, report.title)
} catch (e: Exception) {
_state.update { it.copy(replying = false, error = getApplication<Application>().explain(e)) }
}
}
}
}
@Composable
fun ReportScreen(id: String, onBack: () -> Unit, onReply: (chat: String, title: String) -> Unit, model: ReportViewModel = viewModel(key = "report-$id")) {
val state by model.state.collectAsStateWithLifecycle()
val context = LocalContext.current
LaunchedEffect(id) { model.load(id) }
ReportContent(
state,
onBack = onBack,
onRetry = { model.load(id) },
onReply = { model.reply(onReply) },
onShare = { report ->
val send = Intent(
Intent.ACTION_SEND,
).setType("text/plain").putExtra(Intent.EXTRA_SUBJECT, report.title).putExtra(Intent.EXTRA_TEXT, shareText(report))
runCatching { context.startActivity(Intent.createChooser(send, null)) }
},
)
}
/** What Share hands over: the title, then the report as text -- a page in it as its one line, never its source. */
fun shareText(report: Report): String =
listOf(report.title, pageProjection(report.body.orEmpty(), untitled = "Page")).filter { it.isNotBlank() }.joinToString("\n\n")
/**
* A report, read as a page: its title, where it came from and when, then the body -- Markdown a
* model wrote, drawn as the chat draws a reply (untrusted: no images, no HTML; a page in it is a
* card, not a page). Reply stays at the foot; Share is in the bar.
*/
@Composable
fun ReportContent(state: ReportState, onBack: () -> Unit = {}, onRetry: () -> Unit = {}, onReply: () -> Unit = {}, onShare: (Report) -> Unit = {}) {
val palette = LocalPalette.current
val report = state.report
Scaffold(
containerColor = palette.bg,
topBar = {
BackBar(stringResource(R.string.report), onBack) {
if (report !=
null
) {
IconButton(onClick = { onShare(report) }) { Icon(Icons.Filled.Share, contentDescription = stringResource(R.string.report_share)) }
}
}
},
bottomBar = {
if (report != null) {
Box(Modifier.background(palette.bg).navigationBarsPadding().padding(16.dp)) {
Button(onClick = onReply, enabled = !state.replying, modifier = Modifier.fillMaxWidth().heightIn(min = 52.dp)) {
if (state.replying) {
CircularProgressIndicator(strokeWidth = 2.dp, modifier = Modifier.size(18.dp))
} else {
Icon(Icons.AutoMirrored.Filled.Reply, contentDescription = null, modifier = Modifier.size(18.dp))
}
Spacer(Modifier.width(8.dp))
Text(stringResource(R.string.report_reply))
}
}
}
},
) { padding ->
Column(
Modifier.fillMaxSize().padding(padding).verticalScroll(rememberScrollState()).padding(horizontal = 16.dp, vertical = 8.dp),
verticalArrangement = Arrangement.spacedBy(12.dp),
) {
state.error?.let { error ->
Row(verticalAlignment = Alignment.CenterVertically) {
Text(error, color = palette.danger, style = MaterialTheme.typography.bodyMedium, modifier = Modifier.weight(1f))
if (report == null) TextButton(onClick = onRetry) { Text(stringResource(R.string.retry)) }
}
}
if (report == null) {
if (state.loading) CircularProgressIndicator(strokeWidth = 2.dp, modifier = Modifier.size(24.dp))
} else {
Row(verticalAlignment = Alignment.Top) {
Text(
report.title.ifBlank { stringResource(R.string.report_untitled) },
style = MaterialTheme.typography.headlineSmall,
modifier = Modifier.weight(1f),
)
if (report.high) {
Spacer(Modifier.width(8.dp))
Icon(Icons.Filled.PriorityHigh, contentDescription = stringResource(R.string.report_important), tint = palette.warning)
}
}
ReportFacts(report)
RichMarkdown(report.body.orEmpty().ifBlank { report.summary })
}
}
}
}
@@ -77,6 +77,7 @@ fun RunScreen(
runId: String, runId: String,
onBack: () -> Unit, onBack: () -> Unit,
onOpenChat: (String) -> Unit, onOpenChat: (String) -> Unit,
onOpenReport: (String) -> Unit = {},
model: RunViewModel = viewModel(key = "run-$scheduleId-$runId"), model: RunViewModel = viewModel(key = "run-$scheduleId-$runId"),
) { ) {
val state by model.state.collectAsStateWithLifecycle() val state by model.state.collectAsStateWithLifecycle()
@@ -84,7 +85,7 @@ fun RunScreen(
model.open(scheduleId, runId) model.open(scheduleId, runId)
onPauseOrDispose { } onPauseOrDispose { }
} }
RunContent(state, onBack = onBack, onOpenChat = onOpenChat) RunContent(state, onBack = onBack, onOpenChat = onOpenChat, onOpenReport = onOpenReport)
} }
/** /**
@@ -93,7 +94,7 @@ fun RunScreen(
* links only outside) -- or why there is none. Open its chat goes on from there. * links only outside) -- or why there is none. Open its chat goes on from there.
*/ */
@Composable @Composable
fun RunContent(state: RunState, onBack: () -> Unit = {}, onOpenChat: (String) -> Unit = {}) { fun RunContent(state: RunState, onBack: () -> Unit = {}, onOpenChat: (String) -> Unit = {}, onOpenReport: (String) -> Unit = {}) {
val palette = LocalPalette.current val palette = LocalPalette.current
val context = LocalContext.current val context = LocalContext.current
val copy: (String) -> Unit = remember(context) { val copy: (String) -> Unit = remember(context) {
@@ -128,6 +129,8 @@ fun RunContent(state: RunState, onBack: () -> Unit = {}, onOpenChat: (String) ->
) )
} }
RunFacts(run, withPreview = false) RunFacts(run, withPreview = false)
// What the run filed for the person, when it filed anything.
run.reportId?.let { report -> ReportLink(onClick = { onOpenReport(report) }) }
} }
} }
Header(stringResource(R.string.run_result)) Header(stringResource(R.string.run_result))
@@ -4,6 +4,7 @@ package eu.llembas.android.ui.scheduled
import android.app.Application import android.app.Application
import androidx.compose.foundation.background import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
@@ -33,6 +34,7 @@ import androidx.compose.material.icons.filled.Edit
import androidx.compose.material.icons.filled.Pause import androidx.compose.material.icons.filled.Pause
import androidx.compose.material.icons.filled.PlayArrow import androidx.compose.material.icons.filled.PlayArrow
import androidx.compose.material.icons.filled.Schedule import androidx.compose.material.icons.filled.Schedule
import androidx.compose.material.icons.filled.Summarize
import androidx.compose.material.icons.filled.Tune import androidx.compose.material.icons.filled.Tune
import androidx.compose.material3.AlertDialog import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Button import androidx.compose.material3.Button
@@ -44,6 +46,7 @@ import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.OutlinedButton import androidx.compose.material3.OutlinedButton
import androidx.compose.material3.OutlinedTextField import androidx.compose.material3.OutlinedTextField
import androidx.compose.material3.RadioButton
import androidx.compose.material3.Scaffold import androidx.compose.material3.Scaffold
import androidx.compose.material3.SnackbarHost import androidx.compose.material3.SnackbarHost
import androidx.compose.material3.SnackbarHostState import androidx.compose.material3.SnackbarHostState
@@ -62,6 +65,7 @@ import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextAlign
@@ -83,6 +87,7 @@ import eu.llembas.android.api.ScheduleRun
import eu.llembas.android.api.SchedulesFrame import eu.llembas.android.api.SchedulesFrame
import eu.llembas.android.api.StreamClient import eu.llembas.android.api.StreamClient
import eu.llembas.android.api.computerAway import eu.llembas.android.api.computerAway
import eu.llembas.android.api.notifyChoice
import eu.llembas.android.lembas import eu.llembas.android.lembas
import eu.llembas.android.ui.explain import eu.llembas.android.ui.explain
import eu.llembas.android.ui.progressLineOf import eu.llembas.android.ui.progressLineOf
@@ -424,6 +429,7 @@ fun ScheduleScreen(
onBack: () -> Unit, onBack: () -> Unit,
onEdit: (String) -> Unit, onEdit: (String) -> Unit,
onOpenRun: (String) -> Unit, onOpenRun: (String) -> Unit,
onOpenReport: (String) -> Unit = {},
model: ScheduleViewModel = viewModel(key = "schedule-$id"), model: ScheduleViewModel = viewModel(key = "schedule-$id"),
) { ) {
val state by model.state.collectAsStateWithLifecycle() val state by model.state.collectAsStateWithLifecycle()
@@ -447,6 +453,7 @@ fun ScheduleScreen(
onRunNow = model::runNow, onRunNow = model::runNow,
onPause = model::pause, onPause = model::pause,
onOpenRun = { run -> onOpenRun(run.id) }, onOpenRun = { run -> onOpenRun(run.id) },
onOpenReport = onOpenReport,
onMore = model::more, onMore = model::more,
) )
} }
@@ -466,6 +473,7 @@ fun ScheduleContent(
onRunNow: () -> Unit = {}, onRunNow: () -> Unit = {},
onPause: (Boolean) -> Unit = {}, onPause: (Boolean) -> Unit = {},
onOpenRun: (ScheduleRun) -> Unit = {}, onOpenRun: (ScheduleRun) -> Unit = {},
onOpenReport: (String) -> Unit = {},
onMore: () -> Unit = {}, onMore: () -> Unit = {},
) { ) {
val palette = LocalPalette.current val palette = LocalPalette.current
@@ -488,7 +496,7 @@ fun ScheduleContent(
if (state.loading) CircularProgressIndicator() else state.error?.let { Message(it) } if (state.loading) CircularProgressIndicator() else state.error?.let { Message(it) }
} }
} else { } else {
ScheduleBody(state, schedule, padding, onRunNow, onPause, onOpenRun, onMore) ScheduleBody(state, schedule, padding, onRunNow, onPause, onOpenRun, onOpenReport, onMore)
} }
} }
if (deleting) { if (deleting) {
@@ -514,6 +522,7 @@ private fun ScheduleBody(
onRunNow: () -> Unit, onRunNow: () -> Unit,
onPause: (Boolean) -> Unit, onPause: (Boolean) -> Unit,
onOpenRun: (ScheduleRun) -> Unit, onOpenRun: (ScheduleRun) -> Unit,
onOpenReport: (String) -> Unit,
onMore: () -> Unit, onMore: () -> Unit,
) { ) {
val palette = LocalPalette.current val palette = LocalPalette.current
@@ -534,7 +543,7 @@ private fun ScheduleBody(
val facts = listOfNotNull( val facts = listOfNotNull(
schedule.model?.takeIf { it.isNotBlank() }?.let { stringResource(R.string.schedule_model, it) }, schedule.model?.takeIf { it.isNotBlank() }?.let { stringResource(R.string.schedule_model, it) },
modeWords(schedule.mode), modeWords(schedule.mode),
notifyWords(schedule.notify), notifyWords(schedule),
) )
if (facts.isNotEmpty()) { if (facts.isNotEmpty()) {
Text(facts.joinToString(" · "), style = MaterialTheme.typography.bodySmall, color = palette.inkFaint) Text(facts.joinToString(" · "), style = MaterialTheme.typography.bodySmall, color = palette.inkFaint)
@@ -595,16 +604,22 @@ private fun ScheduleBody(
) )
} }
} }
items(state.runs, key = { it.id }) { run -> RunRow(run, schedule.runsOn, onOpen = { onOpenRun(run) }) } items(state.runs, key = { it.id }) { run -> RunRow(run, schedule.runsOn, onOpen = { onOpenRun(run) }, onOpenReport = onOpenReport) }
if (state.more) item { LaunchedEffect(state.runs.size) { onMore() } } if (state.more) item { LaunchedEffect(state.runs.size) { onMore() } }
} }
} }
@Composable @Composable
private fun notifyWords(notify: String): String? = when (notify) { private fun notifyWords(schedule: Schedule): String? = when (schedule.notify) {
"always" -> stringResource(R.string.notify_always) "always" -> stringResource(R.string.notify_always)
// "When…" with the person's own words (spec 3.8.0); a server before it said "matters".
"when" -> stringResource(R.string.notify_when_words, schedule.notifyWhen.ifBlank { stringResource(R.string.notify_when_default) })
"matters" -> stringResource(R.string.notify_matters) "matters" -> stringResource(R.string.notify_matters)
"never" -> stringResource(R.string.notify_never) "never" -> stringResource(R.string.notify_never)
else -> null else -> null
} }
@@ -696,7 +711,7 @@ internal fun Header(text: String) {
* whole row opens the run. * whole row opens the run.
*/ */
@Composable @Composable
private fun RunRow(run: ScheduleRun, runsOn: RunsOn?, onOpen: () -> Unit) { private fun RunRow(run: ScheduleRun, runsOn: RunsOn?, onOpen: () -> Unit, onOpenReport: (String) -> Unit = {}) {
val palette = LocalPalette.current val palette = LocalPalette.current
Surface( Surface(
onClick = onOpen, onClick = onOpen,
@@ -712,12 +727,27 @@ private fun RunRow(run: ScheduleRun, runsOn: RunsOn?, onOpen: () -> Unit) {
// Which computer the run was for, and whether it was away. // Which computer the run was for, and whether it was away.
runsOn?.let { on -> ComputerName(on, away = run.computerAway) } runsOn?.let { on -> ComputerName(on, away = run.computerAway) }
RunFacts(run, maxLines = 2) RunFacts(run, maxLines = 2)
run.reportId?.let { report -> ReportLink(onClick = { onOpenReport(report) }) }
} }
} }
} }
} }
/** Under a run's time: the model and why, then the result's first lines, or the trouble. */ /** A run that filed a report: the way to it, a tap target of its own inside the run's row. */
@Composable
internal fun ReportLink(onClick: () -> Unit) {
val palette = LocalPalette.current
Row(
Modifier.clip(RoundedCornerShape(12.dp)).clickable(onClick = onClick).heightIn(min = 40.dp).padding(end = 12.dp),
verticalAlignment = Alignment.CenterVertically,
) {
Icon(Icons.Filled.Summarize, contentDescription = null, tint = palette.accent, modifier = Modifier.size(18.dp))
Spacer(Modifier.width(8.dp))
Text(stringResource(R.string.run_open_report), style = MaterialTheme.typography.labelLarge, color = palette.accent)
}
}
/** Under a run's time: the model and why, what it is doing or the trouble, then its note (or the result's first lines). */
@Composable @Composable
internal fun RunFacts(run: ScheduleRun, maxLines: Int = Int.MAX_VALUE, withPreview: Boolean = true) { internal fun RunFacts(run: ScheduleRun, maxLines: Int = Int.MAX_VALUE, withPreview: Boolean = true) {
val palette = LocalPalette.current val palette = LocalPalette.current
@@ -744,7 +774,11 @@ internal fun RunFacts(run: ScheduleRun, maxLines: Int = Int.MAX_VALUE, withPrevi
val tone = if (run.status == "waiting") palette.inkMuted else palette.danger val tone = if (run.status == "waiting") palette.inkMuted else palette.danger
Text(it, style = MaterialTheme.typography.bodySmall, color = tone, maxLines = maxLines, overflow = TextOverflow.Ellipsis) Text(it, style = MaterialTheme.typography.bodySmall, color = tone, maxLines = maxLines, overflow = TextOverflow.Ellipsis)
} }
if (withPreview && run.preview.isNotBlank()) { // The run's own line for the history (spec 3.8.0): what it found, or why it filed no report.
// A model's words: plain text. A server before it sends the result's first lines instead.
if (run.note.isNotBlank()) {
Text(run.note, style = MaterialTheme.typography.bodySmall, color = palette.ink, maxLines = maxLines, overflow = TextOverflow.Ellipsis)
} else if (withPreview && run.preview.isNotBlank()) {
Text(run.preview, style = MaterialTheme.typography.bodySmall, color = palette.ink, maxLines = maxLines, overflow = TextOverflow.Ellipsis) Text(run.preview, style = MaterialTheme.typography.bodySmall, color = palette.ink, maxLines = maxLines, overflow = TextOverflow.Ellipsis)
} }
} }
@@ -758,6 +792,9 @@ data class EditState(
val saving: Boolean = false, val saving: Boolean = false,
val error: String? = null, val error: String? = null,
val unsupported: Boolean = false, val unsupported: Boolean = false,
/** Notify when (spec 3.8.0): `always`, `when` or `never`, and the person's words for `when` (empty: the default). */
val notify: String = "when",
val notifyWhen: String = "",
) )
class ScheduleEditViewModel(app: Application) : AndroidViewModel(app) { class ScheduleEditViewModel(app: Application) : AndroidViewModel(app) {
@@ -774,13 +811,17 @@ class ScheduleEditViewModel(app: Application) : AndroidViewModel(app) {
if (id == null) return if (id == null) return
viewModelScope.launch { viewModelScope.launch {
runCatching { getApplication<Application>().api().schedule(id) }.onSuccess { s -> runCatching { getApplication<Application>().api().schedule(id) }.onSuccess { s ->
_state.update { it.copy(words = s.request.ifBlank { s.instruction }) } _state.update { it.copy(words = s.request.ifBlank { s.instruction }, notify = notifyChoice(s.notify), notifyWhen = s.notifyWhen) }
} }
} }
} }
fun words(text: String) = _state.update { it.copy(words = text, compiled = null) } fun words(text: String) = _state.update { it.copy(words = text, compiled = null) }
fun notify(value: String) = _state.update { it.copy(notify = notifyChoice(value)) }
fun notifyWhen(text: String) = _state.update { it.copy(notifyWhen = text) }
/** The server reads the words: the title, the instruction, the rule and the next runs. */ /** The server reads the words: the title, the instruction, the rule and the next runs. */
fun preview() { fun preview() {
val words = _state.value.words.trim() val words = _state.value.words.trim()
@@ -803,7 +844,14 @@ class ScheduleEditViewModel(app: Application) : AndroidViewModel(app) {
viewModelScope.launch { viewModelScope.launch {
_state.update { it.copy(saving = true, error = null) } _state.update { it.copy(saving = true, error = null) }
try { try {
val saved = getApplication<Application>().api().saveSchedule(compiled, _state.value.words.trim(), editing) val now = _state.value
val saved = getApplication<Application>().api().saveSchedule(
compiled,
now.words.trim(),
editing,
notify = now.notify,
notifyWhen = now.notifyWhen,
)
then(saved.id) then(saved.id)
} catch (e: Exception) { } catch (e: Exception) {
_state.update { it.copy(saving = false, error = getApplication<Application>().explain(e)) } _state.update { it.copy(saving = false, error = getApplication<Application>().explain(e)) }
@@ -821,7 +869,16 @@ fun ScheduleEditScreen(
) { ) {
val state by model.state.collectAsStateWithLifecycle() val state by model.state.collectAsStateWithLifecycle()
LaunchedEffect(id) { model.start(id) } LaunchedEffect(id) { model.start(id) }
ScheduleEditContent(state, editing = id != null, onBack = onBack, onWords = model::words, onPreview = model::preview, onSave = { model.save(onSaved) }) ScheduleEditContent(
state,
editing = id != null,
onBack = onBack,
onWords = model::words,
onPreview = model::preview,
onSave = { model.save(onSaved) },
onNotify = model::notify,
onNotifyWhen = model::notifyWhen,
)
} }
/** /**
@@ -838,6 +895,8 @@ fun ScheduleEditContent(
onWords: (String) -> Unit = {}, onWords: (String) -> Unit = {},
onPreview: () -> Unit = {}, onPreview: () -> Unit = {},
onSave: () -> Unit = {}, onSave: () -> Unit = {},
onNotify: (String) -> Unit = {},
onNotifyWhen: (String) -> Unit = {},
) { ) {
val palette = LocalPalette.current val palette = LocalPalette.current
Scaffold( Scaffold(
@@ -880,11 +939,59 @@ fun ScheduleEditContent(
if (state.unsupported) Text(stringResource(R.string.scheduled_unsupported), color = palette.inkMuted) if (state.unsupported) Text(stringResource(R.string.scheduled_unsupported), color = palette.inkMuted)
state.error?.let { Text(it, color = palette.danger, style = MaterialTheme.typography.bodyMedium) } state.error?.let { Text(it, color = palette.danger, style = MaterialTheme.typography.bodyMedium) }
state.compiled?.let { Understood(it) } state.compiled?.let { Understood(it) }
NotifyWhen(state.notify, state.notifyWhen, onNotify, onNotifyWhen)
Spacer(Modifier.height(24.dp)) Spacer(Modifier.height(24.dp))
} }
} }
} }
/**
* Notify when: every run, when the person's own words hold, or never -- each with one line
* saying what it does. A report is what tells the person; a run without one is a line in the
* task's history. "When…" opens a field with the default already in it.
*/
@Composable
private fun NotifyWhen(notify: String, words: String, onNotify: (String) -> Unit, onWords: (String) -> Unit) {
val palette = LocalPalette.current
val choices = listOf(
Triple("always", R.string.notify_every_run, R.string.notify_every_run_line),
Triple("when", R.string.notify_when_option, R.string.notify_when_line),
Triple("never", R.string.notify_never_option, R.string.notify_never_line),
)
Surface(shape = RoundedCornerShape(20.dp), color = palette.surfaceRaised, contentColor = palette.ink, modifier = Modifier.fillMaxWidth()) {
Column(Modifier.padding(vertical = 12.dp)) {
Text(
stringResource(R.string.notify_when),
style = MaterialTheme.typography.labelLarge,
color = palette.accent,
modifier = Modifier.padding(horizontal = 16.dp),
)
choices.forEach { (value, title, line) ->
Row(
Modifier.fillMaxWidth().clickable { onNotify(value) }.heightIn(min = 56.dp).padding(start = 4.dp, end = 16.dp, top = 4.dp, bottom = 4.dp),
verticalAlignment = Alignment.CenterVertically,
) {
RadioButton(selected = notify == value, onClick = { onNotify(value) })
Column(Modifier.weight(1f)) {
Text(stringResource(title), style = MaterialTheme.typography.bodyLarge)
Text(stringResource(line), style = MaterialTheme.typography.bodySmall, color = palette.inkMuted)
}
}
if (value == "when" && notify == "when") {
val usual = stringResource(R.string.notify_when_default)
OutlinedTextField(
value = words.ifEmpty { usual },
onValueChange = onWords,
label = { Text(stringResource(R.string.notify_when_label)) },
shape = RoundedCornerShape(16.dp),
modifier = Modifier.fillMaxWidth().padding(start = 52.dp, end = 16.dp, bottom = 8.dp),
)
}
}
}
}
}
/** What the server made of the words. The title and instruction are a model's: plain text. */ /** What the server made of the words. The title and instruction are a model's: plain text. */
@Composable @Composable
private fun Understood(c: ScheduleCompiled) { private fun Understood(c: ScheduleCompiled) {
+28
View File
@@ -244,6 +244,34 @@
<string name="channel_scheduled_failures">Selhání naplánovaných úloh</string> <string name="channel_scheduled_failures">Selhání naplánovaných úloh</string>
<string name="scheduled_result_public">Naplánovaná úloha má výsledek.</string> <string name="scheduled_result_public">Naplánovaná úloha má výsledek.</string>
<string name="scheduled_failed_public">Naplánovaná úloha selhala.</string> <string name="scheduled_failed_public">Naplánovaná úloha selhala.</string>
<string name="page_note">Tato odpověď obsahuje stránku: %1$s</string>
<string name="page_where">Zobrazíte ji na webu nebo v aplikaci LLeMbas Desktop.</string>
<string name="page_untitled">Stránka</string>
<string name="reports">Zprávy</string>
<string name="report">Zpráva</string>
<string name="reports_none">Zatím žádné zprávy. Naplánovaná úloha ji napíše, když vám má co říct.</string>
<string name="reports_unsupported">Na této instanci běží LLeMbas, který Zprávy ještě nemá.</string>
<string name="report_untitled">Zpráva bez názvu</string>
<string name="report_delete_title">Smazat tuto zprávu?</string>
<string name="report_delete_line">Zpráva „%1$s“ se smaže natrvalo, i s rozhovorem o ní.</string>
<string name="report_mark_read">Označit jako přečtené</string>
<string name="report_important">Důležité</string>
<string name="report_share">Sdílet</string>
<string name="report_reply">Odpovědět</string>
<string name="report_chat_title">Zpráva: %1$s</string>
<string name="notify_when">Kdy dát vědět</string>
<string name="notify_every_run">Při každém běhu</string>
<string name="notify_every_run_line">Model napíše zprávu pokaždé, i když nic nenašel.</string>
<string name="notify_when_option">Když…</string>
<string name="notify_when_line">Model napíše zprávu jen tehdy, když platí tohle.</string>
<string name="notify_when_label">Když co?</string>
<string name="notify_when_default">něco vyžaduje moji pozornost</string>
<string name="notify_never_option">Nikdy</string>
<string name="notify_never_line">Žádné zprávy: běhy zůstanou jen v historii úlohy.</string>
<string name="notify_when_words">Dá vědět, když: %1$s</string>
<string name="run_open_report">Otevřít její zprávu</string>
<string name="channel_reports">Zprávy</string>
<string name="report_new_public">Nová zpráva</string>
<string name="schedule_run_again">Spustit znovu</string> <string name="schedule_run_again">Spustit znovu</string>
<string name="card_approval">Povolit to?</string> <string name="card_approval">Povolit to?</string>
<string name="card_allow_once">Povolit jednou</string> <string name="card_allow_once">Povolit jednou</string>
+28
View File
@@ -244,6 +244,34 @@
<string name="channel_scheduled_failures">Geplante Fehler</string> <string name="channel_scheduled_failures">Geplante Fehler</string>
<string name="scheduled_result_public">Eine geplante Aufgabe hat ein Ergebnis.</string> <string name="scheduled_result_public">Eine geplante Aufgabe hat ein Ergebnis.</string>
<string name="scheduled_failed_public">Eine geplante Aufgabe ist fehlgeschlagen.</string> <string name="scheduled_failed_public">Eine geplante Aufgabe ist fehlgeschlagen.</string>
<string name="page_note">Diese Antwort hat eine Seite: %1$s</string>
<string name="page_where">Öffne sie im Web oder in LLeMbas Desktop, um sie zu sehen.</string>
<string name="page_untitled">Seite</string>
<string name="reports">Berichte</string>
<string name="report">Bericht</string>
<string name="reports_none">Noch keine Berichte. Eine geplante Aufgabe schreibt einen, wenn sie dir etwas zu sagen hat.</string>
<string name="reports_unsupported">Auf dieser Instanz läuft ein LLeMbas, das noch keine Berichte hat.</string>
<string name="report_untitled">Bericht ohne Titel</string>
<string name="report_delete_title">Diesen Bericht löschen?</string>
<string name="report_delete_line">„%1$s“ wird endgültig gelöscht, samt der Unterhaltung darüber.</string>
<string name="report_mark_read">Als gelesen markieren</string>
<string name="report_important">Wichtig</string>
<string name="report_share">Teilen</string>
<string name="report_reply">Antworten</string>
<string name="report_chat_title">Bericht: %1$s</string>
<string name="notify_when">Benachrichtigen, wenn</string>
<string name="notify_every_run">Bei jedem Lauf</string>
<string name="notify_every_run_line">Das Modell schreibt jedes Mal einen Bericht, auch wenn nichts gefunden wurde.</string>
<string name="notify_when_option">Wenn…</string>
<string name="notify_when_line">Das Modell schreibt nur dann einen Bericht, wenn das zutrifft.</string>
<string name="notify_when_label">Wenn was?</string>
<string name="notify_when_default">etwas braucht meine Aufmerksamkeit</string>
<string name="notify_never_option">Nie</string>
<string name="notify_never_line">Keine Berichte: Läufe bleiben nur im Verlauf der Aufgabe.</string>
<string name="notify_when_words">Meldet sich, wenn: %1$s</string>
<string name="run_open_report">Zugehörigen Bericht öffnen</string>
<string name="channel_reports">Berichte</string>
<string name="report_new_public">Neuer Bericht</string>
<string name="schedule_run_again">Erneut ausführen</string> <string name="schedule_run_again">Erneut ausführen</string>
<string name="card_approval">Das erlauben?</string> <string name="card_approval">Das erlauben?</string>
<string name="card_allow_once">Einmal erlauben</string> <string name="card_allow_once">Einmal erlauben</string>
+28
View File
@@ -244,6 +244,34 @@
<string name="channel_scheduled_failures">Fallos programados</string> <string name="channel_scheduled_failures">Fallos programados</string>
<string name="scheduled_result_public">Una tarea programada tiene un resultado.</string> <string name="scheduled_result_public">Una tarea programada tiene un resultado.</string>
<string name="scheduled_failed_public">Una tarea programada falló.</string> <string name="scheduled_failed_public">Una tarea programada falló.</string>
<string name="page_note">Esta respuesta tiene una página: %1$s</string>
<string name="page_where">Ábrela en la web o en LLeMbas Desktop para verla.</string>
<string name="page_untitled">Página</string>
<string name="reports">Informes</string>
<string name="report">Informe</string>
<string name="reports_none">Aún no hay informes. Una tarea programada escribe uno cuando tiene algo que decirte.</string>
<string name="reports_unsupported">Esta instancia ejecuta un LLeMbas que todavía no tiene Informes.</string>
<string name="report_untitled">Informe sin título</string>
<string name="report_delete_title">¿Eliminar este informe?</string>
<string name="report_delete_line">«%1$s» se elimina para siempre, junto con la conversación sobre él.</string>
<string name="report_mark_read">Marcar como leído</string>
<string name="report_important">Importante</string>
<string name="report_share">Compartir</string>
<string name="report_reply">Responder</string>
<string name="report_chat_title">Informe: %1$s</string>
<string name="notify_when">Avisar cuando</string>
<string name="notify_every_run">En cada ejecución</string>
<string name="notify_every_run_line">El modelo escribe un informe cada vez, también cuando no ha encontrado nada.</string>
<string name="notify_when_option">Cuando…</string>
<string name="notify_when_line">El modelo escribe un informe solo cuando esto se cumple.</string>
<string name="notify_when_label">¿Cuando qué?</string>
<string name="notify_when_default">algo necesita mi atención</string>
<string name="notify_never_option">Nunca</string>
<string name="notify_never_line">Sin informes: las ejecuciones quedan solo en el historial de la tarea.</string>
<string name="notify_when_words">Avisa cuando: %1$s</string>
<string name="run_open_report">Abrir su informe</string>
<string name="channel_reports">Informes</string>
<string name="report_new_public">Informe nuevo</string>
<string name="schedule_run_again">Ejecutar de nuevo</string> <string name="schedule_run_again">Ejecutar de nuevo</string>
<string name="card_approval">¿Permitir esto?</string> <string name="card_approval">¿Permitir esto?</string>
<string name="card_allow_once">Permitir una vez</string> <string name="card_allow_once">Permitir una vez</string>
+28
View File
@@ -244,6 +244,34 @@
<string name="channel_scheduled_failures">Échecs planifiés</string> <string name="channel_scheduled_failures">Échecs planifiés</string>
<string name="scheduled_result_public">Une tâche planifiée a un résultat.</string> <string name="scheduled_result_public">Une tâche planifiée a un résultat.</string>
<string name="scheduled_failed_public">Une tâche planifiée a échoué.</string> <string name="scheduled_failed_public">Une tâche planifiée a échoué.</string>
<string name="page_note">Cette réponse contient une page : %1$s</string>
<string name="page_where">Ouvrez-la sur le web ou dans LLeMbas Desktop pour la voir.</string>
<string name="page_untitled">Page</string>
<string name="reports">Rapports</string>
<string name="report">Rapport</string>
<string name="reports_none">Pas encore de rapport. Une tâche planifiée en rédige un quand elle a quelque chose à vous dire.</string>
<string name="reports_unsupported">Cette instance utilise un LLeMbas qui n’a pas encore les Rapports.</string>
<string name="report_untitled">Rapport sans titre</string>
<string name="report_delete_title">Supprimer ce rapport ?</string>
<string name="report_delete_line">« %1$s » est supprimé définitivement, avec la conversation à son sujet.</string>
<string name="report_mark_read">Marquer comme lu</string>
<string name="report_important">Important</string>
<string name="report_share">Partager</string>
<string name="report_reply">Répondre</string>
<string name="report_chat_title">Rapport : %1$s</string>
<string name="notify_when">Prévenir quand</string>
<string name="notify_every_run">À chaque exécution</string>
<string name="notify_every_run_line">Le modèle rédige un rapport à chaque fois, même quand rien n’a été trouvé.</string>
<string name="notify_when_option">Quand…</string>
<string name="notify_when_line">Le modèle ne rédige un rapport que si ceci est vrai.</string>
<string name="notify_when_label">Quand quoi ?</string>
<string name="notify_when_default">quelque chose demande mon attention</string>
<string name="notify_never_option">Jamais</string>
<string name="notify_never_line">Aucun rapport : les exécutions restent seulement dans l’historique de la tâche.</string>
<string name="notify_when_words">Prévient quand : %1$s</string>
<string name="run_open_report">Ouvrir son rapport</string>
<string name="channel_reports">Rapports</string>
<string name="report_new_public">Nouveau rapport</string>
<string name="schedule_run_again">Relancer</string> <string name="schedule_run_again">Relancer</string>
<string name="card_approval">Autoriser ceci ?</string> <string name="card_approval">Autoriser ceci ?</string>
<string name="card_allow_once">Autoriser une fois</string> <string name="card_allow_once">Autoriser une fois</string>
+28
View File
@@ -244,6 +244,34 @@
<string name="channel_scheduled_failures">Ütemezett hibák</string> <string name="channel_scheduled_failures">Ütemezett hibák</string>
<string name="scheduled_result_public">Egy ütemezett feladatnak eredménye van.</string> <string name="scheduled_result_public">Egy ütemezett feladatnak eredménye van.</string>
<string name="scheduled_failed_public">Egy ütemezett feladat sikertelen volt.</string> <string name="scheduled_failed_public">Egy ütemezett feladat sikertelen volt.</string>
<string name="page_note">Ebben a válaszban van egy oldal: %1$s</string>
<string name="page_where">A megtekintéséhez nyisd meg a weben vagy a LLeMbas Desktopban.</string>
<string name="page_untitled">Oldal</string>
<string name="reports">Jelentések</string>
<string name="report">Jelentés</string>
<string name="reports_none">Még nincsenek jelentések. Egy ütemezett feladat akkor ír egyet, ha van mit mondania neked.</string>
<string name="reports_unsupported">Ezen a példányon olyan LLeMbas fut, amelyben még nincsenek Jelentések.</string>
<string name="report_untitled">Cím nélküli jelentés</string>
<string name="report_delete_title">Törlöd ezt a jelentést?</string>
<string name="report_delete_line">A(z) „%1$s” véglegesen törlődik, a róla szóló beszélgetéssel együtt.</string>
<string name="report_mark_read">Megjelölés olvasottként</string>
<string name="report_important">Fontos</string>
<string name="report_share">Megosztás</string>
<string name="report_reply">Válasz</string>
<string name="report_chat_title">Jelentés: %1$s</string>
<string name="notify_when">Mikor értesítsen</string>
<string name="notify_every_run">Minden futáskor</string>
<string name="notify_every_run_line">A modell minden alkalommal ír jelentést, akkor is, ha semmit sem talált.</string>
<string name="notify_when_option">Amikor…</string>
<string name="notify_when_line">A modell csak akkor ír jelentést, ha ez teljesül.</string>
<string name="notify_when_label">Amikor mi?</string>
<string name="notify_when_default">valami a figyelmemet igényli</string>
<string name="notify_never_option">Soha</string>
<string name="notify_never_line">Nincs jelentés: a futások csak a feladat előzményeiben maradnak meg.</string>
<string name="notify_when_words">Értesít, amikor: %1$s</string>
<string name="run_open_report">A jelentésének megnyitása</string>
<string name="channel_reports">Jelentések</string>
<string name="report_new_public">Új jelentés</string>
<string name="schedule_run_again">Futtatás újra</string> <string name="schedule_run_again">Futtatás újra</string>
<string name="card_approval">Engedélyezzük ezt?</string> <string name="card_approval">Engedélyezzük ezt?</string>
<string name="card_allow_once">Engedélyezés egyszer</string> <string name="card_allow_once">Engedélyezés egyszer</string>
+28
View File
@@ -244,6 +244,34 @@
<string name="channel_scheduled_failures">Errori pianificati</string> <string name="channel_scheduled_failures">Errori pianificati</string>
<string name="scheduled_result_public">Un’attività pianificata ha un risultato.</string> <string name="scheduled_result_public">Un’attività pianificata ha un risultato.</string>
<string name="scheduled_failed_public">Un’attività pianificata non è riuscita.</string> <string name="scheduled_failed_public">Un’attività pianificata non è riuscita.</string>
<string name="page_note">Questa risposta ha una pagina: %1$s</string>
<string name="page_where">Aprila sul web o in LLeMbas Desktop per vederla.</string>
<string name="page_untitled">Pagina</string>
<string name="reports">Rapporti</string>
<string name="report">Rapporto</string>
<string name="reports_none">Ancora nessun rapporto. Un’attività pianificata ne scrive uno quando ha qualcosa da dirti.</string>
<string name="reports_unsupported">Questa istanza usa un LLeMbas che non ha ancora i Rapporti.</string>
<string name="report_untitled">Rapporto senza titolo</string>
<string name="report_delete_title">Eliminare questo rapporto?</string>
<string name="report_delete_line">«%1$s» viene eliminato definitivamente, insieme alla conversazione che lo riguarda.</string>
<string name="report_mark_read">Segna come letto</string>
<string name="report_important">Importante</string>
<string name="report_share">Condividi</string>
<string name="report_reply">Rispondi</string>
<string name="report_chat_title">Rapporto: %1$s</string>
<string name="notify_when">Avvisa quando</string>
<string name="notify_every_run">A ogni esecuzione</string>
<string name="notify_every_run_line">Il modello scrive un rapporto ogni volta, anche quando non ha trovato nulla.</string>
<string name="notify_when_option">Quando…</string>
<string name="notify_when_line">Il modello scrive un rapporto solo quando questo è vero.</string>
<string name="notify_when_label">Quando cosa?</string>
<string name="notify_when_default">qualcosa richiede la mia attenzione</string>
<string name="notify_never_option">Mai</string>
<string name="notify_never_line">Nessun rapporto: le esecuzioni restano solo nella cronologia dell’attività.</string>
<string name="notify_when_words">Avvisa quando: %1$s</string>
<string name="run_open_report">Apri il suo rapporto</string>
<string name="channel_reports">Rapporti</string>
<string name="report_new_public">Nuovo rapporto</string>
<string name="schedule_run_again">Esegui di nuovo</string> <string name="schedule_run_again">Esegui di nuovo</string>
<string name="card_approval">Consentire questo?</string> <string name="card_approval">Consentire questo?</string>
<string name="card_allow_once">Consenti una volta</string> <string name="card_allow_once">Consenti una volta</string>
+28
View File
@@ -244,6 +244,34 @@
<string name="channel_scheduled_failures">Błędy zaplanowanych zadań</string> <string name="channel_scheduled_failures">Błędy zaplanowanych zadań</string>
<string name="scheduled_result_public">Zaplanowane zadanie ma wynik.</string> <string name="scheduled_result_public">Zaplanowane zadanie ma wynik.</string>
<string name="scheduled_failed_public">Zaplanowane zadanie się nie powiodło.</string> <string name="scheduled_failed_public">Zaplanowane zadanie się nie powiodło.</string>
<string name="page_note">Ta odpowiedź zawiera stronę: %1$s</string>
<string name="page_where">Otwórz ją w przeglądarce albo w LLeMbas Desktop, aby ją zobaczyć.</string>
<string name="page_untitled">Strona</string>
<string name="reports">Raporty</string>
<string name="report">Raport</string>
<string name="reports_none">Nie ma jeszcze raportów. Zaplanowane zadanie pisze raport, gdy ma Ci coś do powiedzenia.</string>
<string name="reports_unsupported">Na tej instancji działa LLeMbas, który nie ma jeszcze Raportów.</string>
<string name="report_untitled">Raport bez tytułu</string>
<string name="report_delete_title">Usunąć ten raport?</string>
<string name="report_delete_line">Raport „%1$s” zostanie usunięty na stałe, razem z rozmową o nim.</string>
<string name="report_mark_read">Oznacz jako przeczytany</string>
<string name="report_important">Ważne</string>
<string name="report_share">Udostępnij</string>
<string name="report_reply">Odpowiedz</string>
<string name="report_chat_title">Raport: %1$s</string>
<string name="notify_when">Powiadamiaj, gdy</string>
<string name="notify_every_run">Przy każdym uruchomieniu</string>
<string name="notify_every_run_line">Model pisze raport za każdym razem, także gdy niczego nie znalazł.</string>
<string name="notify_when_option">Gdy…</string>
<string name="notify_when_line">Model pisze raport tylko wtedy, gdy to jest spełnione.</string>
<string name="notify_when_label">Gdy co?</string>
<string name="notify_when_default">coś wymaga mojej uwagi</string>
<string name="notify_never_option">Nigdy</string>
<string name="notify_never_line">Bez raportów: uruchomienia zostają tylko w historii zadania.</string>
<string name="notify_when_words">Powiadamia, gdy: %1$s</string>
<string name="run_open_report">Otwórz jego raport</string>
<string name="channel_reports">Raporty</string>
<string name="report_new_public">Nowy raport</string>
<string name="schedule_run_again">Uruchom ponownie</string> <string name="schedule_run_again">Uruchom ponownie</string>
<string name="card_approval">Zezwolić na to?</string> <string name="card_approval">Zezwolić na to?</string>
<string name="card_allow_once">Zezwól raz</string> <string name="card_allow_once">Zezwól raz</string>
+28
View File
@@ -244,6 +244,34 @@
<string name="channel_scheduled_failures">Zlyhania naplánovaných úloh</string> <string name="channel_scheduled_failures">Zlyhania naplánovaných úloh</string>
<string name="scheduled_result_public">Naplánovaná úloha má výsledok.</string> <string name="scheduled_result_public">Naplánovaná úloha má výsledok.</string>
<string name="scheduled_failed_public">Naplánovaná úloha zlyhala.</string> <string name="scheduled_failed_public">Naplánovaná úloha zlyhala.</string>
<string name="page_note">Táto odpoveď obsahuje stránku: %1$s</string>
<string name="page_where">Zobrazíte ju na webe alebo v aplikácii LLeMbas Desktop.</string>
<string name="page_untitled">Stránka</string>
<string name="reports">Správy</string>
<string name="report">Správa</string>
<string name="reports_none">Zatiaľ žiadne správy. Naplánovaná úloha ju napíše, keď vám má čo povedať.</string>
<string name="reports_unsupported">Na tejto inštancii beží LLeMbas, ktorý Správy ešte nemá.</string>
<string name="report_untitled">Správa bez názvu</string>
<string name="report_delete_title">Odstrániť túto správu?</string>
<string name="report_delete_line">Správa „%1$s“ sa odstráni natrvalo, aj s rozhovorom o nej.</string>
<string name="report_mark_read">Označiť ako prečítané</string>
<string name="report_important">Dôležité</string>
<string name="report_share">Zdieľať</string>
<string name="report_reply">Odpovedať</string>
<string name="report_chat_title">Správa: %1$s</string>
<string name="notify_when">Kedy dať vedieť</string>
<string name="notify_every_run">Pri každom behu</string>
<string name="notify_every_run_line">Model napíše správu zakaždým, aj keď nič nenašiel.</string>
<string name="notify_when_option">Keď…</string>
<string name="notify_when_line">Model napíše správu len vtedy, keď platí toto.</string>
<string name="notify_when_label">Keď čo?</string>
<string name="notify_when_default">niečo si vyžaduje moju pozornosť</string>
<string name="notify_never_option">Nikdy</string>
<string name="notify_never_line">Žiadne správy: behy zostanú len v histórii úlohy.</string>
<string name="notify_when_words">Dá vedieť, keď: %1$s</string>
<string name="run_open_report">Otvoriť jej správu</string>
<string name="channel_reports">Správy</string>
<string name="report_new_public">Nová správa</string>
<string name="schedule_run_again">Spustiť znova</string> <string name="schedule_run_again">Spustiť znova</string>
<string name="card_approval">Povoliť to?</string> <string name="card_approval">Povoliť to?</string>
<string name="card_allow_once">Povoliť raz</string> <string name="card_allow_once">Povoliť raz</string>
+28
View File
@@ -245,6 +245,34 @@
<string name="channel_scheduled_failures">Scheduled failures</string> <string name="channel_scheduled_failures">Scheduled failures</string>
<string name="scheduled_result_public">A scheduled task has a result.</string> <string name="scheduled_result_public">A scheduled task has a result.</string>
<string name="scheduled_failed_public">A scheduled task failed.</string> <string name="scheduled_failed_public">A scheduled task failed.</string>
<string name="page_note">This answer has a page: %1$s</string>
<string name="page_where">Open it on the web or in LLeMbas Desktop to see it.</string>
<string name="page_untitled">Page</string>
<string name="reports">Reports</string>
<string name="report">Report</string>
<string name="reports_none">No reports yet. A scheduled task files one when it has something to tell you.</string>
<string name="reports_unsupported">This instance runs a LLeMbas that has no Reports yet.</string>
<string name="report_untitled">Untitled report</string>
<string name="report_delete_title">Delete this report?</string>
<string name="report_delete_line">“%1$s” is deleted for good, and the conversation about it with it.</string>
<string name="report_mark_read">Mark read</string>
<string name="report_important">Important</string>
<string name="report_share">Share</string>
<string name="report_reply">Reply</string>
<string name="report_chat_title">Report: %1$s</string>
<string name="notify_when">Notify when</string>
<string name="notify_every_run">Every run</string>
<string name="notify_every_run_line">The model writes a report every time, also when nothing was found.</string>
<string name="notify_when_option">When…</string>
<string name="notify_when_line">The model writes a report only when this holds.</string>
<string name="notify_when_label">When what?</string>
<string name="notify_when_default">something needs my attention</string>
<string name="notify_never_option">Never</string>
<string name="notify_never_line">No reports: runs are kept in the task\'s history only.</string>
<string name="notify_when_words">Tells you when: %1$s</string>
<string name="run_open_report">Open its report</string>
<string name="channel_reports">Reports</string>
<string name="report_new_public">New report</string>
<string name="schedule_run_again">Run again</string> <string name="schedule_run_again">Run again</string>
<string name="card_approval">Allow this?</string> <string name="card_approval">Allow this?</string>
<string name="card_allow_once">Allow once</string> <string name="card_allow_once">Allow once</string>
@@ -0,0 +1,60 @@
package eu.llembas.android
import android.app.Application
import android.app.Notification
import eu.llembas.android.push.Notifications
import eu.llembas.android.push.ReportNotice
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertNotNull
import org.junit.Assert.assertTrue
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner
import org.robolectric.RuntimeEnvironment
import org.robolectric.annotation.Config
/**
* A report's notification, both of its faces: unlocked, the report's title and summary; on the
* lock screen the app's fixed words and nothing from the account (rule 5).
*/
@RunWith(RobolectricTestRunner::class)
@Config(sdk = [35], qualifiers = "en")
class ReportNotificationTest {
private val app: Application get() = RuntimeEnvironment.getApplication()
private val notice = ReportNotice("rep1", "Two tenders opened", "Storage bids are due in May.", high = false)
private fun Notification.words() = listOf(Notification.EXTRA_TITLE, Notification.EXTRA_TEXT, Notification.EXTRA_BIG_TEXT).map {
extras.getCharSequence(it)?.toString().orEmpty()
}
@Test
fun unlockedItSaysTheReportLockedOnlyThatThereIsOne() {
val shown = Notifications.reportNotification(app, "home", notice)
assertEquals(LembasApp.CHANNEL_REPORTS, shown.channelId)
assertEquals("Two tenders opened", shown.words()[0])
assertEquals("Storage bids are due in May.", shown.words()[1])
// Private: Android shows the public version on a locked screen.
assertEquals(Notification.VISIBILITY_PRIVATE, shown.visibility)
val locked = shown.publicVersion
assertNotNull(locked)
assertEquals(listOf("LLeMbas", "New report", ""), locked.words())
// Nothing of the report anywhere in what the lock screen gets.
val all = locked.words().joinToString(" ") + locked.extras.keySet().joinToString(" ") { locked.extras.get(it)?.toString().orEmpty() }
assertFalse(all.contains("tenders"))
assertFalse(all.contains("Storage"))
}
@Test
fun itOffersOpenAndMarkReadAndTheSecondNeedsThePhoneUnlocked() {
val shown = Notifications.reportNotification(app, "home", notice)
assertEquals(listOf("Open", "Mark read"), shown.actions.map { it.title.toString() })
assertFalse(shown.actions[0].isAuthenticationRequired)
assertTrue(shown.actions[1].isAuthenticationRequired)
assertNotNull(shown.contentIntent)
assertEquals(Notification.FLAG_AUTO_CANCEL, shown.flags and Notification.FLAG_AUTO_CANCEL)
// A report without a title still says something that is the app's own.
assertEquals("New report", Notifications.reportNotification(app, "home", notice.copy(title = "")).words()[0])
}
}
@@ -0,0 +1,168 @@
package eu.llembas.android
import eu.llembas.android.api.LembasJson
import eu.llembas.android.api.PushPayload
import eu.llembas.android.api.Report
import eu.llembas.android.api.ReportList
import eu.llembas.android.api.ReportReply
import eu.llembas.android.api.Schedule
import eu.llembas.android.api.ScheduleRun
import eu.llembas.android.api.notifyChoice
import eu.llembas.android.api.sortedReports
import eu.llembas.android.push.ReportNotice
import eu.llembas.android.push.ScheduledNotice
import eu.llembas.android.ui.Segment
import eu.llembas.android.ui.pageProjection
import eu.llembas.android.ui.reports.shareText
import eu.llembas.android.ui.splitFences
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertNull
import org.junit.Assert.assertTrue
import org.junit.Test
/**
* Reports (harness spec 3.8.0, `reports.md`) and pages in an answer (`pages.md`), as far as they
* need no phone: the shapes, the list's order, "notify when", the push, and a page's place in
* the text. The shapes here are written out in the test; `ReportsContractTest` reads the server's
* own fixtures once they are pinned.
*/
class ReportsTest {
private val list = """
{"reports": [
{"id": "rep1", "title": "Two tenders opened", "summary": "Storage bids are due in May.", "importance": "high",
"schedule": {"id": "s1", "title": "Morning news"}, "created": "2026-03-10T07:31:00+00:00", "unread": true},
{"id": "rep2", "title": "Nothing new on the bridge", "summary": "", "importance": "normal",
"schedule": {"id": "s2", "title": "Bridge watch"}, "created": "2026-03-11T07:31:00+00:00", "unread": false},
{"id": "rep3", "title": "Flour is back in stock", "created": "2026-03-09T07:31:00+00:00", "unread": true}
]}
""".trimIndent()
@Test
fun theListAndItsOrder() {
val reports = LembasJson.decodeFromString(ReportList.serializer(), list).reports
assertEquals("Morning news", reports[0].schedule?.title)
assertTrue(reports[0].high)
assertFalse(reports[2].high)
assertNull(reports[2].schedule)
// The unread first, the newest first within each half.
assertEquals(listOf("rep1", "rep3", "rep2"), sortedReports(reports).map { it.id })
// A server that says nothing has none.
assertTrue(LembasJson.decodeFromString(ReportList.serializer(), "{}").reports.isEmpty())
}
@Test
fun oneReportItsBodyAndTheChatAReplyContinuesIn() {
val alone = LembasJson.decodeFromString(
Report.serializer(),
"""{"id":"rep1","title":"Two tenders opened","body":"**Two** tenders.","chat":null,"unread":true,"created_at":"2026-03-10T07:31:00+00:00"}""",
)
assertEquals("**Two** tenders.", alone.body)
assertNull(alone.chatId)
// `created` under either name.
assertEquals("2026-03-10T07:31:00+00:00", alone.created)
// The chat as an id, or as an object carrying one: both are the chat.
val replied = LembasJson.decodeFromString(Report.serializer(), """{"id":"rep1","chat":"chat9"}""")
assertEquals("chat9", replied.chatId)
assertEquals("chat9", LembasJson.decodeFromString(Report.serializer(), """{"id":"rep1","chat":{"id":"chat9"}}""").chatId)
assertEquals("chat9", LembasJson.decodeFromString(ReportReply.serializer(), """{"chat":"chat9"}""").chatId)
assertNull(LembasJson.decodeFromString(ReportReply.serializer(), """{"chat":""}""").chatId)
}
@Test
fun aRunLeavesANoteAndMaybeAReport() {
val filed = LembasJson.decodeFromString(ScheduleRun.serializer(), """{"id":"r1","status":"ok","note":"Two tenders; report filed.","report":"rep1"}""")
assertEquals("Two tenders; report filed.", filed.note)
assertEquals("rep1", filed.reportId)
val quiet = LembasJson.decodeFromString(ScheduleRun.serializer(), """{"id":"r2","status":"ok","note":"Nothing changed since Monday.","report":null}""")
assertNull(quiet.reportId)
// A server before 3.8.0 says neither.
val old = LembasJson.decodeFromString(ScheduleRun.serializer(), """{"id":"r3","status":"silent"}""")
assertEquals("", old.note)
assertNull(old.reportId)
}
@Test
fun notifyWhenIsOneOfThree() {
assertEquals("always", notifyChoice("always"))
assertEquals("never", notifyChoice("never"))
assertEquals("when", notifyChoice("when"))
// What a server before 3.8.0 called "when it matters", and a schedule that says nothing: the default.
assertEquals("when", notifyChoice("matters"))
assertEquals("when", notifyChoice(""))
val schedule = LembasJson.decodeFromString(Schedule.serializer(), """{"id":"s1","notify":"when","notify_when":"the price drops below 100"}""")
assertEquals("the price drops below 100", schedule.notifyWhen)
assertEquals("", LembasJson.decodeFromString(Schedule.serializer(), """{"id":"s1","notify":"matters"}""").notifyWhen)
}
@Test
fun aReportsPushOpensTheReport() {
val payload = LembasJson.decodeFromString(
PushPayload.serializer(),
"""{"kind":"report","title":"Two tenders opened","body":"Storage bids are due in May.","url":"/reports/rep1"}""",
)
val notice = ReportNotice.from(payload)!!
assertEquals("rep1", notice.reportId)
assertEquals("Two tenders opened", notice.title)
assertEquals("Storage bids are due in May.", notice.summary)
assertFalse(notice.high)
// The id named outright wins over the address, and importance may make it urgent.
val named = payload.copy(reportId = "rep7", importance = "high")
assertEquals("rep7", ReportNotice.from(named)!!.reportId)
assertTrue(ReportNotice.from(named)!!.high)
// One notification per report.
assertEquals(notice.id, ReportNotice.from(payload)!!.id)
// Not a report: nothing; and a report is not a scheduled result.
assertNull(ReportNotice.from(payload.copy(kind = "reply")))
assertNull(ReportNotice.from(payload.copy(url = "/chat/c1")))
assertNull(ScheduledNotice.from(payload))
}
@Test
fun anOlderServersScheduledPushStillWorks() {
// 2.0.0-beta.11 and before: a run's result is its own push, which opens the run.
val result = LembasJson.decodeFromString(
PushPayload.serializer(),
"""{"kind":"schedule","title":"Morning news","body":"Little happened.","url":"/scheduled/s1?run=r1","schedule_id":"s1","run_id":"r1"}""",
)
assertNull(ReportNotice.from(result))
val notice = ScheduledNotice.from(result)!!
assertEquals("s1", notice.scheduleId)
assertEquals("r1", notice.runId)
assertFalse(notice.failed)
// A failed run keeps its failure notification under 3.8.0 too.
assertTrue(ScheduledNotice.from(result.copy(kind = "schedule_failed"))!!.failed)
}
@Test
fun aPageInAnAnswerIsNeverItsSource() {
val reply = "Sales by month:\n\n```html-view Monthly sales\n<!doctype html>\n<html><script>alert(1)</script></html>\n```\n\nThat is all."
val split = splitFences(reply)
assertEquals(listOf(Segment.Prose("Sales by month:"), Segment.Page("Monthly sales"), Segment.Prose("That is all.")), split)
// The word is exact: these are ordinary code blocks.
assertEquals(listOf(Segment.Code("html", "<p>")), splitFences("```html\n<p>\n```"))
assertEquals(listOf(Segment.Code("html-views", "<p>")), splitFences("```html-views\n<p>\n```"))
// Tildes, no title, and one still being written.
assertEquals(listOf(Segment.Page("")), splitFences("~~~html-view\n<html></html>\n~~~"))
assertEquals(listOf(Segment.Page("Chart", closed = false)), splitFences("```html-view Chart\n<html>"))
// Backticks inside a page do not end it unless a line is the closing fence.
assertEquals(listOf(Segment.Page("T")), splitFences("````html-view T\nconst a = `x`\n```\nstill the page\n````"))
// The server's own line in a page's place.
assertEquals(
listOf(Segment.Prose("Before."), Segment.Page("Monthly sales"), Segment.Prose("After.")),
splitFences("Before.\n\n[page: Monthly sales]\n\nAfter."),
)
assertEquals(listOf(Segment.Prose("See [page: x] inline.")), splitFences("See [page: x] inline."))
}
@Test
fun whatIsCopiedOrSharedSaysThereIsAPage() {
val reply = "Sales:\n\n```html-view Monthly sales\n<html>secret markup</html>\n```\n\n```sh\nmake\n```"
val text = pageProjection(reply, untitled = "Page")
assertEquals("Sales:\n\n[page: Monthly sales]\n\n```sh\nmake\n```", text)
assertFalse(text.contains("secret markup"))
assertEquals("[page: Page]", pageProjection("```html-view\n<html></html>\n```", untitled = "Page"))
val report = Report(id = "rep1", title = "Two tenders opened", body = "Bids are due.\n\n```html-view Chart\n<svg></svg>\n```")
assertEquals("Two tenders opened\n\nBids are due.\n\n[page: Chart]", shareText(report))
}
}
@@ -19,6 +19,8 @@ import eu.llembas.android.api.Message
import eu.llembas.android.api.Metrics import eu.llembas.android.api.Metrics
import eu.llembas.android.api.ModelList import eu.llembas.android.api.ModelList
import eu.llembas.android.api.Progress import eu.llembas.android.api.Progress
import eu.llembas.android.api.Report
import eu.llembas.android.api.ReportSchedule
import eu.llembas.android.api.RunError import eu.llembas.android.api.RunError
import eu.llembas.android.api.RunModel import eu.llembas.android.api.RunModel
import eu.llembas.android.api.RunResult import eu.llembas.android.api.RunResult
@@ -50,6 +52,8 @@ import eu.llembas.android.ui.chat.ChatState
import eu.llembas.android.ui.chat.Draft import eu.llembas.android.ui.chat.Draft
import eu.llembas.android.ui.home.ChatsState import eu.llembas.android.ui.home.ChatsState
import eu.llembas.android.ui.memory.MemoryState import eu.llembas.android.ui.memory.MemoryState
import eu.llembas.android.ui.reports.ReportState
import eu.llembas.android.ui.reports.ReportsState
import eu.llembas.android.ui.scheduled.EditState import eu.llembas.android.ui.scheduled.EditState
import eu.llembas.android.ui.scheduled.ModelsState import eu.llembas.android.ui.scheduled.ModelsState
import eu.llembas.android.ui.scheduled.RunState import eu.llembas.android.ui.scheduled.RunState
@@ -59,6 +63,7 @@ import eu.llembas.android.ui.settings.SettingsState
import eu.llembas.android.ui.settings.WakeTestShown import eu.llembas.android.ui.settings.WakeTestShown
import eu.llembas.android.wake.WakeFailure import eu.llembas.android.wake.WakeFailure
import eu.llembas.android.wake.WakeState import eu.llembas.android.wake.WakeState
import kotlinx.serialization.json.JsonPrimitive
import kotlinx.serialization.json.jsonObject import kotlinx.serialization.json.jsonObject
import java.time.LocalDate import java.time.LocalDate
@@ -645,6 +650,68 @@ object Fakes {
), ),
) )
/** Reports: two unread (one marked important), one read; a long title and a long task name. */
val reports = ReportsState(
reports = listOf(
Report(
id = "rep1",
title = "Two storage tenders opened, and one of them closes before the next run",
summary = "Austria asks for 200 MW of grid storage, bids due in May. A second, smaller one closes on Friday.",
importance = "high",
schedule = ReportSchedule("s1", "Morning news on renewables"),
created = "2026-03-10T07:31:00+00:00",
unread = true,
),
Report(
id = "rep2",
title = "Flour is back in stock",
summary = "The mill lists the stone-ground flour again.",
schedule = ReportSchedule("s2", "The mill's price list, watched every hour of every working day"),
created = "2026-03-09T16:00:00+00:00",
unread = true,
),
Report(
id = "rep3",
title = "Nothing new on the bridge",
summary = "The council has not published the minutes yet.",
schedule = ReportSchedule("s3", "Bridge watch"),
created = "2026-03-08T07:31:00+00:00",
),
),
)
/** One report read as a page: Markdown, a code block, and a page a phone does not draw. */
val report = ReportState(
loading = false,
report = reports.reports[0].copy(
unread = false,
body = """
|Two tenders for grid storage opened this week.
|
|1. **Austria**: 200 MW, bids due on 15 May.
|2. **A smaller one** closes on Friday; see the [notice](https://example.org/notice).
|
|```html-view Storage tenders by month
|<!doctype html><html><body><svg></svg></body></html>
|```
|
|```text
|storage tender: 200 MW, deadline 2026-05-15
|```
""".trimMargin(),
),
)
/** A task's history under spec 3.8.0: a run that filed a report, one that says why it did not, one unchanged. */
val scheduleWithReports = ScheduleState(
schedule = schedules[0].copy(notify = "when", notifyWhen = "a tender for storage opens or closes"),
runs = listOf(
ok.copy(id = "r-10", note = "Two tenders opened; the report says which.", report = JsonPrimitive("rep1"), preview = ""),
ok.copy(id = "r-11", note = "No tender opened or closed since yesterday, so there is nothing to report.", preview = ""),
ScheduleRun(id = "r-12", scheduleId = "s1", dueAt = "2026-03-06T07:30:00+00:00", status = "unchanged", note = "The page did not change."),
),
)
val schedulingModels = ModelsState( val schedulingModels = ModelsState(
models = SchedulingModels( models = SchedulingModels(
models = listOf( models = listOf(
@@ -657,6 +724,9 @@ object Fakes {
), ),
) )
/** The form with "When…" chosen and the person's own words in it. */
val editingNotify: EditState get() = editing.copy(notify = "when", notifyWhen = "a tender for storage opens or closes")
val editing = EditState( val editing = EditState(
words = "Every weekday at 7:30, sum up the news about renewable energy in five points", words = "Every weekday at 7:30, sum up the news about renewable energy in five points",
compiled = ScheduleCompiled( compiled = ScheduleCompiled(
@@ -54,6 +54,10 @@ import eu.llembas.android.ui.home.DrawerContent
import eu.llembas.android.ui.memory.MemoryActions import eu.llembas.android.ui.memory.MemoryActions
import eu.llembas.android.ui.memory.MemoryContent import eu.llembas.android.ui.memory.MemoryContent
import eu.llembas.android.ui.memory.MemoryState import eu.llembas.android.ui.memory.MemoryState
import eu.llembas.android.ui.reports.ReportContent
import eu.llembas.android.ui.reports.ReportsActions
import eu.llembas.android.ui.reports.ReportsContent
import eu.llembas.android.ui.reports.ReportsState
import eu.llembas.android.ui.scheduled.RunContent import eu.llembas.android.ui.scheduled.RunContent
import eu.llembas.android.ui.scheduled.ScheduleContent import eu.llembas.android.ui.scheduled.ScheduleContent
import eu.llembas.android.ui.scheduled.ScheduleEditContent import eu.llembas.android.ui.scheduled.ScheduleEditContent
@@ -88,6 +92,8 @@ private object NoActivityActions : ActivityActions
private object NoSettingsActions : SettingsActions private object NoSettingsActions : SettingsActions
private object NoReportsActions : ReportsActions
private object NoAssistActions : AssistActions private object NoAssistActions : AssistActions
private object NoShareActions : ShareActions private object NoShareActions : ShareActions
@@ -137,7 +143,7 @@ class ScreenShots {
drawerState = rememberDrawerState(DrawerValue.Open), drawerState = rememberDrawerState(DrawerValue.Open),
drawerContent = { drawerContent = {
DrawerContent( DrawerContent(
Fakes.chats, Fakes.chats.copy(unreadReports = 2),
current = "c1", current = "c1",
account = "Home · frodo@example.org", account = "Home · frodo@example.org",
actions = NoDrawerActions, actions = NoDrawerActions,
@@ -247,7 +253,26 @@ class ScreenShots {
} }
@Test @Test
fun scheduleEdit() = shoot("11-schedule-edit") { ScheduleEditContent(Fakes.editing, editing = false) } fun scheduleEdit() {
shoot("11-schedule-edit", Phone.Scroll) { ScheduleEditContent(Fakes.editing, editing = false) }
// "Notify when": the three choices, and "When…" with the person's words.
shoot("11-schedule-edit-notify", Phone.Scroll) { ScheduleEditContent(Fakes.editingNotify, editing = true) }
shoot("11-schedule-edit-notify", Phone.SmallScroll, fontScale = 1.5f) { ScheduleEditContent(Fakes.editingNotify, editing = true) }
}
@Test
fun reports() {
shoot("40-reports") { ReportsContent(Fakes.reports, NoReportsActions) }
shoot("40-reports", Phone.Small, fontScale = 1.5f) { ReportsContent(Fakes.reports, NoReportsActions) }
shoot("40-reports-none") { ReportsContent(ReportsState(), NoReportsActions) }
shoot("40-reports-older-instance") { ReportsContent(ReportsState(unsupported = true), NoReportsActions) }
// One report as a page; the page in it is a card, not a page and not its source.
shoot("41-report", Phone.Scroll) { ReportContent(Fakes.report) }
shoot("41-report", Phone.Small, fontScale = 1.5f) { ReportContent(Fakes.report) }
// A task's runs: the note, the way to a report, an unchanged look.
shoot("42-schedule-runs-reports", Phone.Scroll) { ScheduleContent(Fakes.scheduleWithReports) }
shoot("42-schedule-runs-reports", Phone.SmallScroll, fontScale = 1.5f) { ScheduleContent(Fakes.scheduleWithReports) }
}
@Test @Test
fun scheduleRun() { fun scheduleRun() {
+28
View File
@@ -261,6 +261,34 @@ STRINGS: dict[str, str] = {
"channel_scheduled_failures": "Scheduled failures", "channel_scheduled_failures": "Scheduled failures",
"scheduled_result_public": "A scheduled task has a result.", "scheduled_result_public": "A scheduled task has a result.",
"scheduled_failed_public": "A scheduled task failed.", "scheduled_failed_public": "A scheduled task failed.",
"page_note": "This answer has a page: %1$s",
"page_where": "Open it on the web or in LLeMbas Desktop to see it.",
"page_untitled": "Page",
"reports": "Reports",
"report": "Report",
"reports_none": "No reports yet. A scheduled task files one when it has something to tell you.",
"reports_unsupported": "This instance runs a LLeMbas that has no Reports yet.",
"report_untitled": "Untitled report",
"report_delete_title": "Delete this report?",
"report_delete_line": "“%1$s” is deleted for good, and the conversation about it with it.",
"report_mark_read": "Mark read",
"report_important": "Important",
"report_share": "Share",
"report_reply": "Reply",
"report_chat_title": "Report: %1$s",
"notify_when": "Notify when",
"notify_every_run": "Every run",
"notify_every_run_line": "The model writes a report every time, also when nothing was found.",
"notify_when_option": "When…",
"notify_when_line": "The model writes a report only when this holds.",
"notify_when_label": "When what?",
"notify_when_default": "something needs my attention",
"notify_never_option": "Never",
"notify_never_line": "No reports: runs are kept in the task's history only.",
"notify_when_words": "Tells you when: %1$s",
"run_open_report": "Open its report",
"channel_reports": "Reports",
"report_new_public": "New report",
"schedule_run_again": "Run again", "schedule_run_again": "Run again",
# Cards # Cards
"card_approval": "Allow this?", "card_approval": "Allow this?",
+224
View File
@@ -90,6 +90,7 @@
"card_deny_reason": "Zamítnout a říct proč", "card_deny_reason": "Zamítnout a říct proč",
"card_reason": "Proč ne? (nepovinné)", "card_reason": "Proč ne? (nepovinné)",
"channel_asks": "Otázky a schválení", "channel_asks": "Otázky a schválení",
"channel_reports": "Zprávy",
"channel_scheduled": "Výsledky naplánovaných úloh", "channel_scheduled": "Výsledky naplánovaných úloh",
"channel_scheduled_failures": "Selhání naplánovaných úloh", "channel_scheduled_failures": "Selhání naplánovaných úloh",
"channel_updates": "Aktualizace aplikace", "channel_updates": "Aktualizace aplikace",
@@ -148,13 +149,26 @@
"notification_summaries_switch": "Dovolit asistentovi číst má oznámení, když o to požádám", "notification_summaries_switch": "Dovolit asistentovi číst má oznámení, když o to požádám",
"notification_summaries_unavailable": "V tomto sestavení není. Čtení oznámení vyžaduje sestavení LLeMbas „notifications“, protože Google Play Protect blokuje instalaci aplikace mimo Obchod Play, která je umí číst. Je to stejná aplikace se stejným podpisem: na stránce vydání se soubor končící na -notifications.apk nainstaluje přes tuto.", "notification_summaries_unavailable": "V tomto sestavení není. Čtení oznámení vyžaduje sestavení LLeMbas „notifications“, protože Google Play Protect blokuje instalaci aplikace mimo Obchod Play, která je umí číst. Je to stejná aplikace se stejným podpisem: na stránce vydání se soubor končící na -notifications.apk nainstaluje přes tuto.",
"notify_always": "Dá vědět pokaždé", "notify_always": "Dá vědět pokaždé",
"notify_every_run": "Při každém běhu",
"notify_every_run_line": "Model napíše zprávu pokaždé, i když nic nenašel.",
"notify_matters": "Dá vědět, když na tom záleží", "notify_matters": "Dá vědět, když na tom záleží",
"notify_never": "Nedá vědět nikdy", "notify_never": "Nedá vědět nikdy",
"notify_never_line": "Žádné zprávy: běhy zůstanou jen v historii úlohy.",
"notify_never_option": "Nikdy",
"notify_when": "Kdy dát vědět",
"notify_when_default": "něco vyžaduje moji pozornost",
"notify_when_label": "Když co?",
"notify_when_line": "Model napíše zprávu jen tehdy, když platí tohle.",
"notify_when_option": "Když…",
"notify_when_words": "Dá vědět, když: %1$s",
"offline": "Instance není dostupná. Zkontrolujte připojení telefonu a to, zda se dostane na adresu instance.", "offline": "Instance není dostupná. Zkontrolujte připojení telefonu a to, zda se dostane na adresu instance.",
"older": "Starší zprávy", "older": "Starší zprávy",
"osmand_info": "Ptát se OsmAnd na trasu", "osmand_info": "Ptát se OsmAnd na trasu",
"osmand_info_line": "Umožní „přidat zastávku“ a hledání v okolí i u trasy nastavené přímo v OsmAnd: LLeMbas se OsmAnd zeptá, kde jste a kam trasa vede. Nejdřív LLeMbas povolte v OsmAnd (připojené aplikace, s polohou); OsmAnd dá vědět, pokud povoleno není.", "osmand_info_line": "Umožní „přidat zastávku“ a hledání v okolí i u trasy nastavené přímo v OsmAnd: LLeMbas se OsmAnd zeptá, kde jste a kam trasa vede. Nejdřív LLeMbas povolte v OsmAnd (připojené aplikace, s polohou); OsmAnd dá vědět, pokud povoleno není.",
"output_cut": "Výstup je zde zkrácen. Celý ho najdete na webové stránce.", "output_cut": "Výstup je zde zkrácen. Celý ho najdete na webové stránce.",
"page_note": "Tato odpověď obsahuje stránku: %1$s",
"page_untitled": "Stránka",
"page_where": "Zobrazíte ji na webu nebo v aplikaci LLeMbas Desktop.",
"phone_actions_line": "Model může nabídnout, že v telefonu něco udělá — nastaví budík, přidá událost, připraví zprávu, spustí trasu. Nic se nestane, dokud neklepnete na Provést na jeho kartě, a nikdy při zamčeném telefonu. Mapy Google spustí trasu s několika zastávkami, ale do běžící trasy zastávku nepřidají ani je nelze zastavit; OsmAnd to umí.", "phone_actions_line": "Model může nabídnout, že v telefonu něco udělá — nastaví budík, přidá událost, připraví zprávu, spustí trasu. Nic se nestane, dokud neklepnete na Provést na jeho kartě, a nikdy při zamčeném telefonu. Mapy Google spustí trasu s několika zastávkami, ale do běžící trasy zastávku nepřidají ani je nelze zastavit; OsmAnd to umí.",
"plan_approve": "Schválit plán", "plan_approve": "Schválit plán",
"plan_approve_edit": "Schválit, pokračovat v režimu Upravit", "plan_approve_edit": "Schválit, pokračovat v režimu Upravit",
@@ -169,9 +183,23 @@
"push_no_distributor": "Abyste se dozvěděli, že je odpověď hotová, nainstalujte distributora UnifiedPush, například ntfy, a pak se vraťte sem. Bez něj aplikace nové odpovědi ukáže, jen když je otevřená.", "push_no_distributor": "Abyste se dozvěděli, že je odpověď hotová, nainstalujte distributora UnifiedPush, například ntfy, a pak se vraťte sem. Bez něj aplikace nové odpovědi ukáže, jen když je otevřená.",
"push_on": "Upozornění jsou pro tuto instanci zapnutá.", "push_on": "Upozornění jsou pro tuto instanci zapnutá.",
"regenerate": "Vygenerovat znovu", "regenerate": "Vygenerovat znovu",
"report": "Zpráva",
"report_chat_title": "Zpráva: %1$s",
"report_delete_line": "Zpráva „%1$s“ se smaže natrvalo, i s rozhovorem o ní.",
"report_delete_title": "Smazat tuto zprávu?",
"report_important": "Důležité",
"report_mark_read": "Označit jako přečtené",
"report_new_public": "Nová zpráva",
"report_reply": "Odpovědět",
"report_share": "Sdílet",
"report_untitled": "Zpráva bez názvu",
"reports": "Zprávy",
"reports_none": "Zatím žádné zprávy. Naplánovaná úloha ji napíše, když vám má co říct.",
"reports_unsupported": "Na této instanci běží LLeMbas, který Zprávy ještě nemá.",
"run_missed": "Zmeškáno ×%1$s", "run_missed": "Zmeškáno ×%1$s",
"run_model_instead": "%1$s, místo %2$s", "run_model_instead": "%1$s, místo %2$s",
"run_no_text": "Tento běh nezanechal žádný text.", "run_no_text": "Tento běh nezanechal žádný text.",
"run_open_report": "Otevřít její zprávu",
"run_result": "Výsledek", "run_result": "Výsledek",
"run_retry_at": "Zkusí to znovu v %1$s", "run_retry_at": "Zkusí to znovu v %1$s",
"run_silent": "Nic nového", "run_silent": "Nic nového",
@@ -418,6 +446,7 @@
"card_deny_reason": "Ablehnen und begründen", "card_deny_reason": "Ablehnen und begründen",
"card_reason": "Warum nicht? (optional)", "card_reason": "Warum nicht? (optional)",
"channel_asks": "Fragen und Bestätigungen", "channel_asks": "Fragen und Bestätigungen",
"channel_reports": "Berichte",
"channel_scheduled": "Geplante Ergebnisse", "channel_scheduled": "Geplante Ergebnisse",
"channel_scheduled_failures": "Geplante Fehler", "channel_scheduled_failures": "Geplante Fehler",
"channel_updates": "App-Updates", "channel_updates": "App-Updates",
@@ -477,13 +506,26 @@
"notification_summaries_switch": "Den Assistenten meine Benachrichtigungen lesen lassen, wenn ich frage", "notification_summaries_switch": "Den Assistenten meine Benachrichtigungen lesen lassen, wenn ich frage",
"notification_summaries_unavailable": "Nicht in diesem Build. Das Lesen von Benachrichtigungen braucht den „notifications“-Build von LLeMbas, weil Google Play Protect die Installation einer App von außerhalb des Play Store blockiert, die sie lesen kann. Es ist dieselbe App mit derselben Signatur: Auf der Release-Seite lässt sich die Datei, die auf -notifications.apk endet, über diese installieren.", "notification_summaries_unavailable": "Nicht in diesem Build. Das Lesen von Benachrichtigungen braucht den „notifications“-Build von LLeMbas, weil Google Play Protect die Installation einer App von außerhalb des Play Store blockiert, die sie lesen kann. Es ist dieselbe App mit derselben Signatur: Auf der Release-Seite lässt sich die Datei, die auf -notifications.apk endet, über diese installieren.",
"notify_always": "Meldet sich jedes Mal", "notify_always": "Meldet sich jedes Mal",
"notify_every_run": "Bei jedem Lauf",
"notify_every_run_line": "Das Modell schreibt jedes Mal einen Bericht, auch wenn nichts gefunden wurde.",
"notify_matters": "Meldet sich, wenn es wichtig ist", "notify_matters": "Meldet sich, wenn es wichtig ist",
"notify_never": "Meldet sich nie", "notify_never": "Meldet sich nie",
"notify_never_line": "Keine Berichte: Läufe bleiben nur im Verlauf der Aufgabe.",
"notify_never_option": "Nie",
"notify_when": "Benachrichtigen, wenn",
"notify_when_default": "etwas braucht meine Aufmerksamkeit",
"notify_when_label": "Wenn was?",
"notify_when_line": "Das Modell schreibt nur dann einen Bericht, wenn das zutrifft.",
"notify_when_option": "Wenn…",
"notify_when_words": "Meldet sich, wenn: %1$s",
"offline": "Die Instanz ist nicht erreichbar. Prüfen Sie die Verbindung des Telefons und ob es die Adresse der Instanz erreicht.", "offline": "Die Instanz ist nicht erreichbar. Prüfen Sie die Verbindung des Telefons und ob es die Adresse der Instanz erreicht.",
"older": "Frühere Nachrichten", "older": "Frühere Nachrichten",
"osmand_info": "OsmAnd nach der Route fragen", "osmand_info": "OsmAnd nach der Route fragen",
"osmand_info_line": "Damit „Zwischenstopp hinzufügen“ und die Suche in der Nähe auch mit einer in OsmAnd geplanten Route gehen: LLeMbas fragt OsmAnd, wo du bist und wohin die Route führt. Erlaube LLeMbas zuerst in OsmAnd (verbundene Apps, mit Standort); OsmAnd sagt Bescheid, wenn es nicht erlaubt ist.", "osmand_info_line": "Damit „Zwischenstopp hinzufügen“ und die Suche in der Nähe auch mit einer in OsmAnd geplanten Route gehen: LLeMbas fragt OsmAnd, wo du bist und wohin die Route führt. Erlaube LLeMbas zuerst in OsmAnd (verbundene Apps, mit Standort); OsmAnd sagt Bescheid, wenn es nicht erlaubt ist.",
"output_cut": "Die Ausgabe ist hier verkürzt. Vollständig finden Sie sie auf der Webseite.", "output_cut": "Die Ausgabe ist hier verkürzt. Vollständig finden Sie sie auf der Webseite.",
"page_note": "Diese Antwort hat eine Seite: %1$s",
"page_untitled": "Seite",
"page_where": "Öffne sie im Web oder in LLeMbas Desktop, um sie zu sehen.",
"phone_actions_line": "Ein Modell kann anbieten, etwas auf diesem Telefon zu tun — einen Wecker stellen, einen Termin eintragen, eine Nachricht entwerfen, eine Route starten. Nichts passiert, bevor du auf seiner Karte auf Ausführen tippst, und nie bei gesperrtem Telefon. Google Maps startet eine Route mit ein paar Stopps, kann aber keinen in eine laufende Route einfügen und nicht angehalten werden; OsmAnd kann das.", "phone_actions_line": "Ein Modell kann anbieten, etwas auf diesem Telefon zu tun — einen Wecker stellen, einen Termin eintragen, eine Nachricht entwerfen, eine Route starten. Nichts passiert, bevor du auf seiner Karte auf Ausführen tippst, und nie bei gesperrtem Telefon. Google Maps startet eine Route mit ein paar Stopps, kann aber keinen in eine laufende Route einfügen und nicht angehalten werden; OsmAnd kann das.",
"plan_approve": "Plan bestätigen", "plan_approve": "Plan bestätigen",
"plan_approve_edit": "Bestätigen, weiter im Modus Bearbeiten", "plan_approve_edit": "Bestätigen, weiter im Modus Bearbeiten",
@@ -498,9 +540,23 @@
"push_no_distributor": "Um erfahren zu lassen, wenn eine Antwort fertig ist, installieren Sie einen UnifiedPush-Distributor wie ntfy und kommen Sie dann hierher zurück. Ohne einen zeigt die App neue Antworten nur, wenn sie geöffnet ist.", "push_no_distributor": "Um erfahren zu lassen, wenn eine Antwort fertig ist, installieren Sie einen UnifiedPush-Distributor wie ntfy und kommen Sie dann hierher zurück. Ohne einen zeigt die App neue Antworten nur, wenn sie geöffnet ist.",
"push_on": "Benachrichtigungen sind für diese Instanz eingeschaltet.", "push_on": "Benachrichtigungen sind für diese Instanz eingeschaltet.",
"regenerate": "Neu generieren", "regenerate": "Neu generieren",
"report": "Bericht",
"report_chat_title": "Bericht: %1$s",
"report_delete_line": "„%1$s“ wird endgültig gelöscht, samt der Unterhaltung darüber.",
"report_delete_title": "Diesen Bericht löschen?",
"report_important": "Wichtig",
"report_mark_read": "Als gelesen markieren",
"report_new_public": "Neuer Bericht",
"report_reply": "Antworten",
"report_share": "Teilen",
"report_untitled": "Bericht ohne Titel",
"reports": "Berichte",
"reports_none": "Noch keine Berichte. Eine geplante Aufgabe schreibt einen, wenn sie dir etwas zu sagen hat.",
"reports_unsupported": "Auf dieser Instanz läuft ein LLeMbas, das noch keine Berichte hat.",
"run_missed": "Verpasst ×%1$s", "run_missed": "Verpasst ×%1$s",
"run_model_instead": "%1$s statt %2$s", "run_model_instead": "%1$s statt %2$s",
"run_no_text": "Dieser Lauf hat keinen Text hinterlassen.", "run_no_text": "Dieser Lauf hat keinen Text hinterlassen.",
"run_open_report": "Zugehörigen Bericht öffnen",
"run_result": "Ergebnis", "run_result": "Ergebnis",
"run_retry_at": "Neuer Versuch um %1$s", "run_retry_at": "Neuer Versuch um %1$s",
"run_silent": "Nichts Neues", "run_silent": "Nichts Neues",
@@ -747,6 +803,7 @@
"card_deny_reason": "Denegar y decir por qué", "card_deny_reason": "Denegar y decir por qué",
"card_reason": "¿Por qué no? (opcional)", "card_reason": "¿Por qué no? (opcional)",
"channel_asks": "Preguntas y aprobaciones", "channel_asks": "Preguntas y aprobaciones",
"channel_reports": "Informes",
"channel_scheduled": "Resultados programados", "channel_scheduled": "Resultados programados",
"channel_scheduled_failures": "Fallos programados", "channel_scheduled_failures": "Fallos programados",
"channel_updates": "Actualizaciones de la aplicación", "channel_updates": "Actualizaciones de la aplicación",
@@ -805,13 +862,26 @@
"notification_summaries_switch": "Dejar que el asistente lea mis notificaciones cuando lo pida", "notification_summaries_switch": "Dejar que el asistente lea mis notificaciones cuando lo pida",
"notification_summaries_unavailable": "No en esta versión. Leer notificaciones requiere la versión «notifications» de LLeMbas, porque Google Play Protect bloquea la instalación de una app de fuera de Play Store que pueda leerlas. Es la misma app con la misma firma: en la página de la versión, el archivo que termina en -notifications.apk se instala sobre esta.", "notification_summaries_unavailable": "No en esta versión. Leer notificaciones requiere la versión «notifications» de LLeMbas, porque Google Play Protect bloquea la instalación de una app de fuera de Play Store que pueda leerlas. Es la misma app con la misma firma: en la página de la versión, el archivo que termina en -notifications.apk se instala sobre esta.",
"notify_always": "Avisa siempre", "notify_always": "Avisa siempre",
"notify_every_run": "En cada ejecución",
"notify_every_run_line": "El modelo escribe un informe cada vez, también cuando no ha encontrado nada.",
"notify_matters": "Avisa cuando importa", "notify_matters": "Avisa cuando importa",
"notify_never": "No avisa nunca", "notify_never": "No avisa nunca",
"notify_never_line": "Sin informes: las ejecuciones quedan solo en el historial de la tarea.",
"notify_never_option": "Nunca",
"notify_when": "Avisar cuando",
"notify_when_default": "algo necesita mi atención",
"notify_when_label": "¿Cuando qué?",
"notify_when_line": "El modelo escribe un informe solo cuando esto se cumple.",
"notify_when_option": "Cuando…",
"notify_when_words": "Avisa cuando: %1$s",
"offline": "No se puede acceder a la instancia. Compruebe la conexión del teléfono y que llegue a la dirección de la instancia.", "offline": "No se puede acceder a la instancia. Compruebe la conexión del teléfono y que llegue a la dirección de la instancia.",
"older": "Mensajes anteriores", "older": "Mensajes anteriores",
"osmand_info": "Preguntar a OsmAnd por la ruta", "osmand_info": "Preguntar a OsmAnd por la ruta",
"osmand_info_line": "Permite «añadir una parada» y buscar cerca de ti con una ruta creada en el propio OsmAnd: LLeMbas pregunta a OsmAnd dónde estás y adónde va la ruta. Primero permite LLeMbas en OsmAnd (apps conectadas, con ubicación); OsmAnd te avisa si no está permitido.", "osmand_info_line": "Permite «añadir una parada» y buscar cerca de ti con una ruta creada en el propio OsmAnd: LLeMbas pregunta a OsmAnd dónde estás y adónde va la ruta. Primero permite LLeMbas en OsmAnd (apps conectadas, con ubicación); OsmAnd te avisa si no está permitido.",
"output_cut": "La salida está acortada aquí. La tiene completa en la página web.", "output_cut": "La salida está acortada aquí. La tiene completa en la página web.",
"page_note": "Esta respuesta tiene una página: %1$s",
"page_untitled": "Página",
"page_where": "Ábrela en la web o en LLeMbas Desktop para verla.",
"phone_actions_line": "Un modelo puede ofrecer hacer cosas en este teléfono: poner una alarma, añadir un evento, redactar un mensaje, iniciar una ruta. No pasa nada hasta que tocas Hacerlo en su tarjeta, y nunca con el teléfono bloqueado. Google Maps inicia una ruta con unas pocas paradas, pero no puede añadir una a una ruta en curso ni detenerse a petición; OsmAnd sí.", "phone_actions_line": "Un modelo puede ofrecer hacer cosas en este teléfono: poner una alarma, añadir un evento, redactar un mensaje, iniciar una ruta. No pasa nada hasta que tocas Hacerlo en su tarjeta, y nunca con el teléfono bloqueado. Google Maps inicia una ruta con unas pocas paradas, pero no puede añadir una a una ruta en curso ni detenerse a petición; OsmAnd sí.",
"plan_approve": "Aprobar el plan", "plan_approve": "Aprobar el plan",
"plan_approve_edit": "Aprobar y continuar en Editar", "plan_approve_edit": "Aprobar y continuar en Editar",
@@ -826,9 +896,23 @@
"push_no_distributor": "Para que le avisen cuando una respuesta esté lista, instale un distribuidor de UnifiedPush como ntfy y luego vuelva aquí. Sin uno, la aplicación muestra las respuestas nuevas solo cuando está abierta.", "push_no_distributor": "Para que le avisen cuando una respuesta esté lista, instale un distribuidor de UnifiedPush como ntfy y luego vuelva aquí. Sin uno, la aplicación muestra las respuestas nuevas solo cuando está abierta.",
"push_on": "Las notificaciones están activadas para esta instancia.", "push_on": "Las notificaciones están activadas para esta instancia.",
"regenerate": "Regenerar", "regenerate": "Regenerar",
"report": "Informe",
"report_chat_title": "Informe: %1$s",
"report_delete_line": "«%1$s» se elimina para siempre, junto con la conversación sobre él.",
"report_delete_title": "¿Eliminar este informe?",
"report_important": "Importante",
"report_mark_read": "Marcar como leído",
"report_new_public": "Informe nuevo",
"report_reply": "Responder",
"report_share": "Compartir",
"report_untitled": "Informe sin título",
"reports": "Informes",
"reports_none": "Aún no hay informes. Una tarea programada escribe uno cuando tiene algo que decirte.",
"reports_unsupported": "Esta instancia ejecuta un LLeMbas que todavía no tiene Informes.",
"run_missed": "Perdida ×%1$s", "run_missed": "Perdida ×%1$s",
"run_model_instead": "%1$s, en lugar de %2$s", "run_model_instead": "%1$s, en lugar de %2$s",
"run_no_text": "Esta ejecución no dejó texto.", "run_no_text": "Esta ejecución no dejó texto.",
"run_open_report": "Abrir su informe",
"run_result": "Resultado", "run_result": "Resultado",
"run_retry_at": "Lo intenta de nuevo a las %1$s", "run_retry_at": "Lo intenta de nuevo a las %1$s",
"run_silent": "Nada nuevo", "run_silent": "Nada nuevo",
@@ -1075,6 +1159,7 @@
"card_deny_reason": "Refuser, et dire pourquoi", "card_deny_reason": "Refuser, et dire pourquoi",
"card_reason": "Pourquoi pas ? (facultatif)", "card_reason": "Pourquoi pas ? (facultatif)",
"channel_asks": "Questions et approbations", "channel_asks": "Questions et approbations",
"channel_reports": "Rapports",
"channel_scheduled": "Résultats planifiés", "channel_scheduled": "Résultats planifiés",
"channel_scheduled_failures": "Échecs planifiés", "channel_scheduled_failures": "Échecs planifiés",
"channel_updates": "Mises à jour de l’application", "channel_updates": "Mises à jour de l’application",
@@ -1134,13 +1219,26 @@
"notification_summaries_switch": "Laisser l’assistant lire mes notifications quand je le demande", "notification_summaries_switch": "Laisser l’assistant lire mes notifications quand je le demande",
"notification_summaries_unavailable": "Pas dans cette version. Lire les notifications demande la version « notifications » de LLeMbas, car Google Play Protect bloque l’installation d’une app hors du Play Store capable de les lire. C’est la même app avec la même signature : sur la page de la version, le fichier se terminant par -notifications.apk s’installe par-dessus celle-ci.", "notification_summaries_unavailable": "Pas dans cette version. Lire les notifications demande la version « notifications » de LLeMbas, car Google Play Protect bloque l’installation d’une app hors du Play Store capable de les lire. C’est la même app avec la même signature : sur la page de la version, le fichier se terminant par -notifications.apk s’installe par-dessus celle-ci.",
"notify_always": "Prévient à chaque fois", "notify_always": "Prévient à chaque fois",
"notify_every_run": "À chaque exécution",
"notify_every_run_line": "Le modèle rédige un rapport à chaque fois, même quand rien n’a été trouvé.",
"notify_matters": "Prévient quand c’est important", "notify_matters": "Prévient quand c’est important",
"notify_never": "Ne prévient jamais", "notify_never": "Ne prévient jamais",
"notify_never_line": "Aucun rapport : les exécutions restent seulement dans l’historique de la tâche.",
"notify_never_option": "Jamais",
"notify_when": "Prévenir quand",
"notify_when_default": "quelque chose demande mon attention",
"notify_when_label": "Quand quoi ?",
"notify_when_line": "Le modèle ne rédige un rapport que si ceci est vrai.",
"notify_when_option": "Quand…",
"notify_when_words": "Prévient quand : %1$s",
"offline": "L'instance est injoignable. Vérifiez la connexion du téléphone et qu'il atteint bien l'adresse de l'instance.", "offline": "L'instance est injoignable. Vérifiez la connexion du téléphone et qu'il atteint bien l'adresse de l'instance.",
"older": "Messages précédents", "older": "Messages précédents",
"osmand_info": "Demander l’itinéraire à OsmAnd", "osmand_info": "Demander l’itinéraire à OsmAnd",
"osmand_info_line": "Permet « ajouter un arrêt » et la recherche à proximité avec un itinéraire créé dans OsmAnd même : LLeMbas demande à OsmAnd où vous êtes et où va l’itinéraire. Autorisez d’abord LLeMbas dans OsmAnd (apps connectées, avec la position) ; OsmAnd vous prévient sinon.", "osmand_info_line": "Permet « ajouter un arrêt » et la recherche à proximité avec un itinéraire créé dans OsmAnd même : LLeMbas demande à OsmAnd où vous êtes et où va l’itinéraire. Autorisez d’abord LLeMbas dans OsmAnd (apps connectées, avec la position) ; OsmAnd vous prévient sinon.",
"output_cut": "La sortie est raccourcie ici. Vous la trouverez en entier sur la page web.", "output_cut": "La sortie est raccourcie ici. Vous la trouverez en entier sur la page web.",
"page_note": "Cette réponse contient une page : %1$s",
"page_untitled": "Page",
"page_where": "Ouvrez-la sur le web ou dans LLeMbas Desktop pour la voir.",
"phone_actions_line": "Un modèle peut proposer de faire des choses sur ce téléphone : régler une alarme, ajouter un événement, rédiger un message, lancer un itinéraire. Rien ne se passe tant que vous ne touchez pas Le faire sur sa carte, et jamais téléphone verrouillé. Google Maps lance un itinéraire avec quelques arrêts mais ne peut ni en ajouter à un itinéraire en cours ni être arrêté ; OsmAnd le peut.", "phone_actions_line": "Un modèle peut proposer de faire des choses sur ce téléphone : régler une alarme, ajouter un événement, rédiger un message, lancer un itinéraire. Rien ne se passe tant que vous ne touchez pas Le faire sur sa carte, et jamais téléphone verrouillé. Google Maps lance un itinéraire avec quelques arrêts mais ne peut ni en ajouter à un itinéraire en cours ni être arrêté ; OsmAnd le peut.",
"plan_approve": "Approuver le plan", "plan_approve": "Approuver le plan",
"plan_approve_edit": "Approuver, continuer en mode Modifier", "plan_approve_edit": "Approuver, continuer en mode Modifier",
@@ -1155,9 +1253,23 @@
"push_no_distributor": "Pour être averti quand une réponse est prête, installez un distributeur UnifiedPush tel que ntfy, puis revenez ici. Sans cela, l'application affiche les nouvelles réponses seulement quand elle est ouverte.", "push_no_distributor": "Pour être averti quand une réponse est prête, installez un distributeur UnifiedPush tel que ntfy, puis revenez ici. Sans cela, l'application affiche les nouvelles réponses seulement quand elle est ouverte.",
"push_on": "Les notifications sont activées pour cette instance.", "push_on": "Les notifications sont activées pour cette instance.",
"regenerate": "Régénérer", "regenerate": "Régénérer",
"report": "Rapport",
"report_chat_title": "Rapport : %1$s",
"report_delete_line": "« %1$s » est supprimé définitivement, avec la conversation à son sujet.",
"report_delete_title": "Supprimer ce rapport ?",
"report_important": "Important",
"report_mark_read": "Marquer comme lu",
"report_new_public": "Nouveau rapport",
"report_reply": "Répondre",
"report_share": "Partager",
"report_untitled": "Rapport sans titre",
"reports": "Rapports",
"reports_none": "Pas encore de rapport. Une tâche planifiée en rédige un quand elle a quelque chose à vous dire.",
"reports_unsupported": "Cette instance utilise un LLeMbas qui n’a pas encore les Rapports.",
"run_missed": "Manquée ×%1$s", "run_missed": "Manquée ×%1$s",
"run_model_instead": "%1$s, au lieu de %2$s", "run_model_instead": "%1$s, au lieu de %2$s",
"run_no_text": "Cette exécution n’a laissé aucun texte.", "run_no_text": "Cette exécution n’a laissé aucun texte.",
"run_open_report": "Ouvrir son rapport",
"run_result": "Résultat", "run_result": "Résultat",
"run_retry_at": "Nouvel essai à %1$s", "run_retry_at": "Nouvel essai à %1$s",
"run_silent": "Rien de neuf", "run_silent": "Rien de neuf",
@@ -1404,6 +1516,7 @@
"card_deny_reason": "Elutasítás indoklással", "card_deny_reason": "Elutasítás indoklással",
"card_reason": "Miért nem? (opcionális)", "card_reason": "Miért nem? (opcionális)",
"channel_asks": "Kérdések és jóváhagyások", "channel_asks": "Kérdések és jóváhagyások",
"channel_reports": "Jelentések",
"channel_scheduled": "Ütemezett eredmények", "channel_scheduled": "Ütemezett eredmények",
"channel_scheduled_failures": "Ütemezett hibák", "channel_scheduled_failures": "Ütemezett hibák",
"channel_updates": "Alkalmazásfrissítések", "channel_updates": "Alkalmazásfrissítések",
@@ -1463,13 +1576,26 @@
"notification_summaries_switch": "Az asszisztens kérésemre elolvashatja az értesítéseimet", "notification_summaries_switch": "Az asszisztens kérésemre elolvashatja az értesítéseimet",
"notification_summaries_unavailable": "Ebben a változatban nincs. Az értesítések olvasásához a LLeMbas „notifications” változata kell, mert a Google Play Protect letiltja az olyan, Play Áruházon kívüli alkalmazás telepítését, amely olvasni tudja őket. Ugyanaz az alkalmazás ugyanazzal az aláírással: a kiadás oldalán a -notifications.apk végű fájl erre telepíthető rá.", "notification_summaries_unavailable": "Ebben a változatban nincs. Az értesítések olvasásához a LLeMbas „notifications” változata kell, mert a Google Play Protect letiltja az olyan, Play Áruházon kívüli alkalmazás telepítését, amely olvasni tudja őket. Ugyanaz az alkalmazás ugyanazzal az aláírással: a kiadás oldalán a -notifications.apk végű fájl erre telepíthető rá.",
"notify_always": "Mindig szól", "notify_always": "Mindig szól",
"notify_every_run": "Minden futáskor",
"notify_every_run_line": "A modell minden alkalommal ír jelentést, akkor is, ha semmit sem talált.",
"notify_matters": "Szól, ha számít", "notify_matters": "Szól, ha számít",
"notify_never": "Soha nem szól", "notify_never": "Soha nem szól",
"notify_never_line": "Nincs jelentés: a futások csak a feladat előzményeiben maradnak meg.",
"notify_never_option": "Soha",
"notify_when": "Mikor értesítsen",
"notify_when_default": "valami a figyelmemet igényli",
"notify_when_label": "Amikor mi?",
"notify_when_line": "A modell csak akkor ír jelentést, ha ez teljesül.",
"notify_when_option": "Amikor…",
"notify_when_words": "Értesít, amikor: %1$s",
"offline": "A példány nem érhető el. Ellenőrizze a telefon kapcsolatát, és hogy eléri-e a példány címét.", "offline": "A példány nem érhető el. Ellenőrizze a telefon kapcsolatát, és hogy eléri-e a példány címét.",
"older": "Korábbi üzenetek", "older": "Korábbi üzenetek",
"osmand_info": "Útvonal lekérdezése az OsmAndtól", "osmand_info": "Útvonal lekérdezése az OsmAndtól",
"osmand_info_line": "Így a „megálló hozzáadása” és a közeli keresés az OsmAndban beállított útvonallal is működik: a LLeMbas megkérdezi az OsmAndot, hol vagy és hová tart az útvonal. Előbb engedélyezd a LLeMbast az OsmAndban (csatlakoztatott alkalmazások, helyadattal); az OsmAnd szól, ha nincs engedélyezve.", "osmand_info_line": "Így a „megálló hozzáadása” és a közeli keresés az OsmAndban beállított útvonallal is működik: a LLeMbas megkérdezi az OsmAndot, hol vagy és hová tart az útvonal. Előbb engedélyezd a LLeMbast az OsmAndban (csatlakoztatott alkalmazások, helyadattal); az OsmAnd szól, ha nincs engedélyezve.",
"output_cut": "A kimenet itt lerövidítve jelenik meg. A teljes szöveg a weblapon található.", "output_cut": "A kimenet itt lerövidítve jelenik meg. A teljes szöveg a weblapon található.",
"page_note": "Ebben a válaszban van egy oldal: %1$s",
"page_untitled": "Oldal",
"page_where": "A megtekintéséhez nyisd meg a weben vagy a LLeMbas Desktopban.",
"phone_actions_line": "Egy modell felajánlhatja, hogy tesz valamit ezen a telefonon — ébresztőt állít, eseményt vesz fel, üzenetet fogalmaz, útvonalat indít. Semmi sem történik, amíg a kártyáján nem koppintasz a Mehet gombra, és zárolt telefonnál soha. A Google Térkép néhány megállós útvonalat indít, de futó útvonalhoz nem ad megállót és nem állítható le; az OsmAnd igen.", "phone_actions_line": "Egy modell felajánlhatja, hogy tesz valamit ezen a telefonon — ébresztőt állít, eseményt vesz fel, üzenetet fogalmaz, útvonalat indít. Semmi sem történik, amíg a kártyáján nem koppintasz a Mehet gombra, és zárolt telefonnál soha. A Google Térkép néhány megállós útvonalat indít, de futó útvonalhoz nem ad megállót és nem állítható le; az OsmAnd igen.",
"plan_approve": "Terv jóváhagyása", "plan_approve": "Terv jóváhagyása",
"plan_approve_edit": "Jóváhagyás, folytatás Szerkesztés módban", "plan_approve_edit": "Jóváhagyás, folytatás Szerkesztés módban",
@@ -1484,9 +1610,23 @@
"push_no_distributor": "Hogy értesítést kapjon, amikor egy válasz elkészül, telepítsen egy UnifiedPush-elosztót, például az ntfy-t, majd jöjjön vissza ide. Ha nincs ilyen, az alkalmazás csak akkor mutatja az új válaszokat, amikor meg van nyitva.", "push_no_distributor": "Hogy értesítést kapjon, amikor egy válasz elkészül, telepítsen egy UnifiedPush-elosztót, például az ntfy-t, majd jöjjön vissza ide. Ha nincs ilyen, az alkalmazás csak akkor mutatja az új válaszokat, amikor meg van nyitva.",
"push_on": "Az értesítések be vannak kapcsolva ehhez a példányhoz.", "push_on": "Az értesítések be vannak kapcsolva ehhez a példányhoz.",
"regenerate": "Újragenerálás", "regenerate": "Újragenerálás",
"report": "Jelentés",
"report_chat_title": "Jelentés: %1$s",
"report_delete_line": "A(z) „%1$s” véglegesen törlődik, a róla szóló beszélgetéssel együtt.",
"report_delete_title": "Törlöd ezt a jelentést?",
"report_important": "Fontos",
"report_mark_read": "Megjelölés olvasottként",
"report_new_public": "Új jelentés",
"report_reply": "Válasz",
"report_share": "Megosztás",
"report_untitled": "Cím nélküli jelentés",
"reports": "Jelentések",
"reports_none": "Még nincsenek jelentések. Egy ütemezett feladat akkor ír egyet, ha van mit mondania neked.",
"reports_unsupported": "Ezen a példányon olyan LLeMbas fut, amelyben még nincsenek Jelentések.",
"run_missed": "Kimaradt ×%1$s", "run_missed": "Kimaradt ×%1$s",
"run_model_instead": "%1$s, %2$s helyett", "run_model_instead": "%1$s, %2$s helyett",
"run_no_text": "Ez a futás nem hagyott szöveget.", "run_no_text": "Ez a futás nem hagyott szöveget.",
"run_open_report": "A jelentésének megnyitása",
"run_result": "Eredmény", "run_result": "Eredmény",
"run_retry_at": "Újrapróbálja: %1$s", "run_retry_at": "Újrapróbálja: %1$s",
"run_silent": "Semmi új", "run_silent": "Semmi új",
@@ -1733,6 +1873,7 @@
"card_deny_reason": "Nega e spiega perché", "card_deny_reason": "Nega e spiega perché",
"card_reason": "Perché no? (facoltativo)", "card_reason": "Perché no? (facoltativo)",
"channel_asks": "Domande e approvazioni", "channel_asks": "Domande e approvazioni",
"channel_reports": "Rapporti",
"channel_scheduled": "Risultati pianificati", "channel_scheduled": "Risultati pianificati",
"channel_scheduled_failures": "Errori pianificati", "channel_scheduled_failures": "Errori pianificati",
"channel_updates": "Aggiornamenti dell’app", "channel_updates": "Aggiornamenti dell’app",
@@ -1791,13 +1932,26 @@
"notification_summaries_switch": "Lascia che l’assistente legga le mie notifiche quando lo chiedo", "notification_summaries_switch": "Lascia che l’assistente legga le mie notifiche quando lo chiedo",
"notification_summaries_unavailable": "Non in questa build. Leggere le notifiche richiede la build «notifications» di LLeMbas, perché Google Play Protect blocca l’installazione di un’app esterna al Play Store in grado di leggerle. È la stessa app con la stessa firma: nella pagina della release, il file che termina in -notifications.apk si installa sopra questa.", "notification_summaries_unavailable": "Non in questa build. Leggere le notifiche richiede la build «notifications» di LLeMbas, perché Google Play Protect blocca l’installazione di un’app esterna al Play Store in grado di leggerle. È la stessa app con la stessa firma: nella pagina della release, il file che termina in -notifications.apk si installa sopra questa.",
"notify_always": "Avvisa ogni volta", "notify_always": "Avvisa ogni volta",
"notify_every_run": "A ogni esecuzione",
"notify_every_run_line": "Il modello scrive un rapporto ogni volta, anche quando non ha trovato nulla.",
"notify_matters": "Avvisa quando conta", "notify_matters": "Avvisa quando conta",
"notify_never": "Non avvisa mai", "notify_never": "Non avvisa mai",
"notify_never_line": "Nessun rapporto: le esecuzioni restano solo nella cronologia dell’attività.",
"notify_never_option": "Mai",
"notify_when": "Avvisa quando",
"notify_when_default": "qualcosa richiede la mia attenzione",
"notify_when_label": "Quando cosa?",
"notify_when_line": "Il modello scrive un rapporto solo quando questo è vero.",
"notify_when_option": "Quando…",
"notify_when_words": "Avvisa quando: %1$s",
"offline": "L'istanza non è raggiungibile. Controlla la connessione del telefono e che raggiunga l'indirizzo dell'istanza.", "offline": "L'istanza non è raggiungibile. Controlla la connessione del telefono e che raggiunga l'indirizzo dell'istanza.",
"older": "Messaggi precedenti", "older": "Messaggi precedenti",
"osmand_info": "Chiedi il percorso a OsmAnd", "osmand_info": "Chiedi il percorso a OsmAnd",
"osmand_info_line": "Permette «aggiungi una tappa» e la ricerca nelle vicinanze anche con un percorso impostato in OsmAnd: LLeMbas chiede a OsmAnd dove sei e dove va il percorso. Prima consenti LLeMbas in OsmAnd (app collegate, con posizione); OsmAnd ti avvisa se non è consentito.", "osmand_info_line": "Permette «aggiungi una tappa» e la ricerca nelle vicinanze anche con un percorso impostato in OsmAnd: LLeMbas chiede a OsmAnd dove sei e dove va il percorso. Prima consenti LLeMbas in OsmAnd (app collegate, con posizione); OsmAnd ti avvisa se non è consentito.",
"output_cut": "L'output qui è abbreviato. Lo trovi per intero sulla pagina web.", "output_cut": "L'output qui è abbreviato. Lo trovi per intero sulla pagina web.",
"page_note": "Questa risposta ha una pagina: %1$s",
"page_untitled": "Pagina",
"page_where": "Aprila sul web o in LLeMbas Desktop per vederla.",
"phone_actions_line": "Un modello può offrirsi di fare cose su questo telefono: impostare una sveglia, aggiungere un evento, preparare un messaggio, avviare un percorso. Non succede nulla finché non tocchi Fallo sulla sua scheda, e mai a telefono bloccato. Google Maps avvia un percorso con alcune tappe ma non può aggiungerne a un percorso in corso né essere fermato; OsmAnd sì.", "phone_actions_line": "Un modello può offrirsi di fare cose su questo telefono: impostare una sveglia, aggiungere un evento, preparare un messaggio, avviare un percorso. Non succede nulla finché non tocchi Fallo sulla sua scheda, e mai a telefono bloccato. Google Maps avvia un percorso con alcune tappe ma non può aggiungerne a un percorso in corso né essere fermato; OsmAnd sì.",
"plan_approve": "Approva il piano", "plan_approve": "Approva il piano",
"plan_approve_edit": "Approva, continua in Modifica", "plan_approve_edit": "Approva, continua in Modifica",
@@ -1812,9 +1966,23 @@
"push_no_distributor": "Per essere avvisato quando una risposta è pronta, installa un distributore UnifiedPush come ntfy, poi torna qui. Senza uno, l'app mostra le nuove risposte solo quando è aperta.", "push_no_distributor": "Per essere avvisato quando una risposta è pronta, installa un distributore UnifiedPush come ntfy, poi torna qui. Senza uno, l'app mostra le nuove risposte solo quando è aperta.",
"push_on": "Le notifiche sono attive per questa istanza.", "push_on": "Le notifiche sono attive per questa istanza.",
"regenerate": "Rigenera", "regenerate": "Rigenera",
"report": "Rapporto",
"report_chat_title": "Rapporto: %1$s",
"report_delete_line": "«%1$s» viene eliminato definitivamente, insieme alla conversazione che lo riguarda.",
"report_delete_title": "Eliminare questo rapporto?",
"report_important": "Importante",
"report_mark_read": "Segna come letto",
"report_new_public": "Nuovo rapporto",
"report_reply": "Rispondi",
"report_share": "Condividi",
"report_untitled": "Rapporto senza titolo",
"reports": "Rapporti",
"reports_none": "Ancora nessun rapporto. Un’attività pianificata ne scrive uno quando ha qualcosa da dirti.",
"reports_unsupported": "Questa istanza usa un LLeMbas che non ha ancora i Rapporti.",
"run_missed": "Saltata ×%1$s", "run_missed": "Saltata ×%1$s",
"run_model_instead": "%1$s, invece di %2$s", "run_model_instead": "%1$s, invece di %2$s",
"run_no_text": "Questa esecuzione non ha lasciato testo.", "run_no_text": "Questa esecuzione non ha lasciato testo.",
"run_open_report": "Apri il suo rapporto",
"run_result": "Risultato", "run_result": "Risultato",
"run_retry_at": "Riprova alle %1$s", "run_retry_at": "Riprova alle %1$s",
"run_silent": "Niente di nuovo", "run_silent": "Niente di nuovo",
@@ -2061,6 +2229,7 @@
"card_deny_reason": "Odrzuć i powiedz dlaczego", "card_deny_reason": "Odrzuć i powiedz dlaczego",
"card_reason": "Czemu nie? (opcjonalnie)", "card_reason": "Czemu nie? (opcjonalnie)",
"channel_asks": "Pytania i zatwierdzenia", "channel_asks": "Pytania i zatwierdzenia",
"channel_reports": "Raporty",
"channel_scheduled": "Wyniki zaplanowanych zadań", "channel_scheduled": "Wyniki zaplanowanych zadań",
"channel_scheduled_failures": "Błędy zaplanowanych zadań", "channel_scheduled_failures": "Błędy zaplanowanych zadań",
"channel_updates": "Aktualizacje aplikacji", "channel_updates": "Aktualizacje aplikacji",
@@ -2119,13 +2288,26 @@
"notification_summaries_switch": "Pozwól asystentowi czytać moje powiadomienia, gdy poproszę", "notification_summaries_switch": "Pozwól asystentowi czytać moje powiadomienia, gdy poproszę",
"notification_summaries_unavailable": "Nie w tej wersji. Czytanie powiadomień wymaga wersji „notifications” LLeMbas, bo Google Play Protect blokuje instalację aplikacji spoza Sklepu Play, która potrafi je czytać. To ta sama aplikacja z tym samym podpisem: na stronie wydania plik kończący się na -notifications.apk instaluje się na tę.", "notification_summaries_unavailable": "Nie w tej wersji. Czytanie powiadomień wymaga wersji „notifications” LLeMbas, bo Google Play Protect blokuje instalację aplikacji spoza Sklepu Play, która potrafi je czytać. To ta sama aplikacja z tym samym podpisem: na stronie wydania plik kończący się na -notifications.apk instaluje się na tę.",
"notify_always": "Powiadamia za każdym razem", "notify_always": "Powiadamia za każdym razem",
"notify_every_run": "Przy każdym uruchomieniu",
"notify_every_run_line": "Model pisze raport za każdym razem, także gdy niczego nie znalazł.",
"notify_matters": "Powiadamia, gdy to ważne", "notify_matters": "Powiadamia, gdy to ważne",
"notify_never": "Nigdy nie powiadamia", "notify_never": "Nigdy nie powiadamia",
"notify_never_line": "Bez raportów: uruchomienia zostają tylko w historii zadania.",
"notify_never_option": "Nigdy",
"notify_when": "Powiadamiaj, gdy",
"notify_when_default": "coś wymaga mojej uwagi",
"notify_when_label": "Gdy co?",
"notify_when_line": "Model pisze raport tylko wtedy, gdy to jest spełnione.",
"notify_when_option": "Gdy…",
"notify_when_words": "Powiadamia, gdy: %1$s",
"offline": "Instancja jest nieosiągalna. Sprawdź połączenie telefonu i czy dociera on do adresu instancji.", "offline": "Instancja jest nieosiągalna. Sprawdź połączenie telefonu i czy dociera on do adresu instancji.",
"older": "Wcześniejsze wiadomości", "older": "Wcześniejsze wiadomości",
"osmand_info": "Pytaj OsmAnd o trasę", "osmand_info": "Pytaj OsmAnd o trasę",
"osmand_info_line": "Pozwala „dodać przystanek” i szukać w pobliżu także przy trasie ustawionej w samym OsmAnd: LLeMbas pyta OsmAnd, gdzie jesteś i dokąd prowadzi trasa. Najpierw zezwól LLeMbas w OsmAnd (połączone aplikacje, z lokalizacją); OsmAnd poinformuje, jeśli nie ma zgody.", "osmand_info_line": "Pozwala „dodać przystanek” i szukać w pobliżu także przy trasie ustawionej w samym OsmAnd: LLeMbas pyta OsmAnd, gdzie jesteś i dokąd prowadzi trasa. Najpierw zezwól LLeMbas w OsmAnd (połączone aplikacje, z lokalizacją); OsmAnd poinformuje, jeśli nie ma zgody.",
"output_cut": "Wynik jest tu skrócony. Cały znajduje się na stronie internetowej.", "output_cut": "Wynik jest tu skrócony. Cały znajduje się na stronie internetowej.",
"page_note": "Ta odpowiedź zawiera stronę: %1$s",
"page_untitled": "Strona",
"page_where": "Otwórz ją w przeglądarce albo w LLeMbas Desktop, aby ją zobaczyć.",
"phone_actions_line": "Model może zaproponować zrobienie czegoś na tym telefonie — ustawienie budzika, dodanie wydarzenia, szkic wiadomości, start trasy. Nic się nie dzieje, dopóki nie dotkniesz Zrób to na jego karcie, i nigdy przy zablokowanym telefonie. Mapy Google uruchomią trasę z kilkoma przystankami, ale nie dodadzą przystanku do trwającej trasy ani nie dadzą się zatrzymać; OsmAnd potrafi.", "phone_actions_line": "Model może zaproponować zrobienie czegoś na tym telefonie — ustawienie budzika, dodanie wydarzenia, szkic wiadomości, start trasy. Nic się nie dzieje, dopóki nie dotkniesz Zrób to na jego karcie, i nigdy przy zablokowanym telefonie. Mapy Google uruchomią trasę z kilkoma przystankami, ale nie dodadzą przystanku do trwającej trasy ani nie dadzą się zatrzymać; OsmAnd potrafi.",
"plan_approve": "Zatwierdź plan", "plan_approve": "Zatwierdź plan",
"plan_approve_edit": "Zatwierdź, kontynuuj w trybie Edytuj", "plan_approve_edit": "Zatwierdź, kontynuuj w trybie Edytuj",
@@ -2140,9 +2322,23 @@
"push_no_distributor": "Aby dostawać informacje, kiedy odpowiedź jest gotowa, zainstaluj dystrybutora UnifiedPush, na przykład ntfy, a potem wróć tutaj. Bez niego aplikacja pokazuje nowe odpowiedzi tylko wtedy, gdy jest otwarta.", "push_no_distributor": "Aby dostawać informacje, kiedy odpowiedź jest gotowa, zainstaluj dystrybutora UnifiedPush, na przykład ntfy, a potem wróć tutaj. Bez niego aplikacja pokazuje nowe odpowiedzi tylko wtedy, gdy jest otwarta.",
"push_on": "Powiadomienia są włączone dla tej instancji.", "push_on": "Powiadomienia są włączone dla tej instancji.",
"regenerate": "Wygeneruj ponownie", "regenerate": "Wygeneruj ponownie",
"report": "Raport",
"report_chat_title": "Raport: %1$s",
"report_delete_line": "Raport „%1$s” zostanie usunięty na stałe, razem z rozmową o nim.",
"report_delete_title": "Usunąć ten raport?",
"report_important": "Ważne",
"report_mark_read": "Oznacz jako przeczytany",
"report_new_public": "Nowy raport",
"report_reply": "Odpowiedz",
"report_share": "Udostępnij",
"report_untitled": "Raport bez tytułu",
"reports": "Raporty",
"reports_none": "Nie ma jeszcze raportów. Zaplanowane zadanie pisze raport, gdy ma Ci coś do powiedzenia.",
"reports_unsupported": "Na tej instancji działa LLeMbas, który nie ma jeszcze Raportów.",
"run_missed": "Pominięto ×%1$s", "run_missed": "Pominięto ×%1$s",
"run_model_instead": "%1$s zamiast %2$s", "run_model_instead": "%1$s zamiast %2$s",
"run_no_text": "To uruchomienie nie zostawiło tekstu.", "run_no_text": "To uruchomienie nie zostawiło tekstu.",
"run_open_report": "Otwórz jego raport",
"run_result": "Wynik", "run_result": "Wynik",
"run_retry_at": "Ponowi próbę o %1$s", "run_retry_at": "Ponowi próbę o %1$s",
"run_silent": "Nic nowego", "run_silent": "Nic nowego",
@@ -2389,6 +2585,7 @@
"card_deny_reason": "Odmietnuť a povedať prečo", "card_deny_reason": "Odmietnuť a povedať prečo",
"card_reason": "Prečo nie? (nepovinné)", "card_reason": "Prečo nie? (nepovinné)",
"channel_asks": "Otázky a schválenia", "channel_asks": "Otázky a schválenia",
"channel_reports": "Správy",
"channel_scheduled": "Výsledky naplánovaných úloh", "channel_scheduled": "Výsledky naplánovaných úloh",
"channel_scheduled_failures": "Zlyhania naplánovaných úloh", "channel_scheduled_failures": "Zlyhania naplánovaných úloh",
"channel_updates": "Aktualizácie aplikácie", "channel_updates": "Aktualizácie aplikácie",
@@ -2447,13 +2644,26 @@
"notification_summaries_switch": "Dovoliť asistentovi čítať moje oznámenia, keď o to požiadam", "notification_summaries_switch": "Dovoliť asistentovi čítať moje oznámenia, keď o to požiadam",
"notification_summaries_unavailable": "V tomto zostavení nie je. Čítanie oznámení vyžaduje zostavenie LLeMbas „notifications“, pretože Google Play Protect blokuje inštaláciu aplikácie mimo Obchodu Play, ktorá ich dokáže čítať. Je to tá istá aplikácia s tým istým podpisom: na stránke vydania sa súbor končiaci na -notifications.apk nainštaluje cez túto.", "notification_summaries_unavailable": "V tomto zostavení nie je. Čítanie oznámení vyžaduje zostavenie LLeMbas „notifications“, pretože Google Play Protect blokuje inštaláciu aplikácie mimo Obchodu Play, ktorá ich dokáže čítať. Je to tá istá aplikácia s tým istým podpisom: na stránke vydania sa súbor končiaci na -notifications.apk nainštaluje cez túto.",
"notify_always": "Dá vedieť zakaždým", "notify_always": "Dá vedieť zakaždým",
"notify_every_run": "Pri každom behu",
"notify_every_run_line": "Model napíše správu zakaždým, aj keď nič nenašiel.",
"notify_matters": "Dá vedieť, keď na tom záleží", "notify_matters": "Dá vedieť, keď na tom záleží",
"notify_never": "Nedá vedieť nikdy", "notify_never": "Nedá vedieť nikdy",
"notify_never_line": "Žiadne správy: behy zostanú len v histórii úlohy.",
"notify_never_option": "Nikdy",
"notify_when": "Kedy dať vedieť",
"notify_when_default": "niečo si vyžaduje moju pozornosť",
"notify_when_label": "Keď čo?",
"notify_when_line": "Model napíše správu len vtedy, keď platí toto.",
"notify_when_option": "Keď…",
"notify_when_words": "Dá vedieť, keď: %1$s",
"offline": "Inštancia nie je dostupná. Skontrolujte pripojenie telefónu a či sa dostane na adresu inštancie.", "offline": "Inštancia nie je dostupná. Skontrolujte pripojenie telefónu a či sa dostane na adresu inštancie.",
"older": "Staršie správy", "older": "Staršie správy",
"osmand_info": "Pýtať sa OsmAnd na trasu", "osmand_info": "Pýtať sa OsmAnd na trasu",
"osmand_info_line": "Umožní „pridať zastávku“ a hľadanie v okolí aj pri trase nastavenej priamo v OsmAnd: LLeMbas sa OsmAnd opýta, kde ste a kam trasa vedie. Najprv LLeMbas povoľte v OsmAnd (pripojené aplikácie, s polohou); OsmAnd dá vedieť, ak povolené nie je.", "osmand_info_line": "Umožní „pridať zastávku“ a hľadanie v okolí aj pri trase nastavenej priamo v OsmAnd: LLeMbas sa OsmAnd opýta, kde ste a kam trasa vedie. Najprv LLeMbas povoľte v OsmAnd (pripojené aplikácie, s polohou); OsmAnd dá vedieť, ak povolené nie je.",
"output_cut": "Výstup je tu skrátený. Celý nájdete na webovej stránke.", "output_cut": "Výstup je tu skrátený. Celý nájdete na webovej stránke.",
"page_note": "Táto odpoveď obsahuje stránku: %1$s",
"page_untitled": "Stránka",
"page_where": "Zobrazíte ju na webe alebo v aplikácii LLeMbas Desktop.",
"phone_actions_line": "Model môže ponúknuť, že v telefóne niečo urobí — nastaví budík, pridá udalosť, pripraví správu, spustí trasu. Nič sa nestane, kým neťuknete na Urobiť na jeho karte, a nikdy pri zamknutom telefóne. Mapy Google spustia trasu s niekoľkými zastávkami, ale do bežiacej trasy zastávku nepridajú ani sa nedajú zastaviť; OsmAnd to vie.", "phone_actions_line": "Model môže ponúknuť, že v telefóne niečo urobí — nastaví budík, pridá udalosť, pripraví správu, spustí trasu. Nič sa nestane, kým neťuknete na Urobiť na jeho karte, a nikdy pri zamknutom telefóne. Mapy Google spustia trasu s niekoľkými zastávkami, ale do bežiacej trasy zastávku nepridajú ani sa nedajú zastaviť; OsmAnd to vie.",
"plan_approve": "Schváliť plán", "plan_approve": "Schváliť plán",
"plan_approve_edit": "Schváliť, pokračovať v režime Upraviť", "plan_approve_edit": "Schváliť, pokračovať v režime Upraviť",
@@ -2468,9 +2678,23 @@
"push_no_distributor": "Aby ste sa dozvedeli, že je odpoveď hotová, nainštalujte distributora UnifiedPush, napríklad ntfy, a potom sa vráťte sem. Bez neho aplikácia nové odpovede ukáže, len keď je otvorená.", "push_no_distributor": "Aby ste sa dozvedeli, že je odpoveď hotová, nainštalujte distributora UnifiedPush, napríklad ntfy, a potom sa vráťte sem. Bez neho aplikácia nové odpovede ukáže, len keď je otvorená.",
"push_on": "Upozornenia sú pre túto inštanciu zapnuté.", "push_on": "Upozornenia sú pre túto inštanciu zapnuté.",
"regenerate": "Vygenerovať znova", "regenerate": "Vygenerovať znova",
"report": "Správa",
"report_chat_title": "Správa: %1$s",
"report_delete_line": "Správa „%1$s“ sa odstráni natrvalo, aj s rozhovorom o nej.",
"report_delete_title": "Odstrániť túto správu?",
"report_important": "Dôležité",
"report_mark_read": "Označiť ako prečítané",
"report_new_public": "Nová správa",
"report_reply": "Odpovedať",
"report_share": "Zdieľať",
"report_untitled": "Správa bez názvu",
"reports": "Správy",
"reports_none": "Zatiaľ žiadne správy. Naplánovaná úloha ju napíše, keď vám má čo povedať.",
"reports_unsupported": "Na tejto inštancii beží LLeMbas, ktorý Správy ešte nemá.",
"run_missed": "Zmeškané ×%1$s", "run_missed": "Zmeškané ×%1$s",
"run_model_instead": "%1$s, namiesto %2$s", "run_model_instead": "%1$s, namiesto %2$s",
"run_no_text": "Tento beh nezanechal žiadny text.", "run_no_text": "Tento beh nezanechal žiadny text.",
"run_open_report": "Otvoriť jej správu",
"run_result": "Výsledok", "run_result": "Výsledok",
"run_retry_at": "Skúsi to znova o %1$s", "run_retry_at": "Skúsi to znova o %1$s",
"run_silent": "Nič nové", "run_silent": "Nič nové",