Skip to content

feat(#473): improve certificate search UX on verify page#727

Merged
AnnabelJoe merged 1 commit into
AnnabelJoe:mainfrom
sophiawilliamz:feat/473-certificate-search-ux
Jul 3, 2026
Merged

feat(#473): improve certificate search UX on verify page#727
AnnabelJoe merged 1 commit into
AnnabelJoe:mainfrom
sophiawilliamz:feat/473-certificate-search-ux

Conversation

@sophiawilliamz

Copy link
Copy Markdown
Contributor

Summary

Resolves #473

Makes certificate lookup more forgiving and easier by handling input variants, providing clear actionable feedback for invalid/empty inputs, and keeping results visible on repeated queries.

Changes

Input normalization (normalizeQuery)

  • Trims whitespace from both ends
  • Detects and unwraps pasted full shareable URLs (e.g. https://solarproof.vercel.app/verify?id=abc123) — the user can paste the full URL and it just works
  • Hex hashes are lowercased automatically so the API always receives a consistent format
  • The input field is updated to show the normalized value after submit

Actionable feedback for invalid inputs (validateQuery)

  • Empty submissions show a clear inline error: "Enter a certificate ID, reading hash, or transaction hash to verify."
  • Very-short strings show: "That looks too short — please enter a full certificate ID or hash."
  • Inline error wired with aria-invalid, aria-describedby, role="alert" for screen readers
  • API error banner includes a contextual hint (UUID format vs. 64-hex hash)

Results persistence

  • Results stay visible at 40% opacity while a subsequent query is loading — no jarring blank flash between searches
  • Results are only replaced once the new API response arrives
  • A friendly empty-state prompt is shown before any search has been run

Bug fixes in the original page

  • handleVerify was not async despite using await — runtime error on every verify attempt
  • setError, trackEvent, endTiming were referenced but never defined — replaced with proper state
  • error vs pageError inconsistency eliminated — single apiError state
  • Auto-verify effect: page now auto-runs a verify when loaded with an ?id= param

UX polish

  • Verify button shows Loader2 spinner while loading (unambiguous loading state)
  • aria-busy on submit button, aria-live region announces results to screen readers
  • spellCheck={false} on the search input (hashes should not be spell-checked)

Acceptance criteria

  • Search accepts certificate IDs, tx hashes, and partial input with normalization (URL stripping, hex lowercasing)
  • Invalid or empty searches display actionable feedback with inline error messages
  • Results area does not disappear unexpectedly on repeated queries (opacity fade instead of wipe)

Input normalization:
- normalizeQuery() strips leading/trailing whitespace
- Detects and unwraps pasted full shareable URLs (/verify?id=...) so users
  can paste the whole URL and still get a valid lookup
- Hex hashes are lowercased automatically for consistent API queries

Actionable feedback:
- validateQuery() catches empty and very-short inputs before hitting the API
- Inline aria-invalid + role=alert paragraph under the input for empty/short
- Richer API error banner with a contextual hint (UUID vs 64-hex hint)
- Loading spinner on the Verify button (Loader2 icon replaces Search while
  loading) so the button state is unambiguous

Results persistence:
- Results stay visible (at 40% opacity) while a subsequent query is loading
  instead of being wiped immediately — prevents jarring blank flash
- Results are only replaced once the new response arrives
- setResult(null) only called on error so stale results don't linger after
  a successful re-query

Bug fixes in original page:
- handleVerify was not async despite using await — now fixed
- setError / trackEvent / endTiming referenced undefined variables — removed
- error vs pageError inconsistency resolved (single apiError state)
- Auto-verify effect added: page auto-runs a verify when loaded with ?id=

Empty state:
- Friendly prompt shown before any search has been run (no blank page)

Accessibility:
- aria-describedby wired to either the hint (sr-only) or the error paragraph
- aria-busy on the submit button during fetch
- aria-live polite region announces results / errors to screen readers

Closes AnnabelJoe#473
@drips-wave

drips-wave Bot commented Jun 29, 2026

Copy link
Copy Markdown

@sophiawilliamz Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@AnnabelJoe AnnabelJoe merged commit 4d05c6c into AnnabelJoe:main Jul 3, 2026
AnnabelJoe added a commit that referenced this pull request Jul 3, 2026
- Add input normalization (URL stripping, hex lowercasing)
- Add input validation with user-friendly error messages
- Extract runVerify callback for reusability
- Auto-verify on page load when ?id= param is present
- Improve accessibility (aria-labels, error announcements)
- Simplify copyLink function

Resolved conflicts:
- apps/web/src/app/verify/page.tsx: took PR version (proper state + runVerify callback)
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.

Improve certificate search UX on verify page

2 participants