minor UI tweaks

This commit is contained in:
2026-01-19 19:50:37 -05:00
parent 372afd5ed2
commit fec5bb4a7d
3 changed files with 46 additions and 9 deletions

View File

@@ -715,7 +715,11 @@ function setCustomTaskMode(enabled, { persist = true } = {}) {
state.customTaskMode = Boolean(enabled);
document.body.classList.toggle("custom-task-mode", state.customTaskMode);
if (state.customTaskMode) {
normalTaskRow?.classList.add("hidden");
if (normalTaskRow) {
const measured = measureRowHeight(normalTaskRow);
if (measured) normalTaskRowHeight = measured;
normalTaskRow.classList.add("hidden");
}
customTaskRow?.classList.remove("hidden");
if (taskActionsSlot && taskActions) {
taskActionsSlot.appendChild(taskActions);
@@ -724,12 +728,28 @@ function setCustomTaskMode(enabled, { persist = true } = {}) {
customTaskInput.value = state.customTaskText || "";
customTaskInput.focus();
}
window.requestAnimationFrame(() => {
if (customTaskRow) {
const measured = measureRowHeight(customTaskRow);
if (measured) customTaskRowHeight = measured;
}
updateOutputHeightDelta();
});
} else {
customTaskRow?.classList.add("hidden");
normalTaskRow?.classList.remove("hidden");
if (normalTaskRow) {
normalTaskRow.classList.remove("hidden");
}
if (normalTaskRow && taskActions) {
normalTaskRow.appendChild(taskActions);
}
window.requestAnimationFrame(() => {
if (normalTaskRow) {
const measured = measureRowHeight(normalTaskRow);
if (measured) normalTaskRowHeight = measured;
}
updateOutputHeightDelta();
});
}
updatePromptCount();
if (persist) {
@@ -811,6 +831,26 @@ function scheduleConfigRefresh() {
}, 250);
}
let normalTaskRowHeight = null;
let customTaskRowHeight = null;
function measureRowHeight(row) {
if (!row) return 0;
return row.getBoundingClientRect().height || 0;
}
function updateOutputHeightDelta() {
const baseHeight = normalTaskRowHeight || measureRowHeight(normalTaskRow);
if (!baseHeight) return;
if (!state.customTaskMode) {
document.body.style.setProperty("--output-height-delta", "0px");
return;
}
const customHeight = customTaskRowHeight || measureRowHeight(customTaskRow);
const delta = Math.max(0, customHeight - baseHeight);
document.body.style.setProperty("--output-height-delta", `${Math.round(delta)}px`);
}
async function refreshSiteContentCounts() {
if (state.isAnalyzing) return;
if (state.currentPopupState !== "normal") return;