I managed to clear the chat memory at least temporarily until pickaxe implements it in the backend.
Here is the code to inject into the studio footer:
<script>
(function() {
const DELETE_CLASS = 'delete-memory-btn';
const STORAGE_KEY = 'deletedChatMemories';
// Utilizamos Set para mayor rendimiento y evitar duplicados
function getDeleted() {
try {
return new Set(JSON.parse(localStorage.getItem(STORAGE_KEY)) || []);
} catch {
return new Set();
}
}
function setDeleted(set) {
localStorage.setItem(STORAGE_KEY, JSON.stringify([...set]));
}
function createDeleteButton(btn, title, deletedSet) {
const x = document.createElement('button');
x.className = DELETE_CLASS;
x.textContent = '×';
Object.assign(x.style, {
position: 'absolute',
top: '6px',
right: '12px',
background: 'transparent',
border: 'none',
color: 'rgba(0,0,0,0.4)',
fontSize: '14px',
cursor: 'pointer',
padding: '0',
lineHeight: '1'
});
x.addEventListener('click', e => {
e.stopPropagation();
deletedSet.add(title);
setDeleted(deletedSet);
btn.remove();
});
btn.appendChild(x);
}
function injectDeletes() {
const deletedSet = getDeleted();
document.querySelectorAll('button.select-none[class*="pl-"]').forEach(btn => {
if (btn.querySelector(`.${DELETE_CLASS}`)) return;
const titleEl = btn.querySelector('p.truncate.font-semibold, p.truncate');
if (!titleEl) return;
const title = titleEl.textContent.trim();
if (deletedSet.has(title)) {
btn.remove();
return;
}
btn.style.position = 'relative';
createDeleteButton(btn, title, deletedSet);
});
}
// Inyecta de inmediato y observa cambios nuevos
document.addEventListener('DOMContentLoaded', injectDeletes);
new MutationObserver(injectDeletes).observe(document.body, {
childList: true,
subtree: true
});
})();
</script>
~All glory belongs to God
This allows you to delete chat memories. But it only does so locally. Even if you refresh the page or log in from another link, the memories will still be deleted. But if, for example, you log in from a mobile device, they will reappear. It’s a provisional solution.
Sorry, it’s the best I could do, since I don’t have access to the backend.
What can’t this script do?
As you already know, since it doesn’t have a backend:
- Deleted memories are only stored on the device and browser where they were removed.
- If you access it from another browser or mobile device, the memories will reappear.
- If localStorage is cleared or the cache is cleaned, the deleted memories will come back.
Do you know if it will take a long time to implement it officially? @admin_mike @nathaniel