fix: make dropdown text color conditional for PicoCSS and fix download button positioning to be next to play buttons

This commit is contained in:
Russell Ballestrini 2025-07-03 22:32:44 -04:00
parent 2e655a206b
commit 7bb43c7613
2 changed files with 35 additions and 9 deletions

View file

@ -42,13 +42,15 @@ export async function readPageWithHermes() {
downloadButton.onclick = async () => {
try {
const { generateTitleForTTS } = await import("./tts.js");
console.log("Generating title for Read Page content:", processedContent.substring(0, 200) + "...");
const filename = await generateTitleForTTS(processedContent);
console.log("Generated filename:", filename);
const a = document.createElement("a");
a.href = URL.createObjectURL(blob);
a.download = `${filename}.mp3`;
a.click();
} catch (error) {
console.error("Error generating filename:", error);
console.error("Error generating filename for Read Page:", error);
// Fallback to document title
const a = document.createElement("a");
a.href = URL.createObjectURL(blob);

View file

@ -366,7 +366,7 @@ async function openUncloseaiEmbeddedModalNew() {
border-radius: 6px;
font-size: 14px;
background: ${colors.inputBackground};
color: black;
color: ${USE_CUSTOM_STYLING ? 'black' : colors.primaryText};
`;
// Store models for selection handler
@ -466,7 +466,7 @@ async function openUncloseaiEmbeddedModalNew() {
border-radius: 6px;
font-size: 14px;
background: ${colors.inputBackground};
color: black;
color: ${USE_CUSTOM_STYLING ? 'black' : colors.primaryText};
`;
const voices = ["alloy", "echo", "fable", "onyx", "nova", "shimmer"];
@ -514,7 +514,7 @@ async function openUncloseaiEmbeddedModalNew() {
border-radius: 6px;
font-size: 14px;
background: ${colors.inputBackground};
color: black;
color: ${USE_CUSTOM_STYLING ? 'black' : colors.primaryText};
`;
// Add options for each supported language
@ -1147,7 +1147,7 @@ async function openUncloseaiEmbeddedModalNew() {
line-height: 1.4;
outline: none;
background: ${colors.inputBackground};
color: black;
color: ${USE_CUSTOM_STYLING ? 'black' : colors.primaryText};
transition: border-color 0.2s;
`;
input.onfocus = () => (input.style.borderColor = colors.focusBorder);
@ -1301,7 +1301,13 @@ async function openUncloseaiEmbeddedModalNew() {
a.click();
}
};
userMessageActions.appendChild(downloadBtn);
// Insert download button right after the play button (before delete button)
const userDeleteBtn = userMessageActions.querySelector('button[title="Delete message"]');
if (userDeleteBtn) {
userMessageActions.insertBefore(downloadBtn, userDeleteBtn);
} else {
userMessageActions.appendChild(downloadBtn);
}
}
// Set up audio event handlers
@ -1517,7 +1523,13 @@ async function openUncloseaiEmbeddedModalNew() {
a.click();
}
};
messageActions.appendChild(downloadBtn);
// Insert download button right after the play button (before copy buttons)
const copyRawBtn = messageActions.querySelector('button[title="Copy raw response"]');
if (copyRawBtn) {
messageActions.insertBefore(downloadBtn, copyRawBtn);
} else {
messageActions.appendChild(downloadBtn);
}
}
// Set up audio event handlers
@ -1939,7 +1951,13 @@ You have complete knowledge of this page content and can reference any details,
a.click();
}
};
userMessageActions.appendChild(downloadBtn);
// Insert download button right after the play button (before delete button)
const userDeleteBtn = userMessageActions.querySelector('button[title="Delete message"]');
if (userDeleteBtn) {
userMessageActions.insertBefore(downloadBtn, userDeleteBtn);
} else {
userMessageActions.appendChild(downloadBtn);
}
}
// Set up audio event handlers
@ -2126,7 +2144,13 @@ You have complete knowledge of this page content and can reference any details,
a.click();
}
};
messageActions.appendChild(downloadBtn);
// Insert download button right after the play button (before copy buttons)
const copyRawBtn = messageActions.querySelector('button[title="Copy raw response"]');
if (copyRawBtn) {
messageActions.insertBefore(downloadBtn, copyRawBtn);
} else {
messageActions.appendChild(downloadBtn);
}
}
// Set up audio event handlers