Repository navigation
feat(ui): search enhancement — debounce, mark highlight, clear button (v1.18 D) - #51
Merged
Merged
Conversation
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.
Summary
Implements item D (搜索增强 / Search enhancement) of the UI/UE round-3 wave (rant
2026-08-17T18:06:09, branchfeat/ui-ue-round3, version v1.18).Three acceptance points, all covered across the four search boxes (
#mk-searchmarket /#ak-searchAPI keys /#od-searchdepartments /#ops-searchoperator users):wireSearch(input, render)helper: typing no longer re-renders the whole table on every keystroke; consecutive inputs coalesce into a single render.hl(text, rawQ)helper: escape HTML first, then wrap case-insensitive matches in<mark>(regex-escaped user input,& < >aligned with the escaped text). Highlight is cleared automatically when the query is reset.markstyled with--accent-softbackground +--accent-textcolor (WCAG-friendly in both dark and light themes)..search-boxwith a.search-clearbutton that appears only when the input has content; clicking clears the field, re-renders immediately (no debounce wait), and refocuses. Programmatic clears (resetSearch) keep the × button state in sync — already wired into the existing empty-state "清除搜索 / 清除筛选" buttons.Design notes
wireSearchbinds both the debounced render and the clear button in one place, keeping the four search boxes consistent.Verification
node --checkonapp.js/data.js✓<mark>highlight + clearing, × button show/hide/sync, empty-state reset paths for market & dept, operator email highlight ✓cargo test✓ ·cargo fmt --check✓Rant (verbatim)
Docs
docs/user-stories.mdv1.18 entry extended with item D (remaining E–G noted)ui/README.md: new "搜索增强约定" section + page-list mentions updated