Skip to content

feat: Saved Responses sidebar panel with search, filter, and CRUD#7

Merged
markkr125 merged 4 commits intomainfrom
saved-responses
Mar 12, 2026
Merged

feat: Saved Responses sidebar panel with search, filter, and CRUD#7
markkr125 merged 4 commits intomainfrom
saved-responses

Conversation

@markkr125
Copy link
Owner

Summary

Adds a fully self-contained Saved Responses panel to the right sidebar, allowing users to browse, search, filter, rename, duplicate, and delete saved response examples without leaving the main editor view.

Changes

New: saved_responses sub-package (saved_responses)

  • panel.pySavedResponsesPanel with list/detail splitter layout. Selecting a saved response displays its body (with Pretty/Raw toggle), headers, and request snapshot inline.
  • delegate.py — Custom painted list delegate with coloured status-code badge, response name, and metadata line (date, language, size).
  • search_filter.py_PanelSearchFilterMixin adding body search (Ctrl+F, match highlighting, prev/next navigation) and structured filter (JSONPath for JSON, XPath for XML).
  • helpers.py — Extracted formatting utilities: body size formatting, language detection, JSON/XML pretty-printing, header rendering.

Service & repository layer

  • CollectionService: new static methods — get_saved_responses(), get_saved_response(), save_response(), rename_saved_response(), delete_saved_response(), duplicate_saved_response().
  • SavedResponseDict TypedDict for normalized saved response payloads.
  • Repository: new functions for rename, delete, duplicate, and query (ordered by created_at DESC).

Sidebar integration

  • RightSidebar gains a floppy-disk icon rail button that toggles the Saved Responses flyout panel.
  • MainWindow wires panel signals (save_current_requested, rename_requested, duplicate_requested, delete_requested, refresh_requested) and refreshes the panel on tab switch and after HTTP send.
  • ResponseViewerWidget emits save_availability_changed(bool) so the sidebar can enable/disable "Save Current".

UI polish

  • Selected list items now use palette.highlightedText() for both name and metadata text (fixes invisible text on selection).
  • status_color() added to theme for status-code badge colouring.
  • Global QSS rules added for new objectName selectors (savedResponseStatusBadge).

Tests

  • 455 new lines in test_saved_responses_panel.py covering panel rendering, selection, context menus, search, filter, empty states, and delegate painting.
  • 77 new lines in test_service.py for saved response CRUD service methods.
  • Updated test_response_viewer.py and test_sidebar.py for new panel integration.

@markkr125 markkr125 merged commit 06ffc51 into main Mar 12, 2026
3 checks passed
@markkr125 markkr125 deleted the saved-responses branch March 12, 2026 19:47
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.

1 participant