feat: 운영 안정성과 세션 음성 경험 개선
This commit is contained in:
parent
facc4ad2d9
commit
c788343467
95 changed files with 8431 additions and 1785 deletions
|
|
@ -59,13 +59,15 @@
|
|||
}
|
||||
</script>
|
||||
<!-- 본문/UI 기본 폰트: Pretendard Variable (DESIGN_CONCEPT §3.6) -->
|
||||
<!-- 렌더 블로킹 CDN 스타일시트다. 연결 수립(DNS+TCP+TLS)을 미리 열어 LCP를 줄인다.
|
||||
근본 해결은 Pretendard self-host 이며 별도 과제로 남긴다. -->
|
||||
<link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin />
|
||||
<link rel="dns-prefetch" href="https://cdn.jsdelivr.net" />
|
||||
<!-- self-host 로 전환했다. jsDelivr 렌더 블로킹 스타일시트와 그에 딸린
|
||||
preconnect/dns-prefetch 를 제거해 외부 요청을 0으로 만들었다.
|
||||
@font-face 선언은 src/styles/tokens.css 최상단에 있다. -->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/variable/pretendardvariable.min.css"
|
||||
rel="preload"
|
||||
as="font"
|
||||
type="font/woff2"
|
||||
href="/fonts/PretendardVariable.woff2"
|
||||
crossorigin
|
||||
/>
|
||||
<script>
|
||||
(function () {
|
||||
|
|
@ -96,23 +98,31 @@
|
|||
if (errors.length > 5) errors.shift();
|
||||
render("runtime-error");
|
||||
}
|
||||
function isVisiblyRendered(node) {
|
||||
if (!node) return false;
|
||||
var main = document.querySelector(".vg-main");
|
||||
var mainRect = main ? main.getBoundingClientRect() : null;
|
||||
var viewportTop = mainRect ? mainRect.top : 0;
|
||||
var viewportBottom = mainRect ? mainRect.bottom : window.innerHeight;
|
||||
var rect = node.getBoundingClientRect();
|
||||
var style = window.getComputedStyle(node);
|
||||
return (
|
||||
rect.width > 1 &&
|
||||
rect.height > 1 &&
|
||||
rect.bottom > viewportTop &&
|
||||
rect.top < viewportBottom &&
|
||||
style.display !== "none" &&
|
||||
style.visibility !== "hidden" &&
|
||||
style.opacity !== "0"
|
||||
);
|
||||
}
|
||||
function visibleCount() {
|
||||
var nodes = Array.prototype.slice.call(
|
||||
document.querySelectorAll(
|
||||
"main,header,h1,h2,p,a,button,input,select,article,section,.vg-shell,.ad-head,.ad-diagnostic,.lg-root",
|
||||
"main,header,h1,h2,p,a,button,input,select,article,section,.vg-shell,.vg-route-error,.vgops-head,.vgops-diagnostic,.lg-root",
|
||||
),
|
||||
);
|
||||
return nodes.filter(function (node) {
|
||||
var rect = node.getBoundingClientRect();
|
||||
var style = window.getComputedStyle(node);
|
||||
return (
|
||||
rect.width > 1 &&
|
||||
rect.height > 1 &&
|
||||
style.display !== "none" &&
|
||||
style.visibility !== "hidden" &&
|
||||
style.opacity !== "0"
|
||||
);
|
||||
}).length;
|
||||
return nodes.filter(isVisiblyRendered).length;
|
||||
}
|
||||
function diagnosticApiBase() {
|
||||
var host = window.location.hostname;
|
||||
|
|
@ -139,6 +149,11 @@
|
|||
root_text_length: root && root.innerText ? root.innerText.trim().length : 0,
|
||||
root_child_count: root ? root.childElementCount : 0,
|
||||
visible_nodes: visible,
|
||||
main_scroll_top:
|
||||
document.querySelector(".vg-main") &&
|
||||
document.querySelector(".vg-main").scrollTop
|
||||
? Math.round(document.querySelector(".vg-main").scrollTop)
|
||||
: 0,
|
||||
document_ready_state: document.readyState,
|
||||
viewport: window.innerWidth + "x" + window.innerHeight,
|
||||
user_agent: short(window.navigator && window.navigator.userAgent),
|
||||
|
|
@ -171,13 +186,10 @@
|
|||
var isAdmin = path === "/admin" || path.indexOf("/admin/") === 0;
|
||||
var text = (document.body && document.body.innerText ? document.body.innerText : "").trim();
|
||||
var visible = visibleCount();
|
||||
var hasAdminContent =
|
||||
!isAdmin ||
|
||||
Boolean(
|
||||
document.querySelector(
|
||||
".ad-head,.ad-diagnostic,.ad-status,.ad-section,.ad-panel,.aic,[data-testid='admin-ai-page']",
|
||||
),
|
||||
);
|
||||
var adminContent = document.querySelector(
|
||||
"[data-vignette-admin-root],[data-vignette-admin-diagnostic],[data-testid='admin-ai-page']",
|
||||
);
|
||||
var hasAdminContent = !isAdmin || isVisiblyRendered(adminContent);
|
||||
if (reason === "watchdog" && text.length > 24 && visible > 0 && hasAdminContent) {
|
||||
var old = document.getElementById("vignette-boot-diagnostic");
|
||||
if (old) old.remove();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue