feat: Persist HTTP send history with global/per-request sidebars, replay, and request duplication#13
Merged
Merged
Conversation
- Deleted the HistoryPanel class and its associated tests, as well as all references to it in the UI and documentation. - Updated the ConsolePanel to serve as the sole bottom panel, simplifying the UI structure. - Adjusted documentation and code comments to reflect the removal of the history functionality.
- Introduced `RequestHistoryService` for persisting HTTP send history, including methods for recording sends, retrieving entries, and managing retention settings. - Added `RequestHistoryEntryModel` to the database schema for storing metadata related to each request, including response bodies and snapshots. - Implemented file-backed storage for request bodies and snapshots in `body_store.py`, ensuring efficient management of historical data. - Updated documentation to reflect new request history features and their integration into the UI, including the HistoryPanel for displaying recorded sends. - Enhanced the database initialization process to handle legacy paths and files, ensuring a smooth transition for existing users.
- Introduced `duplicate_request` method to clone requests along with their saved responses and assertions, ensuring unique naming for duplicates. - Updated `RequestHistoryService` to include new methods for managing request history, including enhanced metadata handling and date filtering. - Enhanced UI components to support the new duplication feature and improved history navigation, including global and per-request history panels. - Updated documentation to reflect changes in request management and history features, ensuring clarity on new functionalities. - Refactored related services and models to accommodate the new request duplication logic and maintain consistency across the application.
- Enhanced the `sidebarPanelArea` documentation to clarify the layout and border behavior, specifically regarding the left and right edges. - Modified the `_show_panel` method in `RightSidebar` to include an `expand_flyout` parameter, allowing for more control over flyout expansion. - Adjusted the handling of flyout panel visibility during drag events to ensure consistent state management. - Updated global QSS styles to reflect the new border handling for the sidebar panel area, ensuring proper visual alignment with the icon rail. - Added a test to verify that collapsing the flyout via dragging clears the history rail highlight correctly.
- Updated error reporting in the `_run_restricted_subprocess` function to include detailed information from the subprocess's stderr and exit code. - Introduced a new `_parse_ipc_line` function to handle parsing of IPC lines, specifically for identifying terminal `__done__` rows. - Modified the `_ipc_loop` function to improve handling of subprocess output and ensure proper termination conditions. - Added a `closeEvent` method in the `HistoryPanel` class to cancel in-flight operations during widget teardown. - Enhanced the `FormatTextRunnable` class to check the validity of signals before emitting results, preventing potential errors.
- Replaced the `Runnable` pattern with dedicated worker classes for loading orphan history and detail entries, improving thread management and signal handling. - Introduced shutdown methods in `OrphanHistoryOpenLoader` and `HistoryDetailLoader` to ensure proper cleanup of worker threads during widget teardown. - Updated `HistoryPanel` and `MainWindow` to call shutdown methods, preventing potential memory leaks and ensuring smooth application closure. - Added a new utility function for safely delivering results from worker threads to the GUI thread.
…uplication - Updated README and documentation to reflect new features including request duplication and comprehensive HTTP send history tracking. - Improved UI components to support the new history and duplication functionalities, ensuring better navigation and user experience. - Added details about the left and right sidebar functionalities, including the integration of history panels for both global and per-request sends. - Clarified settings related to history retention and response body storage in the documentation, enhancing user understanding of the new features.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This branch replaces the removed bottom History panel with a full send history system modeled after Postman: every HTTP send can be recorded, browsed, reopened, and replayed from the sidebars.
Persistence and settings
RequestHistoryServicerecords sends at the end of the normal send pipeline (skipped during debug replay via_suppress_history_record).RequestHistoryEntryModel); response bodies and request snapshots are stored on disk underuser_history_root()viabody_store.py.HistorySettingsManager(history/*QSettings) controls retention, body storage, and related options; Settings → History adds a dedicated configuration page.init_dbmigrates the schema for history entries.UI — history panels
HistoryPanel(src/ui/sidebar/history/) supports two modes:globalHistoryPanel): all sends, search, calendar date filter, Open navigates into the correct request/draft tab via_HistoryNavigationMixin.requestHistoryPanel): sends for the active request, Replay re-runs HTTP from the stored snapshot without loading the editor first.text_format_async.Send pipeline and replay
record_sendruns inon_send_finished.build_send_payload_from_entry/entry_for_replay).ResponseReplayIndicatoron the response viewer labels replayed sends; draft session restore can replay history into the viewer only (send_pipeline_history_replay).Request duplication
CollectionService.duplicate_requestclones a request with saved responses and assertions; tree context menu wired throughCollectionWidget.Sidebar and polish
src/ui/panels/history_panel.pyand its tests.expand_flyouton_show_panel, clearersidebarPanelAreaborder behavior (no double line with the icon rail), QSS updates; drag-to-collapse clears the history rail highlight (tested).Tests and docs
request-history-service.md), sidebar reference, signal-flow / service-repository skills, and nestedAGENTS.mdfiles updated.Scope: 4 commits, ~116 files, +8.3k / −685 lines vs
main.Test plan
(deleted), and draft(draft); confirm correct tab/editor behavior and status messages on failure.poetry run pytest,poetry run ruff check src/ tests/,poetry run ruff format --check src/ tests/,poetry run mypy src/ tests/— all green.