release: bump version to 0.84.2
ci / backend (push) Canceled after 0s
ci / frontend (push) Canceled after 0s
ci / delivery (push) Canceled after 0s

This commit is contained in:
rayd1o committed 2026-12-05 01:56:03 +08:00
1 parent 5e6352f524
commit 30b44ec00d
77 files changed
+3312 -1039

No files matched your search

+39 -1
View File
@@ -1304,6 +1304,23 @@ body:not(.layout-mode-mobile) .compute-card.is-spotlight:hover:not(.is-dragging)
color: var(--hud-accent-strong);
}
.compute-source-link.earth-mobile-action-btn {
gap: var(--hud-gap-xs);
}
.compute-source-link > .material-symbols-rounded {
display: inline-flex;
align-items: center;
justify-content: center;
flex: 0 0 auto;
width: 1em;
height: 1em;
overflow: hidden;
font-size: calc(13px * var(--hud-scale));
line-height: 1;
font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
}
/* Stage Narrative Player HUD Bar (F-12, F-14, F-15, F-17 — Pinned Always-On-Top) */
.stage-narrative-bar {
position: absolute;
@@ -2621,9 +2638,26 @@ body:has(.earth-toolbar-cluster.is-expanded):has(.earth-bottom-dock > :not([hidd
}
.copilot-source-card__link {
display: inline-flex;
align-items: center;
gap: calc(3px * var(--hud-scale));
color: var(--hud-accent-strong);
text-decoration: none;
font-weight: 600;
line-height: 1.2;
}
.copilot-source-card__link > .material-symbols-rounded {
display: inline-flex;
align-items: center;
justify-content: center;
flex: 0 0 auto;
width: 1em;
height: 1em;
overflow: hidden;
font-size: calc(12.5px * var(--hud-scale));
line-height: 1;
font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
}
.copilot-source-card__link:hover {
@@ -2786,11 +2820,12 @@ body:has(.earth-toolbar-cluster.is-expanded):has(.earth-bottom-dock > :not([hidd
font: inherit;
font-size: calc(11.5px * var(--hud-scale));
font-weight: 600;
white-space: nowrap;
cursor: pointer;
transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.situational-copilot__send .material-symbols-rounded {
.situational-copilot__send > .material-symbols-rounded {
display: inline-flex;
align-items: center;
justify-content: center;
@@ -2801,6 +2836,8 @@ body:has(.earth-toolbar-cluster.is-expanded):has(.earth-bottom-dock > :not([hidd
font-size: calc(14px * var(--hud-scale));
line-height: 1;
font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
/* The send and stop glyphs sit above the label's visible center in their font boxes. */
translate: 0 calc(1px * var(--hud-scale));
user-select: none;
pointer-events: none;
}
@@ -4274,6 +4311,7 @@ body:not(.layout-mode-mobile) .stage-narrative-bar.is-compact-coexist {
display: inline-flex;
align-items: center;
justify-content: center;
flex: 0 0 auto;
width: 1em;
height: 1em;
overflow: hidden;
+24 -5
View File
@@ -405,8 +405,23 @@
white-space: nowrap;
}
.hud-select-trigger > .material-symbols-rounded {
.hud-select-trigger > .material-symbols-rounded,
.hud-select-menu__option > .material-symbols-rounded,
.earth-mobile-layer-card-icon.material-symbols-rounded,
.earth-mobile-search-chip > .material-symbols-rounded,
.earth-mobile-details-media-credit > .material-symbols-rounded,
.earth-mobile-details-actions .earth-mobile-action-btn > .material-symbols-rounded {
display: inline-flex;
align-items: center;
justify-content: center;
flex: 0 0 auto;
width: 1em;
height: 1em;
overflow: hidden;
font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
}
.hud-select-trigger > .material-symbols-rounded {
color: var(--hud-text-soft);
font-size: calc(16px * var(--hud-scale));
}
@@ -510,7 +525,6 @@
}
.hud-select-menu__option > .material-symbols-rounded {
flex: 0 0 auto;
font-size: calc(14px * var(--hud-scale));
}
@@ -1241,7 +1255,7 @@
opacity: 0.46;
}
.earth-mobile-layer-card-icon {
.earth-mobile-layer-card-icon.material-symbols-rounded {
font-size: 22px;
color: var(--hud-accent-strong);
}
@@ -1347,6 +1361,7 @@
display: inline-flex;
align-items: center;
justify-content: center;
gap: 4px;
padding: 5px 12px;
border-radius: 18px;
border: 1px solid rgba(255, 255, 255, 0.1);
@@ -1360,6 +1375,10 @@
white-space: nowrap;
}
.earth-mobile-search-chip > .material-symbols-rounded {
font-size: 13px;
}
.earth-mobile-search-chip:active {
transform: scale(0.96);
}
@@ -3021,7 +3040,7 @@ label.is-disabled.earth-mobile-settings-card {
pointer-events: auto;
}
.earth-mobile-details-media-credit .material-symbols-rounded {
.earth-mobile-details-media-credit > .material-symbols-rounded {
font-size: 13px;
}
@@ -3181,7 +3200,7 @@ label.is-disabled.earth-mobile-settings-card {
transform: scale(0.97);
}
.earth-mobile-details-actions .earth-mobile-action-btn .material-symbols-rounded {
.earth-mobile-details-actions .earth-mobile-action-btn > .material-symbols-rounded {
font-size: 17px;
}
+52 -18
View File
@@ -510,13 +510,19 @@ body[data-callout-line-style="bold"] .callout-connector circle {
-webkit-user-select: none;
}
.info-card-source-link {
display: inline-block;
margin-top: calc(8px * var(--hud-scale));
.info-card-source-link,
.info-card-auth-link {
display: inline-flex;
align-items: center;
gap: calc(4px * var(--hud-scale));
color: var(--hud-accent);
text-decoration: none;
}
.info-card-source-link {
margin-top: calc(8px * var(--hud-scale));
font-size: var(--hud-font-size-sm);
line-height: 1.45;
text-decoration: none;
}
.info-card-source-link:hover,
@@ -755,10 +761,12 @@ body[data-callout-line-style="bold"] .callout-connector circle {
}
.info-card-compute-collect-button {
--info-card-collect-icon-size: calc(13px * var(--hud-scale));
position: relative;
display: inline-flex;
align-items: center;
gap: 4px;
justify-content: center;
gap: calc(4px * var(--hud-scale));
padding: calc(3px * var(--hud-scale)) calc(8px * var(--hud-scale));
background: transparent;
color: var(--hud-text-soft);
@@ -800,15 +808,27 @@ body[data-callout-line-style="bold"] .callout-connector circle {
flex-shrink: 0;
width: calc(10px * var(--hud-scale));
height: calc(10px * var(--hud-scale));
vertical-align: middle;
border: 1.5px solid rgba(201, 220, 255, 0.35);
border-top-color: #c9dcff;
border-radius: 999px;
animation: info-card-location-spin 0.8s linear infinite;
}
.info-card-compute-candidate-preview.is-loading::before {
margin-inline-end: 4px;
.info-card-compute-collect-button.is-loading::before {
box-sizing: border-box;
width: var(--info-card-collect-icon-size);
height: var(--info-card-collect-icon-size);
}
.info-card-compute-collect-button.is-loading > .material-symbols-rounded {
display: none;
}
.info-card-compute-candidate-preview.is-loading {
display: inline-flex;
align-items: center;
justify-content: center;
gap: calc(4px * var(--hud-scale));
}
.info-card-unresolved-item.is-locating .info-card-unresolved-index {
@@ -819,8 +839,29 @@ body[data-callout-line-style="bold"] .callout-connector circle {
position: absolute;
}
.info-card-compute-collect-button .material-symbols-rounded {
font-size: calc(13px * var(--hud-scale));
.info-card-compute-collect-button > .material-symbols-rounded,
.info-card-source-link > .material-symbols-rounded,
.info-card-auth-link > .material-symbols-rounded,
.earth-workflow-menu__icon.material-symbols-rounded,
.earth-target-tray__icon.material-symbols-rounded {
display: inline-flex;
align-items: center;
justify-content: center;
flex: 0 0 auto;
width: 1em;
height: 1em;
overflow: hidden;
line-height: 1;
font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
}
.info-card-compute-collect-button > .material-symbols-rounded {
font-size: var(--info-card-collect-icon-size);
}
.info-card-source-link > .material-symbols-rounded,
.info-card-auth-link > .material-symbols-rounded {
font-size: calc(12.5px * var(--hud-scale));
}
.info-card-compute-collect-status {
@@ -830,11 +871,8 @@ body[data-callout-line-style="bold"] .callout-connector circle {
}
.info-card-auth-link {
display: inline-block;
margin-left: calc(6px * var(--hud-scale));
color: var(--hud-accent);
font-weight: 500;
text-decoration: none;
}
.info-card-auth-link:hover,
@@ -1045,11 +1083,6 @@ body[data-callout-line-style="bold"] .callout-connector circle {
.earth-workflow-menu__icon.material-symbols-rounded,
.earth-target-tray__icon.material-symbols-rounded {
font-size: 16px;
width: 16px;
height: 16px;
line-height: 1;
font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
flex: 0 0 auto;
}
.earth-workflow-menu__label {
@@ -1160,6 +1193,7 @@ body[data-callout-line-style="bold"] .callout-connector circle {
font-weight: 600;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 5px;
cursor: pointer;
letter-spacing: 0;
+12 -7
View File
@@ -24,12 +24,22 @@
cursor: grabbing;
}
.layer-panel-icon {
flex-shrink: 0;
.layer-panel-icon.material-symbols-rounded,
.layer-row-icon.material-symbols-rounded {
display: inline-flex;
align-items: center;
justify-content: center;
flex: 0 0 auto;
width: 1em;
height: 1em;
overflow: hidden;
font-size: calc(15px * var(--hud-scale));
color: var(--hud-text-soft);
line-height: 1;
font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
}
.layer-panel-icon {
pointer-events: none;
}
@@ -197,11 +207,6 @@
}
.layer-row-icon {
flex-shrink: 0;
font-size: calc(15px * var(--hud-scale));
color: var(--hud-text-soft);
line-height: 1;
font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
transition: color 0.18s ease;
}
@@ -184,7 +184,28 @@ body:not(.layout-mode-mobile) .news-region-card.is-spotlight:hover:not(.is-dragg
}
.news-region-card__content::-webkit-scrollbar { display:none; width:0; height:0; }
.news-region-card__footer { display:flex; align-items:center; gap:calc(4px * var(--hud-scale)); padding:calc(5px * var(--hud-scale)) calc(8px * var(--hud-scale)); flex-shrink:0; border-top:1px solid var(--hud-border); }
.news-region-card__footer a { margin-left:auto; color:var(--hud-accent,#91baff); font-size:var(--hud-font-size-sm); text-decoration:none; white-space:nowrap; }
.news-region-card__source {
display: inline-flex;
align-items: center;
gap: var(--hud-gap-xs);
margin-inline-start: auto;
color: var(--hud-accent, #91baff);
font-size: var(--hud-font-size-sm);
text-decoration: none;
white-space: nowrap;
}
.news-region-card__source > .material-symbols-rounded {
display: inline-flex;
align-items: center;
justify-content: center;
flex: 0 0 auto;
width: 1em;
height: 1em;
overflow: hidden;
font-size: calc(13px * var(--hud-scale));
line-height: 1;
font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
}
.news-region-card__count { min-width:calc(36px * var(--hud-scale)); text-align:center; font-size:var(--hud-font-size-sm); }
.news-region-card button { cursor:pointer; }
.news-region-card button:disabled { opacity:.35; cursor:default; }
+5 -5
View File
@@ -719,11 +719,11 @@
</div>
<div class="earth-mobile-search-chips" role="group" aria-label="快捷分类筛选">
<button type="button" class="earth-mobile-search-chip is-active" data-search-filter="all">全部</button>
<button type="button" class="earth-mobile-search-chip" data-search-filter="satellite" data-search-keyword="卫星"><span aria-hidden="true">🛰️ </span><span>卫星</span></button>
<button type="button" class="earth-mobile-search-chip" data-search-filter="cable" data-search-keyword="海缆"><span aria-hidden="true">🌊 </span><span>海缆</span></button>
<button type="button" class="earth-mobile-search-chip" data-search-filter="landing_point" data-search-keyword="登陆点"><span aria-hidden="true">📍 </span><span>登陆点</span></button>
<button type="button" class="earth-mobile-search-chip" data-search-filter="compute_center" data-search-keyword="算力"><span aria-hidden="true">🖥️ </span><span>算力</span></button>
<button type="button" class="earth-mobile-search-chip" data-search-filter="bgp" data-search-keyword="BGP"><span aria-hidden="true">⚡ </span><span>BGP</span></button>
<button type="button" class="earth-mobile-search-chip" data-search-filter="satellite" data-search-keyword="卫星"><span class="material-symbols-rounded" aria-hidden="true">satellite_alt</span><span>卫星</span></button>
<button type="button" class="earth-mobile-search-chip" data-search-filter="cable" data-search-keyword="海缆"><span class="material-symbols-rounded" aria-hidden="true">cable</span><span>海缆</span></button>
<button type="button" class="earth-mobile-search-chip" data-search-filter="landing_point" data-search-keyword="登陆点"><span class="material-symbols-rounded" aria-hidden="true">location_on</span><span>登陆点</span></button>
<button type="button" class="earth-mobile-search-chip" data-search-filter="compute_center" data-search-keyword="算力"><span class="material-symbols-rounded" aria-hidden="true">memory</span><span>算力</span></button>
<button type="button" class="earth-mobile-search-chip" data-search-filter="bgp" data-search-keyword="BGP"><span class="material-symbols-rounded" aria-hidden="true">hub</span><span>BGP</span></button>
</div>
<div id="mobile-earth-search-meta" class="earth-mobile-search-meta">输入关键词或轻点上方分类快速探索地球对象</div>
<div id="mobile-earth-search-results" class="earth-mobile-search-results" role="listbox" aria-label="移动端搜索结果"></div>
+9 -8
View File
@@ -74,6 +74,11 @@ function safeMediaUrl(value) {
}
}
function computeSourceLink(url, label, buttonClass) {
if (!/^https:\/\//i.test(url || "")) return "";
return `<a class="${buttonClass} compute-source-link" href="${escape(url)}" target="_blank" rel="noopener noreferrer"><span class="earth-settings-chip__label">${escape(label)}</span><span class="material-symbols-rounded" aria-hidden="true">open_in_new</span></a>`;
}
export function initComputeTopic({
setMapQuery,
focusFacility,
@@ -906,9 +911,6 @@ export function initComputeTopic({
}
function mobileRegionDetailHtml(entry, view = participantView(entry)) {
const sourceUrl = /^https:\/\//i.test(view.evidence?.url || "")
? view.evidence.url
: "";
const isBilateral = ["CN", "US"].includes(entry.code) && countries.includes("CN") && countries.includes("US");
const facilityStatus = facilityError
? `<div class="compute-mobile__inline-error" role="alert">${escape(facilityError)} <button type="button" class="earth-mobile-action-btn earth-mobile-action-btn--ghost" data-action="retry">${text("重试", "Retry")}</button></div>`
@@ -929,7 +931,7 @@ export function initComputeTopic({
${view.members.length ? `<section class="compute-mobile__detail-section"><h3>${text("区域成员", "Region members")} <span>${view.members.length}</span></h3><div class="compute-card__members">${view.members.map((member) => `<span class="earth-mobile-settings-chip is-active earth-settings-chip--with-icon">${participantIdentity(member)}<span>${escape(nameOf(member))}</span></span>`).join("")}</div></section>` : ""}
<section class="compute-mobile__detail-section"><h3>${text("已核验设施样本", "Verified Facility Samples")} <span>${escape(view.sampleStatus)}</span></h3><p class="earth-mobile-detail-empty">${text("设施条数仅反映已收录公开样本。", "Facility counts reflect publicly indexed samples only.")}</p>${view.sourceBreakdown ? `<p class="earth-mobile-detail-type">${escape(view.sourceBreakdown)}</p>` : ""}${facilityStatus}</section>
${mediaHtml(view.locations)}
${view.evidence ? `<section class="compute-mobile__detail-section"><h3>${text("来源与证据", "Source and evidence")}</h3><p class="earth-mobile-detail-title">${escape(view.evidence.title || "")}</p><p class="earth-mobile-detail-type">${escape(view.evidence.publisher || "")} · ${escape(view.evidence.report_year || view.evidence.published_at || "")}</p>${view.evidence.locator ? `<p class="earth-mobile-detail-type">${escape(view.evidence.locator)}</p>` : ""}${sourceUrl ? `<a class="earth-mobile-action-btn" href="${escape(sourceUrl)}" target="_blank" rel="noopener noreferrer">${text("打开来源", "Open source")} ↗</a>` : ""}</section>` : ""}`;
${view.evidence ? `<section class="compute-mobile__detail-section"><h3>${text("来源与证据", "Source and evidence")}</h3><p class="earth-mobile-detail-title">${escape(view.evidence.title || "")}</p><p class="earth-mobile-detail-type">${escape(view.evidence.publisher || "")} · ${escape(view.evidence.report_year || view.evidence.published_at || "")}</p>${view.evidence.locator ? `<p class="earth-mobile-detail-type">${escape(view.evidence.locator)}</p>` : ""}${computeSourceLink(view.evidence.url, text("打开来源", "Open source"), "earth-mobile-action-btn")}</section>` : ""}`;
}
function destroyMobileCardPanels() {
@@ -1042,12 +1044,12 @@ export function initComputeTopic({
const lineageMarkup = renderLineageDrawerHtml(evidence);
if (body.innerHTML !== lineageMarkup) body.innerHTML = lineageMarkup;
} else if (evidence) {
const sourceUrl = /^https:\/\//i.test(evidence.url || "") ? evidence.url : "";
evidencePanel.querySelector(".hud-panel__title").textContent = evidence.title;
const pubDateNote = evidence.published_at
? `${text("发布日", "Published")} ${evidence.published_at}`
: `${text("报告年", "Report year")} ${evidence.report_year || ""}`;
const sourceMarkup = `<p class="compute-evidence__meta"><strong>${escape(evidence.publisher)}</strong> · ${escape(pubDateNote)}</p>${evidence.locator ? `<p class="compute-evidence__locator"><span class="material-symbols-rounded" aria-hidden="true">find_in_page</span><span>${escape(evidence.locator)}</span></p>` : ""}${sourceUrl ? `<a class="earth-settings-chip compute-evidence__link" href="${escape(sourceUrl)}" target="_blank" rel="noopener noreferrer">${text("打开权威原文", "Open verified source")} ↗</a>` : ""}`;
const sourceLink = computeSourceLink(evidence.url, text("打开权威原文", "Open verified source"), "earth-settings-chip compute-evidence__link");
const sourceMarkup = `<p class="compute-evidence__meta"><strong>${escape(evidence.publisher)}</strong> · ${escape(pubDateNote)}</p>${evidence.locator ? `<p class="compute-evidence__locator"><span class="material-symbols-rounded" aria-hidden="true">find_in_page</span><span>${escape(evidence.locator)}</span></p>` : ""}${sourceLink}`;
if (body.innerHTML !== sourceMarkup) body.innerHTML = sourceMarkup;
}
}
@@ -1063,7 +1065,6 @@ export function initComputeTopic({
}
const current = lineageData?.current || null;
const src = current?.source || fallbackEvidence || null;
const sourceUrl = /^https:\/\//i.test(src?.url || "") ? src.url : "";
const timestamps = lineageData?.timestamps || null;
const timeline = Array.isArray(lineageData?.timeline) ? lineageData.timeline : [];
const unit = current?.unit || (lineageTarget?.metric === "absolute" ? "EFlops" : "%");
@@ -1086,7 +1087,7 @@ export function initComputeTopic({
${src.locator ? `<p class="compute-evidence__locator"><span class="material-symbols-rounded" aria-hidden="true">find_in_page</span><span>${escape(src.locator)}</span></p>` : ""}
${src.excerpt ? `<blockquote class="compute-evidence__excerpt">${escape(src.excerpt)}</blockquote>` : ""}
${src.content_sha256 ? `<p class="compute-evidence__hash" title="${escape(src.content_sha256)}"><span>SHA-256</span><code>${escape(src.content_sha256.slice(0, 20))}…</code></p>` : ""}
${sourceUrl ? `<a class="earth-settings-chip compute-evidence__link" href="${escape(sourceUrl)}" target="_blank" rel="noopener noreferrer">${text("打开权威原文", "Open verified source")} ↗</a>` : ""}
${computeSourceLink(src.url, text("打开权威原文", "Open verified source"), "earth-settings-chip compute-evidence__link")}
</section>`
: "";
+9 -2
View File
@@ -168,7 +168,11 @@ function applyLocationStatusElement(statusEl, statusText, authRequired = false)
link.href = getAdminLoginUrl();
link.target = '_blank';
link.rel = 'noopener noreferrer';
link.textContent = `${infoText('前往管理员登录')} ↗`;
const icon = document.createElement('span');
icon.className = 'material-symbols-rounded';
icon.setAttribute('aria-hidden', 'true');
icon.textContent = 'open_in_new';
link.append(infoText('前往管理员登录'), icon);
link.addEventListener('click', (event) => {
event.stopPropagation();
});
@@ -840,7 +844,10 @@ function renderDefaultCardContent(content, config, data) {
const fields = [['精度 / 测量', `${metadata.precision || '—'} / ${metadata.measurement || '—'}`]];
html += fields.map(([label, value]) => `<div class="info-card-property"><span class="info-card-label">${escapeInfoCardHtml(infoText(label))}</span><span class="info-card-value">${escapeInfoCardHtml(value)}</span></div>`).join('');
if (/^https?:\/\//i.test(metadata.source_url || '')) {
html += `<a class="info-card-source-link" href="${escapeInfoCardHtml(metadata.source_url)}" target="_blank" rel="noopener noreferrer">${escapeInfoCardHtml(infoText('查看原始来源'))} ↗</a>`;
html += `<a class="info-card-source-link" href="${escapeInfoCardHtml(metadata.source_url)}" target="_blank" rel="noopener noreferrer">
<span>${escapeInfoCardHtml(infoText('查看原始来源'))}</span>
<span class="material-symbols-rounded" aria-hidden="true">open_in_new</span>
</a>`;
}
}
@@ -5,7 +5,6 @@ import {
toggleCables,
} from "./cables.js";
import {
clearSatelliteData,
getSatelliteLegendItems,
loadSatellites,
toggleSatellites,
@@ -173,7 +172,6 @@ function registerSatelliteStartupTask() {
);
await context.yieldFrame(12);
try {
clearSatelliteData();
const canApplyUpdate = () => !context.isCancelled() && context.isSatellitesEnabled();
const loadResult = await loadSatellites({
limit: context.getInitialSatelliteLoadLimit(),
-1
View File
@@ -4337,7 +4337,6 @@ async function ensureSatellitesEnabled(options = {}) {
createSatellites(scene, earth);
}
clearSatelliteData();
let loadResult;
try {
loadResult = await loadSatellites({
+17 -3
View File
@@ -74,7 +74,7 @@ export function initNewsRegionCards({ rootParent, spatial }) {
} : null;
card.source.hidden = !/^https?:\/\//i.test(url);
if (!card.source.hidden) card.source.href = url; else card.source.removeAttribute("href");
card.source.textContent = text("阅读原文 ↗","Read source ↗");
card.sourceLabel.textContent = text("阅读原文", "Read source");
if (card.analyze) card.analyze.disabled = !card.currentStory;
card.scrollbar?.update();
}
@@ -91,10 +91,24 @@ export function initNewsRegionCards({ rootParent, spatial }) {
const element=document.createElement("article");
element.className="hud-panel info-card news news-region-card";
element.dataset.region=region.key;
element.innerHTML=`<header class="info-card-header hud-panel-drag-handle"><span class="info-card-icon" aria-hidden="true">${NEWS_CARD_ICON}</span><h3 class="news-region-card__headline"></h3><span class="news-region-card__region"></span><div class="hud-panel__actions">${iconButton("news-analyze","forum",text("在 AI 参谋中分析","Analyze in AI Copilot"))}${iconButton("card-collapse","expand_less",text("折叠","Collapse"))}</div></header><div class="news-region-card__body hud-panel__body hud-panel__body--collapsible"><div class="info-card-content news-region-card__content hud-scroll-region"></div><footer class="news-region-card__footer">${iconButton("news-prev","chevron_left",text("上一条新闻","Previous story"))}<span class="news-region-card__count"></span>${iconButton("news-next","chevron_right",text("下一条新闻","Next story"))}${iconButton("news-play","pause",text("暂停轮播","Pause rotation"))}<a target="_blank" rel="noopener noreferrer" hidden></a></footer></div>`;
element.innerHTML = `<header class="info-card-header hud-panel-drag-handle"><span class="info-card-icon" aria-hidden="true">${NEWS_CARD_ICON}</span><h3 class="news-region-card__headline"></h3><span class="news-region-card__region"></span><div class="hud-panel__actions">${iconButton("news-analyze","forum",text("在 AI 参谋中分析","Analyze in AI Copilot"))}${iconButton("card-collapse","expand_less",text("折叠","Collapse"))}</div></header>
<div class="news-region-card__body hud-panel__body hud-panel__body--collapsible">
<div class="info-card-content news-region-card__content hud-scroll-region"></div>
<footer class="news-region-card__footer">
${iconButton("news-prev", "chevron_left", text("上一条新闻", "Previous story"))}
<span class="news-region-card__count"></span>
${iconButton("news-next", "chevron_right", text("下一条新闻", "Next story"))}
${iconButton("news-play", "pause", text("暂停轮播", "Pause rotation"))}
<a class="news-region-card__source" target="_blank" rel="noopener noreferrer" hidden>
<span class="news-region-card__source-label"></span>
<span class="material-symbols-rounded" aria-hidden="true">open_in_new</span>
</a>
</footer>
</div>`;
const card={ element, hovered:false, signature:null, typing:false, writer:createTypewriter(), currentStory:null,
title:element.querySelector("h3"), region:element.querySelector(".news-region-card__region"), content:element.querySelector(".news-region-card__content"),
count:element.querySelector(".news-region-card__count"),source:element.querySelector("a"),
count:element.querySelector(".news-region-card__count"),source:element.querySelector(".news-region-card__source"),
sourceLabel:element.querySelector(".news-region-card__source-label"),
previous:element.querySelector('[data-action="news-prev"]'),next:element.querySelector('[data-action="news-next"]'),play:element.querySelector('[data-action="news-play"]'),analyze:element.querySelector('[data-action="news-analyze"]'),
};
card.panel=createHUDPanel({panel:element,header:element.querySelector("header"),body:element.querySelector(".news-region-card__body"),collapseBtn:element.querySelector('[data-action="card-collapse"]'),expandLabel:text("展开新闻","Expand news"),collapseLabel:text("折叠新闻","Collapse news")});
+27 -9
View File
@@ -1074,6 +1074,8 @@ function scheduleBackgroundSatelliteValidation({
})();
}
const lastSatelliteEtags = new Map();
export async function loadSatellites(options = {}) {
abortActiveSatelliteRevalidation();
const limit = getRequestedSatelliteLimit(options.limit);
@@ -1117,7 +1119,7 @@ export async function loadSatellites(options = {}) {
const networkResult = await fetchSatellitesWithRetry({
url: url.toString(),
etag: options.forceNetwork ? null : cachedSnapshot?.etag || null,
etag: options.cacheBust ? null : cachedSnapshot?.etag || lastSatelliteEtags.get(cacheKey) || null,
timeoutMs: options.timeoutMs || SATELLITE_FETCH_TIMEOUT_MS,
maxAttempts: options.maxAttempts || SATELLITE_FETCH_MAX_ATTEMPTS,
signal: options.signal,
@@ -1127,17 +1129,33 @@ export async function loadSatellites(options = {}) {
throw createAbortError("Satellite load aborted");
}
if (networkResult.notModified && cachedFeatures.length > 0) {
applyDecodedSatelliteFeatures(cachedFeatures);
return {
count: cachedFeatures.length,
requestedLimit: limit,
fromCache: true,
notModified: true,
};
if (networkResult.notModified) {
if (networkResult.etag) {
lastSatelliteEtags.set(cacheKey, networkResult.etag);
}
if (satelliteData.length > 0) {
return {
count: satelliteData.length,
requestedLimit: limit,
fromCache: true,
notModified: true,
};
}
if (cachedFeatures.length > 0) {
applyDecodedSatelliteFeatures(cachedFeatures);
return {
count: cachedFeatures.length,
requestedLimit: limit,
fromCache: true,
notModified: true,
};
}
}
const decodedFeatures = decodeSatellitePayload(networkResult.payload);
if (networkResult.etag) {
lastSatelliteEtags.set(cacheKey, networkResult.etag);
}
void writeSatelliteSnapshot(cacheKey, {
etag: networkResult.etag,
payload: networkResult.payload,
@@ -1274,7 +1274,10 @@ export function initSituationalCopilot({
<div class="copilot-source-card__title">${escape(selectedEv.title || turn.activeEvidenceId)}</div>
<div class="copilot-source-card__meta">
<span>${escape([selectedEv.publisher, selectedEv.locator].filter(Boolean).join(" · "))}</span>
${sourceUrl ? `<a class="copilot-source-card__link" href="${escape(sourceUrl)}" target="_blank" rel="noopener noreferrer">${escape(text("原文", "Source"))} ↗</a>` : ""}
${sourceUrl ? `<a class="copilot-source-card__link" href="${escape(sourceUrl)}" target="_blank" rel="noopener noreferrer">
<span>${escape(text("原文", "Source"))}</span>
<span class="material-symbols-rounded" aria-hidden="true">open_in_new</span>
</a>` : ""}
</div>
</div>
</div>` : ""}
+4 -1
View File
@@ -534,7 +534,10 @@ function renderEvidenceDrawerBlock(block, { collapsedOverride } = {}) {
</div>
<div class="wb-evidence-item__meta">
<span>${escapeWorkbenchHtml(metaParts)}</span>
${safeUrl ? `<a class="copilot-source-card__link" href="${escapeWorkbenchHtml(safeUrl)}" target="_blank" rel="noopener noreferrer">${escapeWorkbenchHtml(t("原文", "Source"))} ↗</a>` : ""}
${safeUrl ? `<a class="copilot-source-card__link" href="${escapeWorkbenchHtml(safeUrl)}" target="_blank" rel="noopener noreferrer">
<span>${escapeWorkbenchHtml(t("原文", "Source"))}</span>
<span class="material-symbols-rounded" aria-hidden="true">open_in_new</span>
</a>` : ""}
</div>
</li>`;
})