Open
Conversation
MustaphaBakoji
approved these changes
Feb 22, 2026
MustaphaBakoji
left a comment
There was a problem hiding this comment.
`the code is okay and meet the requirement
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.
🔍 Implement Real-time Task Search
Closes #19
Overview
This PR adds a fully functional search bar to the top of the task list. As the user types, tasks are filtered in real-time based on their input. The implementation is intentionally non-destructive — the
tasksarray is never mutated during filtering — so Issue #9 (persistence), #10 (task renderer), and #13 (filter controls) can all build against the same state without conflict.Changes
style.css#search-container,#search-input, and all child elements using existing CSS design tokens — no hardcoded valuescolor-mix()to derive a tinted glow from--color-primaryautomatically in both light and dark mode.search-icontransitions from muted to primary color when the input is focused via:focus-withinon the container#search-clearand#search-no-resultsare hidden by default and shown by toggling a.visibleclass via JS — no inline style manipulationscript.jsrenderSearchBar()— injects the search bar markup (input, SVG icon, clear button) and a no-results message into their respective placeholder elements. Follows the existing JS-injection pattern soindex.htmlstays untouchedbindSearchEvents()— attachesinputandclicklisteners after the markup exists in the DOMfilterTasks(query)— iterates over rendered<li data-task-id>elements, looks each one up in thetasksarray by ID, and togglesli.hiddenbased on a case-insensitiveincludes()match. Thetasksarray is never modifiedupdateNoResultsMessage(matchCount, query)— shows a contextual "No tasks match '…'" message when zero items pass the filtertoggleClearButton(query)— shows/hides the ✕ button whenever the input has textrenderTasks()now callsfilterTasks(searchQuery)at the end so any active search is automatically re-applied after a task is added, deleted, or updated without extra wiringArchitecture Decisions
Why DOM-only filtering instead of mutating
tasks?Keeping the
tasksarray intact means other contributors working on persistence (#9), the full task renderer (#10), and filter controls (#13) all read the same clean source of truth. Filtering is purely a presentational concern and is handled entirely in the DOM layer.Why
data-task-idas the bridge?Each
<li>carries adata-task-idattribute sofilterTaskscan look up the corresponding task object by ID and read its text for matching. This contract will hold when Issue #10 replaces the temporaryrenderTasks()with its full implementation — it just needs to keep the attribute on each list item.Why
type="search"on the input?It gives mobile users a search-action keyboard, offers a native browser clear affordance as a fallback, and semantically describes the input's purpose to assistive technologies.
How to Test
"read") — only matching tasks should appear instantly"READ","Read", and"read"should all return the same results"zzzz") — a "No tasks match…" message should appear with the query term highlightedNotes for Teammates
Related Issues
Closes #19 — Implement Real-time Task Search