Match code execution output background to code block styling and remove debug logs

This commit is contained in:
Russell Ballestrini 2025-11-10 16:07:50 -05:00
parent 1803ed9030
commit b40ff56b23

View file

@ -93,18 +93,13 @@ 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
const existingBtn = pre.querySelector('.uncloseai-code-copy-btn');
console.log("🔧 Existing button check:", existingBtn);
if (existingBtn) {
console.log("🔧 Buttons already exist, skipping");
return;
}
@ -163,7 +158,11 @@ function addCodeBlockCopyButtons(element) {
resultsContainer.className = 'uncloseai-code-execution-results';
resultsContainer.style.marginTop = '10px';
resultsContainer.style.padding = '10px';
resultsContainer.style.backgroundColor = 'var(--uncloseai-modal-background)';
// Match the code block's background color
const preStyles = window.getComputedStyle(pre);
resultsContainer.style.backgroundColor = preStyles.backgroundColor;
resultsContainer.style.borderRadius = '5px';
resultsContainer.style.fontFamily = 'monospace';
resultsContainer.style.fontSize = '14px';