001_history.sql RawHistoryFolder

1-- +goose Up
2-- History tracking for visited URLs
3
4CREATE TABLE IF NOT EXISTS history (
5    id INTEGER PRIMARY KEY AUTOINCREMENT,
6    url TEXT NOT NULL UNIQUE,
7    title TEXT,
8    favicon_url TEXT,
9    visit_count INTEGER DEFAULT 1,
10    last_visited DATETIME DEFAULT CURRENT_TIMESTAMP,
11    created_at DATETIME DEFAULT CURRENT_TIMESTAMP
12);
13
14CREATE INDEX IF NOT EXISTS idx_history_url ON history(url);
15CREATE INDEX IF NOT EXISTS idx_history_last_visited ON history(last_visited);
16CREATE INDEX IF NOT EXISTS idx_history_visit_count_last_visited ON history(visit_count DESC, last_visited DESC);
17
18-- FTS5 for history search
19CREATE VIRTUAL TABLE IF NOT EXISTS history_fts USING fts5(
20    url,
21    title,
22    content='history',
23    content_rowid='id'
24);
25
26-- Triggers to keep FTS in sync
27-- +goose StatementBegin
28CREATE TRIGGER IF NOT EXISTS history_fts_insert AFTER INSERT ON history BEGIN
29    INSERT INTO history_fts(rowid, url, title) VALUES (NEW.id, NEW.url, NEW.title);
30END;
31-- +goose StatementEnd
32
33-- +goose StatementBegin
34CREATE TRIGGER IF NOT EXISTS history_fts_delete AFTER DELETE ON history BEGIN
35    INSERT INTO history_fts(history_fts, rowid, url, title) VALUES('delete', OLD.id, OLD.url, OLD.title);
36END;
37-- +goose StatementEnd
38
39-- +goose StatementBegin
40CREATE TRIGGER IF NOT EXISTS history_fts_update AFTER UPDATE ON history BEGIN
41    INSERT INTO history_fts(history_fts, rowid, url, title) VALUES('delete', OLD.id, OLD.url, OLD.title);
42    INSERT INTO history_fts(rowid, url, title) VALUES (NEW.id, NEW.url, NEW.title);
43END;
44-- +goose StatementEnd
45
46-- +goose Down
47DROP TRIGGER IF EXISTS history_fts_update;
48DROP TRIGGER IF EXISTS history_fts_delete;
49DROP TRIGGER IF EXISTS history_fts_insert;
50DROP TABLE IF EXISTS history_fts;
51DROP TABLE IF EXISTS history;

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