refactor(overview): export VisuallyHidden from the kit and draw the status once

Overview and the refusal wait both imported VisuallyHidden from react-aria
under an eslint exception. The kit barrel now re-exports it and the exception
is gone, so react-aria stays behind src/ui.

The header status builds its Light once and wraps it in a Link only when the
datapath needs attention, instead of two copies of the same element.
This commit is contained in:
Zakk committed 2026-09-28 02:35:45 +10:00
1 parent 99b261b52e
commit 288354081f
4 files changed
+23 -7

No files matched your search

+1 -1
View File
@@ -99,7 +99,7 @@ export default [
allowImportNames: ['useFilter', 'useDragAndDrop', 'isTextDropItem', 'I18nProvider', 'RouterProvider'],
message: `A React Aria component ${kit}`
},
{name: 'react-aria', allowTypeImports: true, allowImportNames: ['VisuallyHidden'], message: `A React Aria primitive ${kit}`}
{name: 'react-aria', allowTypeImports: true, message: `A React Aria primitive ${kit}`}
],
patterns: [
{group: ['react-aria/private/**'], message: 'Private React Aria paths break on upgrade.'},
+20 -4
View File
@@ -1,7 +1,22 @@
import {VisuallyHidden} from 'react-aria';
import {cardHeadings, useOverview} from './useOverview';
import {useT} from '../../i18n';
import {ActionGroup, Badge, Button, Card, Bar, DataTable, Kv, Light, Link, PopoverDialog, TextTooltip, ErrorMessage, Loading, Empty} from '../../ui/ui';
import {
ActionGroup,
Badge,
Button,
Card,
Bar,
DataTable,
Kv,
Light,
Link,
PopoverDialog,
TextTooltip,
ErrorMessage,
Loading,
Empty,
VisuallyHidden
} from '../../ui/ui';
import Download from '../../ui/icons/Download';
import InfoCircle from '../../ui/icons/InfoCircle';
import {tableLayout} from '../../ui/Table';
@@ -64,6 +79,7 @@ const attachmentsFloor = 2 + tableLayout.headingHeight + 2 * tableLayout.rowHeig
export function Overview({query}: PageProps) {
const t = useT();
const vm = useOverview(query);
const status = <Light tone={vm.status.tone}>{vm.status.text}</Light>;
return (
<div className="rp-page">
<ErrorMessage error={vm.errors.capabilities} onRetry={vm.retry.capabilities} />
@@ -71,10 +87,10 @@ export function Overview({query}: PageProps) {
<div className="rp-cluster">
{vm.status.href ? (
<Link appearance="link" href={vm.status.href}>
<Light tone={vm.status.tone}>{vm.status.text}</Light>
{status}
</Link>
) : (
<Light tone={vm.status.tone}>{vm.status.text}</Light>
status
)}
<Kv row items={vm.strip} />
{vm.reload && (
+1 -2
View File
@@ -1,7 +1,6 @@
import {useEffect, useState, useSyncExternalStore} from 'react';
import {VisuallyHidden} from 'react-aria';
import {useT} from '../i18n';
import {InlineAlert} from '../ui/ui';
import {InlineAlert, VisuallyHidden} from '../ui/ui';
import {currentRefusal, subscribeRefusal, type Refusal} from '../api/refusal';
// A request the backend asked to wait on: why, and a countdown to the automatic retry.
+1
View File
@@ -29,3 +29,4 @@ export {ActionBar} from './ActionBar';
export {ActionGroup, type Action} from './ActionGroup';
export {Card, cardClass} from './Card';
export {Divider} from './Divider';
export {VisuallyHidden} from 'react-aria';