Skip to content

feat: search for tags in the global search and enhance the visually reasoning for matching results - #3558

Merged
AlexAndBear merged 11 commits into
mainfrom
feat/search-tags-or
Oct 7, 2026
Merged

AlexAndBear merged 11 commits into
mainfrom
feat/search-tags-or

Conversation

@AlexAndBear

@AlexAndBear AlexAndBear commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

Description

Experimental, meant for trying it out. The search term entered in the global search is also matched against tags, so typing a tag into the search bar finds the resources that have it. Each result shows why it was found: the found content and the matching tags.

  • Tag search: the search term also matches tags (tag:"*term*"), only if the server supports it (search.property.tag) and not in "Title only" mode.
  • Shared query: the search bar preview and the results page build the query the same way (buildSearchTerm).
  • Why found: each result shows the found content and the matching tags, also for tags picked in the "Tags" filter.
  • Match stays visible: in the one-line found content, the text before the match is cut off instead of the match.
  • OcTag: new xsmall size.
  • Tests: unit tests and a new e2e scenario in fullTextSearch.feature.

Tags match as substrings and case-insensitively (alpha finds the tag Project Alpha), like names.

Search for apollo: Protokoll-Teamsitzung.txt matches by tag, Apollo-Roadmap.md by name, Angebot-Nordwind.txt by content.

Search bar preview Results (tiles)
Search preview with a tag match, a name match and a content match Search results in tiles view with found content and matching tag

Known limitations (to evaluate before a production release)

Related Issue

How Has This Been Tested?

  • test environment: local dev server (pnpm vite) against the docker-compose backend, Chromium at 1440px and 412px
  • test case 1: a file whose name and content don't contain "test" but that has the tag testing is found when searching for "test", in the search bar preview and on the results page
  • test case 2: KQL checked against the server: tag:"*test*" finds testing, tag:"*alpha*" finds Project Alpha, matching is case-insensitive, tag:"test" (without wildcards) only finds exact tags
  • test case 3: found content and matching tags in the search bar preview, the results list and tiles; selecting a tag in the "Tags" filter shows it as matching tag
  • test case 4: exploratory Playwright run for the cut off snippet: tiles in every grid size (also via the "Grid size" slider) at 900/1400/1920px, list view while resizing, open sidebar, search bar preview on desktop and mobile, dark mode; match at the start, middle and end, multiple matches, short content, special characters. The first match was fully visible in every result
  • test case 5: unit tests (pnpm test:unit --run, all passing), vue-tsc --noEmit
  • test case 6: e2e search shows why a resource was found passes in Chromium (as in CI) and fails with the previous snippet truncation

Types of changes

  • Bugfix
  • Enhancement (a change that doesn't break existing code or deployments)
  • Breaking change (a modification that affects current functionality)
  • Technical debt (addressing code that needs refactoring or improvements)
  • Tests (adding or improving tests)
  • Documentation (updates or additions to documentation)
  • Maintenance (like dependency updates or tooling adjustments)

@AlexAndBear

Copy link
Copy Markdown
Member Author

@tbsbdr fyi

@AlexAndBear

Copy link
Copy Markdown
Member Author

Screenshots for a product decision: the search now shows why a file matched — the found content (as on the search page) and the matching tags. Example search term: apollo.

  • Apollo-Roadmap.md → matches by name
  • Protokoll-Teamsitzung.txt → matches by tag ("Apollo")
  • Angebot-Nordwind.txt → matches by content

Search preview (global search bar)

search-preview

Search results – list view

search-results-list

Search results – tiles view

search-results-tiles

Open questions

  1. List view: the matching tag is shown twice — in the tags column and below the match. Keep it, or show the match line only in the preview and tiles?
  2. Tiles view: the found content is truncated to one line, so the highlighted term may be cut off (see Angebot-Nordwind.txt). Should we center the snippet around the match or allow two lines?
  3. Highlighting style: content matches use the yellow marker, tag matches use the bold style of the file name. Is that fine?

@LHBL2003

LHBL2003 commented Oct 5, 2026

Copy link
Copy Markdown

Open questions

  1. Display in the list view: In my view, it is sufficient for the search result to be displayed once, for example in the ‘Tags’ column, provided that this column cannot be hidden.
  2. Tile view: If the item found can be centred automatically, it would be helpful to see straight away exactly what has been found.
  3. I particularly like the idea of highlighting the result in yellow. This helps the human eye to quickly focus on the exact location found. As far as I know, this also corresponds to the standard way of displaying search results in PDF files, which I find very helpful there too.

Especially on the iPhone, it’s often difficult to actually spot the matched section within a page when working with PDF files. I therefore generally find visual highlighting of search results very helpful. I find that many other products lack this kind of support for quickly locating search results. That’s why I think it’s very good from a user’s perspective.

@AlexAndBear

AlexAndBear commented Oct 6, 2026 •

Copy link
Copy Markdown
Member Author

Open questions

  1. Display in the list view: In my view, it is sufficient for the search result to be displayed once, for example in the ‘Tags’ column, provided that this column cannot be hidden.
  2. Tile view: If the item found can be centred automatically, it would be helpful to see straight away exactly what has been found.
  3. I particularly like the idea of highlighting the result in yellow. This helps the human eye to quickly focus on the exact location found. As far as I know, this also corresponds to the standard way of displaying search results in PDF files, which I find very helpful there too.

Especially on the iPhone, it’s often difficult to actually spot the matched section within a page when working with PDF files. I therefore generally find visual highlighting of search results very helpful. I find that many other products lack this kind of support for quickly locating search results. That’s why I think it’s very good from a user’s perspective.

Display in the list view: In my view, it is sufficient for the search result to be displayed once, for example in the ‘Tags’ column, provided that this column cannot be hidden.

It will be hidden on small screens and we only show 2 tags at a time, everything else is hidden under a + button, expanding the right sidebar. In general, I like the idea of having the "reasoning" or "why has this item been found" in the same place (Name, Content, Tags)

I particularly like the idea of highlighting the result in yellow. This helps the human eye to quickly focus on the exact location found. As far as I know, this also corresponds to the standard way of displaying search results in PDF files, which I find very helpful there too.

@tbsbdr @kulmann What do you think, we could change the appearance for search results across the whole ui, wouldn't cause any harm but make it even more visible on smaller screens (we have a lot of those search inputs, nowaydays). That's being said, its not that visually appealing IHMO. (out of scope for this pr)

@AlexAndBear

Copy link
Copy Markdown
Member Author

Regarding open question 2 from #3558 (comment):

Tiles view: the found content is truncated to one line, so the highlighted term may be cut off (see Angebot-Nordwind.txt). Should we center the snippet around the match or allow two lines?

Implemented centering in 535507d: the found content is split at the first match. The text before the match is cut off at its start (…), and the match plus the following text is cut off at its end. The text before the match only takes the remaining space, so the match itself is always fully visible. The snippet stays on one line, so tiles keep their height.

Angebot-Nordwind.txt (tiles)

1-nordwind-tiles

Tiles, grid size 2: match at start, middle, end, multiple matches, short content

2-tiles-grid-size-2

Tiles, smallest grid size (1920 px wide)

3-tiles-grid-size-1

List view

4-list-view

Search preview (mobile)

5-search-preview-mobile

Tested (Playwright, Chromium)

For every result, the first match was checked to be fully visible and not covered by the ellipsis, the snippet to stay on one line, and nothing to overflow the tile or row.

  • Tiles at every grid size (URL parameter and the "Grid size" slider in the view options), at 900, 1400 and 1920 px width
  • List view at 1400 and 900 px, and while resizing the window from 1400 to 600 px
  • Tiles with the sidebar open
  • Search preview in the global search bar, desktop and mobile
  • Mobile (Pixel 7): tiles and list view
  • Dark mode
  • Content: match at the start, in the middle and at the end, multiple matches, very short content, special characters and punctuation
  • Regressions: name-only matches (no snippet), tag filter only, tag filter combined with a search term

@AlexAndBear AlexAndBear changed the title feat: [experimental] search for tags in the global search feat: [experimental] search for tags in the global search and enhance the visually reasoning for matching results Oct 6, 2026
@LHBL2003

LHBL2003 commented Oct 6, 2026

Copy link
Copy Markdown

In general, I like the idea of having the "reasoning" or "why has this item been found" in the same place (Name, Content, Tags)

If the consider the area below the filename in the “Name” column as the place that explains why a search result was found, then listing the matching tags there makes perfect sense as well.

I would just suggest a minor visual adjustment: in my opinion, it would look clearer if the search results below the file name were indented at least as far as the file name itself. Ideally, the search result information could also be marked with a small search result icon – such as a magnifying glass with a text symbol – similar to the folder label.

image

@AlexAndBear

AlexAndBear commented Oct 6, 2026 •

Copy link
Copy Markdown
Member Author

In general, I like the idea of having the "reasoning" or "why has this item been found" in the same place (Name, Content, Tags)

If the consider the area below the filename in the “Name” column as the place that explains why a search result was found, then listing the matching tags there makes perfect sense as well.

I would just suggest a minor visual adjustment: in my opinion, it would look clearer if the search results below the file name were indented at least as far as the file name itself. Ideally, the search result information could also be marked with a small search result icon – such as a magnifying glass with a text symbol – similar to the folder label.

Good point, it looks more clean that way

image

Edit Discussed with the team, that we won't show the icon but keep the indention, as it would create too much visual clutter

@AlexAndBear AlexAndBear changed the title feat: [experimental] search for tags in the global search and enhance the visually reasoning for matching results feat: search for tags in the global search and enhance the visually reasoning for matching results Oct 6, 2026
@AlexAndBear
AlexAndBear marked this pull request as ready for review October 6, 2026 08:23
@github-project-automation github-project-automation Bot moved this to Qualification in OpenCloud Team Board Oct 6, 2026
@AlexAndBear AlexAndBear self-assigned this Oct 7, 2026

@JammingBen JammingBen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found one related issue we already have on main, but maybe you could fix it here while you're at it? When filtering via a tag on the search result page and then reloading the page, the filter still applies, but the filter-chip for "Tags" lost its active state.

@AlexAndBear
AlexAndBear requested a review from JammingBen October 7, 2026 08:40
@AlexAndBear
AlexAndBear merged commit 4772346 into main Oct 7, 2026
31 checks passed
@AlexAndBear
AlexAndBear deleted the feat/search-tags-or branch October 7, 2026 08:54
@openclouders openclouders mentioned this pull request Oct 7, 2026
1 task
openclouders pushed a commit that referenced this pull request Oct 7, 2026
…easoning for matching results (#3558)

* feat: experimental search for tags in the global search

* feat(search): show found content and matching tags in the search preview and results

* fix(search): show tags selected in the tag filter as matching tags

* feat(search): keep the match visible in truncated content snippets

* test(e2e): cover found content and matching tags in the search

* refactor(search): simplify SearchHighlights and share e2e search result args

* feat(design-system): make the xsmall tag size more compact

* feat(search): mark the found content and tags with a search icon and align them with the name

* fix(search): keep long matching tags within narrow tiles

* feat(search): remove the search icon and space matching tags like text

* fix(search): sanitize the search snippet and keep the tag filter chip active after reload
@LHBL2003

LHBL2003 commented Oct 7, 2026

Copy link
Copy Markdown

Edit Discussed with the team, that we won't show the icon but keep the indention, as it would create too much visual clutter

I can’t give it a thumbs-up. It looks very good. I was also wondering whether the TAG symbol might be a bit too much. I think it’s great that the magnifying glass has gone down well in the text excerpt. And that there’s a good solution for the TAG layout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants