Skip to content

Conversation

@moonmeister
Copy link
Member

  • removed downshift in favor of native html
  • implemented dialog with <dialog />
  • simplified event handling/key bindings/ etc
  • used next/link instead of routing manually

@moonmeister moonmeister added the enhancement New feature or request label Jul 1, 2025
@moonmeister moonmeister added the javascript Pull requests that update javascript code label Jul 1, 2025
@github-project-automation github-project-automation bot moved this to 🆕 Backlog in Headless OSS Jul 1, 2025
@moonmeister moonmeister moved this from 🆕 Backlog to 👀 In review in Headless OSS Jul 1, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Refactors the search feature to use the native <dialog> element and a React context, replaces Downshift with simpler event handling, and switches to next/link routing.

  • Removed the Downshift-based search component and its dependency.
  • Implemented a SearchProvider context and refactored search button, modal, and results.
  • Added a dialog-closedby polyfill and standardized routing via next/link.

Reviewed Changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/utils/booleans.js Added isBrowser helper
src/pages/_document.jsx Injected dialog-closedby polyfill script
src/pages/_app.jsx Wrapped application in SearchProvider
src/components/search/state.jsx Created search context and provider
src/components/search/search.jsx New search button with platform-specific shortcut
src/components/search/search-results.jsx Wrapped search results rendering
src/components/search/search-results-list.jsx Validated and rendered individual search items
src/components/search/search-box.jsx Core search modal using <dialog> and debounced API calls
src/components/search-bar.jsx Removed old Downshift-based implementation
src/components/primary-nav.jsx Simplified PrimaryMenu props and removed toggle
src/components/layout.jsx Added <SearchBox> to layout
src/components/header.jsx Swapped out old SearchBar for new Search
package.json Removed downshift dependency
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (2)

src/components/layout.jsx:4

  • [nitpick] The default export in search-box.jsx is named SearchBar, but you're importing it as SearchBox. Consider renaming the component or the import to keep names consistent.
import SearchBox from "./search/search-box";

src/components/primary-nav.jsx:34

  • The setIsMenuOpen prop was removed, but the toggle logic for opening the menu is still needed. Without an onClick handler on the popover button, the menu cannot open—reintroduce or refactor this toggle.
export default function PrimaryMenu({ className }) {

@headless-platform-by-wp-engine

Check out the recent updates to your Headless Platform preview environment:

App Environment URL Build
faustjs.org preview-env-semantic-search-dialog https://hi…wered.com ✅ (logs)

Learn more about preview environments in our documentation.

@headless-platform-by-wp-engine

Check out the recent updates to your Headless Platform preview environment:

App Environment URL Build
faustjs.org preview-env-semantic-search-dialog https://hi…wered.com ✅ (logs)

Learn more about preview environments in our documentation.

@headless-platform-by-wp-engine

Check out the recent updates to your Headless Platform preview environment:

App Environment URL Build
faustjs.org preview-env-semantic-search-dialog https://hi…wered.com ✅ (logs)

Learn more about preview environments in our documentation.

@headless-platform-by-wp-engine

Check out the recent updates to your Headless Platform preview environment:

App Environment URL Build
faustjs.org preview-env-semantic-search-dialog https://hi…wered.com ✅ (logs)

Learn more about preview environments in our documentation.

@Fran-A-Dev
Copy link
Contributor

Fran-A-Dev commented Jul 2, 2025

@kellenmace @moonmeister We should keep the search box pane toward the top of the screen.

It also is jumpy on mobile mode.

@moonmeister moonmeister enabled auto-merge July 2, 2025 17:44
@headless-platform-by-wp-engine

Check out the recent updates to your Headless Platform preview environment:

App Environment URL Build
faustjs.org preview-env-semantic-search-dialog https://hi…wered.com ✅ (logs)

Learn more about preview environments in our documentation.

Copy link
Contributor

@Fran-A-Dev Fran-A-Dev left a comment

Choose a reason for hiding this comment

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

LGTM

@moonmeister moonmeister merged commit fcd5c7a into main Jul 2, 2025
4 checks passed
@moonmeister moonmeister deleted the semantic-search-dialog branch July 2, 2025 19:51
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Closed in Headless OSS Jul 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request javascript Pull requests that update javascript code

Projects

Status: ✅ Closed

Development

Successfully merging this pull request may close these issues.

3 participants