Add History Filter Feature (Fixes Issue #511)#513
Add History Filter Feature (Fixes Issue #511)#513ECWireless merged 9 commits intolivepeer:feat/add-history-filterfrom
Conversation
|
@Roaring30s is attempting to deploy a commit to the Livepeer Foundation Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
rickstaa
left a comment
There was a problem hiding this comment.
@Roaring30s this is amazing! I do wonder if we can improve the styling a bit to make it fit more into the original explorer styling and make it more modern. Let's see if @thebeyondr can help. I also did notice the governance events are not shown.
There was a problem hiding this comment.
Pull request overview
Adds an event-type filtering UI to the Account History view so users can narrow displayed history items by transaction/event kind (Issue #511).
Changes:
- Introduces a
useHistoryFilterhook to manage selected event types, filtered results, and popover open/close behavior. - Adds a
HistoryFilterpopover component (with badge count, clear/done actions, and a scroll-close behavior). - Integrates filtering into
components/HistoryView/index.tsxby renderingfilteredEventsinstead of the full merged history.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| hooks/index.tsx | Re-exports the new useHistoryFilter hook for consumption via "hooks". |
| hooks/filter/useHistoryFilter.ts | Implements filter state + filtered list derivation + scroll-to-close behavior. |
| components/Icons/FilterIcon.tsx | Adds a small filter SVG icon used by the filter button. |
| components/HistoryView/index.tsx | Wires the filter UI into the history view and switches rendering to filteredEvents. |
| components/HistoryView/HistoryFilter.tsx | Implements the popover UI for selecting event types to filter. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
56b7c67
into
livepeer:feat/add-history-filter
|
Overview
This PR adds a filtering system to the account history view, allowing users to filter transaction events by event type. The implementation includes a new
HistoryFiltercomponent and auseHistoryFilterhook that manages filter state and behavior.Fixes: #511
What Was Added
New Files
hooks/filter/useHistoryFilter.ts- Custom hook for managing filter state and logiccomponents/HistoryView/HistoryFilter.tsx- Filter popover componentModified Files
components/HistoryView/index.tsx- Integrated the filter component into the history viewComponent Walkthrough
HistoryFilterComponentThe
HistoryFiltercomponent renders a filter button and popover interface:Filter Button (
PopoverTrigger)Popover Content
Clear- Removes all selected filtersFilters- Title textDone- Closes the popoverposition: stickyto remain visible while scrolling through filter optionsScrollable Filter List
Styling Details
marginRight: "$3") on all screen sizes to prevent edge touchingHook Walkthrough
useHistoryFilterHookThe hook manages all filter-related state and logic:
State Management
selectedEventTypes- Array of currently selected event type stringsisFilterOpen- Boolean controlling popover visibilityEvent Type Configuration
EVENT_TYPE_LABELS- Maps GraphQL event type names to human-readable labels:BondEvent→ "Bonded"DepositFundedEvent→ "Deposit Funded"NewRoundEvent→ "Initialize Round"RebondEvent→ "Rebond"UnbondEvent→ "Unbond"RewardEvent→ "Reward"TranscoderUpdateEvent→ "Transcoder Update"WithdrawStakeEvent→ "Withdraw Stake"WithdrawFeesEvent→ "Withdraw Fees"WinningTicketRedeemedEvent→ "Winning Ticket Redeemed"ReserveFundedEvent→ "Reserve Funded"ALL_EVENT_TYPES- Array of all available event typesFiltering Logic
filteredEvents- Memoized filtered array of events__typenamewhen filters are activetoggleEventType- Adds/removes event types from selectionclearFilters- Resets all selected filtersUX Behavior
composedPath()to detect if scroll originated from within the popoverFeatures
✅ Filter events by event type
✅ Visual indicator (badge) showing number of active filters
✅ Clear all filters button
✅ Sticky header that remains visible while scrolling filter options
✅ Auto-close popover when scrolling the main page
✅ Responsive design with proper spacing on all screen sizes
Integration
The filter is integrated into the
HistoryViewcomponent:Note: First Pass Implementation
This is the first pass of the history filter feature, implemented to gather feedback on:
Additional Features Needed:
Filter Button Location:
Let me know and I can add the changes.