aboutsummaryrefslogtreecommitdiffstats
path: root/src/features
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-09-02 22:25:11 -0700
committerAdam Soltys <[email protected]>2026-09-02 22:25:11 -0700
commit0064b59c3f4543fa709f2b6166174a08d6689506 (patch)
treee34098112f27f93fc32ac89d6aae074896860e0a /src/features
parentd28b716ae791f924d7dea901b9a9711e44bd7312 (diff)
downloadcoinosv3-0064b59c3f4543fa709f2b6166174a08d6689506.tar.gz
coinosv3-0064b59c3f4543fa709f2b6166174a08d6689506.zip
An offboard's price stops hiding in one number: the miners' cut and the ASP's service charge (base + lifetime ppm) record separately and the history detail shows them on their own lines — settling the mystery of a ~350-sat chain fee inside a ~650-sat total. The community row's member count anchors to last session's settled figure instead of ticking upward through the guestbook replay, and a profile's Pay button reached from search actually reaches Send — the lingering search screen was winning the router
Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MrkLsNScXe9b6BviUSdmMr
Diffstat (limited to 'src/features')
-rw-r--r--src/features/ark.js11
-rw-r--r--src/features/messages.js16
2 files changed, 23 insertions, 4 deletions
diff --git a/src/features/ark.js b/src/features/ark.js
index c8e979b..fc5fc9f 100644
--- a/src/features/ark.js
+++ b/src/features/ark.js
@@ -205,6 +205,8 @@ export function mergeArkStates(a, b) {
// a fee learned late (the rescue computed it from inputs − outputs)
// upgrades a recorded zero — the row only renders when the fee is real
if ((rm.feeSat || 0) > 0 && !(lm.feeSat > 0)) take.feeSat = rm.feeSat;
+ if (rm.chainFeeSat != null && lm.chainFeeSat == null) take.chainFeeSat = rm.chainFeeSat;
+ if (rm.serviceFeeSat != null && lm.serviceFeeSat == null) take.serviceFeeSat = rm.serviceFeeSat;
return Object.keys(take).length ? { ...lm, ...take } : lm;
});
// Two devices (or the push and the poll, pre-guard) can each record the
@@ -1115,7 +1117,14 @@ export function arkFeature(ctx) {
})(),
m.to ? row(t('arkPayTo'), shortAddr(m.to, 16, 12)) : null,
m.vtxoId ? row(t('arkVtxoId'), shortTxid(m.vtxoId)) : null,
- m.detail ? row(t('detailsLabel'), m.detail) : null,
+ // An offboard's fee is two different pockets — the miners' cut for the
+ // on-chain weight and the ASP's service charge (base + lifetime ppm) —
+ // shown apart so neither reads as the other being overpriced.
+ m.chainFeeSat != null && m.serviceFeeSat != null
+ ? h('div', { class: 'col', style: 'gap:10px' },
+ row(t('arkFeeChain'), fmtAmount(m.chainFeeSat) + ' ' + unitLabel()),
+ row(t('arkFeeService'), fmtAmount(m.serviceFeeSat) + ' ' + unitLabel()))
+ : m.detail ? row(t('detailsLabel'), m.detail) : null,
// proof of payment: the preimage is what a merchant asks for
m.preimage ? row(t('preimageLabel'), shortTxid(m.preimage)) : null,
m.preimage ? h('button', { class: 'btn-block', onClick: () => ctx.copy(m.preimage) }, t('copyPreimage')) : null,
diff --git a/src/features/messages.js b/src/features/messages.js
index ac43e40..803afc9 100644
--- a/src/features/messages.js
+++ b/src/features/messages.js
@@ -2029,7 +2029,13 @@ export function messagesFeature(ctx) {
} }, t('msgDmsTitle')),
h('button', { class: 'grow', onClick: () => {
const npubStr = npubOf(pk);
+ // leave the whole messaging surface, not just the profile —
+ // a lingering search or thread would win the screen router
+ // and the Send tab would never appear
ui.profilePk = null;
+ ui.profOverThread = false;
+ ui.noteThread = null;
+ ui.userSearch = null;
ui.chatOpen = false;
ui.tab = 'send';
render();
@@ -2418,10 +2424,14 @@ export function messagesFeature(ctx) {
kids.push(h('div', { class: 'list' }, communities().map((jm) => {
const room = rooms.get(jm.community_id);
const name = room?.folded?.metadata?.name || jm.name;
- // until the guestbook fold lands, last session's settled count beats
- // a placeholder that flips a moment later
+ // Last session's settled count anchors the number: while the guestbook
+ // replay is still streaming in (multiple relays, bursts past the fold
+ // debounce), the live tally climbs through intermediate values — take
+ // the max so the count doesn't visibly tick upward on every refresh.
+ // Once the replay settles, the cache is rewritten to the live figure,
+ // so a genuine departure still shows (one quiet step down, not a climb).
const live = room ? [...room.members.values()].filter((m) => m.state === 'join').length : 0;
- const memberCount = live || (st().memberCounts || {})[jm.community_id] || 0;
+ const memberCount = Math.max(live, (st().memberCounts || {})[jm.community_id] || 0);
const unread = room ? roomUnread(room) : false;
return h('div', {
class: 'item chat-thread-row' + (unread ? ' unread' : ''),