Skip to content

feat(import): count the artwork phase, and offer Refresh data - #29

Merged
Digit4w merged 2 commits into
devfrom
feat/import-enrich-phase
Sep 13, 2026
Merged

Digit4w merged 2 commits into
devfrom
feat/import-enrich-phase

Conversation

@Digit4w

@Digit4w Digit4w commented Sep 13, 2026

Copy link
Copy Markdown
Owner

Empilhado sobre perf/virtualize-library-lists (#28). Mergear aquele primeiro.

Contraparte: Digit4w/watchpile-server#22 — e ela entra antes desta, porque é ela que serve as rotas que esta tela chama.

Fecha a tela das duas partes que faltavam do item 11: o progresso do aquecimento, e as tarefas de atualização (11c e 11d).

O aquecimento deixou de ser mudo. Importar terminava, a tela dizia isso, e o servidor passava os 18 a 52 minutos seguintes buscando arte sem nada aparecer. Agora ele tem contador próprio, e a peça fica ao lado do resultado do import, não no lugar dele: são dois fatos que convivem — o import terminou (e os números dele são o que a pessoa veio conferir) e a arte ainda está chegando. Trocar um pelo outro esconderia o resultado por quase uma hora numa biblioteca grande, que é justamente quando ele mais interessa.

Ela não tem Stop, e é decisão: o import ocupa o recurso e travar a instalação é consequência real de deixá-lo rodando; este não ocupa nada — ele cede fichas a quem tem uma tela aberta. Oferecer desistir de um benefício sem custo seria controle nascendo de simetria de layout.

Refresh data entra no menu único da obra, então ela oferece a ação em toda tela. Desabilitado com o motivo quando não há vínculo — a recusa se anuncia antes do clique, já que não há toast para explicá-la depois. A consulta de vínculos só roda com o menu aberto: ela decide um item, e uma grade de mil cartas seriam mil requisições para desenhar algo que ninguém abriu.

A varredura é uma caixa em YOU / Import (decisão do dono) — a seção mais próxima em função: as duas falam com provedores, rodam em segundo plano e mostram contador, e ela reusa a peça de progresso que já vive ali. O custo assumido é o título da seção ficar mais estreito que o conteúdo, que é a mesma dívida de nome que import_jobs carrega no servidor.

Um defeito que este ciclo criou, e que só a tela rodando mostrou: useCancelImport escrevia a resposta em running e latest sem olhar o kind — ela nasceu quando import_jobs só guardava importações. Cancelar a varredura punha o job dela onde a tela espera um import e apagava o bloco Last import. Nenhum teste pegaria: cada peça estava certa sozinha. Corrigido, e coberto por spec.

Testes: 382 (eram 364).

🤖 Generated with Claude Code

Importing finished and the screen said so, while the server spent the
next 18 to 52 minutes fetching artwork with nothing on screen — measured
against 1,200 titles on MyAnimeList and AniList. The server now runs
that as its own job; this reads it.

It sits beside the result block rather than replacing it. Those are two
facts that coexist: the import finished, and its numbers are what the
person came to check, while the artwork is still arriving. Swapping one
for the other would hide the result for the better part of an hour on a
large library, which is exactly when it matters most.

No Stop button, and that is a decision. The import holds the resource
and stalling the installation is a real consequence of leaving it
running; this one holds nothing — it yields tokens to whoever has a
screen open. Offering to abandon a free benefit would be a control born
of layout symmetry.

The poll interval is longer here for the same reason it is 2s there: the
step at which the counter visibly moves. Each title costs a network
round trip with a pause, so asking every two seconds for nearly an hour
would be 1,800 requests to watch the same number.
…rary

Items 11(c) and 11(d), the screen half. The server can reread a
provider; this is where someone asks it to.

Refresh data joins the single entry menu, so the title offers it on
every screen. It is disabled with the reason when the title has no
provider link — the refusal announces itself before the click, since
there is no toast to explain it after. The links query only runs while
the menu is open: it decides one item, and a grid of a thousand cards
would otherwise be a thousand requests to draw something nobody opened.

The sweep is a box in Import (owner's decision). It is the nearest
section in function — both talk to providers, run in the background and
show a counter — and it reuses the progress piece already there. What it
costs is the section title being narrower than its contents, which is
the same naming debt import_jobs carries on the server.

It states the one field that crosses from provider to library, and the
direction: a count that grew gets the new number, and it never shrinks.

A defect this cycle created, found only by running it: useCancelImport
wrote the response into running and latest without looking at kind — it
was written when import_jobs held only imports. Cancelling the sweep
therefore erased the last import's result from the screen. Each job kind
now writes to its own field, and latest stays what it says it is.
@Digit4w
Digit4w changed the base branch from perf/virtualize-library-lists to dev September 13, 2026 20:11
@Digit4w
Digit4w merged commit 24f2dae into dev Sep 13, 2026
@Digit4w
Digit4w deleted the feat/import-enrich-phase branch September 13, 2026 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant