Fixed ahead and behind tag of a branch screen reader support

Pushed-by: Florian Scholdei<florian.scholdei@cloudogu.com>
Co-authored-by: Florian Scholdei<florian.scholdei@cloudogu.com>
Pushed-by: Konstantin Schaper<konstantin.schaper@cloudogu.com>
Committed-by: Florian Scholdei<florian.scholdei@cloudogu.com>
This commit is contained in:
Florian Scholdei
2023-10-25 14:13:15 +02:00
parent eea4b7e03c
commit 6c97c8fcba
4 changed files with 15 additions and 16 deletions

View File

@@ -0,0 +1,2 @@
- type: fixed
description: Ahead and behind tag of a branch to screen reader

View File

@@ -160,9 +160,7 @@
"dangerZone": "Branch löschen",
"aheadBehind": {
"tooltip": "{{ahead}} Commit(s) vor, {{behind}} Commit(s) hinter dem Default Branch",
"label": "Voraus / Hinterher",
"ahead": "Voraus",
"behind": "Hinterher"
"label": "Voraus / Hinterher"
},
"delete": {
"button": "Löschen",

View File

@@ -160,9 +160,7 @@
"dangerZone": "Delete Branch",
"aheadBehind": {
"tooltip": "{{ahead}} commit(s) ahead, {{behind}} commit(s) behind default branch",
"label": "Ahead / Behind",
"ahead": "Ahead",
"behind": "Behind"
"label": "Ahead / Behind"
},
"delete": {
"button": "Delete",

View File

@@ -55,16 +55,17 @@ const AheadBehindTag: FC<Props> = ({ branch, details }) => {
<Tooltip
message={t("branch.aheadBehind.tooltip", { ahead: details.changesetsAhead, behind: details.changesetsBehind })}
>
<span className="is-inline-flex is-align-items-center">
<Icon className={details.changesetsAhead > 0 ? "has-text-success" : "has-text-grey-light"}>arrow-up</Icon>
<Count aria-label={t("branch.aheadBehind.ahead")} className="is-size-7 pl-0">
{details.changesetsAhead}
</Count>
<Icon className={details.changesetsBehind > 0 ? "has-text-warning" : "has-text-grey-light"}>arrow-down</Icon>
<Count aria-label={t("branch.aheadBehind.behind")} className="is-size-7 pr-1">
{details.changesetsBehind}
</Count>
</span>
<>
<span className="is-sr-only">
{t("branch.aheadBehind.tooltip", { ahead: details.changesetsAhead, behind: details.changesetsBehind })}
</span>
<span className="is-inline-flex is-align-items-center" aria-hidden="true">
<Icon className={details.changesetsAhead > 0 ? "has-text-success" : "has-text-grey-light"}>arrow-up</Icon>
<Count className="is-size-7 pl-0">{details.changesetsAhead}</Count>
<Icon className={details.changesetsBehind > 0 ? "has-text-warning" : "has-text-grey-light"}>arrow-down</Icon>
<Count className="is-size-7 pr-1">{details.changesetsBehind}</Count>
</span>
</>
</Tooltip>
);
};