← back to Rentv Sheet Enrich Refine
Live console: guard drag-to-fill against phantom writes — native text-selection drags inside editable cells are now ignored on drop (intentional value-cell drags + external drops still write)
8150eebb287c23ea0f0f1510fcaa91be8417b60e · 2026-08-13 18:07:18 -0700 · Steve Abrams
yoloforever cycle 2 (Cody Bug 4).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Files touched
Diff
commit 8150eebb287c23ea0f0f1510fcaa91be8417b60e
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Thu Aug 13 18:07:18 2026 -0700
Live console: guard drag-to-fill against phantom writes — native text-selection drags inside editable cells are now ignored on drop (intentional value-cell drags + external drops still write)
yoloforever cycle 2 (Cody Bug 4).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
public_live/index.html | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/public_live/index.html b/public_live/index.html
index b25fd2e..a69d9b4 100644
--- a/public_live/index.html
+++ b/public_live/index.html
@@ -611,12 +611,15 @@ function wireGrid(){
// DRAG-TO-FILL: drag a value (from another cell or from outside the app) and drop it onto ANY field to
// REPLACE that field's value in the sheet — EXCEPT the Notes column, where the dropped text is APPENDED.
document.querySelectorAll('#grid td.linkcell,#grid td.callcell,#grid td.mailcell,#grid td.statuscell').forEach(td=>td.setAttribute('draggable','true'));
- gridEl.addEventListener('dragstart',e=>{ const td=e.target.closest('td[data-c]'); if(!td||td.getAttribute('draggable')!=='true')return;
- const r=+td.dataset.r,c=+td.dataset.c, v=(DATA.rows[r]&&DATA.rows[r][c])||td.textContent.trim();
- e.dataTransfer.setData('text/plain',String(v)); e.dataTransfer.effectAllowed='copyMove'; });
+ gridEl.addEventListener('dragstart',e=>{ const td=e.target.closest('td[data-c]');
+ if(td && td.getAttribute('draggable')==='true'){ window._dragText=false; // our intentional value drag
+ const r=+td.dataset.r,c=+td.dataset.c, v=(DATA.rows[r]&&DATA.rows[r][c])||td.textContent.trim();
+ e.dataTransfer.setData('text/plain',String(v)); e.dataTransfer.effectAllowed='copyMove';
+ } else { window._dragText=true; } }); // native text-selection drag -> ignore on drop
gridEl.addEventListener('dragover',e=>{ const td=e.target.closest('td[data-c]'); if(!td)return; e.preventDefault(); e.dataTransfer.dropEffect='copy'; td.classList.add('drophi'); });
gridEl.addEventListener('dragleave',e=>{ const td=e.target.closest('td[data-c]'); if(td)td.classList.remove('drophi'); });
gridEl.addEventListener('drop',async e=>{ const td=e.target.closest('td[data-c]'); if(!td)return; e.preventDefault(); td.classList.remove('drophi');
+ if(window._dragText){ window._dragText=false; return; } // native text-selection move, not an intentional fill
const txt=(e.dataTransfer.getData('text/plain')||'').trim(); if(!txt)return;
const r=+td.dataset.r, c=+td.dataset.c; if(isNaN(r)||isNaN(c))return;
const isNotes=/notes/i.test(DATA.headers[c]||'');
@@ -751,6 +754,7 @@ $('#theme').onclick=()=>{const t=document.body.classList.contains('light')?'dark
applyTheme(LS.get('theme', (window.matchMedia&&matchMedia('(prefers-color-scheme: light)').matches)?'light':'dark'));
// Fit mode = table always fits the window: re-fit columns to the viewport when it resizes
window.addEventListener('resize',()=>{ if(WIDTHPRESET==='fit'){ clearTimeout(window._rzfit); window._rzfit=setTimeout(applyFit,120); } });
+document.addEventListener('dragend',()=>{ window._dragText=false; }); // clear the text-move guard after any drag
document.addEventListener('keydown',e=>{if(e.key==='Escape')closeDraft()});
(async()=>{await loadMeta();await loadData(); if(WIDTHPRESET==='fit')applyFit();})();
</script>
← b159bca FIX critical data-corruption: combined/multi-sheet view writ
·
back to Rentv Sheet Enrich Refine
·
FIX write off-by-hr: 9 tabs have a title row above the heade 1c5e092 →