Merge remote-tracking branch 'origin/main' into timeline/real-time-label

This commit is contained in:
Sameh Khamis committed 2026-11-18 13:10:20 -08:00
commit 2c7b52cb7e
805 files changed
+5859 -661

No files matched your search

+2 -1
View File
@@ -1,5 +1,6 @@
import { t } from '../i18n/index.js';
import { spaceMissionsIndexFailure } from './contextActions.js';
import { translateStatusMessage } from './statusText.js';
import { shouldExpandGlobalContextPanel } from '../rightRailPolicy.js';
export function _initGlobalContextPanel() {
@@ -112,7 +113,7 @@ export function _initGlobalContextPanel() {
if (this.destroyed || searched === false) return false;
const stats = this.installations.getStats?.();
this.showToast(
stats?.statusMessage ||
(stats?.statusMessage && translateStatusMessage(stats.statusMessage)) ||
(stats?.status === 'zoom-in'
? t('Zoom in to search mapped installations')
: t('Nearby installations refreshed')),
+49 -1
View File
@@ -242,9 +242,57 @@ const STATUS_PIECE_PATTERNS = [
],
];
// Shapes of installationFeedback() (data/installationFeedback.js), which stays
// English for the analyst. Keep them in step with its wording.
const MAPPED_SITE_PATTERNS = [
[
/^(.+) — retrying in (\d+)s$/,
([, reason, seconds]) =>
t('{reason} — retrying in {seconds}s', {
reason: translateKnown(reason),
seconds,
}),
],
[
/^(.+) — retry pending$/,
([, reason]) =>
t('{reason} — retry pending', { reason: translateKnown(reason) }),
],
[/^No mapped sites in view$/, () => t('No mapped sites in view')],
[
/^(\d+) mapped sites? in view$/,
([, count]) =>
tn(
Number(count),
'{count} mapped site in view',
'{count} mapped sites in view',
),
],
[
/^No mapped sites within (\d+) km of the contact$/,
([, km]) =>
t('No mapped sites within {km} km of the contact', {
km: formatNumber(Number(km)),
}),
],
[
/^(\d+) mapped sites? within (\d+) km of the contact$/,
([, count, km]) =>
tn(
Number(count),
'{count} mapped site within {km} km of the contact',
'{count} mapped sites within {km} km of the contact',
{ km: formatNumber(Number(km)) },
),
],
];
// First match wins.
const STATUS_SHAPES = [...STATUS_PIECE_PATTERNS, ...MAPPED_SITE_PATTERNS];
/** A status piece by its shape in the UI language, or null. */
function statusPatternText(piece) {
for (const [pattern, format] of STATUS_PIECE_PATTERNS) {
for (const [pattern, format] of STATUS_SHAPES) {
const match = pattern.exec(piece);
if (match) return format(match);
}