v0.14.0 76d1892

types.ts RawHistoryFolder

1/**
2 * Omnibox Component Types
3 *
4 * TypeScript interfaces for omnibox/find functionality that match Go structs
5 */
6
7export interface Suggestion {
8  url: string;
9  favicon?: string;
10}
11
12export interface Favorite {
13  id: number;
14  url: string;
15  title: string;
16  favicon_url: string;
17  position: number;
18}
19
20export interface SearchShortcut {
21  url: string;
22  description: string;
23}
24
25export interface OmniboxMessage {
26  type: "navigate" | "query" | "get_search_shortcuts" | "get_favorites" | "toggle_favorite" | "is_favorite";
27  url?: string;
28  q?: string;
29  limit?: number;
30  title?: string;
31  faviconURL?: string;
32}
33
34export interface FindMatch {
35  element: HTMLElement;
36  context: string;
37}
38
39export interface HighlightNode {
40  span: HTMLElement;
41  text: Text;
42}
43
44export type OmniboxMode = "omnibox" | "find";
45export type ViewMode = "history" | "favorites";
46
47export interface OmniboxConfig {
48  maxMatches?: number;
49  debounceDelay?: number;
50  defaultLimit?: number;
51}
52
53export interface OmniboxState {
54  visible: boolean;
55  mode: OmniboxMode;
56  viewMode: ViewMode;
57  suggestions: Suggestion[];
58  favorites: Favorite[];
59  matches: FindMatch[];
60  selectedIndex: number;
61  activeIndex: number;
62  faded: boolean;
63  inputValue: string;
64  highlightNodes: HighlightNode[];
65  prevOverflow: string;
66  searchShortcuts: Record<string, SearchShortcut>;
67}
68
69// Message bridge interface for Go communication
70export interface OmniboxMessageBridge {
71  postMessage(msg: OmniboxMessage): void;
72  setSuggestions(suggestions: Suggestion[]): void;
73}
74
75// Global API for Go bridge
76export interface OmniboxAPI {
77  setSuggestions: (suggestions: Suggestion[]) => void;
78  toggle: () => void;
79  open: (mode?: OmniboxMode, query?: string) => void;
80  close: () => void;
81  findQuery: (query: string) => void;
82}

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