From e4bf58da19e7e062a8c58cba5828db12b822d096 Mon Sep 17 00:00:00 2001 From: "alexei.dolgolyov" Date: Sat, 16 May 2026 17:05:12 +0300 Subject: [PATCH] fix(dashboard): stop showing perpetual MODIFIED for un-edited legacy layouts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The MODIFIED hint in the Customize Dashboard panel was driven by `presetActive`, recomputed on every save/load via strict deep-equal against each preset. Any drift between a saved layout and the current defaults — older app versions that hadn't yet had some new perf cells added, prior buggy merges that appended new registry keys to the end of perfCells, or stale `visible` values from intermediate dev builds — left `presetActive` undefined forever and pinned the panel in MODIFIED state for users who had not actually edited anything. Split the two concerns: - `presetActive` keeps driving the chip highlight (recomputed). When the layout happens to match a preset exactly the chip lights up. - New `userModified` boolean drives the MODIFIED indicator. Set to true only on actual edits through the panel (visibility / density / ordering / select changes) and on JSON import; cleared by applying a preset and by Reset. Legacy saves without the field load as `userModified: false` so the indicator no longer fires retroactively on data the user never touched. Also tighten `_mergeWithDefaults` so newly-added registry keys land at their canonical positions (subsequence detection) when the saved order is consistent with defaults, which keeps the chip highlight stable across upgrades. --- .../static/js/features/dashboard-customize.ts | 11 +- .../static/js/features/dashboard-layout.ts | 129 ++++++++++++++---- 2 files changed, 109 insertions(+), 31 deletions(-) diff --git a/server/src/ledgrab/static/js/features/dashboard-customize.ts b/server/src/ledgrab/static/js/features/dashboard-customize.ts index ade25eb..c81779e 100644 --- a/server/src/ledgrab/static/js/features/dashboard-customize.ts +++ b/server/src/ledgrab/static/js/features/dashboard-customize.ts @@ -45,6 +45,7 @@ import { import { ICON_X, ICON_EYE, ICON_EYE_OFF, ICON_DOWNLOAD, ICON_REFRESH, } from '../core/icons.ts'; +import { enhanceMiniSelects } from '../core/mini-select.ts'; const ICON_DRAG = ''; const ICON_LOCK = ''; @@ -173,6 +174,10 @@ function _renderPanelBody(): void { ${_renderActions()} `; _bindHandlers(body); + // Enhance the compact