mirror of
https://github.com/stablyai/orca
synced 2026-04-21 14:17:16 +00:00
fix: resolve Radix Dialog accessibility warnings and duplicate React key
Add visually-hidden DialogTitle and DialogDescription to NewWorkspaceComposerModal and ImageViewer to satisfy Radix UI's accessibility requirements for screen readers. Remove duplicate 'copilot' entry in AGENT_CATALOG that caused React's "two children with the same key" warning.
This commit is contained in:
parent
3918e4cfcf
commit
63d8a18bf7
3 changed files with 7 additions and 9 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import React, { useCallback, useEffect } from 'react'
|
||||
import { useAppStore } from '@/store'
|
||||
import { Dialog, DialogContent } from '@/components/ui/dialog'
|
||||
import { Dialog, DialogContent, DialogDescription, DialogTitle } from '@/components/ui/dialog'
|
||||
import NewWorkspaceComposerCard from '@/components/NewWorkspaceComposerCard'
|
||||
import { useComposerState } from '@/hooks/useComposerState'
|
||||
import type { LinkedWorkItemSummary } from '@/lib/new-workspace'
|
||||
|
|
@ -122,6 +122,10 @@ function ComposerModalBody({
|
|||
promptTextareaRef.current?.focus()
|
||||
}}
|
||||
>
|
||||
<DialogTitle className="sr-only">Create New Workspace</DialogTitle>
|
||||
<DialogDescription className="sr-only">
|
||||
Configure a name and prompt for the new workspace.
|
||||
</DialogDescription>
|
||||
<NewWorkspaceComposerCard
|
||||
containerClassName="bg-card/98 shadow-2xl supports-[backdrop-filter]:bg-card/95"
|
||||
composerRef={composerRef}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { Image as ImageIcon, RotateCcw, X, ZoomIn, ZoomOut } from 'lucide-react'
|
||||
import { type JSX, useEffect, useMemo, useState } from 'react'
|
||||
import { Dialog, DialogContent, DialogTitle } from '@/components/ui/dialog'
|
||||
import { Dialog, DialogContent, DialogDescription, DialogTitle } from '@/components/ui/dialog'
|
||||
|
||||
const FALLBACK_IMAGE_MIME_TYPE = 'image/png'
|
||||
const MIN_ZOOM = 0.25
|
||||
|
|
@ -191,6 +191,7 @@ export default function ImageViewer({
|
|||
className="top-1/2 left-1/2 h-[80vh] w-[70vw] max-w-[70vw] -translate-x-1/2 -translate-y-1/2 gap-0 overflow-hidden border border-border/60 bg-background p-0 shadow-2xl sm:max-w-[70vw]"
|
||||
>
|
||||
<DialogTitle className="sr-only">{filename}</DialogTitle>
|
||||
<DialogDescription className="sr-only">Full-size image preview</DialogDescription>
|
||||
<div className="flex items-center justify-between border-b border-border/60 bg-background/95 px-3 py-2">
|
||||
<div className="min-w-0 truncate text-sm font-medium text-foreground">{filename}</div>
|
||||
<button
|
||||
|
|
|
|||
|
|
@ -173,13 +173,6 @@ export const AGENT_CATALOG: AgentCatalogEntry[] = [
|
|||
cmd: 'hermes',
|
||||
faviconDomain: 'nousresearch.com',
|
||||
homepageUrl: 'https://hermes-agent.nousresearch.com/docs/'
|
||||
},
|
||||
{
|
||||
id: 'copilot',
|
||||
label: 'GitHub Copilot',
|
||||
cmd: 'copilot',
|
||||
faviconDomain: 'github.com',
|
||||
homepageUrl: 'https://docs.github.com/en/copilot/how-tos/set-up/install-copilot-cli'
|
||||
}
|
||||
]
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue