UX: landscape result screen, chat emojis, unread badges, remove XP text
CI/CD / CI - API (dotnet build + engine sim) (push) Successful in 4m33s
CI/CD / CI - Web (tsc + next build) (push) Successful in 1m7s
CI/CD / Deploy - local stack (db + server + web) (push) Successful in 55s

- PostMatchRewardsModal: short-height (landscape) compaction so the win/forfeit
  result fits without overflow (smaller emoji/coins/padding, max-h 94dvh, wider).
- Chat: emoji/sticker picker (owned reactions) — tap to send; hidden on focus.
- Unread messages: online-store now tracks a total `unread` (from
  listConversations); NavRail Friends icon shows a badge (unread + requests),
  refreshed every 12s on every screen; Friends «پیام‌ها» tab badged too.
  (Per-conversation unread badges already existed.)
- Remove "XP گران است" / "XP is expensive" from shop.xpHint.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-06-11 14:58:43 +03:30
parent 24a2c251ad
commit deb83cf77c
6 changed files with 104 additions and 32 deletions
+14
View File
@@ -41,9 +41,11 @@ interface OnlineStore {
// chat
activeChatFriend: Friend | null;
chatMessages: ChatMessage[];
unread: number; // total unread messages across conversations (for nav badge)
openChat: (friend: Friend) => Promise<void>;
sendChat: (text: string) => Promise<void>;
closeChat: () => void;
refreshUnread: () => Promise<void>;
}
let roomUnsub: (() => void) | null = null;
@@ -154,11 +156,22 @@ export const useOnlineStore = create<OnlineStore>((set, get) => ({
activeChatFriend: null,
chatMessages: [],
unread: 0,
refreshUnread: async () => {
try {
const convs = await getService().listConversations();
set({ unread: convs.reduce((n, c) => n + (c.unread ?? 0), 0) });
} catch {
/* ignore */
}
},
openChat: async (friend) => {
const svc = getService();
set({ activeChatFriend: friend, chatMessages: await svc.getMessages(friend.id) });
await svc.markRead(friend.id);
get().refreshUnread();
if (chatUnsub) chatUnsub();
chatUnsub = svc.onChat((friendId, msgs) => {
const active = get().activeChatFriend;
@@ -182,5 +195,6 @@ export const useOnlineStore = create<OnlineStore>((set, get) => ({
chatUnsub = null;
}
set({ activeChatFriend: null, chatMessages: [] });
get().refreshUnread();
},
}));