Skip to content

Commit 0262167

Browse files
authored
Merge branch 'main' into directory-casing
2 parents 1e6a5d6 + c11a771 commit 0262167

File tree

5 files changed

+151
-48
lines changed

5 files changed

+151
-48
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2222
- User-specific basic mode setting can now be changed when settingsUIReadOnly is set (#775)
2323
- Fixed an error displaying the Web UI after reverting a commit (#776)
2424
- Fixed errors exporting items when directory casing does not match mappings (#781)
25+
- Improved accessibility of UI when tabbing through items (#764)
2526

2627
## [2.11.0] - 2025-04-23
2728

git-webui/release/share/git-webui/webui/css/git-webui.css

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,19 @@ body {
114114
.btn-sidebar-icon {
115115
padding: 2% 5%;
116116
}
117+
.btn-sidebar-icon:focus-visible {
118+
outline: 2px solid white;
119+
outline-offset: 2px;
120+
box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.4);
121+
}
122+
.btn-sidebar-icon:focus {
123+
outline: 2px solid white;
124+
outline-offset: 2px;
125+
box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.4);
126+
}
117127
.btn-ok {
118128
float: right;
119-
margin-top: -0.6rem;
129+
margin-top: -1.9rem;
120130
margin-right: 0.8rem;
121131
}
122132
#error-modal .modal-body {

git-webui/release/share/git-webui/webui/js/git-webui.js

Lines changed: 64 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -519,10 +519,11 @@ webui.SideBarView = function(mainView, noEventHandlers) {
519519
if($("#btn_createList").length == 0){
520520
var newBranchForm = $('#sidebar-local-branches');
521521

522-
var inputForm = '<button type="submit" class="btn btn-md btn-default btn-ok" id="btn_createList">' +
522+
var inputForm = '<input type="text" class="form-control form-control-xs" id="newBranchName"/>' +
523+
'<button type="submit" class="btn btn-md btn-default btn-ok" id="btn_createList">' +
523524
webui.checkIcon+
524-
'</button>' +
525-
'<input type="text" class="form-control form-control-xs" id="newBranchName"/>'
525+
'</button>'
526+
526527
newBranchForm.append(inputForm);
527528
$("#sidebar-local-branches input").focus();
528529
}
@@ -994,81 +995,120 @@ webui.SideBarView = function(mainView, noEventHandlers) {
994995
self.mainView = mainView;
995996
self.currentContext = self.getCurrentContext();
996997
self.element = $( '<div id="sidebar">' +
997-
'<a href="#" data-toggle="modal" data-target="#help-modal"><img id="sidebar-logo" src="img/git-logo.png"></a>' +
998+
'<a href="#" data-toggle="modal" data-target="#help-modal" tabindex="0"><img id="sidebar-logo" src="img/git-logo.png"></a>' +
998999
'<h5 id="packageVersion"></h5>' +
9991000
'<h4 id="environment"></h4>'+
10001001
'<div id="sidebar-content">' +
10011002
'<section id="sidebar-workspace">' +
1002-
'<h4>Workspace</h4>' +
1003+
'<h4 tabindex="0">Workspace</h4>' +
10031004
'</section>' +
10041005
'<section id="sidebar-stash">' +
1005-
'<h4>Stash</h4>' +
1006+
'<h4 tabindex="0">Stash</h4>' +
10061007
'</section>' +
10071008
'<section id="sidebarDiscarded">' +
1008-
'<h4>Discarded Files</h4>' +
1009+
'<h4 tabindex="0">Discarded Files</h4>' +
10091010
'</section>' +
1010-
'<section id="sidebar-local-branches">' +
1011+
'<section id="sidebar-local-branches" >' +
10111012
'<h4 class="mt-1">Local Branches' +
1012-
'<button type="button" class="btn btn-default btn-sidebar-icon btn-add shadow-none" title="Create new branch">' +
1013+
'<button type="button" class="btn btn-default btn-sidebar-icon btn-add shadow-none" title="Create new branch" tabindex="0">' +
10131014
webui.circlePlusIcon+
10141015
'</button>' + '</h4>' +
10151016
'</section>' +
1016-
'<section id="sidebar-remote-branches">' +
1017+
'<section id="sidebar-remote-branches" >' +
10171018
'<h4 class="mt-1">Remote Branches' +
1018-
'<button type="button" class="btn btn-default btn-sidebar-icon btn-prune-remote-branches shadow-none" title="Git fetch of remote branches">'+
1019+
'<button type="button" class="btn btn-default btn-sidebar-icon btn-prune-remote-branches shadow-none" title="Git fetch of remote branches" tabindex="0 ">'+
10191020
webui.refreshIcon+
10201021
'</button>' +'</h4>' +
10211022
'</section>' +
10221023
'<section id="sidebar-tags">' +
10231024
'<h4>Tags</h4>' +
10241025
'</section>' +
10251026
'<section id="space-filler"></section>'+
1026-
'<section id="sidebar-settings">' +
1027-
'<h4>Settings</h4>' +
1028-
'</section>' +
1029-
'<section id="sidebar-context" data-toggle="tooltip" data-placement="right" title="' + self.currentContext + '">' +
1030-
'<h4>Change Context</h4>' +
1027+
'<section id="sidebar-home" tabindex="0">' +
1028+
'<h4>Home</h4>' +
10311029
'</section>' +
10321030
'<section id="sidebar-vscode">' +
1033-
'<h4><a href="vscode-workspace" target="_blank">Code Workspace</a></h4>' +
1031+
'<h4><a href="vscode-workspace" target="_blank" tabindex="0">Code Workspace</a></h4>' +
10341032
'</section>' +
1035-
'<section id="sidebar-home">' +
1036-
'<h4>Home</h4>' +
1033+
'<section id="sidebar-context" data-toggle="tooltip" data-placement="right" title="' + self.currentContext + '" tabindex="0">' +
1034+
'<h4>Change Context</h4>' +
1035+
'</section>' +
1036+
'<section id="sidebar-settings" tabindex="0">' +
1037+
'<h4>Settings</h4>' +
10371038
'</section>' +
10381039
'</div>' +
10391040
'</div>')[0];
10401041

10411042
if (webui.viewonly) {
10421043
$("#sidebar-workspace", self.element).remove();
10431044
} else {
1045+
function onKeydown(e, outcome) {
1046+
if (e.key === "Enter" || e.key === " ") {
1047+
outcome()
1048+
}
1049+
}
1050+
10441051
var workspaceElement = $("#sidebar-workspace h4", self.element);
1045-
workspaceElement.click(function (event) {
1052+
function navigateToWorkspace() {
10461053
$("*", self.element).removeClass("active");
10471054
workspaceElement.addClass("active");
10481055
self.mainView.workspaceView.show();
1056+
}
1057+
workspaceElement.click(function (event) {
1058+
navigateToWorkspace()
10491059
});
1060+
workspaceElement.on("keydown", function (e) {
1061+
onKeydown(e,navigateToWorkspace)
1062+
})
10501063

10511064
var stashElement = $("#sidebar-stash h4", self.element);
1052-
stashElement.click(function (event) {
1065+
function navigateToStash() {
10531066
$("*", self.element).removeClass("active");
10541067
stashElement.addClass("active");
10551068
self.mainView.stashView.update(0);
1069+
}
1070+
stashElement.click(function (event) {
1071+
navigateToStash()
10561072
});
1073+
stashElement.on("keydown", function (e) {
1074+
onKeydown(e,navigateToStash)
1075+
})
10571076

10581077
var discardedElement = $("#sidebarDiscarded", self.element);
1059-
discardedElement.click(function() {
1078+
function navigateToDiscard() {
10601079
$("*", self.element).removeClass("active");
10611080
discardedElement.addClass("active");
10621081
self.mainView.discardedView.show();
1082+
}
1083+
discardedElement.click(function() {
1084+
navigateToDiscard()
10631085
});
1086+
discardedElement.on("keydown", function (e) {
1087+
onKeydown(e,navigateToDiscard)
1088+
})
10641089

10651090
$(".btn-add", self.element).click(self.createNewLocalBranch);
10661091
$('.btn-prune-remote-branches', self.element).click(self.pruneRemoteBranches);
10671092
$("#sidebar-settings", self.element).click(self.goToSettingsPage);
1093+
$("#sidebar-settings", self.element).on("keydown", function (e) {
1094+
if (e.key === "Enter" || e.key === " ") {
1095+
self.goToSettingsPage();
1096+
}
1097+
});
10681098
$("#sidebar-context", self.element).click(function() {
10691099
self.changeContextGet(0);
10701100
});
1101+
$("#sidebar-context", self.element).on("keydown", function (e) {
1102+
if (e.key === "Enter" || e.key === " ") {
1103+
self.changeContextGet(0);
1104+
}
1105+
});
10711106
$("#sidebar-home", self.element).click(self.goToHomePage);
1107+
$("#sidebar-home", self.element).on("keydown", function (e) {
1108+
if (e.key === "Enter" || e.key === " ") {
1109+
self.goToHomePage();
1110+
}
1111+
});
10721112
}
10731113

10741114
// Removing the link to home if not a top-level page
@@ -1350,12 +1390,12 @@ webui.LogView = function(historyView) {
13501390
if (type == 'revert') {
13511391
webui.git_command(["revert", "--no-commit","HEAD"], function(output) {
13521392
webui.showSuccess(output);
1353-
updateSideBar();;
1393+
updateSideBar();
13541394
});
13551395
} else if (type == 'hardReset') {
13561396
webui.git_command(["reset", "--hard", "HEAD~1"], function(output) {
13571397
webui.showSuccess(output);
1358-
updateSideBar();;
1398+
updateSideBar();
13591399
});
13601400
}
13611401

git-webui/src/share/git-webui/webui/css/git-webui.less

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,22 @@ body {
179179
.btn-sidebar-icon {
180180
padding: 2% 5%;
181181
}
182+
183+
.btn-sidebar-icon:focus-visible {
184+
outline: 2px solid white;
185+
outline-offset: 2px;
186+
box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.4);
187+
}
188+
189+
.btn-sidebar-icon:focus {
190+
outline: 2px solid white;
191+
outline-offset: 2px;
192+
box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.4);
193+
}
182194

183195
.btn-ok {
184196
float: right;
185-
margin-top: -0.6rem;
197+
margin-top: -1.9rem;
186198
margin-right:0.8rem;
187199
}
188200

git-webui/src/share/git-webui/webui/js/git-webui.js

Lines changed: 62 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -519,10 +519,11 @@ webui.SideBarView = function(mainView, noEventHandlers) {
519519
if($("#btn_createList").length == 0){
520520
var newBranchForm = $('#sidebar-local-branches');
521521

522-
var inputForm = '<button type="submit" class="btn btn-md btn-default btn-ok" id="btn_createList">' +
522+
var inputForm = '<input type="text" class="form-control form-control-xs" id="newBranchName"/>' +
523+
'<button type="submit" class="btn btn-md btn-default btn-ok" id="btn_createList">' +
523524
webui.checkIcon+
524-
'</button>' +
525-
'<input type="text" class="form-control form-control-xs" id="newBranchName"/>'
525+
'</button>'
526+
526527
newBranchForm.append(inputForm);
527528
$("#sidebar-local-branches input").focus();
528529
}
@@ -994,81 +995,120 @@ webui.SideBarView = function(mainView, noEventHandlers) {
994995
self.mainView = mainView;
995996
self.currentContext = self.getCurrentContext();
996997
self.element = $( '<div id="sidebar">' +
997-
'<a href="#" data-toggle="modal" data-target="#help-modal"><img id="sidebar-logo" src="img/git-logo.png"></a>' +
998+
'<a href="#" data-toggle="modal" data-target="#help-modal" tabindex="0"><img id="sidebar-logo" src="img/git-logo.png"></a>' +
998999
'<h5 id="packageVersion"></h5>' +
9991000
'<h4 id="environment"></h4>'+
10001001
'<div id="sidebar-content">' +
10011002
'<section id="sidebar-workspace">' +
1002-
'<h4>Workspace</h4>' +
1003+
'<h4 tabindex="0">Workspace</h4>' +
10031004
'</section>' +
10041005
'<section id="sidebar-stash">' +
1005-
'<h4>Stash</h4>' +
1006+
'<h4 tabindex="0">Stash</h4>' +
10061007
'</section>' +
10071008
'<section id="sidebarDiscarded">' +
1008-
'<h4>Discarded Files</h4>' +
1009+
'<h4 tabindex="0">Discarded Files</h4>' +
10091010
'</section>' +
1010-
'<section id="sidebar-local-branches">' +
1011+
'<section id="sidebar-local-branches" >' +
10111012
'<h4 class="mt-1">Local Branches' +
1012-
'<button type="button" class="btn btn-default btn-sidebar-icon btn-add shadow-none" title="Create new branch">' +
1013+
'<button type="button" class="btn btn-default btn-sidebar-icon btn-add shadow-none" title="Create new branch" tabindex="0">' +
10131014
webui.circlePlusIcon+
10141015
'</button>' + '</h4>' +
10151016
'</section>' +
1016-
'<section id="sidebar-remote-branches">' +
1017+
'<section id="sidebar-remote-branches" >' +
10171018
'<h4 class="mt-1">Remote Branches' +
1018-
'<button type="button" class="btn btn-default btn-sidebar-icon btn-prune-remote-branches shadow-none" title="Git fetch of remote branches">'+
1019+
'<button type="button" class="btn btn-default btn-sidebar-icon btn-prune-remote-branches shadow-none" title="Git fetch of remote branches" tabindex="0 ">'+
10191020
webui.refreshIcon+
10201021
'</button>' +'</h4>' +
10211022
'</section>' +
10221023
'<section id="sidebar-tags">' +
10231024
'<h4>Tags</h4>' +
10241025
'</section>' +
10251026
'<section id="space-filler"></section>'+
1026-
'<section id="sidebar-settings">' +
1027-
'<h4>Settings</h4>' +
1028-
'</section>' +
1029-
'<section id="sidebar-context" data-toggle="tooltip" data-placement="right" title="' + self.currentContext + '">' +
1030-
'<h4>Change Context</h4>' +
1027+
'<section id="sidebar-home" tabindex="0">' +
1028+
'<h4>Home</h4>' +
10311029
'</section>' +
10321030
'<section id="sidebar-vscode">' +
1033-
'<h4><a href="vscode-workspace" target="_blank">Code Workspace</a></h4>' +
1031+
'<h4><a href="vscode-workspace" target="_blank" tabindex="0">Code Workspace</a></h4>' +
10341032
'</section>' +
1035-
'<section id="sidebar-home">' +
1036-
'<h4>Home</h4>' +
1033+
'<section id="sidebar-context" data-toggle="tooltip" data-placement="right" title="' + self.currentContext + '" tabindex="0">' +
1034+
'<h4>Change Context</h4>' +
1035+
'</section>' +
1036+
'<section id="sidebar-settings" tabindex="0">' +
1037+
'<h4>Settings</h4>' +
10371038
'</section>' +
10381039
'</div>' +
10391040
'</div>')[0];
10401041

10411042
if (webui.viewonly) {
10421043
$("#sidebar-workspace", self.element).remove();
10431044
} else {
1045+
function onKeydown(e, outcome) {
1046+
if (e.key === "Enter" || e.key === " ") {
1047+
outcome()
1048+
}
1049+
}
1050+
10441051
var workspaceElement = $("#sidebar-workspace h4", self.element);
1045-
workspaceElement.click(function (event) {
1052+
function navigateToWorkspace() {
10461053
$("*", self.element).removeClass("active");
10471054
workspaceElement.addClass("active");
10481055
self.mainView.workspaceView.show();
1056+
}
1057+
workspaceElement.click(function (event) {
1058+
navigateToWorkspace()
10491059
});
1060+
workspaceElement.on("keydown", function (e) {
1061+
onKeydown(e,navigateToWorkspace)
1062+
})
10501063

10511064
var stashElement = $("#sidebar-stash h4", self.element);
1052-
stashElement.click(function (event) {
1065+
function navigateToStash() {
10531066
$("*", self.element).removeClass("active");
10541067
stashElement.addClass("active");
10551068
self.mainView.stashView.update(0);
1069+
}
1070+
stashElement.click(function (event) {
1071+
navigateToStash()
10561072
});
1073+
stashElement.on("keydown", function (e) {
1074+
onKeydown(e,navigateToStash)
1075+
})
10571076

10581077
var discardedElement = $("#sidebarDiscarded", self.element);
1059-
discardedElement.click(function() {
1078+
function navigateToDiscard() {
10601079
$("*", self.element).removeClass("active");
10611080
discardedElement.addClass("active");
10621081
self.mainView.discardedView.show();
1082+
}
1083+
discardedElement.click(function() {
1084+
navigateToDiscard()
10631085
});
1086+
discardedElement.on("keydown", function (e) {
1087+
onKeydown(e,navigateToDiscard)
1088+
})
10641089

10651090
$(".btn-add", self.element).click(self.createNewLocalBranch);
10661091
$('.btn-prune-remote-branches', self.element).click(self.pruneRemoteBranches);
10671092
$("#sidebar-settings", self.element).click(self.goToSettingsPage);
1093+
$("#sidebar-settings", self.element).on("keydown", function (e) {
1094+
if (e.key === "Enter" || e.key === " ") {
1095+
self.goToSettingsPage();
1096+
}
1097+
});
10681098
$("#sidebar-context", self.element).click(function() {
10691099
self.changeContextGet(0);
10701100
});
1101+
$("#sidebar-context", self.element).on("keydown", function (e) {
1102+
if (e.key === "Enter" || e.key === " ") {
1103+
self.changeContextGet(0);
1104+
}
1105+
});
10711106
$("#sidebar-home", self.element).click(self.goToHomePage);
1107+
$("#sidebar-home", self.element).on("keydown", function (e) {
1108+
if (e.key === "Enter" || e.key === " ") {
1109+
self.goToHomePage();
1110+
}
1111+
});
10721112
}
10731113

10741114
// Removing the link to home if not a top-level page

0 commit comments

Comments
 (0)