From 760fbd8c6d4f7ef6863f3f80ac5db7148efdc13a Mon Sep 17 00:00:00 2001 From: Spark Date: Mon, 12 Oct 2026 15:47:28 -0400 Subject: [PATCH] =?UTF-8?q?feat(capture):=20s=C3=A9lecteur=20de=20d=C3=A9p?= =?UTF-8?q?=C3=B4t=20intelligent=20=E2=80=94=20suggestions,=20Tab=20par=20?= =?UTF-8?q?segment,=20validation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - GET /api/repos exhaustif (épinglés, récents, archivés), la palette garde son plafond de 60. - repo-picker.js : liste filtrée sur les deux segments, complétion Tab façon shell (pr Tab → Projets/ avec le séparateur posé, kan Tab → kanbante), ↑/↓/Entrée/clic, avertissement doux si le dépôt n'existe pas. --- app/main.py | 29 +++++ app/templates/capture.html | 8 +- static/css/style.css | 28 +++++ static/js/repo-picker.js | 245 +++++++++++++++++++++++++++++++++++++ 4 files changed, 309 insertions(+), 1 deletion(-) create mode 100644 static/js/repo-picker.js diff --git a/app/main.py b/app/main.py index 0aa9d21..9b2c799 100644 --- a/app/main.py +++ b/app/main.py @@ -3513,6 +3513,35 @@ async def api_stats(): return get_stats() +@app.get("/api/repos") +async def api_repos(): + """Every repo, for pickers (capture page repo selector, 0.21.0). + + Unlike /api/palette (capped at 60 for a launcher), a picker + must be exhaustive — Bruno has 130+ repos. Ranked for the + empty-query case: starred first, archived last, most + recently updated first in between. + """ + repos = await gitea.search_repos() + active, inactive, archived = classify_repos(repos) + try: + starred = {r["full_name"] for r in await gitea.list_starred()} + except Exception: + starred = set() + out = [ + { + "full_name": r["full_name"], + "starred": r["full_name"] in starred, + "updated_at": r.get("updated_at") or "", + "archived": bool(r.get("archived")), + } + for r in active + inactive + archived + ] + out.sort(key=lambda x: x["updated_at"], reverse=True) + out.sort(key=lambda x: (not x["starred"], x["archived"])) + return {"repos": out} + + @app.get("/api/palette") async def api_palette(q: str = ""): """Data for the Ctrl+K command palette (roadmap #10). diff --git a/app/templates/capture.html b/app/templates/capture.html index 684fd57..6a4b9fe 100644 --- a/app/templates/capture.html +++ b/app/templates/capture.html @@ -37,7 +37,12 @@