Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

fix(control-ui): announce GFS listing count updates and fix truncated copy

M1342750da99a
diff --git a/control-ui/components/GfsBrowser.tsx b/control-ui/components/GfsBrowser.tsx
index ed6e98cd5..d4cf0431e 100644
--- a/control-ui/components/GfsBrowser.tsx
+++ b/control-ui/components/GfsBrowser.tsx
@@ -1739,16 +1739,10 @@ export function GfsBrowser(): React.JSX.Element {
)}
{!loading && items.length > 0 ? (
- <p className="cu-gfs-list-count">
- Showing{' '}
- {nextCursor ? (
- <>
- {items.length} of {items.length}+
- </>
- ) : (
- <>all {items.length}</>
- )}{' '}
- items.
+ <p className="cu-gfs-list-count" aria-live="polite">
+ {nextCursor
+ ? `Showing the first ${items.length} items.`
+ : `Showing all ${items.length} items.`}
</p>
) : null}
diff --git a/control-ui/components/__tests__/GfsBrowser.test.tsx b/control-ui/components/__tests__/GfsBrowser.test.tsx
index 4c6a9c1e5..e0f9a1854 100644
--- a/control-ui/components/__tests__/GfsBrowser.test.tsx
+++ b/control-ui/components/__tests__/GfsBrowser.test.tsx
@@ -2578,7 +2578,10 @@ describe('GfsBrowser', () => {
})
renderBrowser()
- expect(await screen.findByText('Showing 2 of 2+ items.')).toBeTruthy()
+ const count = await screen.findByText('Showing the first 2 items.')
+ // WCAG 4.1.3: the count changes after Load more, so updates must be
+ // announced politely.
+ expect(count).toHaveAttribute('aria-live', 'polite')
expect(
screen.getByText(
'The listing is truncated at the page cap — Load more fetches the next page.'
@@ -2599,7 +2602,7 @@ describe('GfsBrowser', () => {
})
renderBrowser()
- expect(await screen.findByText('Showing 2 of 2+ items.')).toBeTruthy()
+ expect(await screen.findByText('Showing the first 2 items.')).toBeTruthy()
fireEvent.click(screen.getByRole('button', { name: 'Load more' }))
expect(await screen.findByText('Showing all 3 items.')).toBeTruthy()
diff --git a/control-ui/package-lock.json b/control-ui/package-lock.json
index 341555ebf..6f2701d5f 100644
--- a/control-ui/package-lock.json
+++ b/control-ui/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-ui",
- "version": "0.1.667",
+ "version": "0.1.668",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-ui",
- "version": "0.1.667",
+ "version": "0.1.668",
"dependencies": {
"@clerum/display-field": "file:../packages/display-field",
"@clerum/frontend-components": "file:../packages/frontend-components",
diff --git a/control-ui/package.json b/control-ui/package.json
index 0e8b91f31..6ce36c167 100644
--- a/control-ui/package.json
+++ b/control-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-ui",
- "version": "0.1.667",
+ "version": "0.1.668",
"private": true,
"scripts": {
"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",