[PR #338] feat: add filter expression history with pinning for JSONPath/XPath responses #260

Open
opened 2026-03-22 21:11:38 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/mountain-loop/yaak/pull/338
Author: @pixel-hawk
Created: 1/2/2026
Status: 🔄 Open

Base: mainHead: dev-branch


📝 Commits (7)

  • 59ea7ac feat: add response filter (JSONPath / Xpath) history management for requests
  • d9355de Merge remote-tracking branch 'origin/main' into dev-branch
  • c2427ac resolved conflict
  • 09c8dc2 chore: remove .envrc and devenv.lock files, update .gitignore to exclude .envrc
  • 7d85c54 feat: enhance FilterHistoryDropdown with pinning functionality and update useInputHistory hook
  • 9c22c25 feat: update FilterHistoryDropdown and TextViewer to support togglePin functionality; refactor useInputHistory for improved state management
  • 9cbd78a Merge branch 'main' into dev-branch

📊 Changes

28 files changed (+1499 additions, -135 deletions)

View changed files

📝 .gitignore (+14 -0)
devenv.nix (+44 -0)
📝 packages/plugin-runtime-types/src/bindings/gen_models.ts (+63 -10)
📝 packages/plugin-runtime/src/PluginInstance.ts (+1 -1)
📝 src-tauri/yaak-git/bindings/gen_models.ts (+108 -10)
📝 src-tauri/yaak-models/bindings/gen_models.ts (+398 -71)
src-tauri/yaak-models/migrations/20260101000000_max-filter-history-setting.sql (+2 -0)
📝 src-tauri/yaak-models/src/models.rs (+9 -0)
📝 src-tauri/yaak-models/src/queries/grpc_requests.rs (+1 -0)
📝 src-tauri/yaak-models/src/queries/http_requests.rs (+1 -0)
📝 src-tauri/yaak-models/src/queries/key_values.rs (+35 -0)
📝 src-tauri/yaak-models/src/queries/websocket_requests.rs (+1 -0)
📝 src-tauri/yaak-plugins/bindings/gen_models.ts (+63 -10)
📝 src-tauri/yaak-sync/bindings/gen_models.ts (+120 -11)
📝 src-tauri/yaak-templates/pkg/yaak_templates.d.ts (+1 -1)
📝 src-tauri/yaak-templates/pkg/yaak_templates_bg.js (+4 -4)
📝 src-tauri/yaak-templates/pkg/yaak_templates_bg.wasm (+0 -0)
📝 src-web/components/Settings/SettingsGeneral.tsx (+23 -0)
📝 src-web/components/core/Dropdown.tsx (+1 -1)
src-web/components/responseViewers/FilterHistoryDropdown.tsx (+193 -0)

...and 8 more files

📄 Description

This PR implements a history management system for response filters (JSONPath and XPath) in Yaak, allowing users to reuse, and manage their filter expressions across requests.

🚀 What's New

Core Features

  1. History Management
    • On Enter saves JSONPath and XPath filter expressions used in response viewers
    • Maintains a chronological history of filter queries per request
    • Deduplicates entries to keep only the most recent occurrence
    • Clean the filter history when requests are deleted
    • Input sanitization (trims whitespace, ignores empty values)
    • Toast notifications for user actions
image
  1. History Dropdown UI
    • New dropdown component accessible via history icon with count badge
    • Groups history items by time: Today, Yesterday, and Older
    • Visual indication of currently active filter
    • Individual delete buttons for each history entry
    • "Clear All History" action for bulk cleanup
    • Truncates long expressions (80 chars) with full text on hover
image
  1. Pin Functionality
  • Pin frequently-used filters to prevent them from being removed
  • Pinned items are excluded from FIFO cleanup when history limit is reached
  • Pinned filters appear in a dedicated "Pinned" section at the top of the dropdown
  • Pinned status persists when re-entering the same filter expression

yaak_demo


  1. Configurable History Limits
    • New workspace setting: "Max Filter History" (default: 20 items)
    • Configurable range: 10-200 items
    • Accessible via Settings → General
    • Database migration to persist setting
image

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/mountain-loop/yaak/pull/338 **Author:** [@pixel-hawk](https://github.com/pixel-hawk) **Created:** 1/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `dev-branch` --- ### 📝 Commits (7) - [`59ea7ac`](https://github.com/mountain-loop/yaak/commit/59ea7ac390ade95d7c5b5bb8ab971d57cf9b1862) feat: add response filter (JSONPath / Xpath) history management for requests - [`d9355de`](https://github.com/mountain-loop/yaak/commit/d9355de02e4cf1fd0027c059a6859a4ab00cbfd1) Merge remote-tracking branch 'origin/main' into dev-branch - [`c2427ac`](https://github.com/mountain-loop/yaak/commit/c2427ac8f7933958f6b942f1b610b4907adee5d4) resolved conflict - [`09c8dc2`](https://github.com/mountain-loop/yaak/commit/09c8dc250acb574a249d3f055313b282d342824e) chore: remove .envrc and devenv.lock files, update .gitignore to exclude .envrc - [`7d85c54`](https://github.com/mountain-loop/yaak/commit/7d85c5487803b780961c02c4b2adec30b8b0aa61) feat: enhance FilterHistoryDropdown with pinning functionality and update useInputHistory hook - [`9c22c25`](https://github.com/mountain-loop/yaak/commit/9c22c2539efcac3888ffeabbdb67e2fe3e1e8805) feat: update FilterHistoryDropdown and TextViewer to support togglePin functionality; refactor useInputHistory for improved state management - [`9cbd78a`](https://github.com/mountain-loop/yaak/commit/9cbd78ad6ea3b8f6941b782284a3955281af9730) Merge branch 'main' into dev-branch ### 📊 Changes **28 files changed** (+1499 additions, -135 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+14 -0) ➕ `devenv.nix` (+44 -0) 📝 `packages/plugin-runtime-types/src/bindings/gen_models.ts` (+63 -10) 📝 `packages/plugin-runtime/src/PluginInstance.ts` (+1 -1) 📝 `src-tauri/yaak-git/bindings/gen_models.ts` (+108 -10) 📝 `src-tauri/yaak-models/bindings/gen_models.ts` (+398 -71) ➕ `src-tauri/yaak-models/migrations/20260101000000_max-filter-history-setting.sql` (+2 -0) 📝 `src-tauri/yaak-models/src/models.rs` (+9 -0) 📝 `src-tauri/yaak-models/src/queries/grpc_requests.rs` (+1 -0) 📝 `src-tauri/yaak-models/src/queries/http_requests.rs` (+1 -0) 📝 `src-tauri/yaak-models/src/queries/key_values.rs` (+35 -0) 📝 `src-tauri/yaak-models/src/queries/websocket_requests.rs` (+1 -0) 📝 `src-tauri/yaak-plugins/bindings/gen_models.ts` (+63 -10) 📝 `src-tauri/yaak-sync/bindings/gen_models.ts` (+120 -11) 📝 `src-tauri/yaak-templates/pkg/yaak_templates.d.ts` (+1 -1) 📝 `src-tauri/yaak-templates/pkg/yaak_templates_bg.js` (+4 -4) 📝 `src-tauri/yaak-templates/pkg/yaak_templates_bg.wasm` (+0 -0) 📝 `src-web/components/Settings/SettingsGeneral.tsx` (+23 -0) 📝 `src-web/components/core/Dropdown.tsx` (+1 -1) ➕ `src-web/components/responseViewers/FilterHistoryDropdown.tsx` (+193 -0) _...and 8 more files_ </details> ### 📄 Description This PR implements a history management system for response filters (JSONPath and XPath) in Yaak, allowing users to reuse, and manage their filter expressions across requests. ## 🚀 What's New ### Core Features 1. **History Management** - On Enter saves JSONPath and XPath filter expressions used in response viewers - Maintains a chronological history of filter queries per request - Deduplicates entries to keep only the most recent occurrence - *Clean the filter history when requests are deleted* - Input sanitization (trims whitespace, ignores empty values) - Toast notifications for user actions <img width="837" height="224" alt="image" src="https://github.com/user-attachments/assets/54038815-011c-4f70-95e1-af069b2ca25b" /> --- 2. **History Dropdown UI** - New dropdown component accessible via history icon with count badge - Groups history items by time: Today, Yesterday, and Older - Visual indication of currently active filter - Individual delete buttons for each history entry - "Clear All History" action for bulk cleanup - Truncates long expressions (80 chars) with full text on hover <img width="825" height="306" alt="image" src="https://github.com/user-attachments/assets/a19c93b2-e2b0-4ee2-8eff-87ad73160efb" /> --- 3. **Pin Functionality** - Pin frequently-used filters to prevent them from being removed - Pinned items are **excluded from FIFO cleanup** when history limit is reached - Pinned filters appear in a dedicated "Pinned" section at the top of the dropdown - Pinned status persists when re-entering the same filter expression ![yaak_demo](https://github.com/user-attachments/assets/db9e172e-e949-402e-9776-033af7b6b47b) --- 4. **Configurable History Limits** - New workspace setting: "Max Filter History" (default: 20 items) - Configurable range: 10-200 items - Accessible via Settings → General - Database migration to persist setting <img width="1488" height="674" alt="image" src="https://github.com/user-attachments/assets/4d24af3e-bbe8-440c-8e3d-8fec7365a309" /> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-22 21:11:38 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/yaak#260