minor UI tweaks
This commit is contained in:
@@ -47,6 +47,8 @@ body {
|
|||||||
font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
|
font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
|
||||||
color: var(--ink);
|
color: var(--ink);
|
||||||
background: var(--page-bg);
|
background: var(--page-bg);
|
||||||
|
--output-max-height-base: 280px;
|
||||||
|
--output-height-delta: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title-block {
|
.title-block {
|
||||||
@@ -188,10 +190,6 @@ select {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
body.custom-task-mode .output {
|
|
||||||
max-height: 210px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.hidden {
|
.hidden {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
@@ -322,14 +320,14 @@ button:active {
|
|||||||
padding: 8px;
|
padding: 8px;
|
||||||
background: var(--output-bg);
|
background: var(--output-bg);
|
||||||
min-height: 210px;
|
min-height: 210px;
|
||||||
max-height: 280px;
|
max-height: calc(var(--output-max-height-base) - var(--output-height-delta));
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.output-body {
|
.output-body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
word-break: break-word;
|
word-break: break-word;
|
||||||
max-height: 260px;
|
max-height: calc(var(--output-max-height-base) - var(--output-height-delta) - 20px);
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
line-height: 1.45;
|
line-height: 1.45;
|
||||||
|
|||||||
@@ -78,7 +78,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="task-row custom-task-row hidden" id="customTaskRow">
|
<div class="task-row custom-task-row hidden" id="customTaskRow">
|
||||||
<div class="field custom-task-field">
|
<div class="field custom-task-field">
|
||||||
<label for="customTaskInput">Custom task</label>
|
|
||||||
<textarea id="customTaskInput" rows="2" placeholder="Enter temporary custom task..."></textarea>
|
<textarea id="customTaskInput" rows="2" placeholder="Enter temporary custom task..."></textarea>
|
||||||
</div>
|
</div>
|
||||||
<div class="custom-task-actions">
|
<div class="custom-task-actions">
|
||||||
|
|||||||
@@ -715,7 +715,11 @@ function setCustomTaskMode(enabled, { persist = true } = {}) {
|
|||||||
state.customTaskMode = Boolean(enabled);
|
state.customTaskMode = Boolean(enabled);
|
||||||
document.body.classList.toggle("custom-task-mode", state.customTaskMode);
|
document.body.classList.toggle("custom-task-mode", state.customTaskMode);
|
||||||
if (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");
|
customTaskRow?.classList.remove("hidden");
|
||||||
if (taskActionsSlot && taskActions) {
|
if (taskActionsSlot && taskActions) {
|
||||||
taskActionsSlot.appendChild(taskActions);
|
taskActionsSlot.appendChild(taskActions);
|
||||||
@@ -724,12 +728,28 @@ function setCustomTaskMode(enabled, { persist = true } = {}) {
|
|||||||
customTaskInput.value = state.customTaskText || "";
|
customTaskInput.value = state.customTaskText || "";
|
||||||
customTaskInput.focus();
|
customTaskInput.focus();
|
||||||
}
|
}
|
||||||
|
window.requestAnimationFrame(() => {
|
||||||
|
if (customTaskRow) {
|
||||||
|
const measured = measureRowHeight(customTaskRow);
|
||||||
|
if (measured) customTaskRowHeight = measured;
|
||||||
|
}
|
||||||
|
updateOutputHeightDelta();
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
customTaskRow?.classList.add("hidden");
|
customTaskRow?.classList.add("hidden");
|
||||||
normalTaskRow?.classList.remove("hidden");
|
if (normalTaskRow) {
|
||||||
|
normalTaskRow.classList.remove("hidden");
|
||||||
|
}
|
||||||
if (normalTaskRow && taskActions) {
|
if (normalTaskRow && taskActions) {
|
||||||
normalTaskRow.appendChild(taskActions);
|
normalTaskRow.appendChild(taskActions);
|
||||||
}
|
}
|
||||||
|
window.requestAnimationFrame(() => {
|
||||||
|
if (normalTaskRow) {
|
||||||
|
const measured = measureRowHeight(normalTaskRow);
|
||||||
|
if (measured) normalTaskRowHeight = measured;
|
||||||
|
}
|
||||||
|
updateOutputHeightDelta();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
updatePromptCount();
|
updatePromptCount();
|
||||||
if (persist) {
|
if (persist) {
|
||||||
@@ -811,6 +831,26 @@ function scheduleConfigRefresh() {
|
|||||||
}, 250);
|
}, 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() {
|
async function refreshSiteContentCounts() {
|
||||||
if (state.isAnalyzing) return;
|
if (state.isAnalyzing) return;
|
||||||
if (state.currentPopupState !== "normal") return;
|
if (state.currentPopupState !== "normal") return;
|
||||||
|
|||||||
Reference in New Issue
Block a user