Scheduled-result notifications: the lock screen says nothing from the account
CI / check (push) Canceled after 0s
CI / check (push) Canceled after 0s
The public version is the app's name and the fixed sentence ("A scheduled task has a
result." / "failed", translated) again; the server's `public` names the task, so it is read
but not shown (section rule 5 outranks the beta.9 plan). Unlocked: unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
3 files changed
+11
-9
No files matched your search
+2
-2
@@ -34,8 +34,8 @@ is in alpha and releases come off `main`.
|
||||
- **A scheduled task that watches a web page** says so on its page (*Only when this page
|
||||
changes*, and the address), and a run that found the page unchanged is shown as *Unchanged*.
|
||||
- **A scheduled task's notification shows its result.** Unlocked, it carries the task's name
|
||||
and the first lines of what it found (pull it open for more); on the lock screen only the
|
||||
task's name and *Finished* or *Failed*. **Run again** starts the task again from the
|
||||
and the first lines of what it found (pull it open for more); on the lock screen only
|
||||
*LLeMbas* and that a scheduled task finished or failed, nothing from your account. **Run again** starts the task again from the
|
||||
notification, once the phone is unlocked. Needs an instance that sends these; an older one
|
||||
keeps the fixed sentence.
|
||||
- **A message waiting behind a reply says how many are ahead of it** and for how long it has
|
||||
|
||||
@@ -136,8 +136,8 @@ object Notifications {
|
||||
* A scheduled run's result or failure, on its own channel, built from the server's payload
|
||||
* alone ([ScheduledNotice]). Unlocked: the task's name and the result's first lines, as the
|
||||
* server cut them (BigTextStyle opens them). On the lock screen only the public version: the
|
||||
* task's name and Finished / Failed (the owner's choice for beta.9; an older server sends no
|
||||
* words, and the app's name and a fixed sentence stand in). A tap and Open go to the run;
|
||||
* app's name and "A scheduled task has a result." (or failed) -- nothing from the account, so
|
||||
* the server's `public` (which names the task) is not used. A tap and Open go to the run;
|
||||
* Run again starts it again, once the phone is unlocked; Pause is there when offered.
|
||||
*/
|
||||
private fun scheduled(context: Context, instance: String, payload: PushPayload) {
|
||||
@@ -145,10 +145,12 @@ object Notifications {
|
||||
val channel = if (notice.failed) LembasApp.CHANNEL_SCHEDULED_FAILURES else LembasApp.CHANNEL_SCHEDULED
|
||||
val fixed = context.getString(if (notice.failed) R.string.scheduled_failed_public else R.string.scheduled_result_public)
|
||||
val open = opener(context, instance, notice.id, chatId = null, scheduleId = notice.scheduleId, runId = notice.runId)
|
||||
// The lock screen gets nothing from the account (Working-notes rule 5): the app's name
|
||||
// and a fixed sentence, never the task's name the server offers in `public`.
|
||||
val public = NotificationCompat.Builder(context, channel)
|
||||
.setSmallIcon(R.drawable.ic_notification)
|
||||
.setContentTitle(notice.publicTitle.ifBlank { context.getString(R.string.app_name) })
|
||||
.setContentText(notice.publicBody.ifBlank { fixed })
|
||||
.setContentTitle(context.getString(R.string.app_name))
|
||||
.setContentText(fixed)
|
||||
.build()
|
||||
val title = notice.title.ifBlank { payload.title.ifBlank { context.getString(R.string.scheduled) } }
|
||||
val body = notice.body.ifBlank { payload.body.ifBlank { fixed } }
|
||||
|
||||
@@ -6,9 +6,9 @@ import eu.llembas.android.api.PushPayload
|
||||
* What a scheduled run's push asks the app to show, read from the server's payload alone
|
||||
* (services/schedule/notify.py `payload`): the schedule and the run it is about, whether it
|
||||
* failed, the actions the server offers, and -- from a server that sends its `notification` --
|
||||
* the words: [title] and [body] (the result's first lines) for an unlocked phone, [publicTitle]
|
||||
* and [publicBody] (the task's name, Finished / Failed) for the lock screen, and the actions'
|
||||
* [labels]. A payload without ids falls back to its `url` (`/scheduled/{schedule}?run={run}`),
|
||||
* the words: [title] and [body] (the result's first lines) for an unlocked phone, and the
|
||||
* actions' [labels]. [publicTitle] / [publicBody] are read but not shown: they name the task,
|
||||
* and the lock screen gets nothing from the account. A payload without ids falls back to its `url` (`/scheduled/{schedule}?run={run}`),
|
||||
* as a browser would open it.
|
||||
*/
|
||||
data class ScheduledNotice(
|
||||
|
||||
Reference in new issue
Block a user