Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ui/admin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,6 @@ <h1 class="sec-title" id="ev-title">General</h1>
</div></div>
</div>

<script type="module" src="/js/admin.js?v=10b7bd5e"></script>
<script type="module" src="/js/admin.js?v=56b0a714"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@
</div>
</div>
</dialog>
<script type="module" src="/js/dashboard.js?v=cec3f699"></script>
<script type="module" src="/js/dashboard.js?v=593d93b6"></script>
</body></html>
8 changes: 4 additions & 4 deletions ui/js/admin-app-form.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { clr, el, focusFirst, initial, inp as inpById, isolate, q as qSel, qa, qi, tgt } from '/js/utils.js?v=dc4ac52e';
import { clr, el, focusFirst, initial, inp as inpById, isolate, q as qSel, qa, qi, tgt } from '/js/utils.js?v=705ca896';
import { html, raw, setHtml } from '/js/html.js?v=c71f8903';
import {
loadLocalIcons,
Expand Down Expand Up @@ -31,10 +31,10 @@ import {
reveal,
setTogDisabled,
swapContent,
} from '/js/admin-shared.js?v=5e6a023a';
import { createListbox } from '/js/listbox.js?v=7d7867ae';
} from '/js/admin-shared.js?v=1c01be9a';
import { createListbox } from '/js/listbox.js?v=f814170f';
import { MAX_LABELS } from '/js/badge-logic.js?v=5c72bd4c';
import { renderColorControl, BADGE_DEFAULT } from '/js/admin-color-control.js?v=64eef54d';
import { renderColorControl, BADGE_DEFAULT } from '/js/admin-color-control.js?v=ef504f96';
import { badgeErrorAdvice, TONE } from '/js/admin-error.js?v=b0881957';
import { fluidHoverClear, fluidHoverKb } from '/js/fluid-hover.js?v=cb886e86';
import { iconSvg } from '/js/icon-set.js?v=628341d4';
Expand Down
4 changes: 2 additions & 2 deletions ui/js/admin-auth.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { apiGet, apiPost } from '/js/admin-shared.js?v=5e6a023a';
import { apiGet, apiPost } from '/js/admin-shared.js?v=1c01be9a';
import { initI18n, t } from '/js/i18n.js?v=ed7c5565';
import { loginErrorKey } from '/js/admin-error.js?v=b0881957';
import { pwStrength } from '/js/password-strength.js?v=389e0ed0';
import { el, inp as inpById, qa } from '/js/utils.js?v=dc4ac52e';
import { el, inp as inpById, qa } from '/js/utils.js?v=705ca896';
import { blockingScreenFor } from '/js/config-recovery.js?v=85138697';

export async function checkAuth(onLogin) {
Expand Down
4 changes: 2 additions & 2 deletions ui/js/admin-color-control.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { PE_SVG, initInlineEdit, toast, reveal } from '/js/admin-shared.js?v=5e6a023a';
import { PE_SVG, initInlineEdit, toast, reveal } from '/js/admin-shared.js?v=1c01be9a';
import { t } from '/js/i18n.js?v=ed7c5565';
import { html, raw, setHtml } from '/js/html.js?v=c71f8903';
import { qa, q } from '/js/utils.js?v=dc4ac52e';
import { qa, q } from '/js/utils.js?v=705ca896';
import { iconSvg } from '/js/icon-set.js?v=628341d4';
import { HUE_NAMES, ROLE_NAMES, TILE_KEYWORDS, pageTheme, tileColor } from '/js/palette.js?v=3fb8ae43';

Expand Down
2 changes: 1 addition & 1 deletion ui/js/admin-drag.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import { applyDrop, canJoinFolder, folderRowZone } from '/js/admin-drag-logic.js?v=6b767e76';
import { state } from '/js/admin-state.js?v=af772a1b';
import { snapshotItems } from '/js/admin-save-logic.js?v=5613a9fa';
import { qa } from '/js/utils.js?v=dc4ac52e';
import { qa } from '/js/utils.js?v=705ca896';

/** @type {(before: unknown) => void} */
let _save = () => {};
Expand Down
8 changes: 4 additions & 4 deletions ui/js/admin-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
import { collapsedFolders, filter, state } from '/js/admin-state.js?v=af772a1b';
import { snapshotItems } from '/js/admin-save-logic.js?v=5613a9fa';
import { reorderItems } from '/js/admin-logic.js?v=1cca36f5';
import { initDrag, wireRowDrag } from '/js/admin-drag.js?v=29e09aad';
import { paintIcon } from '/js/admin-shared.js?v=5e6a023a';
import { clr, el, focusFirst, initial, qa, setUserText } from '/js/utils.js?v=dc4ac52e';
import { initDrag, wireRowDrag } from '/js/admin-drag.js?v=8fa6fbae';
import { paintIcon } from '/js/admin-shared.js?v=1c01be9a';
import { clr, el, focusFirst, initial, qa, setUserText } from '/js/utils.js?v=705ca896';
import { html, raw, setHtml } from '/js/html.js?v=c71f8903';
import { t } from '/js/i18n.js?v=ed7c5565';
import { sizeLabel } from '/js/admin-widget-form.js?v=e0966417';
import { sizeLabel } from '/js/admin-widget-form.js?v=c66544d4';
import { widgetGlyph } from '/js/widget-glyphs.js?v=b383b7c8';
import { iconSvg } from '/js/icon-set.js?v=628341d4';

Expand Down
8 changes: 4 additions & 4 deletions ui/js/admin-settings.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { toast, apiGet, apiPost, errorText, reveal, swapContent, wireInlineEdit } from '/js/admin-shared.js?v=5e6a023a';
import { toast, apiGet, apiPost, errorText, reveal, swapContent, wireInlineEdit } from '/js/admin-shared.js?v=1c01be9a';
import { socketProbeAdvice } from '/js/admin-error.js?v=b0881957';
import { pwStrength } from '/js/password-strength.js?v=389e0ed0';
import { t } from '/js/i18n.js?v=ed7c5565';
Expand All @@ -11,11 +11,11 @@ import {
BLOCK,
} from '/js/admin-logic.js?v=1cca36f5';
import { confirmText, promptModal } from '/js/modal.js?v=6b0320bd';
import { el, inp, setUserText } from '/js/utils.js?v=dc4ac52e';
import { el, inp, setUserText } from '/js/utils.js?v=705ca896';
import { formatNumber } from '/js/format-number.js?v=abcd4ae4';
import { serialWrites } from '/js/admin-save-logic.js?v=5613a9fa';
import { renderColorControl } from '/js/admin-color-control.js?v=64eef54d';
import { BACKDROP } from '/js/background.js?v=d6f2e701';
import { renderColorControl } from '/js/admin-color-control.js?v=ef504f96';
import { BACKDROP } from '/js/background.js?v=25428bf2';
import {
ALLOWED_HOSTS_MAX,
firstBadHost,
Expand Down
2 changes: 1 addition & 1 deletion ui/js/admin-shared.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* Stateless helpers shared by the admin modules. Mutable state stays out. */
import { recoversSession, toastHoldMs } from '/js/admin-logic.js?v=1cca36f5';
import { el, isolate, q } from '/js/utils.js?v=dc4ac52e';
import { el, isolate, q } from '/js/utils.js?v=705ca896';
import { t } from '/js/i18n.js?v=ed7c5565';
import { errorAdvice } from '/js/admin-error.js?v=b0881957';
import { formatList, formatNumber } from '/js/format-number.js?v=abcd4ae4';
Expand Down
8 changes: 4 additions & 4 deletions ui/js/admin-widget-form.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { state } from '/js/admin-state.js?v=af772a1b';
import { PE_SVG, initInlineEdit, swapContent } from '/js/admin-shared.js?v=5e6a023a';
import { createListbox } from '/js/listbox.js?v=7d7867ae';
import { renderWidgetConfigForm } from '/js/widget-config-form.js?v=294805cc';
import { PE_SVG, initInlineEdit, swapContent } from '/js/admin-shared.js?v=1c01be9a';
import { createListbox } from '/js/listbox.js?v=f814170f';
import { renderWidgetConfigForm } from '/js/widget-config-form.js?v=54fa233f';
import { html, raw, setHtml } from '/js/html.js?v=c71f8903';
import { sizesForView, widgetConfigMode, rejectionLines, carriesTypedValues } from '/js/admin-logic.js?v=1cca36f5';
import { t } from '/js/i18n.js?v=ed7c5565';
import { focusFirst, q, qi, qa } from '/js/utils.js?v=dc4ac52e';
import { focusFirst, q, qi, qa } from '/js/utils.js?v=705ca896';
import { iconSvg } from '/js/icon-set.js?v=628341d4';

const SIZES_WITH_ICONS = new Set(['small', 'medium', 'large', 'xlarge']);
Expand Down
18 changes: 9 additions & 9 deletions ui/js/admin.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { buildAppForm, buildFolderForm, captureActLabels, serializeKvRows } from '/js/admin-app-form.js?v=deccbdee';
import { checkAuth, requireLogin, wirePasswordStrength } from '/js/admin-auth.js?v=104be7f0';
import { buildAppForm, buildFolderForm, captureActLabels, serializeKvRows } from '/js/admin-app-form.js?v=4853370b';
import { checkAuth, requireLogin, wirePasswordStrength } from '/js/admin-auth.js?v=5246ff39';
import { recoveryShown } from '/js/config-recovery.js?v=85138697';
import { focusRow, initList, render, syncFilterUI } from '/js/admin-list.js?v=14782161';
import { focusRow, initList, render, syncFilterUI } from '/js/admin-list.js?v=87efcfb7';
import { resolveAdminSection } from '/js/admin-logic.js?v=1cca36f5';
import {
afterImport,
Expand All @@ -23,7 +23,7 @@ import {
showBgFields,
showWallpaperFile,
wireUnsplashKey,
} from '/js/admin-settings.js?v=584aae78';
} from '/js/admin-settings.js?v=41547198';
import {
apiGet,
apiPost,
Expand All @@ -37,13 +37,13 @@ import {
setReauthHandler,
toast,
withheldText,
} from '/js/admin-shared.js?v=5e6a023a';
} from '/js/admin-shared.js?v=1c01be9a';
import { collapsedFolders, filter, state } from '/js/admin-state.js?v=af772a1b';
import { buildWidgetForm } from '/js/admin-widget-form.js?v=e0966417';
import { buildWidgetForm } from '/js/admin-widget-form.js?v=c66544d4';
import { initFluidHover } from '/js/fluid-hover.js?v=cb886e86';
import { formatNumber } from '/js/format-number.js?v=abcd4ae4';
import { initGlideSelect, syncGlideSelect } from '/js/glide-select.js?v=8b39e9d0';
import { createListbox } from '/js/listbox.js?v=7d7867ae';
import { createListbox } from '/js/listbox.js?v=f814170f';
import { html, raw, setHtml } from '/js/html.js?v=c71f8903';
import { initI18n, LANGUAGES, t } from '/js/i18n.js?v=ed7c5565';
import { loadLocalIcons } from '/js/icons.js?v=5ac01d72';
Expand Down Expand Up @@ -82,8 +82,8 @@ import {
storeGet,
storeSet,
tgt,
} from '/js/utils.js?v=dc4ac52e';
import { applyBackground, resolveBackground } from '/js/background.js?v=d6f2e701';
} from '/js/utils.js?v=705ca896';
import { applyBackground, resolveBackground } from '/js/background.js?v=25428bf2';
import { parseYamlTolerant, YamlLiteError, YamlTooLargeError } from '/js/yaml-lite.js?v=a42ef914';

ensureSprite();
Expand Down
2 changes: 1 addition & 1 deletion ui/js/background.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @ts-check
import { cssColor, sanitizeCssUrl } from '/js/utils.js?v=dc4ac52e';
import { cssColor, sanitizeCssUrl } from '/js/utils.js?v=705ca896';
import { loadWallpaper, saveWallpaper } from '/js/wallpaper-cache.js?v=c5f8a3e6';

export const BACKDROP = '#0d1117';
Expand Down
8 changes: 4 additions & 4 deletions ui/js/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ import {
storeSet,
teardownWidgets,
titleWhenTruncated,
} from '/js/utils.js?v=dc4ac52e';
} from '/js/utils.js?v=705ca896';
import { initFluidHover } from '/js/fluid-hover.js?v=cb886e86';
import { initSpotlight } from '/js/spotlight.js?v=c76fb899';
import { initSpotlight } from '/js/spotlight.js?v=ad660003';
import { html, setHtml, raw } from '/js/html.js?v=c71f8903';
import { initI18n, t, currentLang } from '/js/i18n.js?v=ed7c5565';
import { blockingScreenFor, showBlockingScreen } from '/js/config-recovery.js?v=85138697';
Expand All @@ -46,7 +46,7 @@ import {
buildMobile,
resetMobileChrome,
mkFolderGlyph,
} from '/js/ui.js?v=4265d299';
} from '/js/ui.js?v=049178d3';
import { badgeMinimum, badgeSignature, computeBadgeVisual, readBadgeUpdate } from '/js/badge-logic.js?v=5c72bd4c';
import { formatNumber } from '/js/format-number.js?v=abcd4ae4';
import { closeBadgePopover, wireBadgePopover } from '/js/badge-popover.js?v=23793736';
Expand All @@ -59,7 +59,7 @@ import {
restorePage,
wheelPager,
} from '/js/dashboard-logic.js?v=6a29cedc';
import { applyBackground, BACKDROP, resolveBackground } from '/js/background.js?v=d6f2e701';
import { applyBackground, BACKDROP, resolveBackground } from '/js/background.js?v=25428bf2';
import { repeatJittered } from '/js/jitter.js?v=087a1fcf';
import { isMobileLayout, onLayoutChange } from '/js/layout.js?v=e9f4b607';
import { startWakeLock } from '/js/wake-lock.js?v=6b9591cf';
Expand Down
2 changes: 1 addition & 1 deletion ui/js/listbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { nextActiveIndex, singleChoice } from '/js/admin-logic.js?v=1cca36f5';
import { fluidHoverClear, fluidHoverKb } from '/js/fluid-hover.js?v=cb886e86';
import { formatList } from '/js/format-number.js?v=abcd4ae4';
import { html, raw, setHtml } from '/js/html.js?v=c71f8903';
import { qa } from '/js/utils.js?v=dc4ac52e';
import { qa } from '/js/utils.js?v=705ca896';
import { iconSvg } from '/js/icon-set.js?v=628341d4';

const CHEV = iconSvg('chevrons', 22, 'solid', 'dd-chev');
Expand Down
2 changes: 1 addition & 1 deletion ui/js/spotlight.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { fluidHoverClear, fluidHoverKb } from '/js/fluid-hover.js?v=cb886e86';
import { mk, clr, el, initial, inp as inpById, q, qa, setUserText } from '/js/utils.js?v=dc4ac52e';
import { mk, clr, el, initial, inp as inpById, q, qa, setUserText } from '/js/utils.js?v=705ca896';
import { t } from '/js/i18n.js?v=ed7c5565';

/* Attached to the window so a re-open can undo the previous one. */
Expand Down
2 changes: 1 addition & 1 deletion ui/js/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
q,
qa,
setUserText,
} from '/js/utils.js?v=dc4ac52e';
} from '/js/utils.js?v=705ca896';
import { t, currentLang } from '/js/i18n.js?v=ed7c5565';
import { toneForColor } from '/js/label-contrast.js?v=0b1ebb19';
import { mobileMetrics, gridColumnWidth, gridCellCount } from '/js/mobile-metrics.js?v=349f4300';
Expand Down
9 changes: 8 additions & 1 deletion ui/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,15 @@ export function mountScaledWidget(card, { src, title, design, iframeOpts, overla
const refreshInterval = Number(o.refreshInterval) || 0;
if (refreshInterval >= 250) {
const base = refreshInterval;
/* Not ifr.src alone: each assignment adds an entry to the tab's Back
history. */
const reload = () => {
ifr.src = src + (src.includes('?') ? '&' : '?') + '_r=' + Date.now();
const next = src + (src.includes('?') ? '&' : '?') + '_r=' + Date.now();
try {
ifr.contentWindow.location.replace(next);
} catch {
ifr.src = next;
}
};
const jit = () => Math.round(base * (1 + (Math.random() * 2 - 1) * 0.15));
/* The handle is reassigned every tick. The cleanup must read the current
Expand Down
8 changes: 4 additions & 4 deletions ui/js/widget-config-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

import { t } from '/js/i18n.js?v=ed7c5565';
import { html, raw, setHtml } from '/js/html.js?v=c71f8903';
import { reveal, wireInlineEdit } from '/js/admin-shared.js?v=5e6a023a';
import { createListbox } from '/js/listbox.js?v=7d7867ae';
import { renderColorControl } from '/js/admin-color-control.js?v=64eef54d';
import { reveal, wireInlineEdit } from '/js/admin-shared.js?v=1c01be9a';
import { createListbox } from '/js/listbox.js?v=f814170f';
import { renderColorControl } from '/js/admin-color-control.js?v=ef504f96';
import {
seedCarried,
applyOptionSet,
Expand All @@ -15,7 +15,7 @@ import {
visibleFieldFlags,
} from '/js/admin-logic.js?v=1cca36f5';
import { optionsErrorAdvice, TONE } from '/js/admin-error.js?v=b0881957';
import { qi } from '/js/utils.js?v=dc4ac52e';
import { qi } from '/js/utils.js?v=705ca896';
import { formatNumber } from '/js/format-number.js?v=abcd4ae4';

const PE =
Expand Down
29 changes: 29 additions & 0 deletions ui/test/widget-teardown.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,35 @@ test('the rebuild is driven by the shared layout rule', () => {
assert.match(src, /onLayoutChange\(mobile => \{/, 'the layout change is what triggers a rebuild');
});

test('a reload replaces the frame location instead of adding a Back entry', async () => {
const h = harness();
const frames = [];
const make = globalThis.document.createElement;
globalThis.document.createElement = tag => {
const e = make(tag);
if (tag === 'iframe') {
e.replaced = [];
e.contentWindow = { location: { replace: url => e.replaced.push(url) } };
frames.push(e);
}
return e;
};
globalThis.document.hidden = false;
const wait = ms => new Promise(r => h.realSetTimeout(r, ms));
const { mountScaledWidget, teardownWidgets } = await import('../js/utils.js');
try {
mountScaledWidget(h.card(), { ...OPTS, iframeOpts: { refreshInterval: 250 } });
const first = frames[0].src;
await wait(800);
assert.ok(frames[0].replaced.length > 0, 'no reload ran');
assert.match(frames[0].replaced[0], /^http:\/\/svc\/w\?_r=\d+$/);
assert.equal(frames[0].src, first, 'src was reassigned, which adds a Back entry');
} finally {
teardownWidgets();
h.done();
}
});

test('a hidden tab does not reload its widgets, and catches up on return', async () => {
const h = harness();
const frames = [];
Expand Down
Loading