Skip to content

Tell open tabs when a new version is deployed - #8

Merged
Kernel-Hunter merged 1 commit into
mainfrom
auto-update
Oct 31, 2026
Merged

Kernel-Hunter merged 1 commit into
mainfrom
auto-update

Conversation

@Kernel-Hunter

Copy link
Copy Markdown
Owner

Tabs that stay open now find out about a new deploy.

  • The build hashes its files into a build id and writes it into index.html and version.json. A deploy that changes nothing, such as a README commit, keeps the same id and shows no banner.
  • The app checks version.json (cache-busting query, no-store) when the tab becomes visible again and every 30 minutes, then shows "Kandle was updated." with Reload and close in the toast corner.
  • Before reloading it saves the drawings and the script draft immediately. Layouts, indicators, scripts, the watchlist and alerts are already saved as they change. If bar replay is running, or the tab shows a shared chart that has not been kept, the banner lists what would be lost and offers Reload anyway or Not now.
  • Embeds and framed pages never check.
  • The Pages workflow checks that index.html and version.json carry the same id.
  • New FAQ entry on getting a new version.

Tested with unit tests and a Playwright run against builds served under /kandle/ the way Pages serves them. Going from A to B kept a drawing, RSI, the 4h timeframe, two charts and a script draft typed right before Reload. The replay warning showed and Not now left the page alone, and an embed on an old build never fetched version.json.

The build writes a hash of its files into index.html and version.json.
A tab checks version.json when it becomes visible again and every 30
minutes, and shows "Kandle was updated" with a Reload button. Before
reloading it saves the drawings and the script draft right away, and if
bar replay is running or a shared chart is not kept yet, it says so and
waits for a second click. Embeds never check.
@Kernel-Hunter
Kernel-Hunter merged commit 25c6ef2 into main Oct 31, 2026
2 checks passed
@Kernel-Hunter
Kernel-Hunter deleted the auto-update branch October 31, 2026 20:02
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