Skip to content

Sort graduated launches by price; keep the last 200 chat messages - #58

Merged
droplister merged 2 commits into
mainfrom
claude/new-session-ta1vaw
Oct 8, 2026
Merged

droplister merged 2 commits into
mainfrom
claude/new-session-ta1vaw

Conversation

@droplister

Copy link
Copy Markdown
Member

Two small changes from the XCP Wallet Telegram discussion.

Sort graduated launches by price

Market cap folds in effective supply, so a launch that burned part of its supply (e.g. HONDACIVIC, ~15% burnt) ranks below one at the same per-token price. Adds a Price option to the Graduated sort menu, ordering by XCP per whole token (pool XCP reserve ÷ pool token reserve).

  • apps/api/src/queries/launches.ts: price key in SORT_SQL; launches with no pool sort last.
  • apps/web/src/app/[lang]/_components/launch-sections.tsx: matching comparator for the live fallback path. "Price" is already translated in every locale.

Chat: keep the last 200 messages instead of expiring them after a day

Every message was deleted 24 hours after posting, so at low volume the room opened empty. History is now bounded by count only: the newest 200 messages stay until newer posts push them out.

  • packages/chat/src/protocol.ts: CHAT_MAX_MESSAGES 50 → 200; CHAT_TTL_MS removed; history frame size limit scales with the cap.
  • apps/api/src/durable/chat-room.ts: messages are pruned by the cap alone. Retry receipts (no text; they back retries and the cooldown) keep a 24h expiry, and the alarm now tracks receipts only.
  • apps/web/src/hooks/use-chat.ts: drops the client-side age filter and its 30s timer.
  • Tests updated for the new cap and expiry behaviour.

Deploy order: web before API. Browsers on the old bundle reject a history frame over 50 messages, so if the API goes first they miss the backlog on connect until they reload (live messages still arrive).

Testing

  • Chat suites: 236/236 pass. tsc, eslint, numeric and i18n checks pass for both apps; render-reads passes.
  • Full vitest: 1456/1458. The two failures are in tests/websocket-lifecycle.test.ts and fail identically on main in the sandbox, so they're environmental.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LkjKD3QZivr3Qr2cKdjfbz


Generated by Claude Code

claude added 2 commits October 8, 2026 18:37
Market cap folds in effective supply, so a launch that burned part of its
supply ranks below one that did not at the same per-token price. Add a
Price sort that orders by XCP per whole token: SORT_SQL's `price` for the
indexed path and a matching comparator for the live fallback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LkjKD3QZivr3Qr2cKdjfbz
…a day

A quiet room used to delete every message 24 hours after it was posted,
so low chat volume meant visitors opened an empty transcript. History is
now bounded by count alone: the newest 200 messages stay until newer
posts push them out. Retry receipts, which hold no text and only back
retries and the cooldown, keep their 24-hour expiry. The client drops its
age filter and the history frame size limit scales with the new cap.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LkjKD3QZivr3Qr2cKdjfbz
@droplister
droplister merged commit 8ad8fe2 into main Oct 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants