Skip to content

feature: live component search in the demo app navigation drawer - #11

Open
sohankshirsagar wants to merge 4 commits into
mainfrom
devin/1789417411-drawer-component-search
Open

sohankshirsagar wants to merge 4 commits into
mainfrom
devin/1789417411-drawer-component-search

Conversation

@sohankshirsagar

Copy link
Copy Markdown

Summary

The demo drawer lists 17 components with no way to jump to one; this adds a ZdsSearchView header that filters the drawer menu as you type, so the ZDS catalog is browsable by name.

NavigationSearch.attach(navView) inflates a second header (the existing navigation_header stays at index 0, so getHeaderView(0) in MainActivity is unaffected) and drives the existing navigation_drawer menu directly — no new menu model:

onQueryTextChange(q)  -> item.setVisible(title.contains(q)); submenu hidden when 0 children match
                         empty-state TextView shown when nothing matches
onQueryTextSubmit(q)  -> if exactly one leaf is visible, performIdentifierAction() (enter jumps straight to it)
onNavigationItemSelected -> mNavigationSearch.reset()  // clear query + restore all items

Two non-obvious details:

  • syncActionView() hides an item's badge action view while the item is filtered out. Without it, NavigationView's recycler re-attaches the "24" badge from the hidden Buttons row onto whatever row lands in that position.
  • Footer spacer items are skipped by the filter so drawer spacing is unchanged.

Also renames ic_currency_north_america_$_{round,sharp}.xml (unreferenced, added by an automated deps commit) to ..._usd_...: AAPT rejects $ in resource filenames, which fails assembleDebug on main today.

Screenshots

Drawer with the search field, filtered results, and the empty state:

Drawer search field
Filtered to "tab"
No matches

Devin-Org: engineering

Link to Devin session: https://app.devin.ai/sessions/a3b2a208d83f4550abcbbc2bfab5ae0a
Open in Devin Desktop: https://app.devin.ai/desktop/session/a3b2a208d83f4550abcbbc2bfab5ae0a?variant=devin
Requested by: @sohankshirsagar

devin-ai-integration Bot and others added 2 commits September 14, 2026 20:23
Co-Authored-By: Sohan Kshirsagar <sohan.kshirsagar@gmail.com>
…filtered rows

Co-Authored-By: Sohan Kshirsagar <sohan.kshirsagar@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

devin-ai-integration Bot and others added 2 commits September 14, 2026 20:28
Co-Authored-By: Sohan Kshirsagar <sohan.kshirsagar@gmail.com>
…n dark mode

Co-Authored-By: Sohan Kshirsagar <sohan.kshirsagar@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown

Verified on an Android emulator (API level of the devin AVD, 1080x2400), including rechecks of the two fixes made during testing (multi-match submit, dark empty state).

Drawer search verification
  • Passed: live filtering across the Buttons submenu and top-level items, case-insensitive.
  • Passed: buttons → 3 results, Enter stays in the drawer; snack → 1 result, Enter opens Snackbar.
  • Passed: selecting an item navigates, clears the query, and restores the full menu.
  • Passed: the 24 badge stays on Buttons and never lands on a filtered-in row.
  • Passed: dark-mode empty state readable after dc94c7d.
Multiple results: Enter does not navigate Dark empty-state fix
Three results retained after Enter Readable dark no-results message

Drawer search recording

Limitations and pre-existing finding

One local emulator only; no physical device or alternate screen sizes. The ZdsSearchView query hint is still dim in dark mode — Zds.SearchView sets android:textColorHint=@color/zebra_hint and values-night/colors.xml has no zebra_hint override, so it affects the existing Search demo screen too. Left out of this PR.

Devin session

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