Skip to content

Commit 9cf69fe

Browse files
Harden split settings runtime globals
1 parent 3c594ef commit 9cf69fe

10 files changed

Lines changed: 152 additions & 2 deletions
14.1 MB
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cb38a109c5d22bb98b50877f456e37875448dc583c33f188a5be8975d8be5563 folderview.plus-2026.03.22.02.txz

folderview.plus.plg

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@
66
<!ENTITY launch "Settings/FolderViewPlus">
77
<!ENTITY plugdir "/usr/local/emhttp/plugins/&name;">
88
<!ENTITY pluginURL "https://raw.githubusercontent.com/&github;/dev/folderview.plus.plg">
9-
<!ENTITY version "2026.03.22.01">
10-
<!ENTITY md5 "8a9c03722bd35bb4d2524d40f4aaf337">
9+
<!ENTITY version "2026.03.22.02">
10+
<!ENTITY md5 "17fd49f970141da321242e9f70ea7e07">
1111
]>
1212

1313
<PLUGIN name="&name;" author="&author;" version="&version;" launch="&launch;" pluginURL="&pluginURL;" icon="folder-icon.png" support="https://forums.unraid.net/topic/197631-plugin-folderview-plus/" min="7.0.0">
1414
<CHANGES>
1515

16+
###2026.03.22.02
17+
- Maintenance: Update tests for split settings runtime.
18+
19+
1620
###2026.03.22.01
1721
- UX: Refined settings and on-screen update messaging for clarity and consistency.
1822
- Quality: Strengthened release automation and regression guards to prevent note drift.

src/folderview.plus/usr/local/emhttp/plugins/folderview.plus/scripts/folderviewplus.activity-diagnostics.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,47 @@ const exportSupportBundle = () => {
538538
});
539539
};
540540

541+
Object.assign(window, {
542+
lastDiagnostics,
543+
ACTIVITY_FEED_MAX_ENTRIES,
544+
getDiagnostics,
545+
getSupportBundle,
546+
runDiagnosticAction,
547+
trackDiagnosticsEvent,
548+
fetchPrefs,
549+
postPrefs,
550+
createBackup,
551+
createGlobalRollbackCheckpointApi,
552+
restorePreviousGlobalRollbackCheckpointApi,
553+
restoreLatest,
554+
restoreLatestUndo,
555+
executeFolderRuntimeAction,
556+
runScheduledBackup,
557+
syncDockerOrder,
558+
setUpdateStatus,
559+
setRollbackStatus,
560+
formatActivityTimestamp,
561+
renderActivityFeed,
562+
addActivityEntry,
563+
clearActivityFeed,
564+
ADVANCED_MODULE_STATUS_CONFIG,
565+
ensureAdvancedModuleStatusHost,
566+
renderAdvancedModuleStatus,
567+
setAdvancedModuleStatus,
568+
claimAdvancedOperationLock,
569+
releaseAdvancedOperationLock,
570+
withAdvancedOperationLock,
571+
renderChangeHistory,
572+
refreshChangeHistory,
573+
renderDiagnostics,
574+
runDiagnostics,
575+
repairDiagnostics,
576+
exportDiagnosticsByMode,
577+
exportDiagnostics,
578+
exportSupportBundleByMode,
579+
exportSupportBundle
580+
});
581+
541582
window.FolderViewPlusDiagnostics = Object.freeze({
542583
getDiagnostics,
543584
getSupportBundle,

src/folderview.plus/usr/local/emhttp/plugins/folderview.plus/scripts/folderviewplus.folder-editor.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,6 +844,28 @@ const moveFolderUnderDialog = (type, folderId) => {
844844
openFolderTreeMoveDialog(type, folderId, { modeInsideOnly: true, placement: 'inside' });
845845
};
846846

847+
Object.assign(window, {
848+
buildFolderQuickActionSummary,
849+
renderFolderQuickActionSummaryHtml,
850+
closeVmRowDetailsDrawer,
851+
runVmRowDrawerAction,
852+
buildVmRowDetailsDrawerHtml,
853+
toggleVmRowDetailsDrawer,
854+
showFolderRowQuickActions,
855+
openFolderRowQuickActions,
856+
clearRowLongPressState,
857+
bindRowTouchQuickActions,
858+
copyTextToClipboard,
859+
copyFolderId,
860+
saveFolderRecord,
861+
ensureFolderSortModeManual,
862+
buildTreeMoveTargetOptions,
863+
applyFolderTreeMove,
864+
openFolderTreeMoveDialog,
865+
moveFolderToRootQuick,
866+
moveFolderUnderDialog
867+
});
868+
847869
window.FolderViewPlusFolderEditor = Object.freeze({
848870
buildFolderQuickActionSummary,
849871
renderFolderQuickActionSummaryHtml,

src/folderview.plus/usr/local/emhttp/plugins/folderview.plus/scripts/folderviewplus.runtime-parity.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ const typeFolders = (type) => (type === 'docker' ? dockers : vms);
1414
const getManagedTypeLabel = (type) => (normalizeManagedType(type) === 'docker' ? 'Docker' : 'VM');
1515
const getManagedTypePluralLabel = (type) => (normalizeManagedType(type) === 'docker' ? 'Docker' : 'VMs');
1616

17+
Object.assign(window, {
18+
tableIdByType,
19+
parseJsonResponse,
20+
VALID_MANAGED_TYPES,
21+
normalizeManagedType,
22+
typeFolders,
23+
getManagedTypeLabel,
24+
getManagedTypePluralLabel
25+
});
26+
1727
window.FolderViewPlusRuntimeParity = Object.freeze({
1828
tableIdByType,
1929
parseJsonResponse,

src/folderview.plus/usr/local/emhttp/plugins/folderview.plus/scripts/folderviewplus.settings-sections.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,23 @@ const ADVANCED_MODULE_KEYS_BY_TAB = Object.freeze({
6060
});
6161
const BASIC_WORKSPACE_SECTION_KEYS = new Set(['docker', 'vms']);
6262

63+
Object.assign(window, {
64+
ADVANCED_TAB_STORAGE_KEY,
65+
ADVANCED_SECTION_STORAGE_KEY,
66+
ADVANCED_EXPANDED_STORAGE_KEY,
67+
ADVANCED_KNOWN_STORAGE_KEY,
68+
SEARCH_ALL_ADVANCED_STORAGE_KEY,
69+
LEGACY_ADVANCED_SECTION_KEYS,
70+
ADVANCED_SECTION_KEYS,
71+
ADVANCED_GROUPS,
72+
ADVANCED_GROUP_LABELS,
73+
ADVANCED_GROUP_BY_SECTION,
74+
ADVANCED_MODULE_STALE_MS,
75+
ADVANCED_MODULE_KEYS,
76+
ADVANCED_MODULE_KEYS_BY_TAB,
77+
BASIC_WORKSPACE_SECTION_KEYS
78+
});
79+
6380
window.FolderViewPlusSettingsSections = Object.freeze({
6481
ADVANCED_TAB_STORAGE_KEY,
6582
ADVANCED_SECTION_STORAGE_KEY,

src/folderview.plus/usr/local/emhttp/plugins/folderview.plus/scripts/folderviewplus.setup-assistant.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,30 @@ const applyQuickProfilePreset = async (presetId) => {
319319
});
320320
};
321321

322+
Object.assign(window, {
323+
WIZARD_DONE_STORAGE_KEY,
324+
SETUP_ASSISTANT_DONE_STORAGE_KEY,
325+
SETUP_ASSISTANT_DRAFT_STORAGE_KEY,
326+
SETUP_ASSISTANT_PRESETS_STORAGE_KEY,
327+
SETUP_ASSISTANT_DRAFT_MAX_AGE_MS,
328+
SETUP_ASSISTANT_PRESETS_MAX,
329+
SETUP_ASSISTANT_VERSION,
330+
QUICK_PRESET_ACTIVE_STORAGE_KEY,
331+
SETUP_ASSISTANT_STEPS,
332+
SETUP_ASSISTANT_STEPS_BY_ROUTE,
333+
SETUP_ASSISTANT_EXPERIENCE_MODES,
334+
SETUP_ASSISTANT_APPLY_SAFETY_MODES,
335+
SETUP_ASSISTANT_ENV_PRESETS,
336+
SETUP_ASSISTANT_PROFILE_PRESETS,
337+
QUICK_PROFILE_PRESETS,
338+
normalizeQuickProfilePresetId,
339+
getActiveQuickPresetUi,
340+
setActiveQuickPresetUi,
341+
renderQuickProfilePresetButtons,
342+
applyQuickProfileOverrides,
343+
applyQuickProfilePreset
344+
});
345+
322346
window.FolderViewPlusSetupAssistantSupport = Object.freeze({
323347
WIZARD_DONE_STORAGE_KEY,
324348
SETUP_ASSISTANT_DONE_STORAGE_KEY,

src/folderview.plus/usr/local/emhttp/plugins/folderview.plus/scripts/folderviewplus.starter-templates.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -886,6 +886,24 @@ const quickCreateStarterTemplates = async (type) => {
886886
}
887887
};
888888

889+
Object.assign(window, {
890+
DEFAULT_STARTER_FOLDER_ICON,
891+
STARTER_TEMPLATE_CATEGORY_META,
892+
normalizeStarterTemplateCategory,
893+
STARTER_TEMPLATE_BLUEPRINTS,
894+
STARTER_TEMPLATE_SMART_THRESHOLD,
895+
STARTER_TEMPLATE_FALLBACK_BY_TYPE,
896+
STARTER_TEMPLATE_MATCH_ALIASES,
897+
normalizeStarterTemplateMatchText,
898+
buildStarterTemplateHeuristicMap,
899+
collectStarterTemplateSmartSignals,
900+
resolveStarterTemplateSmartIndexes,
901+
buildStarterFolderPayload,
902+
promptStarterTemplateSelection,
903+
quickCreateStarterFolder,
904+
quickCreateStarterTemplates
905+
});
906+
889907
window.FolderViewPlusStarterTemplates = Object.freeze({
890908
DEFAULT_STARTER_FOLDER_ICON,
891909
STARTER_TEMPLATE_CATEGORY_META,

tests/advanced-module-contracts.test.mjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@ import path from 'node:path';
55

66
const repoRoot = path.resolve(process.cwd());
77
const settingsScriptPaths = [
8+
'src/folderview.plus/usr/local/emhttp/plugins/folderview.plus/scripts/folderviewplus.runtime-parity.js',
89
'src/folderview.plus/usr/local/emhttp/plugins/folderview.plus/scripts/folderviewplus.settings-sections.js',
10+
'src/folderview.plus/usr/local/emhttp/plugins/folderview.plus/scripts/folderviewplus.setup-assistant.js',
11+
'src/folderview.plus/usr/local/emhttp/plugins/folderview.plus/scripts/folderviewplus.starter-templates.js',
912
'src/folderview.plus/usr/local/emhttp/plugins/folderview.plus/scripts/folderviewplus.activity-diagnostics.js',
13+
'src/folderview.plus/usr/local/emhttp/plugins/folderview.plus/scripts/folderviewplus.folder-editor.js',
1014
'src/folderview.plus/usr/local/emhttp/plugins/folderview.plus/scripts/folderviewplus.js'
1115
].map((relativePath) => path.join(repoRoot, relativePath));
1216
const script = settingsScriptPaths.map((scriptPath) => fs.readFileSync(scriptPath, 'utf8')).join('\n');
@@ -41,3 +45,12 @@ test('advanced backup and template mutations are lock-guarded', () => {
4145
assert.match(script, /const bulkTemplateAction = \(type, action\) => \{[\s\S]*withAdvancedOperationLock\(type, 'templates'/);
4246
assert.match(script, /const assignSelectedItems = async \(type, namesOverride = null\) => \{[\s\S]*claimAdvancedOperationLock\(resolvedType, 'bulk'/);
4347
});
48+
49+
test('split settings modules publish globals for cross-script browser compatibility', () => {
50+
assert.match(script, /Object\.assign\(window,\s*\{[\s\S]*tableIdByType/);
51+
assert.match(script, /Object\.assign\(window,\s*\{[\s\S]*ADVANCED_TAB_STORAGE_KEY/);
52+
assert.match(script, /Object\.assign\(window,\s*\{[\s\S]*SETUP_ASSISTANT_DONE_STORAGE_KEY/);
53+
assert.match(script, /Object\.assign\(window,\s*\{[\s\S]*STARTER_TEMPLATE_BLUEPRINTS/);
54+
assert.match(script, /Object\.assign\(window,\s*\{[\s\S]*postPrefs/);
55+
assert.match(script, /Object\.assign\(window,\s*\{[\s\S]*openFolderRowQuickActions/);
56+
});

0 commit comments

Comments
 (0)