From f37f2c7df7332df2632334107c9017bb83028bb4 Mon Sep 17 00:00:00 2001 From: jokob-sk Date: Fri, 9 Oct 2026 09:18:04 +1100 Subject: [PATCH 01/10] BE+FE: Plugins -> Sources DevDetails tab --- .claude/skills/plugin-development/SKILL.md | 6 + .claude/skills/ux-design-patterns/SKILL.md | 24 ++ .../skills/plugin-development/plugin-skill.md | 7 + .gemini/skills/ux-design-patterns/SKILL.md | 24 ++ .../skills/plugin-run-development/SKILL.md | 7 + .github/skills/ux-design-patterns/SKILL.md | 24 ++ CLAUDE.md | 1 + front/changeLogCore.php | 2 - front/css/app.css | 116 +++++++- front/css/dark-patch.css | 19 ++ front/css/system-dark-patch.css | 19 ++ front/deviceDetails.php | 162 ++++++++++- front/deviceDetailsEdit.php | 28 +- front/deviceDetailsSessionInfo.php | 257 ++++++++++++++++++ front/js/common.js | 2 +- front/js/plugin_column_render.js | 180 ++++++++++++ front/js/ui_components.js | 16 ++ front/php/templates/header.php | 1 + front/php/templates/language/ar_ar.json | 11 + front/php/templates/language/ca_ca.json | 11 + front/php/templates/language/cs_cz.json | 11 + front/php/templates/language/de_de.json | 11 + front/php/templates/language/en_us.json | 11 + front/php/templates/language/es_es.json | 11 + front/php/templates/language/fa_fa.json | 11 + front/php/templates/language/fi_fi.json | 11 + front/php/templates/language/fr_fr.json | 11 + front/php/templates/language/he_il.json | 11 + front/php/templates/language/hu_hu.json | 11 + front/php/templates/language/id_id.json | 11 + front/php/templates/language/it_it.json | 11 + front/php/templates/language/ja_jp.json | 11 + front/php/templates/language/nb_no.json | 11 + front/php/templates/language/pl_pl.json | 11 + front/php/templates/language/pt_br.json | 11 + front/php/templates/language/pt_pt.json | 11 + front/php/templates/language/ru_ru.json | 13 +- front/php/templates/language/sv_sv.json | 11 + front/php/templates/language/tr_tr.json | 11 + front/php/templates/language/uk_ua.json | 11 + front/php/templates/language/vi_vn.json | 11 + front/php/templates/language/zh_cn.json | 11 + .../skel_device_details_tab_field_view.php | 14 + .../skel_device_details_tab_session_info.php | 34 +++ front/pluginsCore.php | 190 ++----------- front/pluginsFieldView.php | 193 +++++++++++++ package.json | 11 + playwright.config.js | 14 + server/api.py | 6 +- server/db/plugin_field_views.py | 127 +++++++++ server/scan/device_handling.py | 2 +- test/db/test_plugin_field_views.py | 210 ++++++++++++++ test/e2e/README.md | 29 ++ test/e2e/deep-links.spec.js | 32 +++ test/e2e/field-view-join.spec.js | 32 +++ test/e2e/fixtures.js | 98 +++++++ test/e2e/session-info-render.spec.js | 25 ++ test/e2e/shared-fetch.spec.js | 30 ++ 58 files changed, 2008 insertions(+), 200 deletions(-) create mode 100644 front/deviceDetailsSessionInfo.php create mode 100644 front/js/plugin_column_render.js create mode 100644 front/php/templates/skel_device_details_tab_field_view.php create mode 100644 front/php/templates/skel_device_details_tab_session_info.php create mode 100644 front/pluginsFieldView.php create mode 100644 package.json create mode 100644 playwright.config.js create mode 100644 server/db/plugin_field_views.py create mode 100644 test/db/test_plugin_field_views.py create mode 100644 test/e2e/README.md create mode 100644 test/e2e/deep-links.spec.js create mode 100644 test/e2e/field-view-join.spec.js create mode 100644 test/e2e/fixtures.js create mode 100644 test/e2e/session-info-render.spec.js create mode 100644 test/e2e/shared-fetch.spec.js diff --git a/.claude/skills/plugin-development/SKILL.md b/.claude/skills/plugin-development/SKILL.md index 834e69d5a..a70cce240 100644 --- a/.claude/skills/plugin-development/SKILL.md +++ b/.claude/skills/plugin-development/SKILL.md @@ -61,6 +61,12 @@ Every mapped field (`objectPrimaryId`/`objectSecondaryId`/`watchedValue1-4`/`ext | `on_new_device` | When new device detected | | `on_notification` | When notification triggered | +## `all_plugins` Lifecycle - Cache Hot-Path Derivations by Identity + +`all_plugins` (every plugin's parsed `config.json`) is loaded once, in `initialise.py`'s `get_plugins_configs()` call, and reused as the same list object everywhere after that until an actual config reload replaces it. `update_api()` (`server/api.py`), which receives `all_plugins` as a parameter, runs far more often than that - on every scan cycle and every plugin completion (`server/__main__.py`, `server/plugin.py`), not just on reload. + +Any function deriving something from `all_plugins` that gets called from a hot path like `update_api()` should cache its result keyed by `id(all_plugins)`, not recompute on every call - the input is almost always the same object even though the call site fires constantly. `server/db/plugin_field_views.py`'s `get_all_device_field_views()` is the pattern: check `id(all_plugins)` against the last-seen id, recomputing only when a genuinely new object (an actual reload) appears. + ## Plugin Formats | Format | Purpose | Phase | diff --git a/.claude/skills/ux-design-patterns/SKILL.md b/.claude/skills/ux-design-patterns/SKILL.md index 355691b62..1f8fa55a4 100644 --- a/.claude/skills/ux-design-patterns/SKILL.md +++ b/.claude/skills/ux-design-patterns/SKILL.md @@ -11,6 +11,30 @@ Don't introduce new UX behavior or visual patterns unless a PRD explicitly calls Real, recent example: a presence-page Prev/Next pager was first built with custom `