Snapping took the bar sharing the cursor's time and then its nearer extreme, which ignored how far away that extreme was. Pointing below a candle snapped to that candle's low however distant, while the extreme genuinely under the cursor was never considered. Zoomed out to some 360 bars at three pixels apart, that made hitting the bar you meant a matter of several tries. snapPoint now scans six bars either side and takes the extreme nearest in pixels. Proven by probe: with the cursor sitting exactly on one bar's low but nudged two pixels so coordinateToTime resolves to its neighbour, the snap takes the extreme under the cursor rather than the neighbour's. A report of the snap dot appearing "way above the bar" turned out to be the dot landing correctly on the low while the cursor was 151 points below it: the right price scale keeps a bottom margin of 0.1 and the volume overlay is drawn in it, so the lower fifth of the pane sits below every candle. bin/e2e runs tests/e2e against the dev stack inside the playwright service — Node's own test runner, no dependency added here, since Playwright is global in that container. Eleven cases, each one a bug that shipped: the viewport parked ten hours in the past, hourly candles drawn as slivers, stale bar events throwing, comments drifting across a timeframe switch, and three ways a trendline anchor could disagree with its preview. Not one was reachable from pytest. Tests delete any drawing they create, because the dev store is shared with whoever is looking at the app. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
29 lines
942 B
YAML
29 lines
942 B
YAML
# Local development stack. Production (chart.amow.com) is built by Coolify
|
|
# with nixpacks straight from this repo — it does not use this file.
|
|
services:
|
|
api:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.dev
|
|
ports:
|
|
# Host port is overridable. Port 8000 is already used by Coolify on the VPS.
|
|
- "0.0.0.0:${PORT:-8010}:8000"
|
|
volumes:
|
|
# Bind-mount the source so --reload picks up edits without a rebuild.
|
|
- .:/app
|
|
environment:
|
|
- PYTHONDONTWRITEBYTECODE=1
|
|
- PYTHONUNBUFFERED=1
|
|
|
|
playwright:
|
|
image: mcr.microsoft.com/playwright:v1.55.0-noble
|
|
command: sh -c "npm install --global playwright@1.55.0 && sleep infinity"
|
|
depends_on:
|
|
- api
|
|
ipc: host
|
|
environment:
|
|
- LANG=en_US.UTF-8
|
|
volumes:
|
|
- ./artifacts/playwright:/artifacts
|
|
# The e2e suite runs in here; the app is http://api:8000 on this network.
|
|
- ./tests/e2e:/repo/tests/e2e:ro
|