-
Notifications
You must be signed in to change notification settings - Fork 285
feat(webui): add global search access across pages #1595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Pranav Ghorpade <pranavghorpade61@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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> |
Copilot
AI
Feb 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
./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'; | ||
|
|
Copilot
AI
Feb 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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> | ||
| )} |
Copilot
AI
Feb 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 /> | ||
| )} |
Copilot
AI
Feb 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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> |
Copilot
AI
Feb 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 | ||
| }; | ||
|
|
Copilot
AI
Feb 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
|
@netomi done ECA |
Signed-off-by: Pranav-0440 <pranavghorpade61@gmail.com>
9cb4300 to
4e06ed8
Compare
|
@gnugomez could you take a look? |
webui/src/default/menu-content.tsx
Outdated
|
|
||
| // -------------------- Shared Search -------------------- // | ||
|
|
||
| const GlobalSearch: FunctionComponent<{ fullWidth?: boolean }> = ({ fullWidth }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: as other components this one needs to be exported too
| const GlobalSearch: FunctionComponent<{ fullWidth?: boolean }> = ({ fullWidth }) => { | |
| export const GlobalSearch: FunctionComponent<{ fullWidth?: boolean }> = ({ fullWidth }) => { |
webui/src/default/menu-content.tsx
Outdated
| } | ||
| navigate( | ||
| addQuery(ExtensionListRoutes.MAIN, [ | ||
| { key: 'query', value } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: queary is not an accepted search param, use search instead
| { key: 'query', value } | |
| { key: 'search', value } |
webui/src/default/menu-content.tsx
Outdated
|
|
||
| // -------------------- Shared Search -------------------- // | ||
|
|
||
| const GlobalSearch: FunctionComponent<{ fullWidth?: boolean }> = ({ fullWidth }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: the "fullWidth" styles here are making more harm than good, I'd suggest to use default MUI styles for the Input
| const GlobalSearch: FunctionComponent<{ fullWidth?: boolean }> = ({ fullWidth }) => { | |
| const GlobalSearch: FunctionComponent = () => { |
webui/src/default/menu-content.tsx
Outdated
| sx={{ | ||
| mx: 2, | ||
| width: fullWidth ? '100%' : 260 | ||
| }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
following up on my last comment I would remove these styles
| sx={{ | |
| mx: 2, | |
| width: fullWidth ? '100%' : 260 | |
| }} |
| <MobileMenuItem> | ||
| <Link href={user.homepage}> | ||
| <MobileMenuItemText> | ||
| <GitHubIcon sx={itemIcon} /> | ||
| {user.loginName} | ||
| </MobileMenuItemText> | ||
| </Link> | ||
| </MobileMenuItem> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question (blocking): why are you removing the Github menu item?
| <MenuLink href='https://join.slack.com/t/openvsxworkinggroup/shared_invite/zt-2y07y1ggy-ct3IfJljjGI6xWUQ9llv6A'> | ||
| Slack Workspace | ||
| </MenuLink> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: removing this menu item is not part of this patch
webui/src/default/menu-content.tsx
Outdated
| return ( | ||
| <> | ||
| <Box sx={{ px: 2, pb: 1 }}> | ||
| <GlobalSearch fullWidth /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: when we're in the main route we should hide the global search because there's already one present
webui/src/default/menu-content.tsx
Outdated
| return ( | ||
| <> | ||
| <Box sx={{ px: 2, pb: 1 }}> | ||
| <GlobalSearch fullWidth /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
webui/src/default/menu-content.tsx
Outdated
|
|
||
| return ( | ||
| <> | ||
| <GlobalSearch /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
webui/src/default/menu-content.tsx
Outdated
| return ( | ||
| <> | ||
| <Box sx={{ px: 2, pb: 1 }}> | ||
| <GlobalSearch fullWidth /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| <GlobalSearch fullWidth /> | |
| <GlobalSearch /> |





fixes : #299