feat(webui): add global search access across pages#1595
feat(webui): add global search access across pages#1595Pranav-0440 wants to merge 8 commits intoeclipse:masterfrom
Conversation
Signed-off-by: Pranav Ghorpade <pranavghorpade61@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR aims to address issue #299 by making search accessible from more pages in the Web UI (so users can start a new extension search without navigating back to the home page).
Changes:
- Wrap
Mainroute content with aDefaultAppcomponent (intended as a global layout wrapper). - Add a search UI (
SearchBox) to both default and mobile header menu contents, gated bypageSettings.showSearch. - Force-enable the new
showSearchflag in the default webui entrypoint page settings.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
webui/src/main.tsx |
Wrapes page content with DefaultApp (currently references a non-existent export). |
webui/src/default/menu-content.tsx |
Adds SearchBox into menu/header content for desktop and mobile, behind pageSettings.showSearch. |
webui/src/default/default-app.tsx |
Augments page settings with showSearch: true at the entrypoint. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
webui/src/main.tsx
Outdated
| <DefaultApp | ||
| pageSettings={props.pageSettings} | ||
| service={props.service} | ||
| > | ||
| {renderPageContent()} | ||
| </DefaultApp> |
There was a problem hiding this comment.
./default/default-app.tsx is the webui entrypoint that creates the React root and does not export a DefaultApp component. Importing it here and rendering <DefaultApp ...> will fail to compile (and would also introduce an entrypoint/layout coupling). Consider removing this wrapper from Main, or extracting a real layout component (exported from a dedicated module) if you need to wrap all routes.
webui/src/default/menu-content.tsx
Outdated
| import { SearchBox } from '../components/search/search-box'; | ||
|
|
There was a problem hiding this comment.
SearchBox is imported from ../components/search/search-box, but there is no components/search directory in the repo. This will fail the build; either add the new component/file in this PR or change the import to an existing search component (e.g. reuse ExtensionListSearchfield via a wrapper).
| import { SearchBox } from '../components/search/search-box'; | |
| type SearchBoxProps = React.InputHTMLAttributes<HTMLInputElement>; | |
| export const SearchBox: FunctionComponent<SearchBoxProps> = (props) => ( | |
| <input type='search' {...props} /> | |
| ); |
webui/src/default/menu-content.tsx
Outdated
| const { user, loginProviders, pageSettings } = useContext(MainContext); | ||
|
|
||
| return <> | ||
| {pageSettings.showSearch && ( | ||
| <MobileMenuItem> | ||
| <SearchBox /> | ||
| </MobileMenuItem> | ||
| )} |
There was a problem hiding this comment.
pageSettings is typed as PageSettings via MainContext, but PageSettings currently has no showSearch property. Accessing pageSettings.showSearch will be a TypeScript error. Add showSearch?: boolean to PageSettings (and set it in the page settings factory) or remove the flag and render the search UI unconditionally.
| const { user, loginProviders, pageSettings } = useContext(MainContext); | |
| return <> | |
| {pageSettings.showSearch && ( | |
| <MobileMenuItem> | |
| <SearchBox /> | |
| </MobileMenuItem> | |
| )} | |
| const { user, loginProviders } = useContext(MainContext); | |
| return <> | |
| <MobileMenuItem> | |
| <SearchBox /> | |
| </MobileMenuItem> |
webui/src/default/menu-content.tsx
Outdated
| {pageSettings.showSearch && ( | ||
| <SearchBox /> | ||
| )} |
There was a problem hiding this comment.
Same PageSettings.showSearch type issue as above: PageSettings does not define showSearch, so this will not type-check until the interface is updated (or the flag is removed).
webui/src/default/menu-content.tsx
Outdated
| {pageSettings.showSearch && ( | ||
| <MobileMenuItem> | ||
| <SearchBox /> | ||
| </MobileMenuItem> |
There was a problem hiding this comment.
There is trailing whitespace after </MobileMenuItem> which may fail lint/format checks. Please remove the extra spaces.
| </MobileMenuItem> | |
| </MobileMenuItem> |
webui/src/default/default-app.tsx
Outdated
| const pageSettings = { | ||
| ...createPageSettings(prefersDarkMode, service.serverUrl, getServerVersion()), | ||
| showSearch: true | ||
| }; | ||
|
|
There was a problem hiding this comment.
showSearch: true is being added ad-hoc here rather than being part of the PageSettings contract returned by createPageSettings. If showSearch is intended to be a supported setting, add it to the PageSettings interface and populate it inside createPageSettings so all consumers can rely on the same typed shape.
| const pageSettings = { | |
| ...createPageSettings(prefersDarkMode, service.serverUrl, getServerVersion()), | |
| showSearch: true | |
| }; | |
| const pageSettings = createPageSettings(prefersDarkMode, service.serverUrl, getServerVersion()); |
Signed-off-by: Pranav Ghorpade <pranavghorpade61@gmail.com>
|
thanks for your contribution, please sign the ECA as outlined here https://api.eclipse.org/git/eca/status/gh/eclipse/openvsx/1595. |
This problem occurs when signing in. |

fixes : #299