You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add the Created Date range filter on top of the generic full-search
filter controls.
Expose createdFrom and createdTo URL parameters, normalize invalid or
reversed year ranges, and expand committed ranges into inclusive
Pagefind created_year OR filters. Keep same-year selections encoded as a
single starting year.
Render the Created Date control as a Year selector plus a disabled To
selector that unlocks after Year is selected. Display a single range
chip for the committed years and keep clear/remove actions in draft
state until Search or Enter commits.
Add stylesheet and validation coverage for the Created Date control,
loading shell, URL normalization, and Pagefind year filter expansion.
Copy file name to clipboardExpand all lines: scripts/check-pagefind-search-ui
+37-1Lines changed: 37 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -391,24 +391,38 @@ assert_not_contains "$search_constants" 'key: "prefix"' "prefix must not remain
391
391
assert_not_contains "$search_constants"'key: "type"'"type must not remain a visible filter field"
392
392
assert_not_contains "$search_constants"'key: "category"'"category must not remain a visible filter field"
393
393
assert_contains "$search_constants"'key: "author"'"filter constants must define the author field"
394
+
assert_contains "$search_constants"'CREATED_YEAR_FIELD = "created_year"'"filter constants must define the created year Pagefind field"
395
+
assert_contains "$search_constants"'CREATED_FROM_PARAM = "createdFrom"'"filter constants must define the createdFrom URL parameter"
396
+
assert_contains "$search_constants"'CREATED_TO_PARAM = "createdTo"'"filter constants must define the createdTo URL parameter"
394
397
assert_contains "$search_state""AUTHOR_MODE_PARAM""state module must own author mode URL state"
395
398
assert_contains "$search_state""pagefindFilters.author = values""state module must encode author AND filters as arrays"
396
399
assert_contains "$search_state""filterUrlParam(field)""state module must use field-specific URL parameter names"
397
400
assert_contains "$search_state""filterPagefindField(field)""state module must use field-specific Pagefind filter names"
398
401
assert_contains "$search_state""pagefindFilters[filterPagefindField(field)]""state module must encode Proposal Category using the Pagefind field name"
402
+
assert_contains "$search_state""CREATED_FROM_PARAM""state module must own createdFrom URL state"
403
+
assert_contains "$search_state""CREATED_TO_PARAM""state module must own createdTo URL state"
404
+
assert_contains "$search_state""pagefindFilters[CREATED_YEAR_FIELD] = { any: createdYears }""state module must encode created year filters as Pagefind OR filters"
405
+
assert_contains "$search_state""for (let year = from; year <= to; year += 1)""state module must expand created year ranges inclusively"
399
406
assert_contains "$search_state""pushSearchStateIfNeeded""state module must avoid duplicate clean-route history entries"
400
407
assert_contains "$search_filters"'role: "combobox"'"filter module must render custom combobox controls"
401
408
assert_contains "$search_template""search-filter-grid-loading""search template must render loading filter shells before JS starts"
402
409
assert_contains "$search_template""search-filter-field-loading""search template loading shells must use a distinct field hook"
403
410
assert_contains "$search_template""data-search-filter-field=\"proposalCategory\"""search template must render the Proposal Category loading shell"
404
411
assert_contains "$search_template""data-search-filter-field=\"status\"""search template must render the Status loading shell"
405
412
assert_contains "$search_template""data-search-filter-field=\"author\"""search template must render the Author loading shell"
413
+
assert_contains "$search_template""data-search-filter-field=\"created_year\"""search template must render the Created Date loading shell"
406
414
assert_contains "$search_template""Loading values...""search template loading shells must not render fake counts"
407
415
assert_contains "$search_template""disabled""search template loading shells must be disabled"
408
416
assert_not_contains "$search_filters""renderLoadingFilterControls""filter module must not duplicate the template loading render path"
409
417
assert_contains "$search_filters""filterPagefindField(field)""filter module must look up Pagefind filters by field config"
assert_contains "$search_filters""CREATED_DATE_LABEL""filter module must render the dedicated Created Date control"
420
+
assert_contains "$search_filters"'"Year"'"created date filter must label the starting year control"
421
+
assert_contains "$search_filters"'"To"'"created date filter must label the ending year control"
422
+
assert_contains "$search_filters""appendYearOptions(toSelect, false)""Created Date To control must not render a visible Any option"
423
+
assert_contains "$search_filters""createdDate.to || createdDate.from""Created Date To control must default to the selected Year"
411
424
assert_contains "$search_filters"'aria-label": `Remove ${filterLabel(field.key).toLowerCase()} ${value}`'"filter chips must have specific accessible remove labels"
425
+
assert_contains "$search_filters"'aria-label": `Remove created date ${selectedLabel}`'"created date chip must have a specific accessible remove label"
412
426
assert_contains "$search_filters"'class: "search-filter-toggle-icon"'"filter toggles must use the chevron icon hook"
413
427
assert_contains "$search_filters"'"Choose operator"'"author filter must label the operator control"
414
428
assert_contains "$search_filters"'"And"'"author filter must expose the AND operator label"
@@ -418,12 +432,15 @@ assert_contains "$search_filters" "isOutsideClickExempt" "filter outside-click h
418
432
assert_not_contains "$search_filters""Any author""author operator labels must stay concise"
419
433
assert_not_contains "$search_filters""All authors""author operator labels must stay concise"
420
434
assert_contains "$search_css""max-height: min(50vh, 28rem)""filter dropdowns must be capped around 50vh"
435
+
assert_contains "$search_css"".search-created-date-controls""search stylesheet must style the Created Date control"
436
+
assert_contains "$search_css"".search-created-date-select:disabled""Created Date To control must have a disabled visual state"
421
437
assert_contains "$search_css"".search-filter-input:disabled""loading filter inputs must share disabled styling"
422
438
assert_contains "$search_css"".search-filter-toggle:disabled""loading filter toggles must share disabled styling"
423
439
assert_contains "$search_css"".search-page-controls select:disabled""loading sort control must share disabled styling"
424
440
assert_contains "$search_css"".search-page-controls select""sort dropdown must have explicit select styling"
425
441
assert_contains "$search_css"".search-filter-input""generic filter dropdown inputs must have explicit input styling"
426
-
assert_contains "$search_css""background: var(--bs-body-bg, #fff)""generic filter dropdown inputs must have body background"
442
+
assert_contains "$search_css""background: var(--bs-body-bg, #fff)""generic filter dropdown inputs must match Created Date select background"
443
+
assert_contains "$search_css""cursor: pointer;""Created Date selects must use a pointer cursor when enabled"
427
444
assert_contains "$search_css""top: 4.6rem""filter dropdowns must keep a stable overlay position"
428
445
assert_contains "$search_css"'.search-filter-toggle[aria-expanded="true"] .search-filter-toggle-icon::before'"filter chevrons must flip when open"
429
446
assert_contains "$search_css""[data-search-page-submit]""Search button must keep the highlighted action styling"
0 commit comments