Skip to content

WEBDEV-8967: Migrate expandable-search-bar into elements - #83

Open
jbuckner wants to merge 2 commits into
WEBDEV-8966-migrate-scrubber-barfrom
WEBDEV-8967-migrate-expandable-search-bar
Open

WEBDEV-8967: Migrate expandable-search-bar into elements#83
jbuckner wants to merge 2 commits into
WEBDEV-8966-migrate-scrubber-barfrom
WEBDEV-8967-migrate-expandable-search-bar

Conversation

@jbuckner

@jbuckner jbuckner commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

WEBDEV-8967. Stacked on #82, part of WEBDEV-8962.

Brings expandable-search-bar over as ia-expandable-search-bar, and its child as ia-quick-search.

Fixed on the way through:

  • Quick search entries are buttons. They were anchors with a click handler and no href, which nothing can focus and no keyboard can activate — the file carried two eslint-disable lit-a11y/* comments admitting it. Selecting an entry now also returns focus to the input, since closing the list hides the element that had it and the browser would otherwise drop focus to the body.
  • Value tracking binds to input rather than keyup, so a mouse paste, autofill, a drop and an IME composition all register. Arrow keys no longer report a change that didn't happen. keyup still handles Enter.
  • The input and both buttons have accessible names, and the disclosure reports aria-expanded.
  • placeholder and label are properties running through msg(), so they can be translated and overridden instead of being a hardcoded "Search".

QuickSearchEntry is an interface, with data optional.

The updated() hook that writes searchTerm into the field looked redundant next to the .value binding, but it isn't, and it now carries a comment explaining why: Lit dirty-checks a property binding against the value it last committed, not against the DOM, so a consumer that normalises searchTerm in its own inputchange handler can land back on the committed value and leave the field showing something else. There's a test for it.

CI shows only deploy-preview here because the PR isn't based on main (WEBDEV-8972). Verified locally: build, full suite 299 passing, eslint and prettier clean.

Move @internetarchive/expandable-search-bar out of the iaux monorepo as
ia-expandable-search-bar, with its child as ia-quick-search. Fifth of
seven.

- Quick search entries are buttons. They were anchors with a click handler
  and no href, which nothing can focus and no keyboard can activate. The
  source carried two eslint-disable lit-a11y comments acknowledging it.
  Selecting an entry also returns focus to the input, since closing the
  list hides the element that had it.
- Value tracking is bound to input rather than keyup, so a mouse paste,
  autofill, a drop and an IME composition all register. Arrow keys no
  longer report a change that didn't happen. keyup still handles Enter.
- The input and both buttons have accessible names, and the disclosure
  reports aria-expanded.
- placeholder and label are properties running through msg(), so they can
  be translated and overridden.
- Icons take their colour from the bar, and are hidden from assistive tech
  since the controls around them carry the names.

QuickSearchEntry is an interface, with data optional. The updated() hook
that writes searchTerm into the field is kept, and now has a comment saying
why: Lit's property binding dirty-checks against the value it last
committed, so a consumer that normalises searchTerm in its own inputchange
handler can land back on that value and leave the field out of step.

Claude-Session: https://claude.ai/code/session_01U6iNyGicKJywdrWJMTyFin

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1

🚀 View preview at
https://internetarchive.github.io/elements/pr/pr-83/

Built to branch ghpages at 2026-08-27 20:28 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

…ate-expandable-search-bar

* WEBDEV-8966-migrate-scrubber-bar:
  WEBDEV-8972: Run CI on every PR, not just ones based on main (#90)
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.33333% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.80%. Comparing base (84b4995) to head (92ddb48).

Files with missing lines Patch % Lines
...dable-search-bar/ia-expandable-search-bar-story.ts 57.14% 5 Missing and 1 partial ⚠️
...ements/ia-expandable-search-bar/ia-quick-search.ts 81.81% 0 Missing and 2 partials ⚠️
...-expandable-search-bar/ia-expandable-search-bar.ts 96.55% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@                         Coverage Diff                          @@
##           WEBDEV-8966-migrate-scrubber-bar      #83      +/-   ##
====================================================================
+ Coverage                             80.17%   80.80%   +0.62%     
====================================================================
  Files                                    38       41       +3     
  Lines                                  1170     1224      +54     
  Branches                                267      276       +9     
====================================================================
+ Hits                                    938      989      +51     
+ Misses                                  159      154       -5     
- Partials                                 73       81       +8     

☔ 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.

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.

2 participants