fix(ui): respect dismissed stage notices

This commit is contained in:
opencode
2026-05-15 17:49:53 +00:00
parent 2a83a7ec99
commit 0cdbeef3a3
2 changed files with 52 additions and 4 deletions

View File

@@ -501,10 +501,15 @@ export function showManagedBmeNotice(input) {
closeTimer = null;
};
const close = () => {
const close = (reason = "programmatic") => {
if (closed) return;
clearCloseTimer();
closed = true;
try {
currentInput.onDismiss?.({ reason });
} catch (error) {
console.debug?.("[ST-BME] notice dismiss callback failed", error);
}
item.classList.add("st-bme-notice--out");
setTimeout(() => {
item.remove();
@@ -518,7 +523,7 @@ export function showManagedBmeNotice(input) {
clearCloseTimer();
if (nextInput.persist) return;
const duration = Math.max(1400, nextInput.duration_ms || 3200);
closeTimer = setTimeout(close, duration);
closeTimer = setTimeout(() => close("auto"), duration);
};
const update = (nextInput) => {
@@ -539,7 +544,7 @@ export function showManagedBmeNotice(input) {
closeButton.addEventListener("click", (event) => {
event.preventDefault();
event.stopPropagation();
close();
close("user");
});
content.addEventListener("click", (event) => {
@@ -565,7 +570,7 @@ export function showManagedBmeNotice(input) {
if (nextLayout === "normal" && !currentInput.persist) {
clearCloseTimer();
const duration = Math.max(1400, currentInput.duration_ms || 3200);
closeTimer = setTimeout(close, duration);
closeTimer = setTimeout(() => close("auto"), duration);
const progressEl = item.querySelector(".st-bme-notice__progress");
if (progressEl) {
progressEl.style.display = "";