test(gui): settings package suites; ledger-judged re-registration

Full per-file coverage for the three settings packages: invariant
companions, store mirroring with revision guards, behavior-shaped
section/shell specs (props-fed, real store engine), and apply-level
suites on a real Context + SlotCore covering declaration-aware deferral
and HMR collapse recovery. All three registrants now judge presence on
the slot ledger instead of a local disposer, which went stale when a
parent redeclaration cascade removed the entry (ds-review-bot finding);
the locale re-register path keeps the same idempotence.
This commit is contained in:
imccyu
2026-07-26 01:10:23 +08:00
parent b1b180e098
commit c5cc348816
12 changed files with 764 additions and 12 deletions

View File

@@ -98,9 +98,11 @@ export function apply(ctx: ClientContext): void {
}
// Nav labels are registrant-localized: re-register on locale change so
// the ledger carries fresh text (the version bump re-renders the shell).
// The ledger check mirrors tryRegister: after an HMR collapse `dispose`
// stays set while the entry is gone — relabeling then must stay quiet.
const offLocale = ctx.on('locale/change', () => {
if (!registered()) return
dispose?.()
if (dispose === undefined || !registered()) return
dispose()
dispose = undefined
tryRegister()
})