Skip to content

Add response filter history with pinning - #338

Merged
gschier merged 1 commit into
mountain-loop:mainfrom
pixel-hawk:dev-branch
Aug 15, 2026
Merged

Add response filter history with pinning#338
gschier merged 1 commit into
mountain-loop:mainfrom
pixel-hawk:dev-branch

Conversation

@pixel-hawk

@pixel-hawk pixel-hawk commented Jan 2, 2026

Copy link
Copy Markdown
Contributor

Reworked implementation of response filter expression history (thanks @pixel-hawk for the original!).

  • Filters now apply on Enter or the apply button instead of live-updating, so partial expressions don't blank the response
  • The applied filter shows in a banner above the response body
  • Successful expressions are remembered per request, with pinning, in a dropdown next to the filter input

Storage follows the existing useRecent* key-value pattern. No migrations or settings.

image

@pixel-hawk pixel-hawk changed the title feat: add response filter (JSONPath / Xpath) history management for requests feat: add response filter history management for requests (JSONPath / XPath) Jan 2, 2026
@pixel-hawk

Copy link
Copy Markdown
Contributor Author

@gschier could you please review the response filter history changes

@pixel-hawk pixel-hawk changed the title feat: add response filter history management for requests (JSONPath / XPath) feat: support for filter history for response Jan 2, 2026
@pixel-hawk pixel-hawk changed the title feat: support for filter history for response feat: add pinnable filter history for response viewers Jan 2, 2026
@pixel-hawk pixel-hawk changed the title feat: add pinnable filter history for response viewers feat: add filter expression history with pinning for JSONPath/XPath responses Jan 2, 2026
@pixel-hawk

Copy link
Copy Markdown
Contributor Author

@gschier fixed the lint issue

@gschier

gschier commented Jan 4, 2026

Copy link
Copy Markdown
Member

Will get to it when I have time. Feature PRs usually take a while for me to get around to

@gschier gschier changed the title feat: add filter expression history with pinning for JSONPath/XPath responses Add response filter history with pinning Aug 14, 2026
@greptile-apps

greptile-apps Bot commented Aug 14, 2026

Copy link
Copy Markdown

Greptile Summary

The PR changes response filtering from live updates to explicit application and adds request-scoped recent-filter history with pinning.

  • Separates draft filter text from the expression currently applied to the response.
  • Adds an applied-filter banner and recent-filter dropdown.
  • Persists successful expressions and supports pinning, removal, and clearing.
  • Reuses the response-body query when validating expressions.

Confidence Score: 4/5

The 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

Important Files Changed

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
Loading

Reviews (7): Last reviewed commit: "Add response filter history with pinning..." | Re-trigger Greptile

Comment thread apps/yaak-client/components/responseViewers/TextViewer.tsx Outdated
Comment thread apps/yaak-client/hooks/useRecentFilters.ts
Comment thread apps/yaak-client/components/responseViewers/TextViewer.tsx Outdated
Comment thread apps/yaak-client/components/responseViewers/TextViewer.tsx Outdated
Comment thread apps/yaak-client/hooks/useResponseFilter.ts
Comment thread apps/yaak-client/hooks/useResponseFilter.ts
… apply

Co-authored-by: pixel-hawk <kavinprasanth.dev@gmail.com>
@gschier
gschier merged commit 2e0f7d1 into mountain-loop:main Aug 15, 2026
3 checks passed
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.

2 participants