]> cloud.milkyroute.net Git - dolphin.git/commit
Rewrite search integration
authorFelix Ernst <felixernst@kde.org>
Mon, 7 Apr 2025 21:09:00 +0000 (21:09 +0000)
committerFelix Ernst <felixernst@kde.org>
Mon, 7 Apr 2025 21:09:00 +0000 (21:09 +0000)
commit4102ccb80457eea44ea280f0ace2a419602bc34b
tree841e039cf9864276c968a397a2ae75c363199342
parentbfc177d3d1bc5a4a241e35d59086e4824e7c0bd3
Rewrite search integration

This huge commit is a nearly complete rewrite of the Dolphin search
code. It implements most of the improved Dolphin search UI/UX as
designed and discussed in a collaborative effort by Kristen McWilliam,
Jin Liu, Andy Betts, Tagwerk, a few others and me.
See https://invent.kde.org/system/dolphin/-/issues/46.

# Notable changes

- A toggle to change the search tool is provided as most contributors
deemed that useful in
https://invent.kde.org/system/dolphin/-/merge_requests/642#note_985112.
- The default search is changed to filenamesearch for maximum
reliability.
- Removing all search parameters will take users back to the view state
prior to starting a search instead of keeping the search results open.
- The UI for choosing file types or modification dates has been made
more powerful with more granularity and more options.
- Most search parameters can be configured from a popup menu which
gives us extra space for extra clarity.
- Labels and help buttons as well as hyperlinks to settings makes sure
the user always knows why some search parameters are unavailable in
some contexts.
- Chips show important search parameters while the popup is closed.
They allow quickly removing filters.
- The titles of the search and the input field placeholder message
change to make clear whether file names or file contents are searched.
- When the user actively switches the search tool, whether content
should be searched, or whether to search everywhere, this is preserved
for the initial state of the search bar when the user opens it the next
time after restarting Dolphin.

# Architecture

- The new DolphinQuery class is independent of the UI and contains all
search parameters modifiable in Dolphin as easy setters and getters.
- DolphinQuery objects are also used to update the states of every
component in the search UI. There is now a clear separation of UI and
search configuration/DolphinQuery.
- DolphinQuery is responsible for exporting to and importing from
search URLs.
- The search UI always reflects the currently configured DolphinQuery
no matter if the user changed the UI to change the DolphinQuery or
loaded a DolphinQuery/older search URL which then is reflected in the
UI.
- I tried to simplify all classes and their interaction between each
other as much as possible.
- I added some tests

BUG: 386754
CCBUG: 435119
CCBUG: 458761
BUG: 446387
BUG: 470136
CCBUG: 471556
CCBUG: 475439
CCBUG: 477969
BUG: 480001
BUG: 483578
BUG: 488047
BUG: 488845
BUG: 500103
FIXED-IN: 25.08
39 files changed:
src/CMakeLists.txt
src/config-dolphin.h.cmake
src/dolphinmainwindow.cpp
src/dolphinrecenttabsmenu.cpp
src/dolphinviewcontainer.cpp
src/dolphinviewcontainer.h
src/global.h
src/search/bar.cpp [new file with mode: 0644]
src/search/bar.h [new file with mode: 0644]
src/search/barsecondrowflowlayout.cpp [new file with mode: 0644]
src/search/barsecondrowflowlayout.h [new file with mode: 0644]
src/search/chip.cpp [new file with mode: 0644]
src/search/chip.h [new file with mode: 0644]
src/search/configurationpopup.h [new file with mode: 0644]
src/search/dolphin_searchsettings.kcfg
src/search/dolphinfacetswidget.cpp [deleted file]
src/search/dolphinfacetswidget.h [deleted file]
src/search/dolphinquery.cpp
src/search/dolphinquery.h
src/search/dolphinsearchbox.cpp [deleted file]
src/search/dolphinsearchbox.h [deleted file]
src/search/popup.cpp [new file with mode: 0644]
src/search/popup.h [new file with mode: 0644]
src/search/selectors/dateselector.cpp [new file with mode: 0644]
src/search/selectors/dateselector.h [new file with mode: 0644]
src/search/selectors/filetypeselector.cpp [new file with mode: 0644]
src/search/selectors/filetypeselector.h [new file with mode: 0644]
src/search/selectors/minimumratingselector.cpp [new file with mode: 0644]
src/search/selectors/minimumratingselector.h [new file with mode: 0644]
src/search/selectors/tagsselector.cpp [new file with mode: 0644]
src/search/selectors/tagsselector.h [new file with mode: 0644]
src/search/updatablestateinterface.h [new file with mode: 0644]
src/search/widgetmenu.cpp [new file with mode: 0644]
src/search/widgetmenu.h [new file with mode: 0644]
src/tests/CMakeLists.txt
src/tests/dolphinmainwindowtest.cpp
src/tests/dolphinquerytest.cpp
src/tests/dolphinsearchbartest.cpp [new file with mode: 0644]
src/tests/dolphinsearchboxtest.cpp [deleted file]