Skip to content

Add sidebar price graph configuration and UI components#81

Open
irpepper wants to merge 1 commit into
cbrewitt:mainfrom
irpepper:sidebar_graph
Open

Add sidebar price graph configuration and UI components#81
irpepper wants to merge 1 commit into
cbrewitt:mainfrom
irpepper:sidebar_graph

Conversation

@irpepper

@irpepper irpepper commented Mar 1, 2026

Copy link
Copy Markdown

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

  • Sidebar graph panel
    New SidebarGraphPanel shows a small price chart for the active suggestion (buy/sell), with loading and empty states. Reuses the existing GraphPanel in a “sidebar” mode (no volume bars, fewer axis ticks, dedicated colors and padding).
  • Config
    New config section “Sidebar price graph” with:
    • Show sidebar price graph – toggle visibility (default on).
    • Minutes before now / Minutes after now – time window for the graph (15–180 minutes each, default 60/60).
  • Data flow
    When the API returns suggestion + graph data, the same Data is stored on SuggestionManager and used by both the main price graph dialog and the sidebar, so no extra request is made for the sidebar.
  • Refresh behavior
    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

  • SidebarGraphPanel
    Builds a new DataManager only when the suggestion or graph data actually changes (cached by item id and suggestion price/type).
  • GraphPanel (sidebar mode)
    Sidebar time bounds are cached and only recomputed when the current minute or the before/after config changes, instead of every paint.
  • ApiRequestHandler
    Uses @RequiredArgsConstructor(onConstructor_ = @Inject) for consistency with the rest of the codebase.
image image

- 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.
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