Skip to content
This repository was archived by the owner on Jun 16, 2026. It is now read-only.

Add date slider for filtering protocols by activation date#13

Closed
cmehat wants to merge 1 commit into
mainfrom
feat/date-slider
Closed

Add date slider for filtering protocols by activation date#13
cmehat wants to merge 1 commit into
mainfrom
feat/date-slider

Conversation

@cmehat

@cmehat cmehat commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add range slider (bottom-left Leaflet control) to filter protocols by activation date
  • Slider range: earliest activation date to today, step = 1 day
  • Testnet-only protocols (no activation date) only shown when slider is at max
  • Slider disables during playback and re-enables on stop
  • Includes all changes from timeline playback and voting data support

Note: This PR includes the full refactored index.html. Merge after timeline playback PR.

Test plan

  • Move slider left — only older protocols visible
  • Move to minimum — just Athens shown
  • Move to max — all protocols visible, label shows "All protocols"
  • Start playback — slider grays out and is disabled
  • Stop playback — slider re-enables at max position
  • Label updates to "Protocols as of YYYY-MM-DD" when slider is not at max

Refactor index.html with extracted marker helpers (addMarker,
clearAll, showAll). Add play/pause button for animated timeline.
Add date range slider (bottom-left) to filter protocols by
activation date. Slider disables during playback and re-enables
on stop. Testnet-only protocols only shown at max slider position.
Copilot AI review requested due to automatic review settings June 9, 2026 19:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 7 comments.

Comments suppressed due to low confidence (1)

docs/index.html:229

  • filterByDate() assumes activationDate can be compared directly to the slider timestamp, but the slider should operate on calendar days. Precomputing a normalized UTC-day timestamp per entry avoids repeated parsing and ensures inclusions are correct for the displayed date.
      entries = Object.keys(data).map(function (name) {
        var d = data[name];
        d.name = name;
        return d;
      }).filter(function (d) {

Comment thread docs/index.html
var PROTOCOLS_URL = "https://raw.githubusercontent.com/cotezos/tezosprotocolmap/main/protocols.json";
var COLOR_MAINNET = "#1f77b4";
var COLOR_TESTNET = "#ff7f0e";
var DAY_MS = 86400000;
Comment thread docs/index.html
Comment on lines +258 to +264
var dates = entries
.filter(function (d) { return d.activationDate; })
.map(function (d) { return new Date(d.activationDate).getTime(); });

if (dates.length > 0) {
var minDate = Math.min.apply(null, dates);
var maxDate = Date.now();
Comment thread docs/index.html
Comment on lines +201 to +207
var d = entries[i];
if (d.activationDate) {
if (new Date(d.activationDate).getTime() <= timestamp) {
addMarker(i);
count++;
}
} else {
Comment thread docs/index.html
Comment on lines +69 to +74
if (d.voting) {
html += "<br>Voted: Epoch " + esc(String(d.voting.epoch)) +
" \u2014 " + esc(d.voting.result) +
"<br>Ballots: " + d.voting.yayBallots + " yay, " +
d.voting.nayBallots + " nay, " + d.voting.passBallots + " pass";
}
Comment thread docs/index.html
playBtn.href = "#";
playBtn.title = "Play/Pause timeline";
playBtn.textContent = "\u25B6";
playBtn.setAttribute("role", "button");
Comment thread docs/index.html
sliderLabel.style.cssText = "font-size:12px;margin-bottom:6px;color:#333;font-weight:500;";
sliderLabel.textContent = "All protocols";
sliderInput = L.DomUtil.create("input", "", container);
sliderInput.type = "range";
Comment thread docs/index.html
@@ -12,20 +12,25 @@
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
#title { height: 36px; display: flex; align-items: center; padding: 0 14px; background: #1a1a2e; color: #fff; font-size: 14px; font-weight: 600; letter-spacing: 0.3px; }
#title span { opacity: 0.6; margin-left: 8px; font-weight: 400; }
@cmehat

cmehat commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

This project has moved to oyatrino/tezosprotocolmap, where this work has already been merged. Closing as part of deprecating this repository.

@cmehat cmehat closed this Jun 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants