mirror of
https://github.com/docmost/docmost.git
synced 2026-05-07 06:23:06 +08:00
fix: a11y
This commit is contained in:
@@ -870,6 +870,8 @@
|
|||||||
"Previous 7 days": "Previous 7 days",
|
"Previous 7 days": "Previous 7 days",
|
||||||
"Previous 30 days": "Previous 30 days",
|
"Previous 30 days": "Previous 30 days",
|
||||||
"Search chats...": "Search chats...",
|
"Search chats...": "Search chats...",
|
||||||
|
"Search chats": "Search chats",
|
||||||
|
"Ask anything... Use @ to mention pages": "Ask anything... Use @ to mention pages",
|
||||||
"Start a new chat to see it here.": "Start a new chat to see it here.",
|
"Start a new chat to see it here.": "Start a new chat to see it here.",
|
||||||
"Summarize this page": "Summarize this page",
|
"Summarize this page": "Summarize this page",
|
||||||
"Toggle AI Chat": "Toggle AI Chat",
|
"Toggle AI Chat": "Toggle AI Chat",
|
||||||
|
|||||||
@@ -137,7 +137,8 @@ export default function AiChatSidebar() {
|
|||||||
|
|
||||||
<TextInput
|
<TextInput
|
||||||
className={classes.searchInput}
|
className={classes.searchInput}
|
||||||
placeholder="Search chats..."
|
placeholder={t("Search chats...")}
|
||||||
|
aria-label={t("Search chats")}
|
||||||
leftSection={<IconSearch size={14} />}
|
leftSection={<IconSearch size={14} />}
|
||||||
size="xs"
|
size="xs"
|
||||||
value={search}
|
value={search}
|
||||||
|
|||||||
@@ -178,6 +178,7 @@ export default function AsideChatPanel() {
|
|||||||
href="/ai"
|
href="/ai"
|
||||||
variant="subtle"
|
variant="subtle"
|
||||||
color="dark"
|
color="dark"
|
||||||
|
aria-label={t("New chat")}
|
||||||
onClick={handleNewChat}
|
onClick={handleNewChat}
|
||||||
>
|
>
|
||||||
<IconPlus size={20} stroke={1.75} />
|
<IconPlus size={20} stroke={1.75} />
|
||||||
@@ -185,13 +186,23 @@ export default function AsideChatPanel() {
|
|||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
|
||||||
<Tooltip label={t("Open full page")} openDelay={250}>
|
<Tooltip label={t("Open full page")} openDelay={250}>
|
||||||
<ActionIcon variant="subtle" color="dark" onClick={handleExpand}>
|
<ActionIcon
|
||||||
|
variant="subtle"
|
||||||
|
color="dark"
|
||||||
|
aria-label={t("Open full page")}
|
||||||
|
onClick={handleExpand}
|
||||||
|
>
|
||||||
<IconArrowsDiagonal size={18} stroke={1.5} />
|
<IconArrowsDiagonal size={18} stroke={1.5} />
|
||||||
</ActionIcon>
|
</ActionIcon>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
|
||||||
<Tooltip label={t("Close")} openDelay={250}>
|
<Tooltip label={t("Close")} openDelay={250}>
|
||||||
<ActionIcon variant="subtle" color="dark" onClick={handleClose}>
|
<ActionIcon
|
||||||
|
variant="subtle"
|
||||||
|
color="dark"
|
||||||
|
aria-label={t("Close")}
|
||||||
|
onClick={handleClose}
|
||||||
|
>
|
||||||
<IconX size={20} stroke={1.75} />
|
<IconX size={20} stroke={1.75} />
|
||||||
</ActionIcon>
|
</ActionIcon>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
|||||||
@@ -225,6 +225,10 @@ export default function ChatInput({
|
|||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
editorProps: {
|
editorProps: {
|
||||||
|
attributes: {
|
||||||
|
"aria-label": placeholder || t("Ask anything... Use @ to mention pages"),
|
||||||
|
"aria-multiline": "true",
|
||||||
|
},
|
||||||
handleDOMEvents: {
|
handleDOMEvents: {
|
||||||
keydown: (_view, event) => {
|
keydown: (_view, event) => {
|
||||||
if (
|
if (
|
||||||
@@ -275,6 +279,8 @@ export default function ChatInput({
|
|||||||
type="file"
|
type="file"
|
||||||
accept={ACCEPTED_FILE_TYPES}
|
accept={ACCEPTED_FILE_TYPES}
|
||||||
multiple
|
multiple
|
||||||
|
aria-label={t("Add files")}
|
||||||
|
tabIndex={-1}
|
||||||
style={{ display: "none" }}
|
style={{ display: "none" }}
|
||||||
onChange={(e) => handleFileSelect(e.target.files)}
|
onChange={(e) => handleFileSelect(e.target.files)}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -31,7 +31,16 @@ export default function ChatToolGroup({ toolCalls, isStreaming }: Props) {
|
|||||||
<div className={classes.toolGroup}>
|
<div className={classes.toolGroup}>
|
||||||
<div
|
<div
|
||||||
className={classes.toolGroupHeader}
|
className={classes.toolGroupHeader}
|
||||||
|
role="button"
|
||||||
|
tabIndex={0}
|
||||||
|
aria-expanded={expanded}
|
||||||
onClick={() => setExpanded((prev) => !prev)}
|
onClick={() => setExpanded((prev) => !prev)}
|
||||||
|
onKeyDown={(event) => {
|
||||||
|
if (event.key === "Enter" || event.key === " ") {
|
||||||
|
event.preventDefault();
|
||||||
|
setExpanded((prev) => !prev);
|
||||||
|
}
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
{activeLabel ? (
|
{activeLabel ? (
|
||||||
<IconLoader2 size={12} className={classes.processingSpinner} />
|
<IconLoader2 size={12} className={classes.processingSpinner} />
|
||||||
|
|||||||
@@ -98,7 +98,7 @@
|
|||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
letter-spacing: 0.08em;
|
letter-spacing: 0.08em;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
color: light-dark(var(--mantine-color-gray-6), var(--mantine-color-dark-2));
|
color: var(--mantine-color-dimmed);
|
||||||
margin-bottom: var(--mantine-spacing-xs);
|
margin-bottom: var(--mantine-spacing-xs);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,7 +125,7 @@
|
|||||||
.suggestionsLabel {
|
.suggestionsLabel {
|
||||||
font-size: var(--mantine-font-size-xs);
|
font-size: var(--mantine-font-size-xs);
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: light-dark(var(--mantine-color-gray-5), var(--mantine-color-dark-3));
|
color: var(--mantine-color-dimmed);
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
letter-spacing: 0.5px;
|
letter-spacing: 0.5px;
|
||||||
margin-bottom: var(--mantine-spacing-sm);
|
margin-bottom: var(--mantine-spacing-sm);
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
margin-top: 6px;
|
margin-top: 6px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: var(--mantine-font-size-xs);
|
font-size: var(--mantine-font-size-xs);
|
||||||
color: light-dark(var(--mantine-color-gray-5), var(--mantine-color-dark-3));
|
color: var(--mantine-color-dimmed);
|
||||||
}
|
}
|
||||||
|
|
||||||
.attachmentChips {
|
.attachmentChips {
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
padding: 4px var(--mantine-spacing-xs);
|
padding: 4px var(--mantine-spacing-xs);
|
||||||
font-size: var(--mantine-font-size-xs);
|
font-size: var(--mantine-font-size-xs);
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: light-dark(var(--mantine-color-gray-6), var(--mantine-color-dark-2));
|
color: var(--mantine-color-dimmed);
|
||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,7 +104,7 @@
|
|||||||
|
|
||||||
.chatItemDate {
|
.chatItemDate {
|
||||||
font-size: var(--mantine-font-size-xs);
|
font-size: var(--mantine-font-size-xs);
|
||||||
color: light-dark(var(--mantine-color-gray-5), var(--mantine-color-dark-3));
|
color: var(--mantine-color-dimmed);
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
transition: opacity 150ms;
|
transition: opacity 150ms;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
.subtitle {
|
.subtitle {
|
||||||
font-size: var(--mantine-font-size-sm);
|
font-size: var(--mantine-font-size-sm);
|
||||||
color: light-dark(var(--mantine-color-gray-6), var(--mantine-color-dark-2));
|
color: var(--mantine-color-dimmed);
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-top: 6px;
|
margin-top: 6px;
|
||||||
margin-bottom: var(--mantine-spacing-lg);
|
margin-bottom: var(--mantine-spacing-lg);
|
||||||
|
|||||||
Reference in New Issue
Block a user