WEBDEV-8967: Migrate expandable-search-bar into elements - #83
Open
jbuckner wants to merge 2 commits into
Open
Conversation
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>
|
…ate-expandable-search-bar * WEBDEV-8966-migrate-scrubber-bar: WEBDEV-8972: Run CI on every PR, not just ones based on main (#90)
Codecov Report❌ Patch coverage is 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. 🚀 New features to boost your workflow:
|
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.
WEBDEV-8967. Stacked on #82, part of WEBDEV-8962.
Brings
expandable-search-barover asia-expandable-search-bar, and its child asia-quick-search.Fixed on the way through:
href, which nothing can focus and no keyboard can activate — the file carried twoeslint-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.inputrather thankeyup, so a mouse paste, autofill, a drop and an IME composition all register. Arrow keys no longer report a change that didn't happen.keyupstill handles Enter.aria-expanded.placeholderandlabelare properties running throughmsg(), so they can be translated and overridden instead of being a hardcoded "Search".QuickSearchEntryis an interface, withdataoptional.The
updated()hook that writessearchTerminto the field looked redundant next to the.valuebinding, 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 normalisessearchTermin its owninputchangehandler can land back on the committed value and leave the field showing something else. There's a test for it.CI shows only
deploy-previewhere because the PR isn't based onmain(WEBDEV-8972). Verified locally: build, full suite 299 passing, eslint and prettier clean.