Веб-UI: основной идентификатор карточек — download.id вместо infohash

В карточке списка и шапке /download/{id} показываем и копируем download.id
(ULID) — тот же ключ, что в логах (download_id), удобно грепать. Infohash
остаётся в блоке «Информация о торренте». Поиск по списку расширен: матчит
любой идентификатор (download.id ИЛИ infohash), плюс название/контекст.
Удалены осиротевшие поля Infohash/InfohashShort и хелпер shortenHash.

Дельта web-ui влита в спеки, change заархивирован.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
av
2026-07-04 09:47:27 +03:00
co-authored by Claude Opus 4.8
parent 80e725eb9a
commit 9ed732e49e
12 changed files with 220 additions and 64 deletions
-12
View File
@@ -181,8 +181,6 @@ type pageLink struct {
type downloadView struct {
ID string
Title string // отображаемый заголовок карточки
Infohash string // полный (для копирования)
InfohashShort string // усечённый (для показа)
Context string
State string
Error string
@@ -524,8 +522,6 @@ func toView(d store.Download) downloadView {
return downloadView{
ID: d.ID,
Title: downloadTitle(d),
Infohash: d.PrimaryInfohash(),
InfohashShort: shortenHash(d.PrimaryInfohash()),
Context: d.Context,
State: state,
Error: d.ErrorMsg.String,
@@ -560,14 +556,6 @@ func oneLine(s string) string {
return strings.Join(strings.Fields(s), " ")
}
// shortenHash усекает infohash до вида "a1b2c3d4e5…f0" для компактного показа.
func shortenHash(h string) string {
if len(h) <= 12 {
return h
}
return h[:10] + "…" + h[len(h)-2:]
}
// desyncNote — пояснение состояния рассинхрона для UI (см. state-reconciliation).
func desyncNote(s store.State) string {
switch s {