feat: the proof's photo or video opens beside Prova OK and from its order, also after the answer
All checks were successful
Build and deploy / Validate source (push) Successful in 5s
Build and deploy / Integration suite on a real stack (push) Successful in 6m43s
Build and deploy / Secret scan and release gate (push) Successful in 6s
Build and deploy / Publish images (push) Successful in 1m11s

Marcus could not reach the review photo of the proof of #30 (card #31):
in Revisão it sat at the end of the card's Pedido tab, away from the
answer, and once the seller answered, the card left the board and the
photo with it.

- The board sends each order's proof card with its photos and videos.
- "Responder a prova" has "Ver foto" / "Ver vídeo" beside Prova OK, or
  says the Revisor has not sent one yet.
- The parent shows a Prova section (the card, its answer, who and when)
  with the same buttons, and "Aguardando prova" offers them too.
- The viewer drops the print-file line for a review photo and reports a
  photo it could not load, in red and to Sentry.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-11-17 10:37:33 -03:00
parent 5d9a78b63c
commit c61ac27ca4
5 changed files with 71 additions and 13 deletions

View File

@@ -8,8 +8,8 @@
width at the zoom shown (app/printtiles.py), only those on screen.
openViewer(files, {title, onClose}): files are [{name, label, manifest,
picture}], each with its strips' manifest (and their urls), or only a
picture when it has none. */
picture, photo}], each with its strips' manifest (and their urls), or only a
picture when it has none; `photo` marks a review photo, which is whole. */
(function(){
const BG_KEY='dtf-viewer-bg';
const BACKGROUNDS=[['light','Claro'],['dark','Escuro'],['check','Xadrez']];
@@ -103,8 +103,15 @@
for(const b of tabs.children)b.setAttribute('aria-pressed',String(b===tab));
name.textContent=title?title+' · '+f.name:f.name;
if(!f.manifest){
note.textContent=f.picture?'Este arquivo não tem os pedaços para 100%: veja a prévia ou baixe o arquivo.':'Este arquivo não tem prévia: baixe para conferir.';
if(f.picture){try{const r=await fetch(f.picture);picture=await createImageBitmap(await r.blob());}catch(_){}}
// A review photo is the whole picture; a print file without pieces is only its preview.
note.textContent=f.photo?'':f.picture?'Este arquivo não tem os pedaços para 100%: veja a prévia ou baixe o arquivo.':'Este arquivo não tem prévia: baixe para conferir.';
if(f.picture){
try{const r=await fetch(f.picture);if(!r.ok)throw new Error('erro '+r.status);picture=await createImageBitmap(await r.blob());}
catch(e){
const text='Não foi possível abrir '+(f.photo?'a foto':'a prévia')+' '+f.name+' ('+e.message+').';
note.textContent=text;window.dtfObservability?.uiError?.(text,'kanban');
}
}
}
zoom=fitZoom();x=0;y=0;clamp();zoomText.textContent=Math.round(zoom*100)+'%';draw();
}