-
Notifications
You must be signed in to change notification settings - Fork 36
[PB-6258] feat: add attachments type filter to global search #2070
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
Merged
victor-ferro
merged 42 commits into
PB-6258-search-filters-sdk
from
PB-6258-search-type-filter
Aug 13, 2026
+1,699
−114
Merged
Changes from 4 commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
dd4fc15
feat(search): add attachments type filter to global search
victor-ferro 04906d6
feat(search): add remaining file categories to attachments filter
victor-ferro 0d2bb8f
feat(search): add date modified filter to global search
victor-ferro 0fc1863
feat(search): add size filter to global search
victor-ferro 99a1a51
refactor(search): share filter radio list and close panels on enter
victor-ferro 8673153
Merge branch 'PB-6258-search-filters-sdk' into PB-6258-search-type-fi…
victor-ferro 076197e
[PB-6258] refactor: import SearchFileCategory from local search service
victor-ferro 755d696
Merge branch 'PB-6258-search-type-filter' into PB-6258-search-date-fi…
victor-ferro d6186c6
Merge branch 'PB-6258-search-date-filter' into PB-6258-search-size-fi…
victor-ferro c420428
[PB-6258] fix: allow conflicting custom size range so the search show…
victor-ferro 65c0d5a
Revert "[PB-6258] fix: allow conflicting custom size range so the sea…
victor-ferro 89fb69e
[PB-6258] fix: make type filter rows fully clickable via shared Searc…
victor-ferro 2e10b17
Merge branch 'PB-6258-search-type-filter' into PB-6258-search-date-fi…
victor-ferro e0ace0a
[PB-6258] fix: make date filter rows fully clickable via shared Searc…
victor-ferro 5c942a9
Merge branch 'PB-6258-search-date-filter' into PB-6258-search-size-fi…
victor-ferro 27113b6
[PB-6258] fix: make size and date radio rows fully clickable via shar…
victor-ferro 78af36e
[PB-6258] fix: disable future days in date calendar
victor-ferro 8c56bc8
Merge branch 'PB-6258-search-date-filter' into PB-6258-search-size-fi…
victor-ferro f08684a
[PB-6258] fix: reject future dates typed into the specific date inputs
victor-ferro 2db17e6
Merge branch 'PB-6258-search-date-filter' into PB-6258-search-size-fi…
victor-ferro 1c5dc43
[PB-6258] test: document calendar locale mapping including the zh-TW …
victor-ferro 5bd958b
Merge branch 'PB-6258-search-date-filter' into PB-6258-search-size-fi…
victor-ferro 167b3d0
[PB-6258] fix: make any type a real toggle in the search type filter
victor-ferro 74bb655
Merge branch 'PB-6258-search-type-filter' into PB-6258-search-date-fi…
victor-ferro 3fabc52
Merge branch 'PB-6258-search-date-filter' into PB-6258-search-size-fi…
victor-ferro 10b5408
[PB-6258] fix: make the date filter clear control a real button
victor-ferro 74e3c1f
Merge branch 'PB-6258-search-date-filter' into PB-6258-search-size-fi…
victor-ferro 0440644
[PB-6258] fix: make the size filter clear control a real button
victor-ferro 7208f3f
[PB-6258] fix: keep the search filter pills inside the results panel
victor-ferro 0dd9b8e
[PB-6258] feat: show a spinner while the global search is loading
victor-ferro 6f96c31
[PB-6258] fix: only mark the date and size filters as applied when th…
victor-ferro 4c29b88
[PB-6258] fix: accept only digits in the specific date inputs
victor-ferro 04388a6
[PB-6258] fix: switch between search filter dropdowns with a single c…
victor-ferro a4fde62
[PB-6258] fix: keep custom size values within the exact integer range
victor-ferro 2cb5abc
Merge remote-tracking branch 'origin/PB-6258-search-filters-sdk' into…
victor-ferro d9a75b6
Merge remote-tracking branch 'origin/PB-6258-search-type-filter' into…
victor-ferro e82cc3e
Merge remote-tracking branch 'origin/PB-6258-search-date-filter' into…
victor-ferro d49bb0a
Merge branch 'PB-6258-search-filters-sdk' into PB-6258-search-type-fi…
victor-ferro 18e6d58
Merge branch 'PB-6258-search-type-filter' into PB-6258-search-date-fi…
victor-ferro 314f7df
Merge branch 'PB-6258-search-date-filter' into PB-6258-search-size-fi…
victor-ferro 8305c04
Merge pull request #2073 from internxt/PB-6258-search-size-filter
victor-ferro 52ebb08
Merge pull request #2071 from internxt/PB-6258-search-date-filter
victor-ferro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| import { Menu, MenuButton, MenuItems } from '@headlessui/react'; | ||
| import { SearchFileCategory } from '../services'; | ||
| import { Checkbox } from '@internxt/ui'; | ||
| import { CaretDownIcon } from '@phosphor-icons/react'; | ||
| import iconService from 'app/drive/services/icon.service'; | ||
| import { useTranslationContext } from 'app/i18n/provider/TranslationProvider'; | ||
| import { useEffect, useRef } from 'react'; | ||
| import { TYPE_FILTER_ITEMS } from '../utils/typeFilterUtils'; | ||
|
|
||
| interface SearchTypeFilterProps { | ||
| selected: SearchFileCategory[]; | ||
| onToggle: (category: SearchFileCategory) => void; | ||
| onSelectAny: () => void; | ||
| onClose: () => void; | ||
| } | ||
|
|
||
| const MenuCloseObserver = ({ open, onClose }: { open: boolean; onClose: () => void }): null => { | ||
| const wasOpen = useRef(false); | ||
| useEffect(() => { | ||
| if (wasOpen.current && !open) onClose(); | ||
| wasOpen.current = open; | ||
| }, [open]); | ||
| return null; | ||
| }; | ||
|
|
||
| const SearchTypeFilter = ({ selected, onToggle, onSelectAny, onClose }: SearchTypeFilterProps): JSX.Element => { | ||
| const { translate } = useTranslationContext(); | ||
| const isAnyType = selected.length === 0; | ||
|
|
||
| return ( | ||
| <Menu as="div" className="relative"> | ||
| {({ open }) => ( | ||
| <> | ||
| <MenuCloseObserver open={open} onClose={onClose} /> | ||
| <MenuButton | ||
| className={`${ | ||
| isAnyType | ||
| ? 'bg-surface text-gray-80 ring-gray-10 hover:bg-gray-1 hover:shadow-sm hover:ring-gray-20 dark:bg-gray-5 dark:hover:bg-gray-10' | ||
| : 'bg-primary/10 text-primary ring-primary/20 dark:bg-primary/20 dark:text-white dark:ring-primary/75' | ||
| } flex h-8 cursor-pointer items-center space-x-2 rounded-full px-3 font-medium shadow-sm outline-none ring-1 transition-all duration-100 ease-out`} | ||
| > | ||
| <span className="text-sm">{translate('general.searchBar.filters.attachments')}</span> | ||
| <CaretDownIcon size={16} /> | ||
| </MenuButton> | ||
|
|
||
| <MenuItems | ||
| transition | ||
| className="absolute left-0 z-20 mt-1 flex min-w-[240px] origin-top-left flex-col rounded-lg border border-gray-10 bg-surface py-1.5 shadow-subtle-hard outline-none transition duration-100 ease-out data-[closed]:scale-95 data-[closed]:opacity-0 dark:bg-gray-5" | ||
| > | ||
| <div className="flex flex-row items-center gap-2 px-4 py-2"> | ||
| <Checkbox checked={isAnyType} indeterminate={!isAnyType} onClick={onSelectAny} /> | ||
| <p className="text-gray-100">{translate('general.searchBar.filters.anyType')}</p> | ||
| </div> | ||
| <div className="mx-4 border-t border-gray-10" /> | ||
| {TYPE_FILTER_ITEMS.map(({ id, labelKey, extension }) => { | ||
| const Icon = iconService.getItemIcon(id === 'folder', extension); | ||
| return ( | ||
| <div className="flex flex-row items-center gap-2 px-4 py-2" key={id}> | ||
| <Checkbox checked={isAnyType || selected.includes(id)} onClick={() => onToggle(id)} /> | ||
| <Icon className="h-6 w-6 drop-shadow-soft" /> | ||
| <p className="text-gray-100">{translate(`general.searchBar.filters.${labelKey}`)}</p> | ||
| </div> | ||
| ); | ||
| })} | ||
| </MenuItems> | ||
| </> | ||
| )} | ||
| </Menu> | ||
| ); | ||
| }; | ||
|
|
||
| export default SearchTypeFilter; | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I would make clickable all the row instead only the checkbox, ask to designer if have doubts
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.
Done!