Skip to content

Commit 30c73ed

Browse files
Modularize docker runtime core with shared store, guarded actions, and architecture tests
1 parent 0dc5608 commit 30c73ed

12 files changed

Lines changed: 585 additions & 154 deletions

archive/folderview.plus-2026.03.19.17.txz.sha256

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
a143edc48b229ec18e194434a53e346baf46bd56cac1d92fc85bde1ca6fff5b4 folderview.plus-2026.03.20.13.txz
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Docker Runtime Architecture
2+
3+
This document tracks the staged modularization of `docker.js` while preserving Unraid selector/API compatibility.
4+
5+
## Runtime Modules
6+
7+
- `scripts/docker.runtime.shared.js`
8+
- `createRuntimeStateStore`: single source of truth for runtime UI state.
9+
- `createAsyncActionBoundary`: normalized async error handling and user-safe messaging.
10+
- `createContextMenuQuickStripAdapter`: resilient context-menu enhancement for icon-only quick actions.
11+
- `createRuntimePerfTelemetry`: structured action timing with snapshot support.
12+
- `scripts/docker.modules.js`
13+
- view helpers (debug logger, perf tracker, row-centering tools).
14+
15+
## Runtime Ownership
16+
17+
- `docker.js` keeps orchestration and Unraid integration behavior.
18+
- Shared modules own reusable primitives so feature logic is testable without large-file rewrites.
19+
- Store-backed state currently includes:
20+
- `focusedFolderId`
21+
- `lockedFolderIds`
22+
- `pinnedFolderIds`
23+
24+
## Guardrails
25+
26+
- New shared module is loaded in `folderview.plus.Docker.page` before `docker.modules.js` and `docker.js`.
27+
- Context menu quick actions (Focus/Pin/Lock) are enhanced through the adapter rather than ad-hoc DOM logic.
28+
- CSS layout constants use tokenized variables with hard-coded fallback values to preserve legacy contracts.
29+
30+
## Regression Prevention
31+
32+
- Architecture contract tests:
33+
- `tests/docker-runtime-shared-architecture.test.mjs`
34+
- `tests/docker-folder-row-quick-actions.test.mjs`
35+
- `tests/docker-mobile-name-alignment-guard.test.mjs`
36+
- Perf telemetry snapshot is exposed as:
37+
- `window.getDockerRuntimePerfTelemetrySnapshot()`

folderview.plus.plg

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,20 @@
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.20.12">
10-
<!ENTITY md5 "53ab38d43d84b573e23ca2fa27198c3f">
9+
<!ENTITY version "2026.03.20.13">
10+
<!ENTITY md5 "dbd3de15d71be54a1a8141a2486c8cf4">
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.20.13
17+
- Refactor: Added `docker.runtime.shared.js` for Docker runtime state store, async action boundaries, context-menu adapter, and perf telemetry primitives.
18+
- Regression guard: Added architecture and visual-contract tests for Docker quick actions, shared module wiring, and layout token fallback behavior.
19+
- UX: Improved Docker runtime i18n-safe quick action labels and accessibility labels for icon-only context actions.
20+
- Compatibility: Added centralized Docker layout tokens with hard-coded fallbacks to preserve existing selector/spacing contracts.
21+
22+
1623
###2026.03.20.12
1724
- UX: Changed Docker folder click menu so `Focus`, `Pin`, and `Lock` render as icon-only quick actions on one top row.
1825
- Regression guard: Added runtime/test coverage for context quick-action strip detection and styling.

src/folderview.plus/usr/local/emhttp/plugins/folderview.plus/folderview.plus.Docker.page

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ if (!empty($fvplusRuntimeConflicts)) {
3535
<script src="<?php autov('/plugins/folderview.plus/scripts/folderviewplus.utils.js')?>"></script>
3636
<script src="<?php autov('/plugins/folderview.plus/scripts/folderviewplus.request.js')?>"></script>
3737
<script src="<?php autov('/plugins/folderview.plus/scripts/runtime.column-layout.js')?>"></script>
38+
<script src="<?php autov('/plugins/folderview.plus/scripts/docker.runtime.shared.js')?>"></script>
3839
<script src="<?php autov('/plugins/folderview.plus/scripts/docker.modules.js')?>"></script>
3940
<script defer src="<?php autov('/plugins/folderview.plus/scripts/docker.js')?>"></script>
4041

0 commit comments

Comments
 (0)