Add debug logging to diagnose code block button visibility issue
This commit is contained in:
parent
df7b47bc61
commit
1803ed9030
1 changed files with 7 additions and 1 deletions
|
|
@ -93,12 +93,18 @@ async function getSelectedModel() {
|
|||
|
||||
// Helper function to add copy and run buttons to code blocks
|
||||
function addCodeBlockCopyButtons(element) {
|
||||
console.log("🔧 addCodeBlockCopyButtons called on element:", element);
|
||||
const codeBlocks = element.querySelectorAll("pre code");
|
||||
console.log("🔧 Found code blocks:", codeBlocks.length);
|
||||
codeBlocks.forEach((codeBlock) => {
|
||||
const pre = codeBlock.parentElement;
|
||||
console.log("🔧 Processing code block, parent:", pre.tagName);
|
||||
if (pre.tagName.toLowerCase() === "pre") {
|
||||
// Check if buttons already exist to avoid duplicates
|
||||
if (pre.querySelector('.uncloseai-code-copy-btn')) {
|
||||
const existingBtn = pre.querySelector('.uncloseai-code-copy-btn');
|
||||
console.log("🔧 Existing button check:", existingBtn);
|
||||
if (existingBtn) {
|
||||
console.log("🔧 Buttons already exist, skipping");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue