feat(web): restore header search icon on non-home pages#249
Merged
Conversation
Search icon was removed in 3e53e3e (clean header) on the assumption that the hero search on home was enough. It wasn't — on every other page (library, discover, vocabulary, reader, etc) the hero is gone and users had nowhere to launch a search from. User report: 'не очевидно где его искать'. Re-add the search icon to Header.tsx, but only on non-home routes. Home keeps the prominent hero input (no duplicate UI in chrome). The icon opens the existing MobileSearchOverlay component (was orphaned in Search.tsx after the removal, now wired back up). - isHomePage check: /^\/(en|uk)?\/?$/ — covers /, /en, /en/, /uk, /uk/ - nav.search i18n key added (en.json) - Telemetry: emit('header.click', { item: 'search' }) - +10 Header tests covering visibility per route + open/close overlay flow - Total Header tests: 4 → 14; web suite 474 → 484 Tested manually via Playwright: - /en/ — no search icon in header (hero search present) - /en/books/ — search icon visible, clicking it opens overlay Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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
User-reported regression: search is no longer discoverable on inner pages.
Search icon was removed in
3e53e3e("clean header") on the assumption that the hero search input on home was enough. It wasn't — on every other page (library, discover, vocabulary, reader, book detail, …) the hero is gone and users have no entry point to search.Changes
Header.tsx— re-importMobileSearchOverlay, adduseLocation+isHomePageregex (/^\/(en|uk)?\/?$/— covers/,/en,/en/,/uk,/uk/), render search icon button only when!isHomePage. Clicking opens the overlay (was orphaned inSearch.tsx, now wired back up). Wired to existingemit('header.click', { item: 'search' })telemetry channel.en.json—nav.searchi18n key.Header.test.tsx— +10 cases:/,/en,/en/,/uk(home variants)/en/library,/en/discover,/en/vocabulary,/en/books/foo(inner pages)Why keep home iconless
Home's
HeroSectionrenders a prominent full-width search input. Putting a second search icon in the header would be visual duplication and pull attention away from the hero. On every other route the hero is gone — that's where we need the chrome affordance.Tests
pnpm test— 484 passed (was 474, +10 new Header cases)pnpm tsc --noEmit— clean/en/header: Upload + dark_mode + Sign in (no search icon ✓)/en/books/header: Upload + Search + dark_mode + Sign in (search icon present ✓)Rollback plan
Single revert —
git revert <merge-sha>. No DB / API / behaviour changes. Pure UI restore.Notes
MobileSearchOverlaywas already maintained inSearch.tsx(used byHeroSection). This PR just adds a second call-site; no new component code.isHomePageregex matches both/enand/ukroots — if a third locale lands, extend the alternation.header.clickalready exists; newitem: 'search'value will start showing up in dashboards immediately after merge.🤖 Generated with Claude Code