From e4354e2d6dcc3f07e526828e82dec65f8153ff41 Mon Sep 17 00:00:00 2001 From: Youzini-afk <13153778771cx@gmail.com> Date: Wed, 29 Apr 2026 17:28:45 +0800 Subject: [PATCH] fix(notice): fix compact layout title truncated to 'ST...' Root cause: compact layout used width:fit-content on parent with overflow:hidden + min-width:0 on __content flex child. In flex, min-width:0 allows the child to shrink to 0, and fit-content + overflow:hidden causes the content to collapse completely, showing only 'ST...' for the title. Fix: Replace width:fit-content with max-width on the compact parent so the container can size naturally. Give __content flex:1 1 0% so it takes all available space after icon/close button, letting the title fill that space and ellipsis only when it genuinely overflows. --- ui/notice.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ui/notice.js b/ui/notice.js index 2ee3830..567bfe6 100644 --- a/ui/notice.js +++ b/ui/notice.js @@ -69,28 +69,25 @@ function ensureStyle(doc) { display: flex; align-items: center; gap: 10px; - width: fit-content; - max-width: 100%; + max-width: min(400px, calc(100vw - 28px)); align-self: flex-end; padding: 10px; } .st-bme-notice__content { min-width: 0; + flex: 1 1 0%; transition: max-width 280ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease; } .st-bme-notice[data-layout="normal"] .st-bme-notice__content { - max-width: 360px; overflow: hidden; } .st-bme-notice[data-layout="compact"] .st-bme-notice__content { display: flex; align-items: center; - min-width: 0; - max-width: 320px; overflow: hidden; }