From f6ffe469ba7e60e68ac7a839e9642ca3b7f5a592 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rama=20=E2=80=94=20Buttercode=20Systems?= Date: Thu, 26 Nov 2026 09:16:18 +0200 Subject: [PATCH 1/4] Improve responsive containment and UI resilience --- dist/style.css | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/dist/style.css b/dist/style.css index 253510c..b469731 100644 --- a/dist/style.css +++ b/dist/style.css @@ -64,3 +64,77 @@ .invoice-top .text-right .invoice-title{color:var(--accent)} .doc-logo{display:block;max-height:56px;max-width:180px;object-fit:contain;margin-bottom:12px} .logo-preview{max-height:64px;max-width:180px;object-fit:contain;margin-top:10px;border:1px solid var(--line);border-radius:8px;padding:6px;background:var(--paper)} + + +/* Responsive containment and interaction quality pass (2026-11-26) */ +:root{--content-max:1500px;--control-target:44px;--motion-fast:140ms;--motion-base:200ms} +html{width:100%;min-width:0;scroll-padding-top:1rem} +body,#app,.shell,.workspace,.content,.panel,.panel-body,.editor-grid,.editor-aside,.settings-wrap{min-width:0;max-width:100%} +body{overflow-wrap:break-word} +img,video,canvas,svg,iframe{max-width:100%} +img,video{height:auto} +.content{width:100%;max-width:var(--content-max)} +.heading,.heading>* ,.toolbar>* ,.topbar>* ,.top-right,.actions,.filters,.panel-head>*{min-width:0} +.heading,.panel-head,.toolbar,.banner,.invoice-top,.list-card{flex-wrap:wrap} +.heading .actions{max-width:100%} +.stats{grid-template-columns:repeat(4,minmax(0,1fr))} +.stat,.stat-value,.stat-label,.stat-note{min-width:0} +.stat-value{white-space:normal;overflow-wrap:anywhere;line-height:1.2;font-variant-numeric:tabular-nums} +.table-wrap{max-width:100%;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch} +.table-wrap table{max-width:100%} +td,th{overflow-wrap:anywhere} +input,select,textarea{max-width:100%;min-width:0} +button,a,.btn,.icon-btn,.filter,.nav-item{touch-action:manipulation} +button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{scroll-margin:1rem} +dialog{max-width:calc(100vw - 24px);max-width:calc(100dvw - 24px);max-height:calc(100dvh - 24px);overscroll-behavior:contain} +.dialog-body{min-width:0;overflow-wrap:anywhere} +#toast{width:max-content;width:fit-content;max-width:calc(100vw - 24px);max-width:calc(100dvw - 24px);overflow-wrap:anywhere} +code,pre,.address,.invoice-title,.subtitle,.form-note,.error{overflow-wrap:anywhere} +.demo-banner{background:#fdf0cd;color:#624b16;border-color:#e6d4a6} +:root[data-theme=dark] .demo-banner{background:#3a301d;color:#f2d89c;border-color:#66532c} +.btn,.icon-btn,.filter,.nav-item{transition:background-color var(--motion-fast) ease,color var(--motion-fast) ease,border-color var(--motion-fast) ease,transform var(--motion-fast) ease} +.btn:active,.icon-btn:active,.filter:active{transform:translateY(1px)} +@media(max-width:1024px){.grid-main{grid-template-columns:minmax(0,1fr)}.dashboard-secondary{grid-template-columns:repeat(2,minmax(0,1fr))}.editor-grid{grid-template-columns:minmax(0,1fr)}.editor-aside{min-width:0}} +@media(max-width:767px){ + .content{padding-left:clamp(14px,4vw,20px);padding-right:clamp(14px,4vw,20px)} + .topbar{gap:10px;padding-left:clamp(12px,3.5vw,20px);padding-right:clamp(12px,3.5vw,20px)} + .top-right{gap:8px;flex-wrap:wrap;justify-content:flex-end} + .heading{align-items:flex-start} + .heading>div:first-child{flex:1 1 180px} + .heading .actions{flex:0 1 auto} + .stats{grid-template-columns:repeat(2,minmax(0,1fr))} + .stat-value{font-size:clamp(17px,5.4vw,26px);letter-spacing:-.6px} + .dashboard-secondary{display:block} + .editor-aside{display:block} + .invoice-top>div{min-width:0;max-width:100%} + .invoice-parties>*{min-width:0;overflow-wrap:anywhere} + .detail-paper{min-width:0;max-width:100%;padding:clamp(16px,5vw,24px)} + .invoice-detail-lines{width:max-content;min-width:420px;max-width:none} + .invoice-line{min-width:0;grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) 40px} + .invoice-line>*{min-width:0} + .invoice-line input{min-width:0;padding-left:8px;padding-right:8px} + .line-total{overflow-wrap:anywhere} + .dialog-body{padding:clamp(16px,5vw,20px)} + .dialog-head,.dialog-foot{padding-left:clamp(14px,5vw,20px);padding-right:clamp(14px,5vw,20px)} + .search{min-width:0;width:100%;max-width:none} + .toolbar .filters{max-width:100%} + .list-card>*{min-width:0;overflow-wrap:anywhere} +} +@media(max-width:420px){ + .heading .actions{width:100%} + .heading .actions .btn{flex:1 1 auto;white-space:normal} + .stats{gap:8px} + .stat{min-height:0;padding:13px} + .stat-label{gap:5px;font-size:10px;overflow-wrap:anywhere} + .stat-note{font-size:10px} + .panel-head{align-items:flex-start} + .panel-head .actions{width:100%} + .form-grid{grid-template-columns:minmax(0,1fr)} + .span-2{grid-column:auto} + .invoice-parties{grid-template-columns:minmax(0,1fr)} + .invoice-line{grid-template-columns:minmax(0,1fr) minmax(0,1fr) 36px;gap:7px} + .invoice-line .line-desc{grid-column:1/-1} + .invoice-line .line-total{grid-column:1/3;text-align:left;padding-top:0} + .invoice-line>.icon-btn{grid-column:3;grid-row:2} +} +@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}} From b10596587d8f2c48351a8193f4892a8dd013a660 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rama=20=E2=80=94=20Buttercode=20Systems?= Date: Thu, 26 Nov 2026 09:16:21 +0200 Subject: [PATCH 2/4] Refresh PWA cache for UI overhaul --- dist/sw.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/sw.js b/dist/sw.js index 8af04bb..dd1f23f 100644 --- a/dist/sw.js +++ b/dist/sw.js @@ -1,4 +1,4 @@ -const CACHE='invoiceflow-v049'; +const CACHE='invoiceflow-v050-ui-overhaul'; const ASSETS=['./','./index.html','./style.css','./core.js','./app.js','./draft.js','./receipt.js','./pdf.js','./vendor/pdf-lib.js','./vendor/fontkit.js','./vendor/DejaVuSans.ttf','./icon.svg','./icon-192.png','./icon-512.png','./manifest.webmanifest']; self.addEventListener('install',event=>{event.waitUntil(caches.open(CACHE).then(cache=>cache.addAll(ASSETS)).then(()=>self.skipWaiting()))}); self.addEventListener('activate',event=>{event.waitUntil(caches.keys().then(keys=>Promise.all(keys.filter(k=>k.startsWith('invoiceflow-')&&k!==CACHE).map(k=>caches.delete(k)))).then(()=>self.clients.claim()))}); From 1e372c488fd7ac73e738b7309a8c1ba198f5fb2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rama=20=E2=80=94=20Buttercode=20Systems?= Date: Thu, 26 Nov 2026 09:26:31 +0200 Subject: [PATCH 3/4] Include visible business initials in avatar accessible name --- dist/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/app.js b/dist/app.js index 6a3a734..d27b197 100644 --- a/dist/app.js +++ b/dist/app.js @@ -29,7 +29,7 @@ function load(key){return new Promise((resolve,reject)=>{const t=db.transaction( async function commit(change,{checkpoint=false,workspaceSwitch=false}={}){if(switching&&!workspaceSwitch)throw Error('A workspace switch is in progress. Try again in a moment.');if(working)throw Error('A save is already in progress. Try again in a moment.');working=true;const key=mode;try{const draft=structuredClone(state);change(draft);draft.revision=state.revision+1;validateState(draft);makeBackup(draft,key);await new Promise((resolve,reject)=>{const t=db.transaction('workspaces','readwrite'),store=t.objectStore('workspaces'),r=store.get(key);let conflict=false;r.onsuccess=()=>{if((r.result?.revision||0)!==state.revision){conflict=true;t.abort();return}if(checkpoint)store.put(structuredClone(state),key+'-before-restore');store.put(draft,key)};t.oncomplete=resolve;t.onabort=()=>reject(Error(conflict?'This workspace changed in another tab. Reload before saving to avoid overwriting changes.':'Could not save. Device storage may be full. Export a backup before closing.'));t.onerror=()=>reject(Error('Could not save to device storage. Your changes were not saved.'))});state=draft;return draft}finally{working=false}} async function switchMode(){if(working||switching)return;switching=true;const previousMode=mode,previousState=state,target=mode==='demo'?returnMode:'demo';try{const stored=await load(target),incoming=stored||(target==='demo'?demoState():emptyState());validateState(incoming);if(previousMode!=='demo')returnMode=previousMode;clearDraftFor(previousMode,!!route.quote,route.id);mode=target;state=incoming;if(!stored)await commit(()=>{},{workspaceSwitch:true});route={page:'overview'};invoiceFilter='all';search='';render();toast(mode==='demo'?'Example data · isolated from your real workspace.':'Back in your real workspace.')}catch(error){mode=previousMode;state=previousState;throw error}finally{switching=false}} const pages=[['overview','grid','Overview'],['invoices','invoice','Invoices'],['quotes','invoice','Quotes'],['collections','clock','Collections'],['expenses','expense','Expenses'],['customers','users','Customers'],['items','box','Items'],['templates','box','Templates'],['reports','chart','Reports'],['cashflow','chart','Cash Flow'],['compliance','chart','Compliance']]; -function render(){const current=route.quote||route.page==='quote'?'quotes':route.page==='editor'||route.page==='invoice'?'invoices':route.page;const navCurrent=current==='client'?'customers':current;document.title=`${current[0].toUpperCase()+current.slice(1)} · InvoiceFlow`;app.innerHTML=`
Workspace / ${esc(pages.find(p=>p[0]===current)?.[2]||(current==='client'?'Customers':'Settings'))}
InvoiceFlow
${mode==='demo'?'DEMO WORKSPACE':'LOCAL FIRST · ZAR'}
${mode==='demo'?``:''}${renderPage()}
InvoiceFlow A little less admin.${offlineReady?'Offline ready · ':''}Device only. Back up regularly.
`;maybeBackupNudge();bindPage();enhanceScrollRegions();renderedOnce=true;} +function render(){const current=route.quote||route.page==='quote'?'quotes':route.page==='editor'||route.page==='invoice'?'invoices':route.page;const navCurrent=current==='client'?'customers':current;document.title=`${current[0].toUpperCase()+current.slice(1)} · InvoiceFlow`;app.innerHTML=`
Workspace / ${esc(pages.find(p=>p[0]===current)?.[2]||(current==='client'?'Customers':'Settings'))}
InvoiceFlow
${mode==='demo'?'DEMO WORKSPACE':'LOCAL FIRST · ZAR'}
${mode==='demo'?``:''}${renderPage()}
InvoiceFlow A little less admin.${offlineReady?'Offline ready · ':''}Device only. Back up regularly.
`;maybeBackupNudge();bindPage();enhanceScrollRegions();renderedOnce=true;} function enhanceScrollRegions(){const nav=app.querySelector('nav'),active=nav?.querySelector('[aria-current=page]');if(nav&&active&&nav.scrollWidth>nav.clientWidth)nav.scrollLeft=active.offsetLeft-nav.offsetLeft-(nav.clientWidth-active.offsetWidth)/2;for(const table of app.querySelectorAll('.table-wrap')){if(table.scrollWidth<=table.clientWidth)continue;table.tabIndex=0;table.setAttribute('role','region');table.setAttribute('aria-label','Scrollable table. Use arrow keys or swipe sideways to see all columns.');const hint=document.createElement('p');hint.className='table-scroll-hint';hint.textContent='Swipe or scroll sideways to see all columns →';table.before(hint)}} function heading(title,subtitle,actions='',eyebrow='YOUR MONEY, AT A GLANCE'){return `
${eyebrow}

${title}

${subtitle}

${actions}
`} const btn=(label,action,primary=false,i='',extra='')=>``; From 9434d69bac1bf774a95569bd531d3794b9238674 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rama=20=E2=80=94=20Buttercode=20Systems?= Date: Thu, 26 Nov 2026 09:39:02 +0200 Subject: [PATCH 4/4] Preserve intended tablet statistics layout --- dist/style.css | 1 - 1 file changed, 1 deletion(-) diff --git a/dist/style.css b/dist/style.css index b469731..58e0799 100644 --- a/dist/style.css +++ b/dist/style.css @@ -77,7 +77,6 @@ img,video{height:auto} .heading,.heading>* ,.toolbar>* ,.topbar>* ,.top-right,.actions,.filters,.panel-head>*{min-width:0} .heading,.panel-head,.toolbar,.banner,.invoice-top,.list-card{flex-wrap:wrap} .heading .actions{max-width:100%} -.stats{grid-template-columns:repeat(4,minmax(0,1fr))} .stat,.stat-value,.stat-label,.stat-note{min-width:0} .stat-value{white-space:normal;overflow-wrap:anywhere;line-height:1.2;font-variant-numeric:tabular-nums} .table-wrap{max-width:100%;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}