Precise risk-free entry, and autoload the latest saved run - #23
Merged
Merged
Conversation
GusFurtado
force-pushed
the
rail-cleanup-and-fixes
branch
from
September 12, 2026 00:52
40caf31 to
7eb210d
Compare
Risk-free rate: - Slider step tightened from 5 to 1 (81 positions instead of 17 — 5x finer dragging resolution). - The read-only value display is now an editable text field: type an exact rate directly rather than fighting the slider for it. Plain text, not <input type="number"> — a number input's displayed decimal separator follows the browser's locale (this session's browser shows commas), while its underlying value is always period-formatted regardless, which would silently break for anyone typing what looks like a perfectly normal number in their own locale. Comma is accepted as an alias for the decimal point when parsing instead. - Commits on `change` (blur/Enter), not `input`, and the render loop skips reformatting the field while it's focused — typing a value doesn't fight itself, and an unrelated render() firing mid-edit (e.g. the running overlay finishing) doesn't reset the cursor either. - Real, previously-unnoticed bug fixed along the way: nothing ever moved the *slider's* thumb except its own drag handler, so toggling units, typing an exact value, or loading a saved run with a different rate all left the thumb sitting wherever it last was, out of sync with the actual state. renderRfControl() now syncs it every render. Saved runs: - init() now loads the most recent saved run automatically (saved runs are stored newest-first) if one exists, instead of always starting from the empty state. First-time visitors with nothing saved still get the get-started card. Verified with headless Chromium: typing an exact rate (including comma-decimal) moves both the display and the slider correctly and round-trips through the annualized toggle; a genuinely-focused mid-edit survives an unrelated render() unreformatted; invalid input reverts cleanly; loading two seeded saved runs on a fresh page auto-selects the newest one and fires a real analyze call with its tickers/period. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
GusFurtado
force-pushed
the
rf-precision-and-autoload
branch
from
September 12, 2026 00:53
bfd1583 to
fb3a2b4
Compare
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.
Context
Two more items from feedback. Stacked on #22.
Risk-free rate precision
<input type="number">, but a number input's displayed decimal separator follows the browser's locale (this session's browser renders commas) while its underlying.valueis always period-formatted regardless — a recipe for someone typing what looks like a completely normal number in their own locale and having it silently fail to parse. Switched to plain text withinputmode="decimal", and comma is accepted as an alias for the decimal point when parsing.change(blur/Enter), notinput, and the render loop skips reformatting the field while it's focused, so typing doesn't fight itself and an unrelatedrender()firing mid-edit (e.g. the running overlay finishing) doesn't reset the cursor.renderRfControl()now syncs it on every render.Autoload the latest saved run
init()now loads the most recent saved run automatically (saved runs are stored newest-first) if one exists, instead of always starting from the empty state. First-time visitors with nothing saved still get the get-started card.Verification
Headless Chromium: typing an exact rate (including comma-decimal) moves both the display and the slider correctly and round-trips through the annualized toggle; a genuinely-focused mid-edit survives an unrelated
render()unreformatted; invalid input reverts cleanly; loading two seeded saved runs on a fresh page auto-selects the newest one and fires a real analyze call with its tickers/period.🤖 Generated with Claude Code