From d4741556b66ee0f773a4bc6a96f6485fd9e254ce Mon Sep 17 00:00:00 2001 From: Prayuj Tuli Date: Mon, 24 Aug 2026 00:05:16 -0400 Subject: [PATCH 1/3] fix(game): contain inbox round logs --- src/app.css | 34 +++++++++++++++++++++++++++++++++- src/routes/game/+page.svelte | 33 ++++++++++++++++++++++++++------- 2 files changed, 59 insertions(+), 8 deletions(-) diff --git a/src/app.css b/src/app.css index 73fb3b6..ed29dd7 100644 --- a/src/app.css +++ b/src/app.css @@ -244,17 +244,45 @@ inset 0 1px rgba(255, 242, 181, 0.12); } + .mail-dialog-report { + height: min(680px, calc(100vh - 4rem)); + } + .mail-dialog-header { @apply flex items-center gap-3 border-b border-[#777354] bg-[#3a4e4c] px-4 py-3; box-shadow: inset 0 1px rgba(222, 240, 238, 0.12); } .mail-dialog-body { + display: flex; min-height: 0; + flex: 1 1 auto; + flex-direction: column; + overflow: hidden; + background: #172326; + } + + .mail-round-log { + display: flex; + min-height: 0; + flex: 1 1 auto; + flex-direction: column; + overflow: hidden; + } + + .mail-round-log-list { + min-height: 0; + } + + .mail-round-log-list-expanded { + flex: 1 1 auto; overflow-y: auto; scrollbar-color: #5e7378 #1c292c; scrollbar-width: thin; - background: #172326; + } + + .mail-round-log-toggle { + @apply w-full shrink-0 border-t border-white/[0.07] bg-white/[0.025] px-3 py-2 text-[9px] font-semibold text-[#b8c3bc] transition-colors hover:bg-white/[0.06] hover:text-white; } .mail-dialog-footer { @@ -608,6 +636,10 @@ max-height: calc(100vh - 1rem); } + .mail-dialog-report { + height: calc(100vh - 1rem); + } + .mail-dialog-footer { @apply block; } diff --git a/src/routes/game/+page.svelte b/src/routes/game/+page.svelte index 5074dd6..a12ca6d 100644 --- a/src/routes/game/+page.svelte +++ b/src/routes/game/+page.svelte @@ -141,6 +141,7 @@ let policySaving = false; let activeGameTooltip: { title: string; detail: string; x: number; y: number; below: boolean } | null = null; let selectedMailboxMessageId: string | null = null; + let mailRoundLogExpanded = false; const showGameTooltip = (event: MouseEvent | FocusEvent, title: string, detail: string) => { const rect = (event.currentTarget as HTMLElement).getBoundingClientRect(); @@ -751,6 +752,7 @@ const id = message.mailboxMessageId?.value; if (!id) return; selectedMailboxMessageId = id; + mailRoundLogExpanded = false; if (message.readAt) return; try { const response = await mailboxClient.markMailboxMessageRead({ mailboxMessageId: message.mailboxMessageId }); @@ -3118,12 +3120,19 @@ {#if selectedMailboxMessage} {@const report = selectedMailboxMessage.content.case === 'battleReport' ? selectedMailboxMessage.content.value : undefined} + {@const visibleReportRounds = report ? (mailRoundLogExpanded ? report.rounds : report.rounds.slice(0, 3)) : []} + {@const hiddenReportRoundCount = report ? Math.max(0, report.rounds.length - visibleReportRounds.length) : 0}
(selectedMailboxMessageId = null)} transition:fade={{ duration: 140 }} > -