Skip to content

Feat/trust lookup history#472

Open
Devadakene wants to merge 2 commits into
CredenceOrg:mainfrom
Devadakene:feat/trust-lookup-history
Open

Feat/trust lookup history#472
Devadakene wants to merge 2 commits into
CredenceOrg:mainfrom
Devadakene:feat/trust-lookup-history

Conversation

@Devadakene

Copy link
Copy Markdown

This PR closes #445

Description

This pull request adds a local, capped, and de-duplicated recent lookups history to the Trust Score page, turning repeated Stellar address checks into a single click.

Key Features

  1. Lookup History Persistence:

    • Persists lookups locally using the existing useLocalStorage hook under the key 'credence:recent-lookups'.
    • Capped at the last 5 entries, de-duplicated, and sorted with the most recent lookup at the top.
    • Cleans up and filters any corrupt or invalid localStorage payloads on load.
  2. Keyboard-Accessible Recent Lookups UI:

    • Renders a control below the AddressInput presenting the recent lookups.
    • Utilizes native <button> elements to guarantee keyboard focusability and activation (via space/Enter).
    • Dynamically respects the addressDisplay settings ('short'/'full'/'friendly') from SettingsContext. If set to 'friendly' and the entry matches the currently connected wallet, it renders 'My Wallet'.
    • Incorporates a "Clear history" button to easily reset the lookup list.
    • The control is hidden automatically if the history is empty.
  3. URL & Active State Integration:

    • Clicking a recent lookup button pre-fills the address input, updates the URL ?address= parameter for query parameter synchronization, and triggers the score lookup immediately.

Files Modified

  • src/pages/TrustScore.tsx: Added recent lookups state, logic, event handlers, and UI markup.
  • src/pages/TrustScore.css: Styled the lookup history container, list, action buttons, and clear button with accessible focus rings and hover transitions.
  • src/pages/TrustScore.test.tsx: Added comprehensive RTL tests verifying capping/de-duplication ordering, clear actions, selection-triggered lookups, formatting modes, and corrupt fallback handling.

Devadakene added 2 commits June 29, 2026 01:15
Documents the 360px/768px contract, per-route grid reflow citing real sources, the layout spacing-token rule, and a manual responsive QA checklist.
…ted history

Adds a keyboard-accessible recent-lookups control backed by useLocalStorage that respects the addressDisplay setting and supports clearing.
@drips-wave

drips-wave Bot commented Jun 29, 2026

Copy link
Copy Markdown

@Devadakene 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

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.

Persist and restore the Trust Score lookup history in localStorage with a recent-lookups dropdown

1 participant