ssb: Working toward a more sensible unread indication and user interface for setting read/unread.

This commit is contained in:
2024-12-01 12:56:31 -05:00
parent ba7d1ad35f
commit effb354d1b
4 changed files with 24 additions and 6 deletions

View File

@ -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`
<div>
${final_messages.map(
(x) =>
html`<tf-message
html`
${x.rowid == unread_rowid && x != final_messages[0] ?
html`<div style="display: flex; flex-direction: row">
<div style="border-bottom: 1px solid #f00; flex: 1; align-self: center; height: 1px"></div>
<div style="color: #f00; padding: 8px">unread</div>
<div style="border-bottom: 1px solid #f00; flex: 1; align-self: center; height: 1px"></div>
</div>` :
undefined}
<tf-message
.message=${x}
whoami=${this.whoami}
.users=${this.users}