Commit graph

62 commits

Author SHA1 Message Date
234b57e8b6 Stamp drawings and alerts with symbol; snap from the instrument profile.
Missing JSON still loads as /ES. No switcher and no second stream.
2026-09-07 04:01:08 -05:00
bc9fed764a Show session high/low as short ticks at the live edge.
Forming daily H/L, not a full-width line. Config default on.
A forming tick only moves the marks if the range actually expanded.
2026-09-01 22:39:37 -05:00
a057341bbf Put Duplicate on the drawings list; do not require a time under the click.
The handler never ran — no event, no POST. Right-click in empty time
also hid the menu. List button uses the selected trendline.
2026-08-28 15:17:19 -05:00
6f03560e74 Default confluence zone alerts off; Config can turn them back on.
Armed drawings and DMA bells still fire. The pref lives in user_prefs
so pushes follow it, not a display checkbox.
2026-08-27 17:09:23 -05:00
e94bd3d3d2 Keep both drawing-visibility rules when hiding manual levels
Resolves a conflict between hide_finer_trendlines and upstream's
drawingVisible helper. They gate on different prefs — hideLowerTfDrawings
versus hide_finer_trendlines — so both apply rather than one replacing
the other.
2026-08-26 06:14:59 +00:00
693d0873f8 diag delay so we can solve trendline slope problem 2026-08-24 01:43:35 -05:00
18585e42cd trendline selection issue 2026-08-23 23:25:55 -05:00
eaf118ef8b drawings from higher timeframes to lower fixes 2026-08-23 21:37:19 -05:00
dae60fdf67 undo 2026-08-21 03:10:31 +00:00
6e69b7337a current bar fix and ma features 2026-08-20 23:15:34 +00:00
92a9d4b3d3 snapping 2026-08-20 16:07:19 +00:00
58a64c1eeb fib levels 2026-08-19 09:09:47 +00:00
08cff3ce53 enable symbols and comments in the future whitespace 2026-08-19 08:36:31 +00:00
44cec38750 slope in tooltip 2026-08-19 05:30:16 +00:00
cc25871032 Keep the Schwab token alive, and reconnect from the header
The live socket never made a REST call, so the seven-day refresh
token expired while the chart still looked fine. A deploy then
could not log in. Ping user preferences every six hours, and when
the grant is already dead offer a one-click reconnect that writes
the token on the existing callback.
2026-08-18 10:11:02 +00:00
d9a272760b Add a Drawings layer toggle that hides lines and comments 2026-08-18 09:53:33 +00:00
7f452703d3 some things only displayed optionally 2026-08-16 21:38:26 -05:00
73beae051a tweaks 2026-08-15 05:14:28 -05:00
11508e5325 tweaks 2026-08-15 04:48:49 -05:00
3adb98c1fe resizable drawing list 2026-08-15 04:33:06 -05:00
777ad4af91 version at bottom 2026-08-15 03:57:31 -05:00
aae47b6681 autoscroll optional 2026-08-14 13:58:44 -05:00
6e781ed163 options finding feature 2026-08-14 06:18:53 -05:00
8ab054cf67 timeframe trendline interactions 2026-08-14 04:58:08 -05:00
952a3bb7f3 animated current price 2026-08-14 03:53:04 -05:00
a09e4f1208 better select and visibility 2026-08-14 03:33:53 -05:00
087d9d9d2a changed ntfy string 2026-08-14 02:44:10 -05:00
f9e02fc3e4 fixed del key bug 2026-08-14 01:12:20 -05:00
7d9644ab55 color select alignment 2026-08-13 20:30:07 -05:00
54f4871757 key nudge for all drawing types 2026-08-13 19:02:49 -05:00
0a56d56261 reposition price level lines 2026-08-13 06:44:01 -05:00
0e2d5fa2cb Expand drawing widths and quarantine live-feed test 2026-08-13 03:54:28 -05:00
32e25b84aa Number alerts, stamp them locally, and compact the zone list
Alerts get a number, assigned server-side and shown in both the push and the
Events list, so a notification on a phone can be matched to a row on a screen
when several fire together. It could not come from the browser: that counter
restarts on reload and differs between tabs. It is persisted next to the
cooldown state, because numbering restarting after a deploy would collide with a
phone's existing notification history — which changed that file from a list to
an object, with the loader still reading the old shape.

Pushes now carry a timestamp in the configured zone rather than the server's.
ALERT_TIMEZONE defaults to America/Chicago; containers run UTC, and a push
reading 02:14 to someone seeing 21:14 costs a translation every time. The
browser already formats its own times locally and is unchanged.

Confluence zones are one line each, ordered by price rather than by proximity,
so the list reads top to bottom the way the chart does and all of them fit on
screen — sixteen zones in 394px, about 25px each, where each previously took a
four-line block. Ordering is a display concern only: the server still returns
them nearest-first, which is what the alert path wants.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-11 21:44:57 -05:00
e957991242 symbol improvements 2026-08-11 19:51:39 -05:00
0bca5d3bb7 color palette improved handling 2026-08-11 19:10:12 -05:00
81045e2128 trendlines should only show numbers until selected or hover 2026-08-11 18:59:12 -05:00
c653e65d5b diagnostic capture feature 2026-08-11 16:08:32 -05:00
a395818581 Post cross-thread events through the loop, and measure how late it runs
P0 from docs/async_refactor.md. The mutating routes are sync `def`, so FastAPI
runs them in a threadpool, and they reach Runtime.broadcast through
rebuild_levels — writing asyncio.Queue directly from there. That queue is not
thread-safe: it wakes a consumer by resolving a Future, which only the loop
thread may do. A dropped wakeup means a drawing made in one browser does not
reach another until the next market tick.

broadcast now posts through call_soon_threadsafe when it is off the loop, and
publishes directly when it is on it, so the stream's own path pays nothing.

Worth being straight about the tests: the race is timing-dependent and did not
reproduce in twenty attempts — a foreign-thread put_nowait usually lands in the
ready queue before the loop sleeps, and a tick every second covers the rest.
Even asyncio's debug thread-affinity check stays quiet unless a consumer is
parked on the Future at that instant. So the tests assert the contract rather
than provoke the failure: a broadcast from a worker thread must go through
call_soon_threadsafe, one from the loop must deliver synchronously, and both
must arrive.

Also adds the loop-lag probe, which reports scheduling drift as loop_lag_ms on
/api/status. It found P1 on its first run: 19,441ms worst against 1.5ms in
steady state, which is seeding blocking the loop. "The chart feels laggy" is now
a number.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-11 15:30:45 -05:00
273d947c0a name change 2026-08-11 15:18:25 -05:00
8ca774f821 compact drawing list 2026-08-11 15:13:48 -05:00
3b3c06a1f3 - Drag a selected trendline body to reposition the entire line.
- Duplicate and delete from the line context menu.
     - Copies shift ten bars right.
     - Default names are up and down; copies become up 2, down 2, etc.
     - Exact local data receipt time including seconds.
     - Deployment timestamp removed.
     - Test cleanup no longer deletes drawings created from your browser.
     - JWT password session flow.
2026-08-11 05:46:09 -05:00
4488c7d4b9 Fix freshness and daily date labels 2026-08-11 04:23:19 -05:00
91677127a0 Unify chart geometry and deepen 30m history 2026-08-11 04:08:02 -05:00
0e32c0bbab Rename to /ESsence and write down the house rules
The header spent a whole line on a "CME FUTURES" eyebrow that told you nothing
the chart didn't — it only ever shows /ES. Dropping it takes the header from
64px to 44px and hands the space to the chart. The title becomes /ESsence.

AGENTS.md records the rules worth keeping, chief among them that a bug should
prompt the question of whether a unit test could reasonably have caught it —
written when the answer is yes, skipped when it is a rendering or data-source
quirk, and named after the failure rather than the function.

It is AGENTS.md rather than CLAUDE.md deliberately: opencode's instruction
loader walks up looking for AGENTS.md only and never reads CLAUDE.md, and the
ask-opencode skill asks the calling agent to distil house rules by hand rather
than forwarding a file. CLAUDE.md is a symlink to it so both tools resolve to
one source of truth.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-10 17:10:24 -05:00
9008e9cd8e Show the trendline Side control only when it can do anything
Snapping now always lands an anchor on a bar extreme, and which extreme it is
decides the side — a high is resistance, a low is support. That left the Side
dropdown unable to affect the result: it was overridden on every drawn line.

It now appears only when "Snap to highs/lows" is off, the one case where there
is no extreme to infer from. With snapping on the row reads "Side auto" instead,
so the behaviour is stated rather than implied by a control that does nothing.
An "Auto" option in the dropdown would have been the same no-op wearing a label.

Verified in a browser both ways, and that the inference itself holds with the
dropdown left on its default: drawing above the candles yields resistance
snapped to the bar high, drawing below yields support snapped to the bar low.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-10 16:18:56 -05:00
9ab68f6cff Add chart comments and turn Lines & levels into Drawings
A comment is a ManualLine with kind="comment", so it inherits persistence, the
shared drawing-number sequence, the list, filtering and deletion rather than
needing a parallel set of endpoints. The rule that must never bend is that
ManualLineStore.levels() excludes them: a comment reaching the level list would
join a confluence cluster and push a phone notification about a piece of text.
It is created with armed=False, and PATCH returns to_dict() rather than
to_level() for a comment, so nothing is ever handed a level-shaped comment.
Three tests cover the exclusion, the shared numbering and the kind derived for
drawings saved before comments existed.

Pinned comments carry anchor_t and anchor_p and travel with the chart; floating
ones carry x and y as fractions of the pane, hold their place through any zoom
and can be dragged. They render as DOM rather than canvas because they hold
arbitrary text, collapse to a numbered dot, and a floating one must ignore the
time scale entirely. A pinned comment scrolled out of view parks on the edge it
left, pointing back toward itself, so it never simply disappears.

Lines & levels becomes Drawings, filtered by type and by text. The text match
covers the label, the kind and the #number, so "comment", "cpi" and "7" all
narrow the list, and Delete acts on whatever the filter shows — which is what
makes deleting by type or by string one button.

Verified in a browser: placing a comment renders it at the click, clicking it
collapses it, scrolling away parks it on the edge, a floating one holds its
pixel position through a 300-bar scroll, and the filters cut 3 rows to 1 by type,
1 by text and 0 for a miss, with no console errors.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-10 15:58:21 -05:00
0465519348 Reclaim the sidebar's vertical space
The right column ran past the viewport with nothing selected. Five changes, none
of which remove functionality.

The five daily MA periods now share one line. 10px gaps and a 22px indent had
pushed 200 onto a row by itself; nowrap, 7px gaps and 12px boxes fit all five
with room to spare. Auto trendlines becomes a parenthetical on the Manual lines
row instead of owning one — it is disabled until M8, so a full row overstated
it. The alert log becomes a collapsible section like Confluence zones, closed by
default with its count in the summary, so activity stays visible while it is
shut and the banner, sound and phone push are untouched.

Tools becomes a collapsible section as well, open by default, and each tool's
panel is now bound to armedTool: the label, colour, width and side controls
appear only for the tool actually armed. armTool already toggled and allowed one
armed tool at a time, so the panels follow it with no new state.

Layers moves above Tools and starts collapsed. The zeroed top margin moves from
a Tools-specific class to .sidebar-section:first-of-type, so reordering again
cannot reintroduce a gap above the first section.

Measured with nothing armed: 1110px of content down to 900px, inside the
viewport rather than past it. Verified in a browser — arming each tool reveals
that tool's panel and no other, disarming hides both, Tools opens by default,
Layers starts closed and still lays its periods out on one line when opened.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-10 15:02:06 -05:00
a0b8ac1cd2 Reclaim vertical space in the layer panel
Three cuts, so the right column keeps more of itself for the chart.

The five daily MA periods now sit on one line. 10px gaps and a 22px indent had
pushed 200 onto a row by itself; nowrap, 7px gaps, a 4px label gap and 12px
boxes fit all five with room to spare, verified as five labels sharing one
offsetTop and no horizontal overflow.

Auto trendlines becomes a parenthetical on the Manual lines row instead of
owning a row. It is disabled until M8 builds it, so a full row overstated it.

The alert log becomes a collapsible section like Confluence zones, closed by
default with its count in the summary. Closed by default is the point — leaving
it open would reclaim nothing — and the count keeps activity visible while it
is shut, with the banner, sound and phone push unaffected either way.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-10 14:55:55 -05:00
f64576372c Add Font Awesome 7.3.1 and move the tool glyphs onto it
The sidebar drew its tool icons with box-drawing characters, which render at the
mercy of whatever font the system picks. Two are converted as the first users of
the icon set: a trend arrow for Trendline, a rule for Price level.

Served from unpkg, matching Vue and Lightweight Charts, and pinned for the same
reason they are — an unpinned icon set is a silent redesign on someone else's
release. cdnjs was the first choice and does not carry 7.3.1 on that path; it
404s, which in a browser shows up only as icons that quietly fail to their
fallback font at zero width. Verified rendering: computed family is
"Font Awesome 7 Free" at 17.5px with glyph content, no failed requests.

Lucide 1.31.0 is the lighter alternative if the weight ever matters — stroke SVGs
that can be inlined, dropping the CDN dependency entirely.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-10 06:10:28 -05:00
2efcec6a76 Price trendlines across bars, add one-shot alerts, collapse layers, drop 1h MAs
The trendline bug: a line continued past its second anchor at a different
slope. Two conventions were fighting, and both were wrong.

Lightweight Charts spaces bars evenly however much time separates them — a
weekend is forty-nine hours and one bar wide. The renderer extended the line by
interpolating between bar indices, which looked straight but disagreed with the
server, since price_at() advances per second. Measured on real bars that reached
147 points: the chart drew a level the alerts did not believe in. Making the
renderer match price_at() fixed the disagreement and made the visible kick worse,
because now the line really did climb an hour's worth of slope across a one-bar
maintenance break.

Neither convention is what a person means by drawing a line. A trendline advances
per bar, so both sides now evaluate in bar space: a new bar_space module the
runtime uses to position sloped levels, mirrored by indexAt() in the chart. The
line is straight on screen and the alert fires where it is drawn.

Also, from testing against the live chart:

- A plain click with the trendline tool armed did nothing and left the tool
  armed, so the next click began a new line — which is how the slope change was
  first noticed. Click-click and press-drag-release are both supported now, with
  the rubber band following the cursor between clicks.
- Hand-placed levels are armed, fire once, then disarm themselves, and can be
  re-armed from the sidebar. Verified end to end: created armed, tripped within
  thirty seconds, disarmed, re-armed.
- Layers is collapsible.
- The 1h moving averages are gone; only the daily set remains.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-10 04:15:05 -05:00