Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

chore(web): address WCAG A/AA issues on agent logs page (SNP-896) (#43215)

Joel3f0032f20bf6
diff --git a/web/app/components/base/markdown-blocks/__tests__/code-block.spec.tsx b/web/app/components/base/markdown-blocks/__tests__/code-block.spec.tsx
index 83cc7410393..7ad03b5ceb9 100644
--- a/web/app/components/base/markdown-blocks/__tests__/code-block.spec.tsx
+++ b/web/app/components/base/markdown-blocks/__tests__/code-block.spec.tsx
@@ -76,6 +76,10 @@ vi.mock('../shiki-highlight', () => ({
highlightCode: mockHighlightCode,
}))
+vi.mock('../../svg-gallery', () => ({
+ default: ({ content }: { content: string }) => <div data-testid="svg-renderer">{content}</div>,
+}))
+
vi.mock('echarts', () => ({
getInstanceByDom: mockEcharts.getInstanceByDom,
}))
@@ -251,12 +255,13 @@ describe('CodeBlock', () => {
const user = userEvent.setup()
render(<CodeBlock className="language-svg">{'<svg/>'}</CodeBlock>)
- expect(await screen.findByText('common.svgRenderer.generatingImage'))!.toBeInTheDocument()
-
- const svgToggleButton = screen.getAllByRole('button')[0]
- await user.click(svgToggleButton!)
+ expect(await screen.findByTestId('svg-renderer')).toHaveTextContent('<svg/>')
+ const svgToggleButton = screen.getByRole('button', { name: 'SVG' })
+ expect(svgToggleButton).toHaveAttribute('aria-pressed', 'true')
+ await user.click(svgToggleButton)
- expect(screen.queryByText('common.svgRenderer.generatingImage')).not.toBeInTheDocument()
+ expect(svgToggleButton).toHaveAttribute('aria-pressed', 'false')
+ expect(screen.queryByTestId('svg-renderer')).not.toBeInTheDocument()
})
it('should render syntax-highlighted output when language is standard and app theme is dark', async () => {
diff --git a/web/app/components/base/sort/index.tsx b/web/app/components/base/sort/index.tsx
index ecca7d7e041..31a2284a253 100644
--- a/web/app/components/base/sort/index.tsx
+++ b/web/app/components/base/sort/index.tsx
@@ -29,24 +29,27 @@ function Sort({ order, value, items, onSelect }: Props) {
}, [items, value])
return (
- <div className="inline-flex items-center">
+ <div className="inline-flex max-w-full min-w-0 items-center">
<DropdownMenu>
- <div className="relative">
- <DropdownMenuTrigger className="flex min-h-8 cursor-pointer items-center rounded-l-lg border-none bg-components-input-bg-normal px-2 py-1 outline-hidden hover:bg-state-base-hover-alt focus-visible:ring-2 focus-visible:ring-state-accent-solid data-popup-open:bg-state-base-hover-alt! data-popup-open:hover:bg-state-base-hover-alt">
- <div className="flex items-center gap-0.5 px-1">
+ <div className="relative min-w-0 flex-1">
+ <DropdownMenuTrigger className="flex min-h-8 min-w-0 cursor-pointer items-center rounded-l-lg border-none bg-components-input-bg-normal px-2 py-1 outline-hidden hover:bg-state-base-hover-alt focus-visible:ring-2 focus-visible:ring-state-accent-solid data-popup-open:bg-state-base-hover-alt! data-popup-open:hover:bg-state-base-hover-alt">
+ <div className="flex min-w-0 items-center gap-0.5 px-1">
<div className="system-sm-regular text-text-tertiary">
{t(($) => $['filter.sortBy'], { ns: 'appLog' })}
</div>
<div
className={cn(
- 'system-sm-regular text-text-tertiary',
+ 'min-w-0 system-sm-regular break-words text-text-tertiary',
!!value && 'text-text-secondary',
)}
>
{triggerContent}
</div>
</div>
- <span aria-hidden className="i-ri-arrow-down-s-line size-4 text-text-tertiary" />
+ <span
+ aria-hidden
+ className="i-ri-arrow-down-s-line size-4 shrink-0 text-text-tertiary"
+ />
</DropdownMenuTrigger>
<DropdownMenuContent
placement="bottom-start"
@@ -86,7 +89,7 @@ function Sort({ order, value, items, onSelect }: Props) {
<button
type="button"
aria-label={t(($) => $[`filter.${order ? 'ascending' : 'descending'}`], { ns: 'appLog' })}
- className="ml-px cursor-pointer rounded-r-lg border-none bg-components-button-tertiary-bg p-2 outline-hidden hover:bg-components-button-tertiary-bg-hover focus-visible:ring-2 focus-visible:ring-state-accent-solid"
+ className="ml-px shrink-0 cursor-pointer rounded-r-lg border-none bg-components-button-tertiary-bg p-2 outline-hidden hover:bg-components-button-tertiary-bg-hover focus-visible:ring-2 focus-visible:ring-state-accent-solid"
onClick={() => onSelect(`${order ? '' : '-'}${value}`)}
>
{!order && (
diff --git a/web/features/agent-v2/agent-detail/logs/__tests__/log-detail-panel.spec.tsx b/web/features/agent-v2/agent-detail/logs/__tests__/log-detail-panel.spec.tsx
index cdef32279b3..8d996902036 100644
--- a/web/features/agent-v2/agent-detail/logs/__tests__/log-detail-panel.spec.tsx
+++ b/web/features/agent-v2/agent-detail/logs/__tests__/log-detail-panel.spec.tsx
@@ -4,6 +4,7 @@ import type {
} from '@dify/contracts/api/console/agent/types.gen'
import type { IChatItem } from '@/app/components/base/chat/chat/type'
import type { OnFeedback } from '@/app/components/base/chat/types'
+import { Drawer } from '@langgenius/dify-ui/drawer'
import { QueryClient } from '@tanstack/react-query'
import { render, screen, waitFor } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
@@ -149,7 +150,9 @@ function renderPanel(log: AgentLogConversationItemResponse, messages: AgentLogMe
render(
<QueryClientTestProvider queryClient={queryClient}>
- <AgentLogDetailPanel agentId="agent-1" log={log} onClose={vi.fn()} />
+ <Drawer open>
+ <AgentLogDetailPanel agentId="agent-1" log={log} onClose={vi.fn()} />
+ </Drawer>
</QueryClientTestProvider>,
)
diff --git a/web/features/agent-v2/agent-detail/logs/__tests__/page.browser.spec.tsx b/web/features/agent-v2/agent-detail/logs/__tests__/page.browser.spec.tsx
new file mode 100644
index 00000000000..c541e26cc2c
--- /dev/null
+++ b/web/features/agent-v2/agent-detail/logs/__tests__/page.browser.spec.tsx
@@ -0,0 +1,119 @@
+import type {
+ AgentLogListResponse,
+ AgentLogSourceListResponse,
+} from '@dify/contracts/api/console/agent/types.gen'
+import { QueryClient } from '@tanstack/react-query'
+import { page } from 'vite-plus/test/browser'
+import { render } from 'vitest-browser-react'
+import { QueryClientTestProvider } from '@/test/console/query-provider'
+import { AgentLogsPage } from '../page'
+
+const mocks = vi.hoisted(() => ({
+ logs: vi.fn(),
+ sources: vi.fn(),
+}))
+
+vi.mock('react-i18next', async () => {
+ const { createReactI18nextMock } = await import('@/test/i18n-mock')
+ const { default: agentV2 } = await import('@/i18n/locales/en-US/agent-v-2.json')
+ const { default: appLog } = await import('@/i18n/locales/en-US/app-log.json')
+ const { default: common } = await import('@/i18n/locales/en-US/common.json')
+ return createReactI18nextMock({ ...agentV2, ...appLog, ...common })
+})
+
+vi.mock('@/context/i18n', async (importOriginal) => ({
+ ...(await importOriginal<typeof import('@/context/i18n')>()),
+ useDocLink: () => (path: string) => path,
+}))
+vi.mock('@/hooks/use-timestamp', () => ({ default: () => ({ formatTime: () => '' }) }))
+vi.mock('@/service/console', async (importOriginal) => ({
+ ...(await importOriginal<typeof import('@/service/console')>()),
+ consoleQuery: {
+ agent: {
+ byAgentId: {
+ feedbacks: { post: { mutationOptions: () => ({ mutationFn: vi.fn() }) } },
+ logSources: {
+ get: { queryOptions: () => ({ queryKey: ['log-sources'], queryFn: mocks.sources }) },
+ },
+ logs: {
+ get: {
+ key: () => ['agent-logs'],
+ queryOptions: () => ({ queryKey: ['agent-logs'], queryFn: mocks.logs }),
+ },
+ byConversationId: {
+ messages: {
+ get: {
+ key: () => ['agent-log-messages'],
+ queryOptions: () => ({ queryKey: ['agent-log-messages'], queryFn: vi.fn() }),
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+}))
+
+const emptyLogs: AgentLogListResponse = {
+ data: [],
+ has_more: false,
+ limit: 25,
+ page: 1,
+ total: 0,
+}
+
+const emptySources: AgentLogSourceListResponse = { data: [], groups: [] }
+
+it('keeps log filters and pagination reachable at a 320 by 256 viewport', async () => {
+ await page.viewport(320, 256)
+ mocks.logs.mockResolvedValue(emptyLogs)
+ mocks.sources.mockResolvedValue(emptySources)
+ const queryClient = new QueryClient({ defaultOptions: { queries: { retry: false } } })
+
+ try {
+ const screen = await render(
+ <QueryClientTestProvider queryClient={queryClient}>
+ <div style={{ width: 224, height: 256 }}>
+ <AgentLogsPage agentId="agent-1" />
+ </div>
+ </QueryClientTestProvider>,
+ )
+
+ await expect.element(screen.getByText('No logs found')).toBeVisible()
+ const section = screen.getByRole('region', { name: 'Logs' }).first().element()
+ const panel = section.firstElementChild as HTMLElement
+ const controls = [
+ screen.getByRole('combobox', { name: 'Last 7 days' }),
+ screen.getByRole('combobox', { name: 'Log source' }),
+ screen.getByRole('searchbox', { name: 'Search logs' }),
+ screen.getByRole('button', { name: /Sort by:/ }),
+ ]
+ const bounds = panel.getBoundingClientRect()
+ const controlBounds = controls.map((control) => control.element().getBoundingClientRect())
+
+ for (const rect of controlBounds) {
+ expect(rect.left).toBeGreaterThanOrEqual(bounds.left - 1)
+ expect(rect.right).toBeLessThanOrEqual(bounds.right + 1)
+ }
+ for (let index = 1; index < controlBounds.length; index++) {
+ const previous = controlBounds[index - 1]!
+ const current = controlBounds[index]!
+ expect(current.left >= previous.right || current.top >= previous.bottom).toBe(true)
+ }
+
+ const tableViewport = screen.getByRole('region', { name: 'Logs' }).last().element()
+ const table = screen.getByRole('table').element()
+ expect(table.getBoundingClientRect().width).toBeGreaterThan(tableViewport.clientWidth)
+ tableViewport.scrollLeft = 100
+ expect(tableViewport.scrollLeft).toBeGreaterThan(0)
+
+ expect(panel.scrollHeight).toBeGreaterThan(panel.clientHeight)
+ panel.scrollTop = panel.scrollHeight
+ expect(panel.scrollTop).toBeGreaterThan(0)
+ await expect.element(screen.getByRole('button', { name: /Edit page number/ })).toBeVisible()
+ await expect.element(screen.getByRole('radiogroup', { name: 'Items per page' })).toBeVisible()
+ } finally {
+ queryClient.clear()
+ await page.viewport(1280, 720)
+ }
+})
diff --git a/web/features/agent-v2/agent-detail/logs/__tests__/page.spec.tsx b/web/features/agent-v2/agent-detail/logs/__tests__/page.spec.tsx
index 3511d774534..1cdb21cd8bf 100644
--- a/web/features/agent-v2/agent-detail/logs/__tests__/page.spec.tsx
+++ b/web/features/agent-v2/agent-detail/logs/__tests__/page.spec.tsx
@@ -396,6 +396,21 @@ describe('AgentLogsPage', () => {
).not.toBeInTheDocument()
})
+ it('includes the visible fallback label in an untitled log button name', async () => {
+ mocks.logsQueryFn.mockResolvedValue({
+ ...populatedLogsResponse,
+ data: [{ ...populatedLogsResponse.data[0]!, title: '' }],
+ })
+
+ renderPage()
+
+ expect(
+ await screen.findByRole('button', {
+ name: 'agentV2.agentDetail.logs.notAvailable conversation-1',
+ }),
+ ).toBeInTheDocument()
+ })
+
it('should keep existing log rows visible while filter changes refetch', async () => {
const user = userEvent.setup()
let resolveNextLogs: (value: AgentLogListResponse) => void = () => undefined
@@ -443,6 +458,8 @@ describe('AgentLogsPage', () => {
await user.click(await screen.findByRole('button', { name: 'Previous conversation' }))
+ expect(screen.getByRole('dialog', { name: 'Previous conversation' })).toBeInTheDocument()
+
await waitFor(() => {
expect(mocks.messagesQueryOptions).toHaveBeenCalledWith({
input: {
diff --git a/web/features/agent-v2/agent-detail/logs/components/log-detail-panel.tsx b/web/features/agent-v2/agent-detail/logs/components/log-detail-panel.tsx
index a35347618c2..5ae705d87ba 100644
--- a/web/features/agent-v2/agent-detail/logs/components/log-detail-panel.tsx
+++ b/web/features/agent-v2/agent-detail/logs/components/log-detail-panel.tsx
@@ -4,6 +4,7 @@ import type {
} from '@dify/contracts/api/console/agent/types.gen'
import type { IChatItem } from '@/app/components/base/chat/chat/type'
import type { ChatConfig, OnFeedback } from '@/app/components/base/chat/types'
+import { DrawerTitle } from '@langgenius/dify-ui/drawer'
import { IconButton } from '@langgenius/dify-ui/icon-button'
import { Tooltip, TooltipContent, TooltipTrigger } from '@langgenius/dify-ui/tooltip'
import { skipToken, useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
@@ -108,9 +109,9 @@ export function AgentLogDetailPanel({
</div>
</div>
<div className="flex min-w-0 grow flex-wrap items-center justify-end gap-y-1">
- <div className="min-w-0 truncate system-sm-medium text-text-secondary">
- {log?.title || log?.conversation_id}
- </div>
+ <DrawerTitle className="min-w-0 truncate system-sm-medium text-text-secondary">
+ {log?.title || log?.conversation_id || tAgentV2(($) => $['agentDetail.logs.title'])}
+ </DrawerTitle>
</div>
<IconButton
size="lg"
diff --git a/web/features/agent-v2/agent-detail/logs/components/logs-table.tsx b/web/features/agent-v2/agent-detail/logs/components/logs-table.tsx
index e30b734f6ee..39406d21557 100644
--- a/web/features/agent-v2/agent-detail/logs/components/logs-table.tsx
+++ b/web/features/agent-v2/agent-detail/logs/components/logs-table.tsx
@@ -52,7 +52,7 @@ export function AgentLogsTable({
return (
<div className="flex h-full min-w-0 flex-col overflow-hidden">
- <div className="shrink-0 pr-3">
+ <div className="hidden shrink-0 pr-3 lg:block">
<table aria-hidden="true" className="w-full table-fixed border-collapse">
<LogsTableColGroup />
<LogsTableHeader labels={tableHeaderLabels} sort={sort} />
@@ -63,13 +63,13 @@ export function AgentLogsTable({
<ScrollAreaViewport
aria-label={t(($) => $['agentDetail.logs.title'])}
role="region"
- tabIndex={-1}
- className="overscroll-contain"
+ tabIndex={0}
+ className="overscroll-contain focus-visible:ring-2 focus-visible:ring-state-accent-solid"
>
<ScrollAreaContent className="pr-3">
- <table className="w-full table-fixed border-collapse">
+ <table className="w-full min-w-[56rem] table-fixed border-collapse lg:min-w-0">
<LogsTableColGroup />
- <LogsTableHeader labels={tableHeaderLabels} sort={sort} rowClassName="sr-only" />
+ <LogsTableHeader labels={tableHeaderLabels} sort={sort} rowClassName="lg:sr-only" />
<AgentLogsTableBody
logs={logs}
isPending={isPending}
@@ -85,6 +85,9 @@ export function AgentLogsTable({
<ScrollAreaScrollbar>
<ScrollAreaThumb />
</ScrollAreaScrollbar>
+ <ScrollAreaScrollbar orientation="horizontal" className="lg:hidden">
+ <ScrollAreaThumb />
+ </ScrollAreaScrollbar>
</ScrollArea>
</div>
)
@@ -124,7 +127,7 @@ function AgentLogsTableBody({
{isPending && <LogsSkeletonRows />}
{isError && (
<LogsStateRow>
- <div className="flex items-center justify-center gap-2">
+ <div className="flex items-center justify-start gap-2 lg:justify-center">
<span>{t(($) => $['agentDetail.logs.loadFailed'])}</span>
<Button variant="secondary" size="small" onClick={onRetry}>
{tCommon(($) => $['operation.retry'])}
@@ -137,7 +140,6 @@ function AgentLogsTableBody({
)}
{isSuccess &&
logs.map((log) => {
- const logTitle = log.title || log.conversation_id
const isSelected = selectedLogId === log.id
return (
@@ -164,7 +166,6 @@ function AgentLogsTableBody({
<TableCell>
<button
type="button"
- aria-label={logTitle}
className="block w-full truncate rounded-sm text-left system-sm-medium text-text-secondary focus-visible:ring-2 focus-visible:ring-state-accent-solid focus-visible:outline-hidden"
onClick={(event) => {
event.stopPropagation()
@@ -172,6 +173,7 @@ function AgentLogsTableBody({
}}
>
{log.title || notAvailable}
+ {!log.title && <span className="sr-only"> {log.conversation_id}</span>}
</button>
</TableCell>
<td className="px-3">
@@ -270,7 +272,7 @@ function LogsTableColGroup() {
function LogsStateRow({ children }: { children: ReactNode }) {
return (
<tr className="h-20 border-b border-divider-subtle">
- <td colSpan={9} className="px-3 text-center text-text-tertiary">
+ <td colSpan={9} className="px-3 text-left text-text-tertiary lg:text-center">
{children}
</td>
</tr>
diff --git a/web/features/agent-v2/agent-detail/logs/components/source-picker.tsx b/web/features/agent-v2/agent-detail/logs/components/source-picker.tsx
index 81d08706451..a7816ae6a5f 100644
--- a/web/features/agent-v2/agent-detail/logs/components/source-picker.tsx
+++ b/web/features/agent-v2/agent-detail/logs/components/source-picker.tsx
@@ -113,7 +113,7 @@ export function AgentLogSourcePicker({
<ComboboxPositioner>
<ComboboxPopup
aria-label={t(($) => $['agentDetail.logs.filters.source.label'])}
- className="w-80 p-0"
+ className="w-80 max-w-[calc(100vw-1rem)] p-0"
>
<div className="p-2 pb-1">
<ComboboxInputGroup className="h-8 min-h-8 px-2">
diff --git a/web/features/agent-v2/agent-detail/logs/page.tsx b/web/features/agent-v2/agent-detail/logs/page.tsx
index 3abf0ec3139..08107cdbe19 100644
--- a/web/features/agent-v2/agent-detail/logs/page.tsx
+++ b/web/features/agent-v2/agent-detail/logs/page.tsx
@@ -11,7 +11,16 @@ import {
DrawerPortal,
DrawerViewport,
} from '@langgenius/dify-ui/drawer'
-import { Pagination } from '@langgenius/dify-ui/pagination'
+import {
+ PaginationContent,
+ PaginationNavigation,
+ PaginationNext,
+ PaginationPageJump,
+ PaginationPageList,
+ PaginationPageSize,
+ PaginationPrevious,
+ PaginationRoot,
+} from '@langgenius/dify-ui/pagination'
import { keepPreviousData, useQuery } from '@tanstack/react-query'
import dayjs from 'dayjs'
import { useState } from 'react'
@@ -124,8 +133,11 @@ export function AgentLogsPage({ agentId }: AgentLogsPageProps) {
}
return (
- <AgentDetailSectionSurface label={t(($) => $['agentDetail.sections.logs'])}>
- <header className="h-26.5 shrink-0 px-6 pt-3 pb-2">
+ <AgentDetailSectionSurface
+ label={t(($) => $['agentDetail.sections.logs'])}
+ panelClassName="max-lg:overflow-y-auto"
+ >
+ <header className="h-auto shrink-0 px-3 pt-3 pb-2 lg:h-26.5 lg:px-6">
<div className="min-w-0">
<h2 className="system-xl-semibold text-text-primary">
{t(($) => $['agentDetail.logs.title'])}
@@ -144,73 +156,73 @@ export function AgentLogsPage({ agentId }: AgentLogsPageProps) {
</p>
</div>
- <div className="mt-3 flex min-w-0 items-center justify-between gap-3">
- <div className="flex min-w-0 flex-1 items-center gap-2">
- <Chip
- value={period}
- items={periodItems}
- leftIcon={
- <span aria-hidden className="i-ri-calendar-line block size-4 text-text-secondary" />
- }
- className="min-w-32"
- onSelect={(item) => {
- setPage(1)
- setPeriod(item.value)
- }}
- onClear={() => {
- setPage(1)
- setPeriod('allTime')
- }}
- />
+ <div className="mt-3 flex min-w-0 flex-wrap items-center gap-2">
+ <Chip
+ value={period}
+ items={periodItems}
+ leftIcon={
+ <span aria-hidden className="i-ri-calendar-line block size-4 text-text-secondary" />
+ }
+ className="min-w-32"
+ onSelect={(item) => {
+ setPage(1)
+ setPeriod(item.value)
+ }}
+ onClear={() => {
+ setPage(1)
+ setPeriod('allTime')
+ }}
+ />
- <AgentLogSourcePicker
- value={source}
- groups={logSourcesQuery.data?.groups ?? []}
- isLoading={logSourcesQuery.isPending}
- isError={logSourcesQuery.isError}
- onRetry={() => {
- void logSourcesQuery.refetch()
- }}
- onChange={(nextSource) => {
- setPage(1)
- setSource(nextSource)
- }}
- />
+ <AgentLogSourcePicker
+ value={source}
+ groups={logSourcesQuery.data?.groups ?? []}
+ isLoading={logSourcesQuery.isPending}
+ isError={logSourcesQuery.isError}
+ onRetry={() => {
+ void logSourcesQuery.refetch()
+ }}
+ onChange={(nextSource) => {
+ setPage(1)
+ setSource(nextSource)
+ }}
+ />
- <SearchInput
- aria-label={t(($) => $['agentDetail.logs.filters.search.label'])}
- value={keyword}
- placeholder={t(($) => $['agentDetail.logs.filters.search.placeholder'])}
- className="w-50 shrink-0"
- onValueChange={(nextKeyword) => {
+ <SearchInput
+ aria-label={t(($) => $['agentDetail.logs.filters.search.label'])}
+ value={keyword}
+ placeholder={t(($) => $['agentDetail.logs.filters.search.placeholder'])}
+ className="w-full min-w-0 sm:w-50"
+ onValueChange={(nextKeyword) => {
+ setPage(1)
+ setKeyword(nextKeyword)
+ }}
+ />
+
+ <div className="ml-auto max-w-full">
+ <Sort
+ order={sort.order === 'desc' ? '-' : ''}
+ value={sort.field}
+ items={[
+ {
+ value: 'created_at',
+ name: t(($) => $['agentDetail.logs.filters.sort.lastCreatedTime']),
+ },
+ {
+ value: 'updated_at',
+ name: t(($) => $['agentDetail.logs.filters.sort.lastUpdatedTime']),
+ },
+ ]}
+ onSelect={(nextSortValue) => {
setPage(1)
- setKeyword(nextKeyword)
+ setSort(parseSortValue(nextSortValue))
}}
/>
</div>
-
- <Sort
- order={sort.order === 'desc' ? '-' : ''}
- value={sort.field}
- items={[
- {
- value: 'created_at',
- name: t(($) => $['agentDetail.logs.filters.sort.lastCreatedTime']),
- },
- {
- value: 'updated_at',
- name: t(($) => $['agentDetail.logs.filters.sort.lastUpdatedTime']),
- },
- ]}
- onSelect={(nextSortValue) => {
- setPage(1)
- setSort(parseSortValue(nextSortValue))
- }}
- />
</div>
</header>
- <div className="min-h-0 flex-1 px-6 pt-2 pb-3">
+ <div className="min-h-40 flex-1 px-3 pt-2 pb-3 lg:min-h-0 lg:px-6">
<AgentLogsTable
logs={logs}
isPending={logsQuery.isPending}
@@ -245,29 +257,38 @@ export function AgentLogsPage({ agentId }: AgentLogsPageProps) {
</DrawerPortal>
</Drawer>
- <Pagination
+ <PaginationRoot
page={currentPage}
totalPages={totalPages}
onPageChange={setPage}
- className="h-14 shrink-0 px-6 py-3"
- labels={{
- previous: tCommon(($) => $['pagination.previous']),
- next: tCommon(($) => $['pagination.next']),
- editPageNumber: (page, totalPages) =>
- tCommon(($) => $['pagination.editPageNumber'], { page, totalPages }),
- pageNumberInput: tCommon(($) => $['pagination.pageNumber']),
- }}
- pageSize={{
- value: limit,
- options: [10, 25, 50],
- onValueChange: (nextLimit) => {
- setPage(1)
- setLimit(nextLimit)
- },
- label: tCommon(($) => $['pagination.perPage']),
- ariaLabel: tCommon(($) => $['pagination.perPage']),
- }}
- />
+ className="h-auto shrink-0 px-3 py-3 lg:h-14 lg:px-6"
+ >
+ <PaginationContent className="max-lg:grid-cols-1 max-lg:justify-items-start">
+ <PaginationNavigation>
+ <PaginationPrevious aria-label={tCommon(($) => $['pagination.previous'])} />
+ <PaginationPageJump
+ aria-label={tCommon(($) => $['pagination.editPageNumber'], {
+ page: currentPage,
+ totalPages,
+ })}
+ inputLabel={tCommon(($) => $['pagination.pageNumber'])}
+ />
+ <PaginationNext aria-label={tCommon(($) => $['pagination.next'])} />
+ </PaginationNavigation>
+ <PaginationPageList className="max-lg:hidden" />
+ <PaginationPageSize
+ value={limit}
+ options={[10, 25, 50]}
+ onValueChange={(nextLimit) => {
+ setPage(1)
+ setLimit(nextLimit)
+ }}
+ label={tCommon(($) => $['pagination.perPage'])}
+ aria-label={tCommon(($) => $['pagination.perPage'])}
+ className="max-lg:col-start-1 max-lg:justify-self-start"
+ />
+ </PaginationContent>
+ </PaginationRoot>
</AgentDetailSectionSurface>
)
}