Add sidebar price graph configuration and UI components#81
Open
irpepper wants to merge 1 commit into
Open
Conversation
- Introduced a new sidebar graph section in FlippingCopilotConfig for price visualization. - Added sidebar graph panel to display price trends based on user-defined time ranges. - Updated CopilotPanel to include the sidebar graph and refresh logic. - Enhanced SuggestionManager to manage graph data and state. - Implemented necessary UI adjustments in GraphPanel and RenderV2 for sidebar compatibility. - Added configuration options for sidebar graph visibility and time range settings.
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.
Sidebar price graph
Summary
Adds a compact price graph in the Flipping Copilot sidebar that shows recent and near-future prices for the current suggestion. Users can show/hide the graph and configure the time range (minutes before and after “now”) via plugin config.
Changes
Feature
New
SidebarGraphPanelshows a small price chart for the active suggestion (buy/sell), with loading and empty states. Reuses the existingGraphPanelin a “sidebar” mode (no volume bars, fewer axis ticks, dedicated colors and padding).New config section “Sidebar price graph” with:
When the API returns suggestion + graph data, the same
Datais stored onSuggestionManagerand used by both the main price graph dialog and the sidebar, so no extra request is made for the sidebar.Sidebar visibility and time range respond immediately to config changes. Refreshes are coordinated through
CopilotPanel.refresh()so the suggestion panel, controls, and sidebar graph stay in sync.Code quality
Builds a new
DataManageronly when the suggestion or graph data actually changes (cached by item id and suggestion price/type).Sidebar time bounds are cached and only recomputed when the current minute or the before/after config changes, instead of every paint.
Uses
@RequiredArgsConstructor(onConstructor_ = @Inject)for consistency with the rest of the codebase.