feat: global search with Ctrl+K across containers, projects, volumes, images and networks #31

Merged
jfro merged 3 commits from feat/21-global-search into main 2026-11-30 21:27:49 +00:00
Owner

Closes #21

What

  • Ctrl+K (or Search at the top of the sidebar) opens a search palette over any page. It matches compose projects, containers, volumes, images and networks, grouped by kind (up to 6 each, plus "Show all N in ").
  • Ranking: exact > prefix > word start > substring, then running/in use first, then name. Data comes from what the window already has: no engine call per keystroke.
  • Enter / click jumps to the item: switches page, clears that page's search if it would hide the item, expands a collapsed compose project, selects it and scrolls it into view. A result that disappeared while the palette was open is ignored.
  • Show all switches to the page and fills in its own search field with the query.
  • The pages and the palette share one matcher (ui/qml/Search.qml, a singleton like Theme), so a page search and global search agree on fields: containers title/name/image/project, volumes name/driver/project, images repo/tags/id, networks name/driver/project/subnet.
  • Ctrl+K works from any page and with focus in a search field; it does nothing while a dialog is open (no stacked popups) and closes the sidebar menus. Escape closes it and gives focus back; an empty query shows a hint.
  • Mock search screenshot scene ("shop": project, 4 containers, 2 volumes, image, network). README features + screenshot table updated. Every screenshot changed because the sidebar now has the Search entry.

Tested

  • Local CI (fmt, clippy ×2 with -D warnings, build, tests ×2, mock build).
  • By hand with --mock --show: Ctrl+K from a focused page search; jump to a volume (page switch + select); jump to a container inside a collapsed project while the Containers search held an unrelated filter (filter cleared, project expanded, row selected).

Screenshot
search
search, light

Stacked on #30 (#14) → #29 (#13).

Closes #21 **What** - **Ctrl+K** (or **Search** at the top of the sidebar) opens a search palette over any page. It matches compose projects, containers, volumes, images and networks, grouped by kind (up to 6 each, plus "Show all N in <page>"). - Ranking: exact > prefix > word start > substring, then running/in use first, then name. Data comes from what the window already has: no engine call per keystroke. - **Enter / click jumps** to the item: switches page, clears that page's search if it would hide the item, expands a collapsed compose project, selects it and scrolls it into view. A result that disappeared while the palette was open is ignored. - **Show all** switches to the page and fills in its own search field with the query. - The pages and the palette share one matcher (`ui/qml/Search.qml`, a singleton like Theme), so a page search and global search agree on fields: containers title/name/image/project, volumes name/driver/project, images repo/tags/id, networks name/driver/project/subnet. - Ctrl+K works from any page and with focus in a search field; it does nothing while a dialog is open (no stacked popups) and closes the sidebar menus. Escape closes it and gives focus back; an empty query shows a hint. - Mock `search` screenshot scene ("shop": project, 4 containers, 2 volumes, image, network). README features + screenshot table updated. Every screenshot changed because the sidebar now has the Search entry. **Tested** - Local CI (fmt, clippy ×2 with -D warnings, build, tests ×2, mock build). - By hand with `--mock --show`: Ctrl+K from a focused page search; jump to a volume (page switch + select); jump to a container inside a collapsed project while the Containers search held an unrelated filter (filter cleared, project expanded, row selected). **Screenshot** ![search](https://git.knope.dev/attachments/049093ca-b3b6-4dfd-bb8d-10bab35a605f) ![search, light](https://git.knope.dev/attachments/3bb3eeee-c7a8-49f4-978f-534e14d798bb) Stacked on #30 (#14) → #29 (#13).
feat: global search with Ctrl+K across containers, projects, volumes, images and networks
All checks were successful
CI / test (pull_request) Successful in 5m6s
fcfedce08a
A search palette (Ctrl+K, or Search at the top of the sidebar) matches
compose projects, containers, volumes, images and networks from what the
window already holds, with no engine call per keystroke. Results are
grouped by kind, up to six each, ranked exact > prefix > word start >
substring, then running first, then by name. Enter or a click jumps to
the item: it switches page, clears a page search that would hide it,
expands its collapsed project and scrolls it into view. "Show all N in
<page>" fills in that page's own search.

The pages and the palette share one matcher (Search.qml). Ctrl+K works
from any page and from the search fields, but not over an open dialog.
Escape closes it and gives focus back.

Closes #21
jfro added this to the v1.0 milestone 2026-11-30 20:48:54 +00:00
jfro changed target branch from feat/14-debug-shell to main 2026-11-30 20:50:24 +00:00
fix: open global search with Ctrl+K from read-only text (logs, info, file preview)
All checks were successful
CI / test (pull_request) Successful in 5m11s
23b6506f00
Read-only TextEdit/TextArea take Ctrl+K as delete-to-end-of-line before the
window Shortcut sees it. Those editors now forward it to Search.paletteRequested.
Author
Owner

F14 (from Nye's review): Ctrl+K did nothing with focus in the log view, an info value or the Files preview. Read-only TextEdit/TextArea take Ctrl+K (delete to end of line) before the window Shortcut sees it.

Fixed in 23b6506: each read-only editor forwards Ctrl+K with Keys.onPressed: event => Search.forwardShortcut(event), and Main opens the palette on Search.paletteRequested. Copy and selection still work, and a plain K is ignored. Checked live in --mock --show from the log view and an info row; local CI green.

**F14 (from Nye's review):** Ctrl+K did nothing with focus in the log view, an info value or the Files preview. Read-only `TextEdit`/`TextArea` take Ctrl+K (delete to end of line) before the window `Shortcut` sees it. **Fixed in 23b6506:** each read-only editor forwards Ctrl+K with `Keys.onPressed: event => Search.forwardShortcut(event)`, and Main opens the palette on `Search.paletteRequested`. Copy and selection still work, and a plain K is ignored. Checked live in `--mock --show` from the log view and an info row; local CI green.
jfro left a comment

Review from Nye (posted for it; its token can't comment)

PR #31 (#21 global search) review — Nye, at fcfedce

Gates: fmt, clippy (+mock), build (+mock), 51 tests: pass (C17).
By hand (--mock --show): Ctrl+K from page search field OK; blocked over Pull dialog OK; jump to stopped
container hidden by page filter (filter cleared) OK; child of collapsed stack (expanded) OK; image by short
ID with Images filter set (cleared) OK; Show all 7 in Containers fills page search OK; Escape returns focus OK.

F14 (medium) — Ctrl+K does nothing with focus in the log view

The read-only, selectable TextEdit on each log line (LogView.qml:330) accepts the Ctrl+K ShortcutOverride,
so Main.qml's window Shortcut never fires. Same elements: InfoRow.qml:106 TextEdit, FilesView.qml:425 TextArea.
Proof: tst_ctrlk.qml (qmltestrunner, offscreen) fails test_log_view_focused.
QT_QPA_PLATFORM=offscreen /usr/lib/qt6/bin/qmltestrunner -input tst_ctrlk.qml
Fix that works (tst_ctrlk_fixed.qml passes): the key press still reaches the TextEdit, so handle it there:
Keys.onPressed: event => { if (event.key === Qt.Key_K && (event.modifiers & Qt.ControlModifier)) { ; event.accepted = true } }
e.g. a signal searchRequested() / a shared handler, or reach window.openSearch(). Apply to LogView, InfoRow, FilesView preview.
Please run tst_ctrlk.qml-style check against the real elements, or tell me and I'll recheck live.

Low notes (not blocking)

  1. Enter picks the top of the first group: "nginx" opens the web container (image nginx:...) though the
    Images group has an exact "nginx". Consider ordering groups by their best rank.
  2. Stack rows now match the page filter on title/name only (before: title/name/image/project). Fine if
    stacks never carry those fields; worth a glance.
  3. Not tried: scrolling to a far-down row (window wouldn't shrink here); the code path looks right.
**Review from Nye** (posted for it; its token can't comment) # PR #31 (#21 global search) review — Nye, at fcfedce Gates: fmt, clippy (+mock), build (+mock), 51 tests: pass (C17). By hand (--mock --show): Ctrl+K from page search field OK; blocked over Pull dialog OK; jump to stopped container hidden by page filter (filter cleared) OK; child of collapsed stack (expanded) OK; image by short ID with Images filter set (cleared) OK; Show all 7 in Containers fills page search OK; Escape returns focus OK. ## F14 (medium) — Ctrl+K does nothing with focus in the log view The read-only, selectable TextEdit on each log line (LogView.qml:330) accepts the Ctrl+K ShortcutOverride, so Main.qml's window Shortcut never fires. Same elements: InfoRow.qml:106 TextEdit, FilesView.qml:425 TextArea. Proof: tst_ctrlk.qml (qmltestrunner, offscreen) fails test_log_view_focused. QT_QPA_PLATFORM=offscreen /usr/lib/qt6/bin/qmltestrunner -input tst_ctrlk.qml Fix that works (tst_ctrlk_fixed.qml passes): the key press still reaches the TextEdit, so handle it there: Keys.onPressed: event => { if (event.key === Qt.Key_K && (event.modifiers & Qt.ControlModifier)) { <open search>; event.accepted = true } } e.g. a `signal searchRequested()` / a shared handler, or reach window.openSearch(). Apply to LogView, InfoRow, FilesView preview. Please run tst_ctrlk.qml-style check against the real elements, or tell me and I'll recheck live. ## Low notes (not blocking) 1. Enter picks the top of the first group: "nginx" opens the web container (image nginx:...) though the Images group has an exact "nginx". Consider ordering groups by their best rank. 2. Stack rows now match the page filter on title/name only (before: title/name/image/project). Fine if stacks never carry those fields; worth a glance. 3. Not tried: scrolling to a far-down row (window wouldn't shrink here); the code path looks right.
fix: list global search groups by their best match so Enter picks the closest hit
All checks were successful
CI / test (pull_request) Successful in 5m12s
CI / test (push) Successful in 5m15s
4877570794
Author
Owner

Low notes from Nye's review:

  1. Enter picked the top of the first group: fixed in 4877570. Groups are now ordered by their best match (ties keep the usual kind order), so "nginx" lists Images (exact nginx) first, then the web container. Tried live with --mock. Local CI green (fmt, clippy, build, tests, +mock). The README search screenshot ("shop") is unchanged.
  2. Stack rows matching on title/name only: stacks carry only name/title (no image or project fields; see src/window/data.rs stack JSON), so nothing was lost.
  3. Scrolling to a far-down row: not tried live either; same path as the other pages.
**Low notes from Nye's review:** 1. Enter picked the top of the first group: fixed in 4877570. Groups are now ordered by their best match (ties keep the usual kind order), so "nginx" lists Images (exact `nginx`) first, then the `web` container. Tried live with `--mock`. Local CI green (fmt, clippy, build, tests, +mock). The README search screenshot ("shop") is unchanged. 2. Stack rows matching on title/name only: stacks carry only `name`/`title` (no image or project fields; see `src/window/data.rs` stack JSON), so nothing was lost. 3. Scrolling to a far-down row: not tried live either; same path as the other pages.
jfro merged commit 4877570794 into main 2026-11-30 21:27:49 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jfro/krane!31
No description provided.