Conversation
The request history is stored in a SQLite database. It is displayed in the UI on a per request basis. The full history can be seen by clicking an icon in the request history sidebar
e165160 to
da5f61b
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a comprehensive request history feature to RestWave, allowing users to track, search, and replay HTTP requests. The feature adds persistent storage of request history with filtering capabilities and session management.
- Adds SQLite-based request history tracking with detailed metadata
- Implements session management for persisting UI state between application runs
- Creates a new History Window with search and filter functionality for browsing all request history
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| RestWave/Views/MainWindow.axaml.cs | Adds history menu item click handler to open history window |
| RestWave/Views/MainWindow.axaml | Adds History menu item to Tools menu |
| RestWave/Views/HttpView.axaml.cs | Implements request history tracking, session management, and history pane functionality |
| RestWave/Views/HttpView.axaml | Updates UI layout with history panel and related controls |
| RestWave/Views/HistoryWindow.axaml.cs | Creates dedicated history window with search and replay functionality |
| RestWave/Views/HistoryWindow.axaml | Defines UI for comprehensive history browsing with filters |
| RestWave/Views/Components/HistoryConverters.cs | Implements value converters for formatting history display data |
| RestWave/ViewModels/HttpViewModel.cs | Adds request history integration and replay functionality |
| RestWave/ViewModels/HistoryViewModel.cs | Creates view model for history management with search and pagination |
| RestWave/ViewModels/CollectionsViewModel.cs | Adds method to programmatically select requests by name |
| RestWave/Services/SessionManager.cs | Implements session persistence for UI state and current request |
| RestWave/Services/RequestsManager.cs | Adds history updates for request/collection rename and move operations |
| RestWave/Services/HistoryManager.cs | Core service for SQLite-based request history storage and retrieval |
| RestWave/Services/ConfigManager.cs | Fixes configuration loading logic |
| RestWave/RestWave.csproj | Adds SQLite and JSON dependencies |
| RestWave/Models/SessionState.cs | Defines session state data structure |
| RestWave/Models/RequestHistoryItem.cs | Defines request history item data structure |
| RestWave/Models/Config.cs | Adds configuration options for history and session features |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| } | ||
|
|
||
| protected override void OnLoaded(RoutedEventArgs e) | ||
| protected override async void OnLoaded(RoutedEventArgs e) |
There was a problem hiding this comment.
Using async void should be avoided except for event handlers. Consider making this method return Task and using async/await properly, or handle exceptions within the method to prevent unhandled exceptions.
| RequestHistory.Add(item); | ||
| } | ||
| } | ||
| catch(Exception e) |
There was a problem hiding this comment.
Missing space after 'catch' keyword. Should be 'catch (Exception e)'.
| catch(Exception e) | |
| catch (Exception e) |
| return element.EnumerateArray().Select(FilterJsonElement).ToArray(); | ||
|
|
||
| default: | ||
| return element.GetRawText().Trim('"'); |
There was a problem hiding this comment.
The Trim('"') operation assumes the JSON element is a string with quotes, but other JSON value types (numbers, booleans, null) don't have quotes. This could cause incorrect data filtering for non-string values.
| return element.GetRawText().Trim('"'); | |
| switch (element.ValueKind) | |
| { | |
| case JsonValueKind.String: | |
| return element.GetString(); | |
| case JsonValueKind.Number: | |
| // Try to get as int, long, or double, fallback to string | |
| if (element.TryGetInt64(out long l)) | |
| return l; | |
| if (element.TryGetDouble(out double d)) | |
| return d; | |
| return element.GetRawText(); | |
| case JsonValueKind.True: | |
| case JsonValueKind.False: | |
| return element.GetBoolean(); | |
| case JsonValueKind.Null: | |
| return null; | |
| default: | |
| return element.GetRawText(); | |
| } |
No description provided.