This commit is contained in:
Siddharth Mishra 2026-11-04 09:04:41 +07:00 committed by GitHub
commit 4f7b3df374
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -528,13 +528,16 @@ export const FileChooser = ({
}
isActive={i === dirs.length - 1}
>
{ dir === "/" ? <OutlinedHddIcon className="breadcrumb-hdd-icon" /> : dir }
{ dir === "/"
? <OutlinedHddIcon className="breadcrumb-hdd-icon" aria-hidden={false} aria-label={_("Filesystem")} />
: dir
}
</BreadcrumbItem>
);
});
return (
<Breadcrumb>
<Breadcrumb aria-label={_("File path")}>
{crumbs}
</Breadcrumb>
);
@ -543,7 +546,7 @@ export const FileChooser = ({
function header(dlg: DialogState<FileChooserValues>) {
const preparedFilters = (
dlg.values.filters.length > 1 &&
<ToggleGroup>
<ToggleGroup aria-label={_("File filters")}>
{
dlg.values.filters.map(f => {
return (
@ -563,6 +566,8 @@ export const FileChooser = ({
const textFilter = (
<TextInput
type="search"
aria-label={_("Filter by name")}
placeholder={_("Type to filter")}
value={dlg.values.textFilter}
onChange={(_event, value) => dlg.field("textFilter").set(value)}
@ -716,7 +721,7 @@ export const FileChooser = ({
}
return (
<Table variant="compact" borders={false}>
<Table variant="compact" borders={false} aria-label={_("Places")}>
<Tbody onKeyDown={keyboardNavigationHandler}>
{ collection(dlg.values.recent_collection) }
{ dlg.values.shortcuts.map(shortcut) }
@ -822,8 +827,6 @@ export const FileChooser = ({
}
return (
<Tr
aria-label={file.name}
aria-roledescription={file.type === "dir" ? _("Folder") : _("File")}
isRowSelected={file.name === dlg.values.selected?.name}
key={idx}
data-name={name}
@ -833,13 +836,16 @@ export const FileChooser = ({
isClickable
>
<Td>
<Icon>
<Icon aria-hidden="true">
{ file.type === "dir"
? <FolderIcon />
: <OutlineFileIcon />
}
</Icon>
&nbsp;&nbsp;
<span className="pf-v6-screen-reader">
{file.type === "dir" ? _("Folder") : _("File")}:{" "}
</span>
{emphasize_matches(name, dlg.values.textFilter)}
</Td>
{ location && <Td>{location}</Td> }
@ -853,7 +859,7 @@ export const FileChooser = ({
}
return (
<Table variant="compact" borders={false}>
<Table variant="compact" borders={false} aria-label={dlg.values.collection ? dlg.values.collection.label : _("Files")}>
{ listingBody() }
</Table>
);
@ -866,6 +872,7 @@ export const FileChooser = ({
position="top"
onClose={Dialogs.close}
className="file-chooser"
aria-label={title}
>
<ModalHeader title={title} />
<ModalBody>
@ -918,6 +925,7 @@ const FileChooserButton = ({
<Button
variant="plain"
icon={<FolderOpenIcon />}
aria-label={props.title || _("Choose file")}
onClick={
() => {
Dialogs.show(
@ -936,6 +944,7 @@ const FileChooserButton = ({
export const FileChooserInput = ({
ouiaId,
placeholder = "",
ariaLabel,
value,
onChange,
isDisabled = false,
@ -943,6 +952,7 @@ export const FileChooserInput = ({
} : {
ouiaId?: undefined | string;
placeholder?: string,
ariaLabel?: string,
value: string,
onChange: (path: string, from_dialog: boolean) => void,
isDisabled?: boolean,
@ -956,6 +966,7 @@ export const FileChooserInput = ({
<TextInputGroupMain
value={value}
placeholder={placeholder}
aria-label={ariaLabel || placeholder || _("File path")}
onChange={(_event, value) => onChange(value, false)}
autoComplete="off"
/>
@ -996,6 +1007,7 @@ export const DialogFileChooserInput = ({
<FileChooserInput
ouiaId={field.ouia_id()}
placeholder={placeholder}
ariaLabel={label}
value={field.get()}
onChange={(val, from_dialog) => field.set_debounced(val, from_dialog ? 0 : undefined)}
isDisabled={!!excuse}