fix: address board switcher review

This commit is contained in:
ajnart committed 2026-08-22 10:53:16 +02:00
1 parent 88541b013d
commit 4f86eb5731
2 files changed
+13 -6

No files matched your search

@@ -16,6 +16,7 @@ import {
ThemeIcon, ThemeIcon,
UnstyledButton, UnstyledButton,
useMatches, useMatches,
VisuallyHidden,
} from "@mantine/core"; } from "@mantine/core";
import { useHotkeys } from "@mantine/hooks"; import { useHotkeys } from "@mantine/hooks";
import { IconArrowDown, IconArrowRight, IconLayoutBoard, IconReplace } from "@tabler/icons-react"; import { IconArrowDown, IconArrowRight, IconLayoutBoard, IconReplace } from "@tabler/icons-react";
@@ -54,10 +55,7 @@ export const BoardSwitcher = ({ children }: BoardSwitcherProps) => {
}); });
const availableBoards = useMemo( const availableBoards = useMemo(
() => () => boards.filter((board) => board.id !== currentBoard?.id),
boards
.filter((board) => board.id !== currentBoard?.id)
.toSorted((first, second) => first.name.localeCompare(second.name)),
[boards, currentBoard?.id], [boards, currentBoard?.id],
); );
const filteredBoards = useMemo(() => { const filteredBoards = useMemo(() => {
@@ -176,7 +174,15 @@ export const BoardSwitcher = ({ children }: BoardSwitcherProps) => {
overlayProps={{ backgroundOpacity: 0.18, blur: 2 }} overlayProps={{ backgroundOpacity: 0.18, blur: 2 }}
transitionProps={{ transition: "fade", duration: 100, timingFunction: "ease" }} transitionProps={{ transition: "fade", duration: 100, timingFunction: "ease" }}
> >
<Stack data-autofocus tabIndex={-1} gap="md" onKeyDown={handleModalKeyDown} className={classes.content}> <Stack
data-autofocus
tabIndex={-1}
gap="md"
onKeyDown={handleModalKeyDown}
className={classes.content}
aria-describedby="board-switcher-instructions"
>
<VisuallyHidden id="board-switcher-instructions">{t("keyboard.instructions")}</VisuallyHidden>
<ScrollArea.Autosize mah={640} type="auto" offsetScrollbars> <ScrollArea.Autosize mah={640} type="auto" offsetScrollbars>
{results} {results}
</ScrollArea.Autosize> </ScrollArea.Autosize>
+2 -1
View File
@@ -5140,7 +5140,8 @@
"currentHidden": "Current board: {name}", "currentHidden": "Current board: {name}",
"keyboard": { "keyboard": {
"navigate": "Navigate", "navigate": "Navigate",
"open": "Open" "open": "Open",
"instructions": "Type to filter boards. Use the arrow keys to move through results and Enter to open a board."
}, },
"empty": { "empty": {
"title": "No other boards", "title": "No other boards",