Podcast-Artikel: Benachrichtigungsziel episode:<id> wie in der Android-Bridge, im Vertrag festgehalten
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
dbd4fb6e3a
commit
810cf7741c
3 changed files with 4 additions and 3 deletions
|
|
@ -43,7 +43,8 @@ Transcript and article are stored in plain text on the server, like all podcast
|
||||||
Tapping it opens diora at the episode.
|
Tapping it opens diora at the episode.
|
||||||
4. A device with a key (`static/js/podcast-article.js`) picks up the open wishes, reserves one,
|
4. A device with a key (`static/js/podcast-article.js`) picks up the open wishes, reserves one,
|
||||||
writes the article and saves it. It then says "Artikel fertig" (on Android as a system
|
writes the article and saves it. It then says "Artikel fertig" (on Android as a system
|
||||||
notification through the bridge) and opens it on a tap.
|
notification through the bridge, `DioraNative.notify(title, text, target)` with target
|
||||||
|
`episode:<id>` or `item:<id>`; elsewhere a toast) and opens it on a tap.
|
||||||
5. The article is the first tab of the episode ("Artikel") and an item of the favourite blog
|
5. The article is the first tab of the episode ("Artikel") and an item of the favourite blog
|
||||||
"Podcast-Artikel", linking back to the episode.
|
"Podcast-Artikel", linking back to the episode.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -303,7 +303,7 @@ export async function write(episodeId, {onState, signal} = {}) {
|
||||||
export function notifyDone(title, episodeId) {
|
export function notifyDone(title, episodeId) {
|
||||||
const N = globalThis.DioraNative;
|
const N = globalThis.DioraNative;
|
||||||
try {
|
try {
|
||||||
if (N && typeof N.notify === 'function') { N.notify('Artikel fertig', title, 'episode/' + episodeId); return; }
|
if (N && typeof N.notify === 'function') { N.notify('Artikel fertig', title, 'episode:' + episodeId); return; }
|
||||||
} catch (e) { /* fall back to the toast */ }
|
} catch (e) { /* fall back to the toast */ }
|
||||||
const AI = ai();
|
const AI = ai();
|
||||||
if (AI && AI.toast) AI.toast('Artikel fertig: ' + title);
|
if (AI && AI.toast) AI.toast('Artikel fertig: ' + title);
|
||||||
|
|
|
||||||
|
|
@ -152,7 +152,7 @@ test('pickUp: android bridge notifies instead of the toast', async () => {
|
||||||
const got = [];
|
const got = [];
|
||||||
globalThis.DioraNative = {notify: (...a) => got.push(a)};
|
globalThis.DioraNative = {notify: (...a) => got.push(a)};
|
||||||
await pa.pickUp();
|
await pa.pickUp();
|
||||||
assert.deepEqual(got, [['Artikel fertig', 'Titel', 'episode/1']]);
|
assert.deepEqual(got, [['Artikel fertig', 'Titel', 'episode:1']]);
|
||||||
assert.deepEqual(w.notices, []);
|
assert.deepEqual(w.notices, []);
|
||||||
globalThis.DioraNative = undefined;
|
globalThis.DioraNative = undefined;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue