From 3d01b81a316e229c5c410071d3d2f1fd9dbe9c4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cau=C3=AA=20Faleiros?= Date: Mon, 16 Nov 2026 12:45:21 -0300 Subject: [PATCH] feat: new layout phase G, the phone as on the canvas MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The bottom bar keeps Produção, Cotações, Pagamentos and Números; Mais opens a sheet with the other sections (Montar, Site, Integrações, Usuários, as the role allows, with the rail's icons) and the account (theme, password, Sair) under their own headings, as in Ph1 and Ph2. Stage chips drop their icons and keep the fade at the edge; the contraction fields take the full width in the order page (Ph3). Números on the phone names each stage's limit, overruns and waiting orders, and Por origem fits its five columns. Co-Authored-By: Claude Opus 5.5 (1M context) --- web/kanban-board.js | 27 ++++++++++++++++++--------- web/kanban.css | 32 ++++++++++++++++++++++++++------ web/kanban.js | 4 +++- 3 files changed, 47 insertions(+), 16 deletions(-) diff --git a/web/kanban-board.js b/web/kanban-board.js index 079772c..6aef1d4 100644 --- a/web/kanban-board.js +++ b/web/kanban-board.js @@ -572,16 +572,25 @@ function phoneMenu(){ const ava=node('span',initialsOf(ME.name||ME.email),'ava');ava.append(node('i',undefined,'pres on')); words.append(node('b',ME.name||ME.email),node('span',(ROLE_NAMES[ME.role]||ME.role)+(myMachine()?', na '+myMachine().name:''),'sub')); who.append(ava,words); - const rows=[]; - if(TAB_NEEDS.integrations()){const n=$('badge-integrations').textContent; - rows.push(mrow(IC.link,'Integrações',go(()=>showTab('integrations')),'mrow',n?statePill(n,'warn'):null));} - if(TAB_NEEDS.users())rows.push(mrow(IC.user,'Usuários',go(()=>showTab('users')))); - if(ME.machine_question)rows.push(mrow(IC.printer,'Trocar de máquina',go(()=>askMachine(true)),'mrow',node('span',myMachine()?.name||'','lbl'))); + // Seções: the tabs that do not fit the bottom bar (canvas Ph2), with the + // rail's own icon and name; then the account. + const sections=[]; + for(const name of MORE_TABS){ + if(TAB_NEEDS[name]&&!TAB_NEEDS[name]())continue; + const nav=document.querySelector('.rail .nav[data-tab="'+name+'"]'); + const n=name==='integrations'?$('badge-integrations').textContent:''; + const row=mrow(nav.querySelector('path').getAttribute('d'),nav.querySelector('span').textContent,go(()=>showTab(name)),'mrow',n?statePill(n,'warn'):null); + if(tab===name)row.classList.add('on'); + sections.push(row); + } + if(ME.machine_question)sections.push(mrow(IC.printer,'Trocar de máquina',go(()=>askMachine(true)),'mrow',node('span',myMachine()?.name||'','lbl'))); const light=kanbanTheme.get()==='light'; - rows.push(mrow(light?ICON_MOON:ICON_SUN,light?'Mudar para o modo escuro':'Mudar para o modo claro',go(()=>{kanbanTheme.toggle();paintThemeToggle();}))); - rows.push(mrow(IC.key,'Trocar a senha',go(accountForm))); - rows.push(mrow(IC.logout,'Sair',go(()=>$('logout').click()),'mrow bad')); - const body=node('div',undefined,'sbody');body.append(...rows); + const account=[mrow(light?ICON_MOON:ICON_SUN,light?'Mudar para o modo escuro':'Mudar para o modo claro',go(()=>{kanbanTheme.toggle();paintThemeToggle();})), + mrow(IC.key,'Trocar a senha',go(accountForm)), + mrow(IC.logout,'Sair',go(()=>$('logout').click()),'mrow bad')]; + const body=node('div',undefined,'sbody'); + if(sections.length)body.append(node('span','Seções','sgroup'),...sections); + body.append(node('span','Conta','sgroup'),...account); m=sheet([who,body],{label:'Mais',role:'menu'}); } // The board's filters on the phone: every kind, the product too, and how many diff --git a/web/kanban.css b/web/kanban.css index edc94ef..9f80402 100644 --- a/web/kanban.css +++ b/web/kanban.css @@ -1130,8 +1130,8 @@ select.inp{appearance:none;-webkit-appearance:none;padding-right:32px;background .shell{padding-bottom:72px} /* the bar at the bottom */ .rail{position:fixed;left:0;right:0;bottom:0;top:auto;z-index:15;width:auto;height:72px;flex-direction:row;align-items:stretch;gap:0;padding:4px 4px 10px;border-right:0;border-top:1px solid var(--railln);background:var(--top)} - .rail .mark,.rail .grow,.railmachine,#theme-rail,.account,.nav[data-tab=integrations],.nav[data-tab=users]{display:none!important} - .nav{flex:1 1 0;width:auto;height:auto;min-width:0;gap:5px;font-size:11px;font-weight:600;border-radius:12px;color:var(--tx3)} + .rail .mark,.rail .grow,.railmachine,#theme-rail,.account,.nav[data-tab=montar],.nav[data-tab=site],.nav[data-tab=integrations],.nav[data-tab=users]{display:none!important} + .nav{flex:1 1 0;width:auto;height:auto;min-width:0;padding:0 1px;gap:5px;font-size:11px;font-weight:600;letter-spacing:-.01em;border-radius:12px;color:var(--tx3)} .nav .i{width:22px;height:22px} .nav:hover{background:transparent} .nav[aria-selected=true],.nav.on{background:transparent;color:var(--tx)} @@ -1162,7 +1162,8 @@ select.inp{appearance:none;-webkit-appearance:none;padding-right:32px;background #tab-board .tools{display:none} .mtabs{display:flex;gap:6px;overflow-x:auto;padding:10px 12px;border-bottom:1px solid var(--ln);background:var(--top);scrollbar-width:none;position:sticky;top:58px;z-index:4;-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 40px),transparent);mask-image:linear-gradient(90deg,#000 calc(100% - 40px),transparent)} .mtab,#quote-filters button,#stats-period button,#stats-range .btn,.pagetools .seg button{flex:none;height:36px;padding:0 13px 0 10px;border-radius:999px;border:1px solid var(--ln2);background:transparent;color:var(--tx2);font-size:13px;font-weight:600;display:flex;align-items:center;gap:7px;white-space:nowrap;box-shadow:none} - .mtab .sg{width:16px;height:16px} + .mtab .sg{display:none} + .mtab{padding:0 14px} .mtab .n,#quote-filters .n,.pagetools .seg .n{font-size:12px;font-weight:600;color:var(--tx3)} .mtab.on,#quote-filters button.on,#stats-period button.on,.pagetools .seg button.on{background:var(--ink);border-color:var(--ink);color:var(--onink)} .mtab.on .sg,.mtab.on .n,#quote-filters .on .n,.pagetools .seg .on .n{color:var(--onink)} @@ -1204,6 +1205,10 @@ select.inp{appearance:none;-webkit-appearance:none;padding-right:32px;background .mrow .mtext{flex:1} .mrow .lbl,.mrow .pill{margin-left:auto} .mrow.bad,.mrow.bad .i{color:var(--bad)} + .mrow.on{background:var(--sf2)} + .msheet .sgroup{display:block;padding:16px 12px 4px;font-size:11.5px;font-weight:650;letter-spacing:.06em;text-transform:uppercase;color:var(--tx3)} + .msheet .sgroup+.mrow{margin-top:2px} + .msheet .sbody .mrow+.sgroup{margin-top:6px;border-top:1px solid var(--ln)} /* the order's menu, as a sheet */ .menu.dmenu{position:fixed;left:0;right:0;top:auto;bottom:0;width:auto;z-index:31;padding:16px 6px 10px;border-radius:18px 18px 0 0;border:0;box-shadow:0 0 0 100vmax var(--scrim);animation:sheetUp .4s cubic-bezier(.16,1,.3,1) both} .menu.dmenu .menuitem{min-height:56px;height:auto;gap:14px;font-size:15px;padding:0 12px} @@ -1225,6 +1230,12 @@ select.inp{appearance:none;-webkit-appearance:none;padding-right:32px;background .nextbox{display:flex;flex-direction:column;align-items:stretch;gap:12px;padding:16px;border:1px solid var(--ln);background:var(--sf)} .nextbox>.ninfo{gap:8px;flex:initial;min-width:0} .nextbox h3{font-size:17px;margin:0} + /* fields full width on the phone (canvas Ph3) */ + .contrrow{display:flex;flex-direction:column;align-items:stretch;gap:6px} + .contr{align-items:stretch;width:100%} + .contr select{width:100%;min-width:0} + .item .dl div:has(.contr){flex-direction:column;align-items:stretch;gap:6px} + .item .dl div:has(.contr) dd{text-align:left} .nnote{font-size:14px} .nextbox .nact{position:fixed;left:0;right:0;bottom:0;z-index:5;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:12px 16px 18px;border-top:1px solid var(--ln);background:var(--top)} .nextbox .nact>*{height:50px;font-size:15px;width:100%} @@ -1343,7 +1354,7 @@ select.inp{appearance:none;-webkit-appearance:none;padding-right:32px;background #tab-stats .stats-grid>section:has(#stats-machines){display:none} #tab-stats .grouph{margin:8px 0 0;font-size:11.5px;letter-spacing:.05em} #tab-stats .stats-details .stats-det{height:44px;padding:0 14px;font-size:14px} - #tab-stats .stats-det span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap} + #tab-stats .stats-det span{display:none} #tab-stats .stats-details[open] .stats-det{margin-bottom:8px} #tab-stats .stats-details>.panel+.panel{margin-top:8px} .hk,.mk{padding:14px;gap:4px;border:0;border-right:1px solid var(--ln);border-bottom:1px solid var(--ln)} @@ -1379,8 +1390,17 @@ select.inp{appearance:none;-webkit-appearance:none;padding-right:32px;background #stats-stages td,#stats-rework td{padding:0;border:0} #stats-stages td:nth-child(1) .sub{display:none} #stats-stages td:nth-child(1){font-size:14.5px;font-weight:600} - #stats-stages td:nth-child(2){grid-column:2;grid-row:1/3;align-self:center;font-size:13.5px} - #stats-stages td:nth-child(3){grid-column:1;grid-row:2;font-size:12.5px;padding-left:28px} + /* a stage: name and average on top, then the limit, the overruns and now, each named */ + #stats-stages td:nth-child(2){grid-column:2;grid-row:1;align-self:center;font-size:14px} + #stats-stages td:nth-child(n+3){grid-column:1/-1;font-size:12.5px;color:var(--tx2);padding-left:28px;text-align:left} + #stats-stages td:nth-child(3)::before{content:"Aceitável: "} + #stats-stages td:nth-child(4)::before{content:"Estouros: "} + #stats-stages td:nth-child(5)::before{content:"Agora: "} + #stats-stages td:nth-child(n+3)::before{color:var(--tx3)} + #tab-stats .table td.r{white-space:nowrap} + #stats-origins td{padding:10px 6px;font-size:12.5px} + #stats-origins td:first-child{padding-left:12px} + #stats-origins td:last-child{padding-right:12px;white-space:normal} #stats-rework td:nth-child(1){font-size:14px} #stats-rework td:nth-child(1) .sub{display:none} #stats-rework td:nth-child(2){font-weight:600;color:var(--tx)} diff --git a/web/kanban.js b/web/kanban.js index 52ca694..4c3732e 100644 --- a/web/kanban.js +++ b/web/kanban.js @@ -666,12 +666,14 @@ async function load(quiet=false){ } } // The page's name in the top bar; Produção also says what is open. +// On the phone the bottom bar holds four tabs; these live in its Mais sheet. +const MORE_TABS=['montar','site','integrations','users']; const PAGE_TITLES={board:'Produção',quotes:'Cotações',payments:'Pagamentos',stats:'Números',site:'Site',integrations:'Integrações',users:'Usuários',montar:'Montar folha'}; function showTab(name){ tab=name;$('tab-quotes').classList.remove('reviewing'); for(const b of document.querySelectorAll('[data-tab]'))b.setAttribute('aria-selected',String(b.dataset.tab===name)); $('page-title').textContent=PAGE_TITLES[name];$('board-summary').hidden=name!=='board';$('filter-open').hidden=name!=='board'; - $('more-nav').classList.toggle('on',['integrations','users'].includes(name)); + $('more-nav').classList.toggle('on',MORE_TABS.includes(name)); for(const id of ['board','quotes','payments','stats','site','integrations','users','montar'])$('tab-'+id).hidden=name!==id; const lists={quotes:loadQuotes,payments:loadIssues,stats:loadStats,site:loadSiteAdmin,integrations:eventsIfAllowed,users:loadUsers,montar:loadMontador}; if(board&&lists[name])lists[name]().catch(e=>say(e.message,true));