Repository navigation
feat(import): count the artwork phase, and offer Refresh data - #29
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 dataentra 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 queimport_jobscarrega no servidor.Um defeito que este ciclo criou, e que só a tela rodando mostrou:
useCancelImportescrevia a resposta emrunningelatestsem olhar okind— ela nasceu quandoimport_jobssó guardava importações. Cancelar a varredura punha o job dela onde a tela espera um import e apagava o blocoLast import. Nenhum teste pegaria: cada peça estava certa sozinha. Corrigido, e coberto por spec.Testes: 382 (eram 364).
🤖 Generated with Claude Code