detached 0269280

fix(omnibox): restore find highlight styling

commit
0269280d25d2404954a44e6bef21a612aef67c1d
author
bamen · · 2025-09-17 05:25 UTC
parent
4ab2302
signature
unsigned
1 file · +37 -1
M gui/src/components/omnibox/find.ts +37 -1
@@ -7,6 +7,40 @@
77 import type { FindMatch, HighlightNode } from './types';
88 import { omniboxStore } from './stores.svelte.ts';
99
10+// Track whether we've injected highlight styles into the main document.
11+let findStylesInjected = false;
12+
13+function ensureFindStyles(): void {
14+ if (findStylesInjected) {
15+ return;
16+ }
17+
18+ try {
19+ const style = document.createElement('style');
20+ style.id = 'dumber-find-styles';
21+ style.textContent = `
22+ .find-highlight {
23+ background-color: rgb(255 235 59);
24+ color: rgb(0 0 0);
25+ padding: 0 0.125rem;
26+ border-radius: 0.125rem;
27+ box-shadow: 0 0 0 1px rgb(200 185 0) inset;
28+ }
29+
30+ .find-active {
31+ background-color: rgb(255 152 0) !important;
32+ color: rgb(0 0 0);
33+ box-shadow: 0 0 0 1px rgb(179 107 0) inset !important;
34+ }
35+ `;
36+
37+ (document.head || document.documentElement).appendChild(style);
38+ findStylesInjected = true;
39+ } catch (error) {
40+ console.warn('Failed to inject find styles:', error);
41+ }
42+}
43+
1044 /**
1145 * Find text in the current page and highlight matches
1246 */
@@ -24,6 +58,8 @@ export function findInPage(query: string): void {
2458 return;
2559 }
2660
61+ ensureFindStyles();
62+
2763 // Get omnibox root to exclude from search
2864 const omniboxRoot = document.getElementById('dumber-omnibox-root');
2965 const matches: FindMatch[] = [];
@@ -199,4 +235,4 @@ export function jumpToMatch(delta: number): void {
199235
200236 omniboxStore.setSelectedIndex(newIndex);
201237 revealMatch(newIndex);
202-}⏎̸
238+}
@@ -7,6 +7,40 @@
7 import type { FindMatch, HighlightNode } from './types';7 import type { FindMatch, HighlightNode } from './types';
8 import { omniboxStore } from './stores.svelte.ts';8 import { omniboxStore } from './stores.svelte.ts';
9 9
10+// Track whether we've injected highlight styles into the main document.
11+let findStylesInjected = false;
12+
13+function ensureFindStyles(): void {
14+ if (findStylesInjected) {
15+ return;
16+ }
17+
18+ try {
19+ const style = document.createElement('style');
20+ style.id = 'dumber-find-styles';
21+ style.textContent = `
22+ .find-highlight {
23+ background-color: rgb(255 235 59);
24+ color: rgb(0 0 0);
25+ padding: 0 0.125rem;
26+ border-radius: 0.125rem;
27+ box-shadow: 0 0 0 1px rgb(200 185 0) inset;
28+ }
29+
30+ .find-active {
31+ background-color: rgb(255 152 0) !important;
32+ color: rgb(0 0 0);
33+ box-shadow: 0 0 0 1px rgb(179 107 0) inset !important;
34+ }
35+ `;
36+
37+ (document.head || document.documentElement).appendChild(style);
38+ findStylesInjected = true;
39+ } catch (error) {
40+ console.warn('Failed to inject find styles:', error);
41+ }
42+}
43+
10 /**44 /**
11 * Find text in the current page and highlight matches45 * Find text in the current page and highlight matches
12 */46 */
@@ -24,6 +58,8 @@ export function findInPage(query: string): void {
24 return;58 return;
25 }59 }
26 60
61+ ensureFindStyles();
62+
27 // Get omnibox root to exclude from search63 // Get omnibox root to exclude from search
28 const omniboxRoot = document.getElementById('dumber-omnibox-root');64 const omniboxRoot = document.getElementById('dumber-omnibox-root');
29 const matches: FindMatch[] = [];65 const matches: FindMatch[] = [];
@@ -199,4 +235,4 @@ export function jumpToMatch(delta: number): void {
199 235
200 omniboxStore.setSelectedIndex(newIndex);236 omniboxStore.setSelectedIndex(newIndex);
201 revealMatch(newIndex);237 revealMatch(newIndex);
202-}⏎̸238+}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 8

Tags 42

↑↓ moveenter openesc close