Let an open heatmap tab notice that the store took a new week - #34
Merged
Conversation
The Target Date control is resolved in layout(), which runs once per page load, while the navbar badge sits on a five-minute dcc.Interval. So a tab left open across a Friday release contradicted its own header: the badge moved, the grid did not, and the new week could not even be selected by hand because it was absent from the dropdown. Observed 2026-08-14, when the 2026-08-11 week landed at 15:34. The navbar poller now republishes the week into cot_release_store whenever it changes, and the heatmap re-offers its dates from that. Following the new week is conditional: sitting on the newest is a default nobody chose, so it tracks, while a deliberately chosen older week is left alone and merely gains the new option. The caption moves onto the selected date at the same time. Reading get_available_dates()[0] unconditionally made it a claim about the store rather than about the table beneath it, which was wrong in both directions: stale on an open tab, and wrong on any deliberate look at an older week. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
The heatmap page kept rendering the previous COT week while the navbar badge above it announced the new one.
The Target Date control is resolved in
layout(), which runs once per page load. The navbar badge sits on a five-minutedcc.Interval. So a tab left open across a Friday release contradicted its own header: the badge moved, the grid did not, and the new week could not even be selected by hand because it was absent from the dropdown. Observed 2026-08-14, when the 2026-08-11 week landed at 15:34.What changed
cot_release_store, only when it changes, so the five-minute tick does not wake every subscriber for nothing.get_available_dates()[0]unconditionally made it a claim about the store rather than about the table beneath it, which was wrong in both directions: stale on an open tab, and wrong on any deliberate look at an older week.Unknownmid-sync. Replacing a real date with "unavailable" on a tab that was showing one would misfire on exactly the day it matters most.The arithmetic lives in
next_date_selection, apart from the callback, because a Dash callback cannot be called directly to check it.Tests
tests/test_heatmap_follows_release.py, 9 tests. 147 passed, ruff clean.Callback registration smoke-checked against a built app; not yet exercised in a running instance.
Related
The
Unknownhandling pairs with mspinola/cotmetrics#14, which fixes the same torn read at source. This branch is safe without it: the badge just never seesNoneand keeps printingUnknownas before.🤖 Generated with Claude Code