fix(reader): preserve third-party KOReader menu entries

Extend KOReader's cached menu order instead of persisting complete
override lists. Remove marker-owned legacy overrides during upgrade
while preserving hand-maintained entries.

Closes #1878
This commit is contained in:
neon
2026-10-21 19:51:36 +00:00
parent 8f289c295a
commit 99aa7dce70
4 changed files with 134 additions and 55 deletions
@@ -37,7 +37,10 @@ describe('KOReader plugin update source wiring', () => {
expect(pin).toContain('local TAB_ID = "bookorbit_tab"');
expect(pin).toContain('local function normalizeButtons(buttons, with_tab)');
expect(pin).toContain('if BookOrbitMenuPin.tab then order[TAB_ID] = {} end');
expect(pin).toContain('local function normalizeRuntimeOrder(order)');
expect(pin).toContain('local function migrateOverride(prefix)');
expect(pin).toContain('normalizeRuntimeOrder(order)');
expect(pin).not.toContain('order[BUTTONS] = copyList');
expect(updater).toContain('function UpdateCheck:updateCheckMenuText()');
expect(updater).toContain('return T(_("Plugin update available: v%1 -> v%2"), PLUGIN_VERSION, self.settings.update_latest_version)');