feat(dictionary): faster search, browse-by-letter, a11y and share fixes - #77
Open
MadhuS-1605 wants to merge 2 commits into
Open
MadhuS-1605 wants to merge 2 commits into
MadhuS-1605 wants to merge 2 commits into
Conversation
Dictionary page improvements: - search: on an exact/prefix hit, skip the phonetic-sibling shard fetch (and skip sibling widening for 1-akshara queries) — the multi-shard network cost is only paid when the direct lookup finds nothing - useSearch: debounce 120ms -> 220ms so each keystroke doesn't fire a shard load - DictionaryLetterIndex: tap-a-letter varnamale index in the empty state, counts summed from the manifest shards; seeds a prefix search - SearchResults: reset "show more related" via effect instead of a remount key, so the list no longer collapses mid-scroll on each keystroke - a11y: live result-count / "no words found" status line - EntryCard: copied links and citations use CANONICAL_ORIGIN, not the runtime origin (preview deploys were leaking their host into shared URLs) - page: move the offline "download dictionary" button below the search UI Also on this branch (carried from prior session work): - share card: word cards render up to ~5 sense lines, not just defs[0] - proverbs: browse gaade by first letter (full varnamale index) Signed-off-by: MadhuS-1605 <madhusgowda56@gmail.com>
MadhuS-1605
force-pushed
the
feat/dictionary-improvements
branch
from
September 6, 2026 08:06
84caddf to
052c6d3
Compare
…tionary-improvements Signed-off-by: MadhuS-1605 <madhusgowda56@gmail.com> # Conflicts: # src/app/dictionary/page.tsx # src/features/dictionary/components/DictionarySearch.tsx # src/features/dictionary/components/EntryCard.tsx # src/features/proverbs/components/ProverbsBrowse.tsx
Contributor
Author
|
Rebased/merged Conflicting files: Resolution kept
|
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.
Closes #76
What this changes
Search performance (
search.ts,useSearch.ts)searchKannadaloads only the query's own shard(s) up front. It widens to phonetic-neighbour letters (ಸ→ಶ,ಷ) only when the direct exact/prefix lookup finds nothing and the query is 2+ aksharas. An exact hit no longer triggers a multi-shard download.Browse by letter (new
DictionaryLetterIndex.tsx)manifest.shards; letters with no entries are disabled.Results UX (
SearchResults.tsx,DictionarySearch.tsx)SearchResultsno longer remounts on every keystroke (droppedkey={normalise(q)}); the "show more related" expansion is reset with an effect instead, so it stops collapsing mid-scroll.role="status"/aria-live="polite"line:{n} resultsor "no words found" — the no-results state was previously never announced to screen readers.Share / URL correctness (
EntryCard.tsx)CANONICAL_ORIGINinstead ofwindow.location.origin, so links copied from a preview deploy no longer carry the preview host.Page layout (
dictionary/page.tsx)Carried on this branch (adjacent, prior session work)
defs[0](shareCard.tsgainssupportMaxLines; the headword + senses block is centred together).features/proverbs/lib/letters.ts,ProverbsBrowse.tsx).Testing
tsc --noEmitclean.vitest run— 528 tests pass, including a new case insearch.test.tslocking in "sibling shards fetched only on a miss", and new tests for the proverb letter index and the multi-line share card.