[PB-6258] feat: add date modified filter to global search - #2071
Open
victor-ferro wants to merge 7 commits into
Open
[PB-6258] feat: add date modified filter to global search#2071victor-ferro wants to merge 7 commits into
victor-ferro wants to merge 7 commits into
Conversation
Deploying drive-web with
|
| Latest commit: |
1c5dc43
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://57b341a5.drive-web.pages.dev |
| Branch Preview URL: | https://pb-6258-search-date-filter.drive-web.pages.dev |
victor-ferro
force-pushed
the
PB-6258-search-date-filter
branch
from
July 27, 2026 07:52
3fe5d9f to
0d2bb8f
Compare
7 tasks
…lter # Conflicts: # src/views/Home/components/NavbarGlobalSearch.tsx
victor-ferro
marked this pull request as ready for review
July 29, 2026 14:42
CandelR
reviewed
Jul 31, 2026
Comment on lines
+122
to
+140
| <div | ||
| role="none" | ||
| onMouseDown={(event) => event.preventDefault()} | ||
| onClick={(event) => event.preventDefault()} | ||
| > | ||
| <div className="flex flex-row items-center gap-2 px-4 py-2"> | ||
| <RadioButton checked={isAnyDate} onClick={() => onSelectPreset('any')} /> | ||
| <p className="text-gray-100">{translate('general.searchBar.filters.date.anyDate')}</p> | ||
| </div> | ||
| <div className="mx-4 border-t border-gray-10" /> | ||
| {DATE_PRESET_ITEMS.map(({ id, labelKey }) => ( | ||
| <div className="flex flex-row items-center gap-2 px-4 py-2" key={id}> | ||
| <RadioButton checked={preset === id} onClick={() => onSelectPreset(id)} /> | ||
| <p className="text-gray-100"> | ||
| {translate(`general.searchBar.filters.date.${labelKey}`, { year: presetYears[id] })} | ||
| </p> | ||
| </div> | ||
| ))} | ||
| </div> |
Collaborator
There was a problem hiding this comment.
I would make the whole row clickable, not just the radio button
|
|
||
| const getCalendarLocale = (): string => { | ||
| const language = i18next.language ?? 'en'; | ||
| return language.toLowerCase() === 'zh-tw' ? 'zh-tw' : language.split('-')[0].toLowerCase(); |
Collaborator
There was a problem hiding this comment.
Perhaps we should document this, even if it’s just with a test, as it’s not immediately clear why this is the case
Comment on lines
+46
to
+47
| const isDayDisabled = (day: Dayjs): boolean => | ||
| Boolean((minDate && day.isBefore(minDate, 'day')) || (maxDate && day.isAfter(maxDate, 'day'))); |
Collaborator
There was a problem hiding this comment.
I’d say we need to check whether maxDate is later than today’s date, as we shouldn’t be able to filter by dates later than today, should we?
…lter # Conflicts: # src/views/Home/components/SearchTypeFilter.tsx
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



Description
Part 3/4 of the PB-6258 stack. Adds the "Date modified" pill with single-choice presets (Today, Last 7/30 days, This/Last year) and a Specific date mode with After/Before inputs supporting open and closed ranges. Dates are typed (
dd/mm/yyyy, strict) or picked in the newDateCalendarcomponent; invalid or range-inverting entries are ignored. Includes theDropdownCloseObserverhelper and i18n for the 8 locales.Blocked by internxt/sdk#429 (see base PR #2069).
Related Issues
Relates to PB-6258 (JIRA).
Related Pull Requests
Checklist
Testing Process
Manual browser testing: each preset issues the expected
modifiedAfter/modifiedBeforeISO params; open ranges send a single param; each calendar disables days beyond the opposite bound; locale rendering verified in Spanish.Additional Notes
Pre-existing bug found: the global dayjs locale set in
i18n.service.tsfalls back to English ('es-ES'is not normalized to'es').DateCalendarworks around it with per-instance locales.