aboutsummaryrefslogtreecommitdiffstats
path: root/src/features
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-08-04 01:55:02 -0700
committerAdam Soltys <[email protected]>2026-08-04 01:55:02 -0700
commit7ff9861f545aaa8e05a61b43d73cf762eec72595 (patch)
tree0711188fe1cf2ed832e869770fc5f9c88b88cf7d /src/features
parent78f947817b8a6f2d15d042d39eb5f2e9d5cb7d1c (diff)
downloadcoinosv3-7ff9861f545aaa8e05a61b43d73cf762eec72595.tar.gz
coinosv3-7ff9861f545aaa8e05a61b43d73cf762eec72595.zip
Five conversations, then 'show all' — communities stay in reach
Co-Authored-By: Claude Fable 5 <[email protected]>
Diffstat (limited to 'src/features')
-rw-r--r--src/features/messages.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/features/messages.js b/src/features/messages.js
index 0a17b03..65a71a8 100644
--- a/src/features/messages.js
+++ b/src/features/messages.js
@@ -1344,9 +1344,14 @@ export function messagesFeature(ctx) {
? h('div', { class: 'list' }, resultRows(h, dmSearch.rows, (r) => openThread(r.pk)))
: h('div', { class: 'small muted' }, t('msgNoMatches'))));
}
+ // A long DM history must not bury the communities below it: past a
+ // handful, the rest waits behind "show all". (No cap for barely-over —
+ // a "show 2 more" button costs more than the rows it hides.)
+ const DM_PREVIEW = 5;
+ const shownDms = (ui.msgAllDms || dmRows.length <= DM_PREVIEW + 2) ? dmRows : dmRows.slice(0, DM_PREVIEW);
kids.push(
dmRows.length
- ? h('div', { class: 'list' }, dmRows.map(({ peer, last }) =>
+ ? h('div', { class: 'list' }, shownDms.map(({ peer, last }) =>
h('div', {
class: 'item chat-thread-row',
onClick: () => { ui.msgView = 'dm'; ui.msgPeer = peer; ui.msgStick = true; render(); },
@@ -1358,6 +1363,12 @@ export function messagesFeature(ctx) {
h('span', { class: 'chat-time' }, timeLabel(last.rumor.created_at * 1000))),
h('div', { class: 'muted small chat-preview' }, (last.mine ? t('msgYouPrefix') + ' ' : '') + last.rumor.content)))))
: h('div', { class: 'muted small' }, t('msgNoDms')));
+ if (shownDms.length < dmRows.length)
+ kids.push(h('button', { class: 'linklike small', onClick: () => { ui.msgAllDms = true; render(); } },
+ t('msgShowAllDms', { n: dmRows.length })));
+ else if (ui.msgAllDms && dmRows.length > DM_PREVIEW + 2)
+ kids.push(h('button', { class: 'linklike small', onClick: () => { ui.msgAllDms = false; render(); } },
+ t('msgShowFewerDms')));
// ---- communities
kids.push(h('div', { class: 'row between mt16', style: 'align-items:baseline' },