Skip to content

Conversation

@avi1989
Copy link
Owner

@avi1989 avi1989 commented Sep 25, 2025

No description provided.

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
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link

Copilot AI Sep 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
RequestHistory.Add(item);
}
}
catch(Exception e)
Copy link

Copilot AI Sep 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space after 'catch' keyword. Should be 'catch (Exception e)'.

Suggested change
catch(Exception e)
catch (Exception e)

Copilot uses AI. Check for mistakes.
return element.EnumerateArray().Select(FilterJsonElement).ToArray();

default:
return element.GetRawText().Trim('"');
Copy link

Copilot AI Sep 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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();
}

Copilot uses AI. Check for mistakes.
@avi1989 avi1989 merged commit 1488f5f into master Sep 25, 2025
4 checks passed
@avi1989 avi1989 deleted the request-history branch September 28, 2025 08:07
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