Search across containers, volumes and images #21
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Design notes for #21 from Nye (research, tested on Qt 6.8):
#21 Global search — recommended approach (Nye, Nov 30)
Shape: a Ctrl+K palette (
SearchPalette.qml, a modalPopupnear the top of the window) plus a "Search Ctrl+K" entry at the top of the sidebar that opens it. Type to filter, Up/Down to move, Enter to jump, Escape to close. Results are grouped by kind (Projects, Containers, Volumes, Images, Networks), with up to 6 per kind and a "Show all N in " row.Tested: a QML
Shortcut { sequences: ["Ctrl+K"] }in an ApplicationWindow fires even while a TextField has focus. Qt 6.8 TextInput doesn't take Ctrl+K as delete-to-end, and the field's text stays as it was. So no Keys handlers are needed. Use the window-level Shortcut (default context WindowShortcut).Data: no new Rust. Everything is already parsed in QML:
window.groups/window.byKey(Main.qml l.24-52). Keys:stack:<project>,container:<id>.volumesPage.volumes(fromContainerModel.volumes_json). Keyvolume:<name>.imagesPage.images. Keyimage:<id>.Matching: reuse the per-page search. Move
ResourceList.matches()(l.38-47) andContainerList.matches()(l.27-31) into oneui/qml/search.js(.pragma library,matches(item, fields, q)). The pages and the palette then use the same function and fields: containers title/name/image/project; volumes name/driver/project; images repo/tags/shortId; networks name/driver. List the .js in build.rs if qml files are listed there (check that cxx-qt's qml_module takes a qml_files .js; if not, put the function in a smallSearch.qmlsingleton like Theme). Ranking: exact > prefix > word-start > substring, then running before stopped, then name.Jump (the fiddly part):
select(key)(Main l.290). If the container is inside a collapsed stack, expand it first (ContainerList.collapsedl.14: expose anexpand(stackKey)).page, thenvolumesPage.selectedKey/imagesPage.selectedKey(Main already does this in its screenshot scenes, l.356/361).clearSearch()on ResourceList/ContainerList.moveSelectionscrolls). AddonSelectedKeyChanged: positionViewAtIndex(..., ListView.Contain)to both lists.Must-dos for review:
byKey[key]before selecting.searchscreenshot scene (palette open with "shop": project + 4 containers + volumeshop_db+ image), README features list updated.