Add quote-aware price label with reload and realtime multi-chart cards#13
Open
Add quote-aware price label with reload and realtime multi-chart cards#13
Conversation
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.
Motivation
Description
templates/index.htmlto strengthen the current-price label styling, add a reload button next to the label in all symbol dropdowns, and replace the plain-muted price text with formatted, quote-aware price text.+) modal and autocomplete flow, pluschartDashboard()andchartCard()Alpine components implementing per-card state, a period selector (1Y/3M/1M/1W/1D), a fixed-size sliding window (N=80), 5s polling, dynamic y-axis init/expansion, highlighted current point, line history, non-flickering tooltip, always-visible Y min/max indicators, floating price indicator line/label, and improved X-axis tick formatting dependent on period.detectQuoteCurrency(),formatPriceByQuote()andformatTimestampByPeriod()helpers and updatedsymbolDropdown()to addreloadPrice()and to format prices with explicit quote currency (including BRL locale formatting) while reusing the existing/binance/priceendpoint (force-reload via timestamp query param).internal/service/binance_price_service.gowithBinanceKlinePointandGetKlineClosePrices(...)to fetch and parse close prices from Binance klines; added a new/binance/klinesroute andhandleBinanceKlinesininternal/httpserver/server.goand aBinanceKlinesResponsestruct to return historical points by the selected period/interval mapping.setIntervaland is cleared on card removal to avoid duplicate polling or leaks, and chart initialization reuses the existing price fetch for updates.Testing
gofmt -w internal/service/binance_price_service.go internal/httpserver/server.gosuccessfully.go build ./...which completed successfully in the CI-like environment used here.go run ./cmd/serverbut the process exited early due to an unreachable database host in this environment (DNS fordbnot resolvable), so end-to-end UI runtime verification (browser smoke) could not be executed here.Codex Task