getkirby / kirby

Kirby's core application folder
https://getkirby.com
Other
1.27k stars 167 forks source link

The search box in the pages field doesn't find subpages #4878

Closed MoritzLost closed 1 year ago

MoritzLost commented 1 year ago

Description

A pages field with the option subpages: true and search: true shows both a search box and a little arrow icon next to pages with subpages. However, the search box only finds pages at the currently selected level. This is unintuitive and unexpected – as a user, I would expect the search field to search across all selectable pages.

Here's a video demonstrating the issue:

https://user-images.githubusercontent.com/10146880/205280237-682d3582-8261-486b-bcca-822ec1e9217a.mov

The Team page is nested under the Demo page. Searching for Team in the search box yields no results at the top level, and only finds the page if I'm viewing that folder. For a site with lots of pages (in particular nested pages), using the search box to find the page I'm looking for instead of manually navigating to the page tree is much easier and quicker, but isn't possible because of this.

Expected behavior

The search box in the pages field should search across all selectable pages, not just the current level.

To reproduce

  1. Create a page with some nested pages.
  2. Open a pages field with search: true and subpages: true.
  3. Type in the title of one of the nested pages, the search will yield no result.

Your setup

Kirby Version
3.8.1.1

Your system (please complete the following information)

distantnative commented 1 year ago

Just to manage expectations: This will take some time. As far as I can tell, it won't make much sense to tackle this issue before we have refactored the picker fields in a better way. And that alone is a bigger project. Nevertheless, I do agree with your expected behaviour.

afbora commented 1 year ago

I suggest moving this to backlog or nolt.

distantnative commented 1 year ago

@afbora is right. This works as implemented/expected currently. I get the request, but it is indeed more a feature. Moved it over: https://kirby.nolt.io/494 - please make sure to upvote.

MoritzLost commented 1 year ago

@distantnative Thanks for creating an issue! Though I'm not sure I agree that this is not a bug. From a user perspective (especially for editors with not a lot of technical experience), this definitely feels like a bug. If I can manually find a page but the search can't, then the search is broken. The fact that the search doesn't find subpages because of technical implementation details doesn't matter at all to the end-user – what matters is learned behaviour. A search box usually search across everything (without the current scope), so that's what will be expected.

As long as the search box doesn't work as most users would expect it to, it will unfortunately never make sense to display it at all. So in my opinion this should receive more attention, not be pushed to some feature request board to never be touched again. Anyway, I've upvoted the request on nolt.

distantnative commented 1 year ago

I totally get your perspective and it can be frustrating when a feature doesn't do what you want it to do. But it is right now implemented as a filter of the list of entries, not a multi-hierarchical search. You can disagree with the decision to do it like that. But it doesn't make sense to have it as a bug when it works as the objective behind the implementation expects it to do.