Skip to content

Show when menu search has more results - #941

Open
harshita-jangra wants to merge 3 commits into
eizedev:mainfrom
harshita-jangra:fix-menu-search-more-results
Open

harshita-jangra wants to merge 3 commits into
eizedev:mainfrom
harshita-jangra:fix-menu-search-more-results

Conversation

@harshita-jangra

@harshita-jangra harshita-jangra commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #851

  • Show an informational message when a menu search returns more than 8 matching results.
  • Continue displaying only the first 8 results to preserve the existing search behavior.
  • Show the number of displayed results using the existing SEARCH_HITS constant.
  • Add English and German translations for the new message.
  • Add tests for searches with more than 8 results, fewer results, and empty queries.

Checklist (PRODUCT.md)

  • Linked issue: react: the menu search cuts at 8 hits without saying so #851
  • Added tests for the new search behavior without weakening existing tests.
  • Docs, upgrading notes and CHANGELOG.md describe the new state.
  • Reviewed by someone who did not write it. I have reviewed, run and understand the changes.

Test plan

  • npm test -w pivotkit-react — 364 tests passed.
  • npm run lint — passed.
  • npm run types — passed.
  • npm run build -w pivotkit-react — passed.
  • npm run coverage -w pivotkit-react — 364 tests passed.
  • git diff --check — passed.

The full browser test suite was started but interrupted before completion, so it is not reported as passed.

@eizedev

eizedev commented Nov 25, 2026

Copy link
Copy Markdown
Owner

Hi @harshita-jangra ,

thanks for picking this up and for helping on pivotkit. The change does what #851 asks for, and I like that you reused SEARCH_HITS and added tests. I have a few notes:

  1. The comment in searchHits that explained the sort order ("a stable sort: …") got lost, and the JSDoc got shorter. Could you put both back please?
  2. The texts: the English one reads a bit odd ("to see fewer results"), and the German one uses "du", while the other menu texts use the infinitive. How about:
    • en: "Only the first {count} results are shown. Type more to narrow the search."
    • de: "Nur die ersten {count} Treffer. Mehr Wörter grenzen die Suche ein."
  3. A small one: searchHasMore filters and sorts everything a second time. One function that returns the hits and whether there are more would avoid that. While you're there, the formatting (indentation) around return (<> in levels.jsx is a bit off.
  4. CI fails on "Function size and complexity". That's not really your part/fault: LevelMenu was already too long before your change. I'll take care of that part.
  5. Changelog: please add a line under [Unreleased] in packages/pivotkit-react/CHANGELOG.md, in a ### Fixed section. Something like: "The menu search says when it shows only the first 8 results."

I will try to add it to the upcoming release 0.11.0 that will be released tomorrow (if i make it in time) if everything looks good.

Thanks again!
René

@harshita-jangra

harshita-jangra commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor Author

Hi @eizedev,
thanks for the review! I've addressed the requested changes and pushed the updates. All 364 tests are passing. Please take another look when you get a chance.

@eizedev

eizedev commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Hi @harshita-jangra ,

thanks for the quick update, this looks good to me. I tried it in the playground and the hint shows up nicely below the results, in English and German.

Two small things are left, and both come from our side, not yours:

  1. While you were working on it, I merged another change into main that touches SearchHits in levels.jsx, so your branch has a conflict now. Could you merge main into your branch? The hits there now pass disabled, reason and note to MenuItem; please keep those next to your hasMore part. CI starts once the conflict is gone.
  2. After that merge, the [Unreleased] part of the changelog already has a ### Fixed section further down. Could you move your line there, so there is only one?

A note on the conflict: pivotkit moves fast at the moment, with releases almost every day, so open pull requests will need an update from main more often than usual. That's not on you, and I'm really glad you're helping.

That's all from my side. I'll take care of the LevelMenu size check as promised and merge it after that.

Thanks again,
René

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

react: the menu search cuts at 8 hits without saying so

2 participants