Compare commits

...

1 Commits

Author SHA1 Message Date
root
e7faf92d3c feat(frontend): show next_expected_seq and page continuity hints 2026-05-12 16:00:38 +00:00

View File

@@ -10,12 +10,19 @@ type MessageItem = {
isDeleted?: boolean
}
type PageInfo = {
nextExpectedSeq?: number
highestCommittedSeq?: number
hasMore?: boolean
}
export default function ChatPage() {
const [searchParams, setSearchParams] = useSearchParams()
const guildId = searchParams.get('guildId') ?? ''
const [channelId, setChannelId] = useState(() => searchParams.get('channelId') ?? '')
const [content, setContent] = useState('')
const [messages, setMessages] = useState<MessageItem[]>([])
const [pageInfo, setPageInfo] = useState<PageInfo | null>(null)
const [socketState, setSocketState] = useState<'offline' | 'online'>('offline')
const [seqFrom, setSeqFrom] = useState('1')
const [seqTo, setSeqTo] = useState('999999')
@@ -55,6 +62,7 @@ export default function ChatPage() {
},
})
setMessages(res.data.items ?? [])
setPageInfo(res.data.page ?? null)
}
async function sendMessage() {
@@ -133,6 +141,12 @@ export default function ChatPage() {
</li>
))}
</ul>
{pageInfo ? (
<p>
next_expected_seq: {pageInfo.nextExpectedSeq ?? '-'} | highest_committed_seq:{' '}
{pageInfo.highestCommittedSeq ?? '-'} | has_more: {String(pageInfo.hasMore ?? false)}
</p>
) : null}
</section>
)
}