Skip to content

fix(mods): resolve startup mod updates notice when updates complete (#752) - #798

Open
Zaldaryon wants to merge 1 commit into
devfrom
fix/issue-752-startup-mod-update-notice
Open

Zaldaryon wants to merge 1 commit into
devfrom
fix/issue-752-startup-mod-update-notice

Conversation

@Zaldaryon

Copy link
Copy Markdown
Collaborator

Summary

When mod updates are detected on startup, GlobalModUpdateChecker displays an actionable notification banner ("The selected Installation has X Mods with updates available") with a "View updates" action. Because actionable notifications have no auto-dismiss timeout, the notice remained on screen indefinitely even after the player navigated to Manage Mods and completed "Update all" or updated the individual mods.

This change:

  1. Adds options.onCreated and options.id to NotificationOptions and introduces resolveNotification(id: string, resolvedWith?: string) to NotificationsContext to dismiss banners and mark records resolved in the Activity Center.
  2. Introduces an in-memory registry (modUpdateNotices.ts) tracking the active startup mod update notice per installation.
  3. Automatically resolves and dismisses the startup notice when:
    • "Update all" completes successfully in useBulkUpdateMods and leaves no remaining updatable mods.
    • Folder refresh in useManageInstalledMods finishes scanning and confirms zero updatable mods remain (covering single mod updates, manual installations, and deletions).

Type

  • Bug fix
  • Feature
  • Performance
  • Refactor or cleanup
  • Tests only
  • Docs or build

Checklist

  • Targets dev, not main.
  • npm run typecheck passes.
  • npm run lint:ci passes.
  • npm run format:check passes.
  • npm run test:coverage passes, coverage at or above the floor in vitest.config.ts.
  • npm run build:unpack passes.

Testing

  1. npm run typecheck: passed with zero errors across node, web, and tests.
  2. npm run lint:ci: passed with zero errors across oxlint and eslint.
  3. npm run format:check: passed with 100% formatted.
  4. npm run test:coverage: passed with 305 test files (1927 tests passed, 2 skipped) with coverage floors exceeded:
    • Statements: 95.06% (floor: 94.0%)
    • Branches: 91.27% (floor: 89.0%)
    • Functions: 95.87% (floor: 94.0%)
    • Lines: 97.03% (floor: 96.0%)
  5. npm run build:unpack: passed with unpacked Linux binary generated in dist/linux-unpacked.
  6. Unit and DOM tests:
    • Added unit tests in tests/renderer/modUpdateNotices.test.ts for recording, retrieving, and resolving startup notice entries.
    • Added unit tests in tests/renderer-dom/activityCenter.test.tsx for options.onCreated, options.id, and resolveNotification.
    • Added regression test in tests/renderer-dom/globalModUpdateChecker.test.tsx verifying startup notice tracking and dismissal upon resolution.

Related issues

Fixes #752

@Zaldaryon
Zaldaryon requested a review from Pixnop October 27, 2026 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant