feat: stroke class, residue per artwork, mixed strokes, sheets split by class
All checks were successful
Build and deploy / Validate source (push) Successful in 1m25s
Build and deploy / Integration suite on a real stack (push) Successful in 4m40s
Build and deploy / Secret scan and release gate (push) Successful in 12s
Build and deploy / Publish images (push) Successful in 1m38s

Round 3, items 9, 4, 16 and 17 (Dropstar, 2026-10-30).

- 9: the Site measures the thinnest stroke of each sheet and loose artwork
  (alpha > 40, chamfer distance in strips, width at local maxima, 1st
  percentile, at 300 DPI) and sends stroke_px and C1/C2/C3 with the item.
  The Kanban shows the class prefilled in the approve step; Produção may
  change it (POST /orders/{id}/contraction, who and when recorded), and the
  manifest carries it.
- 4: the residue check runs on each loose artwork, accepted per artwork; the
  sheet inherits what was accepted.
- 16: fine lines and solid areas in one file. Loose art: a pop-up with
  [Subir separado] [Continuar assim]. Ready sheet: protect the fine lines
  (default), protect the solid areas (stroke_choice client_c3, starts at C3)
  or go back and send two sheets, which holds the order.
- 17: loose art of fine (C1, C2) and solid (C3) strokes goes on separate
  sheets, each its own order item (split group/part/of) with its own file
  and class. Each sheet rounds to 10 cm and the 1 m minimum is charged once
  per group, since the customer did not choose the split. Cart, payment
  summary, portal, receipt and mail show it as such.
- The board loads quote views in two queries instead of two per quote.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-11-03 10:24:29 -03:00
parent 388408d4d6
commit 2615163fd3
23 changed files with 547 additions and 57 deletions

View File

@@ -426,6 +426,9 @@ function previaAoVivo(){
const prontas=artes.filter(a=>a.cm>0 && a.cm<=larguraFilme() && (a.src||a.semPrevia));
const W=Math.round(300*ZOOMS[zoomI]);
$('vArea').classList.toggle('ampliado', zoomI>0);
montagemFolhas=null;
const grupos=gruposDeTraco(prontas);
if(grupos.length>1){ montaFolhasDeTraco(grupos,W); $('vArea').scrollTop=0; return; }
desenhaMontagem($('vArea'), prontas, 0, W, $('vUso'), r=>{
montagemCm = r.alturaCm; // altura real da folha montada
montagemFolgaCm = r.folgaCm ?? MARGEM_CM;
@@ -439,6 +442,43 @@ function previaAoVivo(){
},140);
}
// Item 17 (Dropstar, 30/10/2026): artes de traço fino (C1, C2) e de traço
// grosso (C3) saem em folhas separadas, cada uma com a sua contração; o
// cliente não escolhe nada. Uma arte que o navegador não mediu fica nas finas.
const NOMES_TRACO=['traço fino','chapado'];
function gruposDeTraco(lista){
const grossa=a=>(tracoDaArte(a)||{}).classe==='C3';
const grupos=[lista.filter(a=>!grossa(a)), lista.filter(grossa)];
return grupos.every(g=>g.length) ? grupos : [lista];
}
function montaFolhasDeTraco(grupos,W){
const area=$('vArea'), versao=area.montagemVersao, feitas=[];
$('vUso').innerHTML='';
const painel=document.createElement('div'); painel.className='folhasTraco';
grupos.forEach((lista,i)=>{
const figura=document.createElement('figure'); figura.className='folhaTraco';
// Sem a nota de aproveitamento de cada folha: quem separou fomos nós.
const legenda=document.createElement('figcaption'), desenho=document.createElement('div'), uso=document.createElement('div');
legenda.textContent='Folha '+(i+1)+' · '+NOMES_TRACO[i];
figura.append(legenda,desenho); painel.append(figura);
desenhaMontagem(desenho, lista, 0, W, uso, r=>{
if(area.montagemVersao!==versao) return; // a montagem mudou nesse meio-tempo
legenda.textContent='Folha '+(i+1)+' · '+NOMES_TRACO[i]+' · '+fmtM(Math.ceil(+(r.alturaCm/100).toFixed(4)*10)/10)+' m';
feitas[i]={nome:NOMES_TRACO[i], artes:lista, alturaCm:r.alturaCm, folgaCm:r.folgaCm ?? MARGEM_CM,
layout:r.placements ? {height_cm:+r.alturaCm.toFixed(4), placements:r.placements} : null};
if(feitas.filter(Boolean).length<grupos.length) return;
montagemFolhas=feitas.every(f=>f.layout) ? feitas : null;
montagemLayout=null;
montagemCm=feitas.reduce((t,f)=>t+f.alturaCm,0);
montagemFolgaCm=Math.min(...feitas.map(f=>f.folgaCm));
$('vMt').textContent=montagemFolhas ? fmtM(cobrarFolhas(montagemFolhas))+' m' : '—';
resumoArtes();
agendaAvaliacao();
});
});
area.replaceChildren(painel);
}
function motivoNota(){
if(!nota) return 'sem nota ainda · a conferência roda na sala antes de imprimir';
if(!ehFolha()){
@@ -457,7 +497,7 @@ function previa(){
// olhou dentro dela. Largura e metragem — o que de fato medimos — já aparecem
// na coluna ao lado e no carrinho.
if(ehFolha()){ $('prev').classList.remove('on'); return; }
const cob=cobrar(metros), sobra=+(cob-metros).toFixed(2);
const cob=cobrarMontagem(), sobra=+(cob-metros).toFixed(2);
$('pMt').innerHTML=fmtM(cob)+'<small> m</small>';
$('pSub').textContent='folha montada por nós com as artes que você enviou';
const linhas=[