xonecas.io
8356
Wx

www-xonecas-io / commit da02332

/projects filters by a month range on a two-thumb slider (1020)

Co-Authored-By: Claude Opus 5.5

Sean Caetano Martin2026-11-08 da02332a5b7bd0f9d4b2dda6b579ca4d24047685 parent fb938ee

10 files changed

internal/site/assets/site.css+9−0
@@ -102,3 +102,12 @@
102102 .code .nf, .code .nc { color: #f5a64f; }
103103 .code .nt { color: #ffd166; }
104104 }
105+
106+/* Two-thumb range: two range inputs stacked on one track, and only their thumbs take the pointer. */
107+.range { position: relative; height: 1rem; }
108+.range::before { content: ""; position: absolute; inset: 7px 0; background: var(--color-line); }
109+.range input { position: absolute; inset: 0; width: 100%; margin: 0; appearance: none; background: none; pointer-events: none; }
110+.range input::-webkit-slider-thumb { appearance: none; pointer-events: auto; width: 1rem; height: 1rem; border-radius: 2px; background: var(--color-accent); cursor: pointer; }
111+.range input::-moz-range-thumb { pointer-events: auto; width: 1rem; height: 1rem; border: 0; border-radius: 2px; background: var(--color-accent); cursor: pointer; }
112+.range input:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--color-ink); outline-offset: 2px; }
113+.range input:focus-visible::-moz-range-thumb { outline: 2px solid var(--color-ink); outline-offset: 2px; }
internal/site/rows.go+9−7
@@ -1,6 +1,7 @@
11 package site
22
33 import (
4+ "maps"
45 "slices"
56 "strings"
67 "time"
@@ -25,13 +26,14 @@ func Rows(projects []project.Project) []ProjectRow {
2526 rows := make([]ProjectRow, len(projects))
2627 for i, p := range projects {
2728 r := ProjectRow{
28- El: Element{Num: i + 1, Weight: p.Commits, Sym: symbol(p.Name, taken), Name: p.Name, Group: group(p.Tags), Post: slices.Contains(p.Tags, "post-AI")},
29- Desc: p.Description,
30- From: 100 * day(p.First).Sub(start).Hours() / span,
31- Width: 100 * day(p.Last).Sub(day(p.First)).Hours() / span,
32- Tags: p.Tags,
33- First: p.First,
34- Last: p.Last,
29+ El: Element{Num: i + 1, Weight: p.Commits, Sym: symbol(p.Name, taken), Name: p.Name, Group: group(p.Tags), Post: slices.Contains(p.Tags, "post-AI")},
30+ Desc: p.Description,
31+ From: 100 * day(p.First).Sub(start).Hours() / span,
32+ Width: 100 * day(p.Last).Sub(day(p.First)).Hours() / span,
33+ Tags: p.Tags,
34+ First: p.First,
35+ Last: p.Last,
36+ Months: strings.Join(slices.Sorted(maps.Keys(p.Months)), " "),
3537 }
3638 for _, n := range heat {
3739 if p.Commits >= n {
internal/site/static/projects.js+15−2
@@ -1,5 +1,6 @@
11 // Filters, sorts and searches the /projects list, and keeps the view in the URL.
22 // Tags from different pairs must all match; tags of the same pair match either.
3+// The date range keeps a project with any commit in a month between its two thumbs.
34 const form = document.getElementById("filters"), list = document.getElementById("rows");
45 const search = document.querySelector("input[name=q]"), rows = [...list.children];
56 const sorts = {
@@ -7,15 +8,22 @@ const sorts = {
78 oldest: (a, b) => a.dataset.first.localeCompare(b.dataset.first),
89 commits: (a, b) => b.dataset.commits - a.dataset.commits,
910 };
11+const ym = (y, m) => `${y}-${String(m).padStart(2, "0")}`, months = [];
12+const lo = rows.map(r => r.dataset.first).sort()[0], hi = rows.map(r => r.dataset.last).sort().at(-1).slice(0, 7);
13+for (let y = +lo.slice(0, 4), m = +lo.slice(5, 7); ym(y, m) <= hi; m === 12 ? (y++, m = 1) : m++) months.push(ym(y, m));
1014
1115 function apply() {
1216 const pairs = [...form.querySelectorAll("fieldset")].slice(0, -1)
1317 .map(f => [...f.querySelectorAll(":checked")].map(i => i.value)).filter(p => p.length);
1418 const q = search.value.trim().toLowerCase(), sort = form.sort.value;
19+ const a = Math.min(form.from.value, form.to.value), b = Math.max(form.from.value, form.to.value);
20+ const from = months[a], to = months[b];
21+ document.getElementById("span").textContent = `${from} – ${to}`;
1522 let shown = 0;
1623 for (const r of rows.sort(sorts[sort])) {
1724 const tags = r.dataset.tags.split(" ");
18- r.hidden = !r.dataset.name.includes(q) || !pairs.every(p => p.some(t => tags.includes(t)));
25+ r.hidden = !r.dataset.name.includes(q) || !pairs.every(p => p.some(t => tags.includes(t)))
26+ || !r.dataset.months.split(" ").some(m => m >= from && m <= to);
1927 shown += !r.hidden;
2028 list.append(r);
2129 }
@@ -25,6 +33,8 @@ function apply() {
2533 for (const p of pairs) for (const t of p) url.append("tag", t);
2634 if (sort !== "recent") url.set("sort", sort);
2735 if (q) url.set("q", q);
36+ if (a > 0) url.set("from", from);
37+ if (b < months.length - 1) url.set("to", to);
2838 history.replaceState(null, "", url.size ? "?" + url : location.pathname);
2939 }
3040
@@ -32,8 +42,11 @@ const url = new URLSearchParams(location.search), want = url.getAll("tag");
3242 for (const i of form.tag) i.checked = want.includes(i.value);
3343 form.sort.value = sorts[url.get("sort")] ? url.get("sort") : "recent";
3444 search.value = url.get("q") || "";
45+form.from.max = form.to.max = months.length - 1;
46+form.from.value = Math.max(0, months.indexOf(url.get("from")));
47+form.to.value = url.has("to") && months.includes(url.get("to")) ? months.indexOf(url.get("to")) : months.length - 1;
3548 search.form.addEventListener("submit", e => e.preventDefault());
3649 search.addEventListener("input", apply);
37-form.addEventListener("change", apply);
50+form.addEventListener("input", apply);
3851 form.hidden = false;
3952 apply();
internal/site/style.go+5−5
@@ -14,11 +14,11 @@ func styleData() map[string]any {
1414 "Heat": []int{0, 2, 8, 27, 62, 205, 625},
1515 "Tags": []string{"frontend", "backend", "small", "big", "pre-AI", "post-AI"},
1616 "Rows": []ProjectRow{
17- {mc, "A good idea 👾 A fast, transparent agent for the terminal", "TypeScript", 94.3, 4.7, 6, []string{"post-AI", "big"}, "", ""},
18- {zn, "Zoea-Nova is a high-performance command center designed to orchestrate massive swarms of agents", "Go", 95.8, 3.1, 5, []string{"post-AI", "big", "backend"}, "", ""},
19- {cl, "Terminal comics from the AI coding build log", "Python", 97.4, 1.6, 2, []string{"post-AI", "small", "frontend", "backend"}, "", ""},
20- {xc, "My space online.", "JavaScript", 3.6, 5.7, 3, []string{"pre-AI", "big", "frontend"}, "", ""},
21- {fn, "Node.js Module for ffmpeg library.", "JavaScript", 0, 34, 1, []string{"pre-AI", "small"}, "", ""},
17+ {mc, "A good idea 👾 A fast, transparent agent for the terminal", "TypeScript", 94.3, 4.7, 6, []string{"post-AI", "big"}, "", "", ""},
18+ {zn, "Zoea-Nova is a high-performance command center designed to orchestrate massive swarms of agents", "Go", 95.8, 3.1, 5, []string{"post-AI", "big", "backend"}, "", "", ""},
19+ {cl, "Terminal comics from the AI coding build log", "Python", 97.4, 1.6, 2, []string{"post-AI", "small", "frontend", "backend"}, "", "", ""},
20+ {xc, "My space online.", "JavaScript", 3.6, 5.7, 3, []string{"pre-AI", "big", "frontend"}, "", "", ""},
21+ {fn, "Node.js Module for ffmpeg library.", "JavaScript", 0, 34, 1, []string{"pre-AI", "small"}, "", "", ""},
2222 },
2323 "Tree": map[string]any{
2424 "Head": Commit{mc, "a2174ac", "chore: pkg bump", "xonecas", "2026-10-02", ""},
internal/site/templates/projects.html+5−1
@@ -10,9 +10,13 @@
1010 <fieldset class="flex items-center gap-3 sm:ml-auto"><span class="text-soft">Sort</span>
1111 {{range list "recent" "oldest" "commits"}}<label class="cursor-pointer font-semibold has-checked:underline underline-offset-4 decoration-2"><input type="radio" name="sort" value="{{.}}" class="sr-only" {{if eq . "recent"}}checked{{end}}>{{.}}</label>{{end}}
1212 </fieldset>
13+ <div class="w-full flex items-center gap-3"><span class="text-soft">Active</span>
14+ <div class="range flex-1 max-w-md"><input type="range" name="from" min="0" value="0" aria-label="From month"><input type="range" name="to" min="0" aria-label="To month"></div>
15+ <output id="span" class="font-mono text-xs"></output>
16+ </div>
1317 </form>
1418 <ol id="rows">
15- {{range .Rows}}<li data-name="{{lower .El.Name}}" data-tags="{{range .Tags}}{{.}} {{end}}" data-first="{{.First}}" data-last="{{.Last}}" data-commits="{{.El.Weight}}">{{template "project-row" .}}</li>{{end}}
19+ {{range .Rows}}<li data-name="{{lower .El.Name}}" data-tags="{{range .Tags}}{{.}} {{end}}" data-first="{{.First}}" data-last="{{.Last}}" data-months="{{.Months}}" data-commits="{{.El.Weight}}">{{template "project-row" .}}</li>{{end}}
1620 </ol>
1721 <p id="none" hidden class="py-6 text-soft">No project matches.</p>
1822 </main>
internal/site/view.go+1−0
@@ -18,6 +18,7 @@ type ProjectRow struct {
1818 Heat int // 0-6, from commit count
1919 Tags []string
2020 First, Last string // dates of the first and last commit, for sorting
21+ Months string // every YYYY-MM with my commits, space-separated, for the date filter
2122 }
2223
2324 // TreeEntry is one file or folder in a file tree, with its last commit.
tickets/1020-let-s-add-a-filtering-control-for-filtering-by.md+14−3
@@ -2,13 +2,13 @@
22 id: 1020
33 title: let's add a filtering control for filtering by start and end years/months. use a slider
44 type: feature
5-status: doing
5+status: review
66 priority: p2
77 created: 2026-11-08T03:56:52Z
8-updated: 2026-11-08T04:02:14Z
8+updated: 2026-11-08T04:16:55Z
99 source: devnote
1010 area: site
11-moves: 2026-11-08T04:02:14Z inbox doing drag
11+moves: 2026-11-08T04:02:14Z inbox doing drag; 2026-11-08T04:16:55Z doing review agent
1212 ---
1313
1414 ## Context
@@ -20,3 +20,14 @@ Filed from `http://192.168.122.10:8080/projects/`, on `form#filters.flex.flex-wr
2020 - 2026-11-08 03:57Z (agent): Triage: type feature (it was bug), priority p2, area site. No typos to fix. Filed on the /projects filter form, so it extends 1006 (tag filters and search).
2121
2222 Question: which projects does a range like 2014-03 to 2016-08 keep: (a) those with any commit inside it, (b) those that started inside it, or (c) those whose whole first-to-last span is inside it? I'd recommend (a).
23+
24+- 2026-11-08 04:16Z (agent): Done, keeping projects with any commit in the range (my recommendation (a), as you asked me to decide).
25+
26+ - /projects: an 'Active' row under the tags. One track, two thumbs, from the first month with commits (2011-01) to the last (2026-11), with the chosen range printed beside it. Dragging filters live, together with tags, sort and search.
27+ - The range goes into the URL as ?from=YYYY-MM&to=YYYY-MM, only when narrowed, and loads back from it.
28+ - internal/site/rows.go and view.go: ProjectRow.Months lists every month with my commits; projects.html prints it as data-months. projects.js does the filtering and the URL. site.css: a small .range block, two stacked range inputs where only the thumbs take the pointer, in the accent color.
29+ - The thumbs may cross; the range is always the lower to the higher.
30+
31+ CHECKED: go vet, go test pass. In agent-browser: default shows all 82, 2011-01 – 2026-11. Setting 2024-11 – 2025-11 shows 3 (the-champs-timer, lazy-history, scrap-paper), the same 3 as a Python check over data/projects.json. ?from=2024-11&to=2025-11 loads back to the same 3. A real mouse drag of the left thumb moved it to 2018-11 (19 projects) and updated the URL.
32+
33+ NOT CHECKED: phone width, dark theme, keyboard use of the thumbs. If the slider looks unstyled in your browser, hard-refresh: a stale site.css is cached. Filed separately.
tickets/1021-frontend-design-pass.md+2−2
@@ -5,13 +5,13 @@ type: feature
55 status: doing
66 priority: p3
77 created: 2026-11-08T03:57:11Z
8-updated: 2026-11-08T04:13:42Z
8+updated: 2026-11-08T04:13:53Z
99 source: human
1010 area: design
1111 moves: 2026-11-08T04:02:10Z inbox todo drag; 2026-11-08T04:04:48Z todo doing drag
1212 ---
1313
14-We have our initial design and style and look. Now let's take it to the next level, polish, alignment, whitespace. Walk the site, end to end with agent browser. Make sure it flows well, the ux is natural and space is being used well at most resolutions sizes. Make sure themes look great, dark and light. Atention to typography detaui
14+We have our initial design and style and look. Now let's take it to the next level, polish, alignment, whitespace. Walk the site, end to end with agent browser. Make sure it flows well, the ux is natural and space is being used well at most resolutions sizes. Make sure themes look great, dark and light. Atention to typography details, font sizes, etc.
1515
1616 It's not a rebrand or restructure, it's polishing and refining.
1717
tickets/1025-need-a-light-dark-toggel.md+12−0
@@ -0,0 +1,12 @@
1+---
2+id: 1025
3+title: Need a light/dark toggel
4+type: bug
5+status: doing
6+priority: p2
7+created: 2026-11-08T04:14:52Z
8+updated: 2026-11-08T04:14:56Z
9+source: human
10+moves: 2026-11-08T04:14:56Z inbox doing drag
11+---
12+
tickets/1026-browsers-keep-a-stale-site-css-after-a-rebuild.md+15−0
@@ -0,0 +1,15 @@
1+---
2+id: 1026
3+title: Browsers keep a stale site.css after a rebuild
4+type: bug
5+status: inbox
6+priority: p2
7+area: site
8+created: 2026-11-08T04:16:55Z
9+updated: 2026-11-08T04:16:55Z
10+source: agent
11+---
12+
13+After 'make build' changed site.css, agent-browser kept using the old one on reload: the 1020 slider rendered unstyled until I re-fetched /site.css with cache: 'reload'. Pages link a fixed /site.css, and the dev server sends Last-Modified with no Cache-Control, so browsers cache it heuristically. The same will hit visitors after a deploy.
14+
15+Seen: once, in the VM's agent-browser on 192.168.122.10:8080. Not checked: other static files (projects.js, egg.js), and how Caddy would send them.