Skip to content

Commit

Permalink
fix: add aria-label to components to resolve accessibility warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
pompurin404 committed Feb 3, 2025
1 parent 35c239e commit 7c8661e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/renderer/src/components/profiles/profile-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ const ProfileItem: React.FC<Props> = (props) => {
{extra && (
<Progress
className="w-full"
aria-label="流量使用进度"
classNames={{
indicator: isCurrent ? 'bg-primary-foreground' : 'bg-foreground'
}}
Expand Down
1 change: 1 addition & 0 deletions src/renderer/src/components/sider/profile-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ const ProfileCard: React.FC<Props> = (props) => {
{extra && (
<Progress
className="w-full"
aria-label="流量使用进度"
classNames={{ indicator: match ? 'bg-primary-foreground' : 'bg-foreground' }}
value={calcPercent(extra?.upload, extra?.download, extra?.total)}
/>
Expand Down
1 change: 1 addition & 0 deletions src/renderer/src/pages/connections.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ const Connections: React.FC = () => {
classNames={{ trigger: 'data-[hover=true]:bg-default-200' }}
size="sm"
className="w-[180px] min-w-[120px]"
aria-label="连接排序方式"
selectedKeys={new Set([connectionOrderBy])}
onSelectionChange={async (v) => {
await patchAppConfig({
Expand Down
3 changes: 3 additions & 0 deletions src/renderer/src/pages/mihomo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ const Mihomo: React.FC = () => {
classNames={{ trigger: 'data-[hover=true]:bg-default-200' }}
className="w-[100px]"
size="sm"
aria-label="选择内核版本"
selectedKeys={new Set([core])}
onSelectionChange={async (v) => {
try {
Expand Down Expand Up @@ -650,6 +651,7 @@ const Mihomo: React.FC = () => {
classNames={{ trigger: 'data-[hover=true]:bg-default-200' }}
className="w-[100px]"
size="sm"
aria-label="选择日志等级"
selectedKeys={new Set([logLevel])}
onSelectionChange={(v) => {
onChangeNeedRestart({ 'log-level': v.currentKey as LogLevel })
Expand All @@ -667,6 +669,7 @@ const Mihomo: React.FC = () => {
classNames={{ trigger: 'data-[hover=true]:bg-default-200' }}
className="w-[100px]"
size="sm"
aria-label="选择进程查找模式"
selectedKeys={new Set([findProcessMode])}
onSelectionChange={(v) => {
onChangeNeedRestart({ 'find-process-mode': v.currentKey as FindProcessMode })
Expand Down

0 comments on commit 7c8661e

Please sign in to comment.