fix: a proof card shows the film it prints, the Kanban's tooltips stay whole on screen, and a session that changed is a warning (DTF-WEB-26)

A proof card bills 0 m: the board now carries proof_film_cm per item (the
same measure as Números), the card reads 'prova · 0,15 m', the column
totals count it, and the drawer says 'prova sem custo', the proof's film
and 'Folha do pedido'. The [data-tip] tooltips were CSS boxes inside the
card, cut by the column and over the card below; one box fixed to the
window now sits under the element, or over it near the bottom, inside the
screen. 'Sua conta ou sessão mudou' is guidance shown as a warning, so it
stays out of Sentry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-11-30 16:45:59 -03:00
parent 1a35dea7a5
commit 885d211ae2
6 changed files with 52 additions and 16 deletions

View File

@@ -1207,5 +1207,30 @@ function paintSync(){
$('sync').onclick=e=>{e.stopPropagation();const m=$('sync-menu');m.hidden=!m.hidden;$('sync').setAttribute('aria-expanded',String(!m.hidden));
if(!m.hidden)document.addEventListener('click',()=>{m.hidden=true;$('sync').setAttribute('aria-expanded','false');},{once:true});};
$('refresh').addEventListener('click',()=>{$('sync-menu').hidden=true;});
// Tooltips ([data-tip]): one box on the page itself, fixed to the window, so
// a card's column never cuts it and it never covers the card below; it sits
// under the element, or over it near the bottom, always inside the screen.
(()=>{
const box=node('div',undefined,'tipbox');box.setAttribute('role','tooltip');box.hidden=true;document.body.append(box);
let target=null,timer=null;
const hide=()=>{clearTimeout(timer);timer=null;target=null;box.hidden=true;};
const place=el=>{
box.textContent=el.dataset.tip;box.hidden=false;
const r=el.getBoundingClientRect(),b=box.getBoundingClientRect(),gap=8,edge=8;
let top=r.bottom+gap;
if(top+b.height>innerHeight-edge&&r.top-gap-b.height>=edge)top=r.top-gap-b.height;
const left=Math.min(Math.max(edge,r.left+r.width/2-b.width/2),innerWidth-edge-b.width);
box.style.top=Math.round(top)+'px';box.style.left=Math.round(left)+'px';
};
const show=el=>{
if(!el||!el.dataset.tip||el===target)return;
clearTimeout(timer);target=el;timer=setTimeout(()=>{if(target===el&&el.isConnected)place(el);},350);
};
document.addEventListener('mouseover',e=>{const el=e.target.closest?.('[data-tip]');if(el)show(el);else if(target)hide();});
document.addEventListener('focusin',e=>{const el=e.target.closest?.('[data-tip]');if(el)show(el);});
document.addEventListener('focusout',hide);
addEventListener('scroll',hide,true);
addEventListener('keydown',e=>{if(e.key==='Escape')hide();});
})();
// The tabs live in later files: wait for all scripts before loading.
addEventListener('DOMContentLoaded',()=>restoreFolder().finally(()=>load()));