feat(shortcut): Add keyboard shortcuts for repository file and code search

Add GitHub-like keyboard shortcuts for repository navigation:
- Press 'T' to focus the "Go to file" search input
- Press 'S' to focus the "Search code" input
- Press 'Escape' to blur focused search inputs

Both search inputs display a keyboard hint (kbd element) showing
the available shortcut. The hint hides when the input is focused
or has a value.

Includes unit tests and e2e tests for the new functionality.
This commit is contained in:
micahkepe authored and Micah Kepe committed 2026-02-14 22:43:52 -08:00
1 parent a6282c98d7
commit 7226ecde9a
7 files changed
+460 -4

No files matched your search

+39
View File
@@ -2064,3 +2064,42 @@ tbody.commit-list {
.branch-selector-dropdown .scrolling.menu .loading-indicator {
height: 4em;
}
/* Keyboard shortcut hint styles for repo search inputs */
.repo-code-search-input-wrapper {
position: relative;
}
.repo-code-search-input-wrapper input {
padding-right: 32px !important;
}
.repo-search-shortcut-hint {
position: absolute;
right: 40px; /* account for the search button */
top: 50%;
transform: translateY(-50%);
display: inline-block;
padding: 2px 6px;
font-size: 11px;
line-height: 14px;
color: var(--color-text-light-2);
background-color: var(--color-box-body);
border: 1px solid var(--color-secondary);
border-radius: var(--border-radius);
box-shadow: inset 0 -1px 0 var(--color-secondary);
pointer-events: none;
z-index: 1;
}
/* Override Fomantic UI action input styles for file search - need high specificity */
.repo-file-search-input-wrapper.ui.input input,
.repo-file-search-input-wrapper.ui.input input:hover {
border-right: 1px solid var(--color-input-border) !important;
border-top-right-radius: 0.28571429rem !important;
border-bottom-right-radius: 0.28571429rem !important;
}
.repo-file-search-input-wrapper.ui.input input:focus {
border-color: var(--color-primary) !important;
}