Add response filter history with pinning - #338
Conversation
|
@gschier could you please review the response filter history changes |
|
@gschier fixed the lint issue |
|
Will get to it when I have time. Feature PRs usually take a while for me to get around to |
Greptile SummaryThe PR changes response filtering from live updates to explicit application and adds request-scoped recent-filter history with pinning.
Confidence Score: 4/5The PR is not yet safe to merge because a pending successful filter evaluation can restore history that the user removed or cleared. The successful evaluation callback still performs an unconditional delayed history write, so deletion and clear operations can be undone when an earlier filter request settles afterward. Files Needing Attention: apps/yaak-client/hooks/useResponseFilter.ts, apps/yaak-client/hooks/useRecentFilters.ts
|
| Filename | Overview |
|---|---|
| apps/yaak-client/hooks/useResponseFilter.ts | Introduces separate draft and applied filter state, explicit asynchronous validation, and successful-expression recording. |
| apps/yaak-client/hooks/useRecentFilters.ts | Adds request-scoped persisted history operations, pinning, deduplication, and bounded eviction. |
| apps/yaak-client/components/responseViewers/TextViewer.tsx | Adds explicit apply interactions, the recent-history dropdown, and an applied-filter status banner. |
| apps/yaak-client/components/responseViewers/HTMLOrTextViewer.tsx | Connects filter validation and display to the shared response-body query cache. |
| apps/yaak-client/hooks/useResponseBodyText.ts | Extracts reusable response-body query options for validation and display. |
| apps/yaak-client/components/responseViewers/RecentFiltersDropdown.tsx | Adds grouped pinned and recent filter actions with removal and clearing controls. |
Sequence Diagram
sequenceDiagram
participant U as User
participant V as Response viewer
participant Q as Response query
participant H as Filter history
U->>V: Enter or select expression
V->>V: Set applied filter
V->>Q: Evaluate expression
Q-->>V: Successful filtered response
V->>H: Record successful expression
H-->>V: Updated recent filters
Reviews (7): Last reviewed commit: "Add response filter history with pinning..." | Re-trigger Greptile
… apply Co-authored-by: pixel-hawk <kavinprasanth.dev@gmail.com>
Reworked implementation of response filter expression history (thanks @pixel-hawk for the original!).
Storage follows the existing
useRecent*key-value pattern. No migrations or settings.