From effb354d1b1e39f7cf45abeb58362579baf74741 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Sun, 1 Dec 2024 12:56:31 -0500 Subject: [PATCH] ssb: Working toward a more sensible unread indication and user interface for setting read/unread. --- apps/ssb.json | 2 +- apps/ssb/tf-message.js | 8 ++++---- apps/ssb/tf-news.js | 19 ++++++++++++++++++- apps/ssb/tf-tab-news-feed.js | 1 + 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/apps/ssb.json b/apps/ssb.json index 95f9a0aa..4661196d 100644 --- a/apps/ssb.json +++ b/apps/ssb.json @@ -1,5 +1,5 @@ { "type": "tildefriends-app", "emoji": "🐌", - "previous": "&NniJybtFHDaypdljDj1kbGIpwU8T5lX9m7+bA1YTu+M=.sha256" + "previous": "&Hnfvxu/+f8Z3qbbn/6M5+E7ju/Cj6fxg7SEBwlTy23g=.sha256" } diff --git a/apps/ssb/tf-message.js b/apps/ssb/tf-message.js index 5701e75d..3840c1d4 100644 --- a/apps/ssb/tf-message.js +++ b/apps/ssb/tf-message.js @@ -323,13 +323,13 @@ ${JSON.stringify(mention, null, 2)} React - ${!content.root ? + ${(!content.root && this.message.rowid <= this.channel_unread) ? html` - + ` : undefined}

diff --git a/apps/ssb/tf-news.js b/apps/ssb/tf-news.js index 6645e940..39d400e9 100644 --- a/apps/ssb/tf-news.js +++ b/apps/ssb/tf-news.js @@ -181,11 +181,28 @@ class TfNewsElement extends LitElement { let final_messages = this.group_following( this.finalize_messages(messages_by_id) ); + let unread_rowid = -1; + for (let message of final_messages) { + if (message.rowid < this.channel_unread) { + console.log(message.rowid, this.channel_unread); + unread_rowid = message.rowid; + break; + } + } + console.log(unread_rowid); return html`
${final_messages.map( (x) => - html` +
+
unread
+
+
` : + undefined} + Mark All Read