Skip to content

Add a submit button so the search form works without JavaScript#167

Open
loevgaard wants to merge 1 commit into
issue-134-i18n-search-pagefrom
issue-122-search-submit-button
Open

Add a submit button so the search form works without JavaScript#167
loevgaard wants to merge 1 commit into
issue-134-i18n-search-pagefrom
issue-122-search-submit-button

Conversation

@loevgaard

Copy link
Copy Markdown
Member

What

The search results form (facets + sorting + pagination) rendered form_start … form_end with no submit button anywhere — all submission was done by the JavaScript auto-submit in search.js. With JavaScript disabled, blocked, or failed to load, a shopper could run the initial query from the URL but couldn't apply a filter, change sorting, or paginate.

Add a real "Apply filters" submit button to _results.html.twig, visible by default (so the plain GET form works everywhere) and hidden by search.js on init (so the enhanced auto-submit behaviour is unchanged when JS is available). Hiding it in JS — rather than via <noscript> — also covers failed/blocked JS.

The apply_filters key is translated into all 12 locales.

Testing

  • e2e filters by a brand facet: with JS enabled the fallback button is hidden and checking a facet auto-submits.
  • e2e without javascript (javaScriptEnabled: false): the button is visible; checking a facet and pressing it filters the results.
  • The functional search-page tests still pass (template renders with the button + translation key).

Closes #122


Stacked on #166 (#134).

@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (issue-134-i18n-search-page@1a48b78). Learn more about missing BASE report.

Additional details and impacted files
@@                      Coverage Diff                      @@
##             issue-134-i18n-search-page     #167   +/-   ##
=============================================================
  Coverage                              ?   48.90%           
  Complexity                            ?      800           
=============================================================
  Files                                 ?      140           
  Lines                                 ?     2560           
  Branches                              ?        0           
=============================================================
  Hits                                  ?     1252           
  Misses                                ?     1308           
  Partials                              ?        0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@loevgaard loevgaard force-pushed the issue-122-search-submit-button branch 2 times, most recently from b20de3c to 66de828 Compare July 10, 2026 17:20
@loevgaard loevgaard force-pushed the issue-134-i18n-search-page branch from 1a28b4c to 53e0175 Compare July 10, 2026 17:20
The search results form (facets + sorting + pagination) rendered with no
submit control; all submission was done by the JavaScript auto-submit in
search.js, so with JS disabled/blocked/failed a shopper could not apply a
filter, change sorting or paginate.

Add a real "Apply filters" submit button to _results.html.twig, visible by
default (so the GET form works everywhere) and hidden by search.js on init
(so the enhanced auto-submit behaviour is unchanged with JS). The
apply_filters key is translated into all 12 locales. e2e covers both the
JS-enabled (button hidden) and JS-disabled (button applies filters) paths.

Closes #122
@loevgaard loevgaard force-pushed the issue-122-search-submit-button branch from 66de828 to 5f82972 Compare July 10, 2026 18:11
@loevgaard loevgaard force-pushed the issue-134-i18n-search-page branch from 53e0175 to 1a48b78 Compare July 10, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant