From b9ebdc0fdba3ad90c82fc62c9c31712fa853fac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cau=C3=AA=20Faleiros?= Date: Thu, 1 Oct 2026 15:43:55 -0300 Subject: [PATCH] fix: "Criar pedido de teste" works again, and the quote list is wider A checkbox label named `confirm` in the quote panel hid window.confirm from the test-order button, which failed with "can't access lexical declaration 'confirm' before initialization". The quote list takes about a third of the screen (up to 640 px) and cuts long e-mails with an ellipsis. Co-Authored-By: Claude Opus 5.5 --- web/kanban.css | 5 +++-- web/kanban.js | 9 ++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/web/kanban.css b/web/kanban.css index c80143c..256121f 100644 --- a/web/kanban.css +++ b/web/kanban.css @@ -153,7 +153,8 @@ main{padding:0 24px 24px} /* Quotes */ #tab-quotes{padding-top:18px} .split{display:flex;gap:0;border:1px solid var(--line);border-radius:12px;overflow:hidden;min-height:calc(100vh - 140px)} -.split .list{width:460px;flex-shrink:0;border-right:1px solid var(--line);padding:16px;display:flex;flex-direction:column;gap:12px;background:#111316} +/* About a third of the screen: the rows carry a picture, the customer and the price. */ +.split .list{width:clamp(460px,34vw,640px);flex-shrink:0;border-right:1px solid var(--line);padding:16px;display:flex;flex-direction:column;gap:12px;background:#111316} .qitem{text-align:left;display:flex;align-items:center;gap:12px;padding:12px;border-radius:10px;border:1px solid var(--line2);background:var(--card);width:100%} .qitem .qmain{flex:1;min-width:0} .qitem .qmain>span{display:block} @@ -163,7 +164,7 @@ main{padding:0 24px 24px} .chips.small{gap:6px} .chips.small .chip{height:30px;padding:0 10px;font-size:13px} .qitem[aria-current=true]{border-color:var(--accent);background:#1F1A15} -.qitem b{display:block;font-size:14.5px;overflow-wrap:anywhere} +.qitem b{display:block;font-size:14.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis} .qitem span{font-size:13.5px;color:var(--muted)} .qitem .right{text-align:right;flex-shrink:0} .qitem .flag{display:block;color:var(--warn);font-weight:600;margin-top:4px} diff --git a/web/kanban.js b/web/kanban.js index a20f7ea..b0c278b 100644 --- a/web/kanban.js +++ b/web/kanban.js @@ -490,7 +490,8 @@ function renderQuotes(){ else currentQuote=quoteRows.find(q=>q.id===currentQuote.id)||currentQuote; const list=quoteRows.map(q=>{ const b=node('button',undefined,'qitem');b.type='button';b.dataset.quotePick=q.id;b.setAttribute('aria-current',String(q.id===currentQuote?.id)); - const left=node('div',undefined,'qmain');left.append(node('b',q.draft.customer.mail), + const mail=node('b',q.draft.customer.mail);mail.title=q.draft.customer.mail; + const left=node('div',undefined,'qmain');left.append(mail, node('span',q.draft.items.map(i=>SHORT[i.mode]).join(' + ')+' · '+metres(quoteMetres(q)))); if(q.draft.items.some(i=>i.production?.version!==2))left.append(node('span','Montagem antiga: peça nova cotação','flag')); else if(q.draft.items.some(i=>i.quality_status==='warning'))left.append(node('span','Ressalva de resolução aceita pelo cliente','flag')); @@ -541,9 +542,11 @@ function review(quote){ const edits=quote.draft.items.map(item=>{const fields={};content.append(quoteItem(item,fields)); return ()=>({...item,metres:fields.metres.value,grade:Number(fields.grade.value)});}); const check=node('input');check.type='checkbox';check.required=true; - const confirm=node('label',undefined,'check');confirm.append(check,'Arquivos, metragem e nota conferidos'); + // Not "confirm": that name in this function hid window.confirm from the + // test-order button above, which then failed before asking anything. + const checked=node('label',undefined,'check');checked.append(check,'Arquivos, metragem e nota conferidos'); const submit=node('button','Aprovar cotação','btn primary'); - foot.append(confirm,submit); + foot.append(checked,submit); form.append(content,foot); form.onsubmit=async e=>{e.preventDefault();submit.disabled=true; try{const approved=await api('/quotes/'+quote.id+'/approve',{items:edits.map(fn=>fn())});