xP: indicate hidden buffer lines

This commit is contained in:
Přemysl Eric Janouch 2022-09-11 21:30:51 +02:00
parent 96fc12bc4c
commit c3a52b9e4c
Signed by: p
GPG Key ID: A0420B94F92B9493
2 changed files with 24 additions and 3 deletions

View File

@ -43,6 +43,9 @@ body {
bottom: -1px; bottom: -1px;
background: #ccc; background: #ccc;
} }
button {
font: inherit;
}
.middle { .middle {
flex: auto; flex: auto;
@ -111,9 +114,8 @@ body {
font-weight: bold; font-weight: bold;
} }
.unread { .unread {
height: 1px;
grid-column: span 2; grid-column: span 2;
background: #ff5f00; border-top: 1px solid #ff5f00;
} }
.time { .time {
padding: .1em .3em; padding: .1em .3em;
@ -121,6 +123,13 @@ body {
color: #bbb; color: #bbb;
border-right: 1px solid #ccc; border-right: 1px solid #ccc;
} }
.time.hidden:after {
border-top: .2em dotted #ccc;
display: block;
width: 50%;
margin: 0 auto;
content: "";
}
.mark { .mark {
padding-right: .3em; padding-right: .3em;
text-align: center; text-align: center;

View File

@ -580,13 +580,20 @@ let Buffer = {
return m('.buffer') return m('.buffer')
let lastDateMark = undefined let lastDateMark = undefined
let squashing = false
let markBefore = b.lines.length let markBefore = b.lines.length
- b.newMessages - b.newUnimportantMessages - b.newMessages - b.newUnimportantMessages
b.lines.forEach((line, i) => { b.lines.forEach((line, i) => {
if (i == markBefore) if (i == markBefore)
lines.push(m('.unread')) lines.push(m('.unread'))
if (line.isUnimportant && b.hideUnimportant)
if (!line.isUnimportant || !b.hideUnimportant) {
squashing = false
} else if (squashing) {
return return
} else {
squashing = true
}
let date = new Date(line.when) let date = new Date(line.when)
let dateMark = date.toLocaleDateString() let dateMark = date.toLocaleDateString()
@ -594,6 +601,11 @@ let Buffer = {
lines.push(m('.date', {}, dateMark)) lines.push(m('.date', {}, dateMark))
lastDateMark = dateMark lastDateMark = dateMark
} }
if (squashing) {
lines.push(m('.time.hidden'))
lines.push(m('.content'))
return
}
let attrs = {} let attrs = {}
if (line.leaked) if (line.leaked)