Give the unresolved-conflicts notification a "Resolve Now" button - #41
Open
TheValiantOne wants to merge 1 commit into
Open
Give the unresolved-conflicts notification a "Resolve Now" button#41TheValiantOne wants to merge 1 commit into
TheValiantOne wants to merge 1 commit into
Conversation
The post-deploy scan's notification shipped `actions: []` and a message that
named a count and nothing else. On a real install it fired ("WitcherScriptMerger:
5 unresolved script conflicts found") seconds before the user launched a game that
would not start, with an empty mod0000_MergedFiles - the extension had detected
the problem, said so, and led nowhere, because acting on it meant knowing to go
find a different button on a different page.
The notification now carries a "Resolve Now" action running the same workflow as
the Mods-page toolbar action, and says the game may fail to start until the
conflicts are merged. The action dismisses the notification before starting, so a
count that is about to be stale can't sit there through the merge and then be
re-shown by the post-merge scan.
The resolver is injected as an optional third argument rather than imported:
resolveAction imports coexistenceGuard, which imports conflictNotifications, so
importing it back would close a cycle. index.ts - the composition root, which
already imports resolveAction - supplies it, wrapping the call in the same
log-only last-resort catch registerResolveScriptConflictsAction uses, since
resolveScriptConflicts reports its own failures to the user. Omitting the argument
keeps the old passive shape, so nothing else that calls this function changes.
6 new tests (223 total): the action's presence and title, that invoking it runs
the resolver and dismisses first (asserted by call order), that a missing dismiss
callback doesn't throw, the consequence wording, and - in index.test.ts - that the
injected callback reaches resolveScriptConflicts with the api and that a rejected
workflow doesn't escape. index.test.ts's './resolveAction' mock is partial
(importOriginal spread) so registerResolveScriptConflictsAction stays real for the
existing registration test. typecheck and lint clean.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FP8H6rBLCGPBFRSVsF3Kgw
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The problem
The post-deploy scan's notification shipped
actions: []and a message that named a count and nothing else.On a real install it fired seconds before the user launched a game that wouldn't start:
The extension had detected the problem and said so. It led nowhere — acting on it meant knowing to go find a different button, on a different page, with no indication that the consequence was a game that wouldn't launch. A warning like that reads as noise, and gets treated as noise.
The change
The notification now carries a "Resolve Now" action running the same workflow as the Mods-page toolbar action, and states the consequence:
The action dismisses the notification before starting the workflow, so a count that's about to be stale can't sit there through the merge and then get re-shown by the post-merge scan.
Why the resolver is injected
resolveAction→coexistenceGuard→conflictNotifications. ImportingresolveScriptConflictsback intoconflictNotificationswould close that cycle.So it's an optional third argument, supplied by
index.ts— the composition root, which already importsresolveAction. The call is wrapped in the same log-only last-resort catchregisterResolveScriptConflictsActionuses around its own invocation, sinceresolveScriptConflictsreports its own failures to the user.Omitting the argument keeps the old passive shape, so this is additive for any other caller.
Verification
6 new tests, 223 total, all passing.
npm run typecheckandnpm run lintclean.conflictNotifications.test.ts:dismisscallback doesn't throwindex.test.ts:resolveScriptConflictswith the apiOne test-infrastructure note for review:
index.test.ts's new'./resolveAction'mock is partial (importOriginalspread, stubbing onlyresolveScriptConflicts). Mocking the whole module broke the existing test that assertsregisterResolveScriptConflictsActionreachescontext.registerAction— that one needs the real implementation.Scope
Only the unresolved-conflicts notification.
coexistenceGuard's drift notification already has a "More" action and fires during aresolveScriptConflictsrun (right before the preview dialog appears), so a second button there would be redundant — left alone deliberately.AI-assisted development
Produced by Claude Code (Opus 5). Per
CONTRIBUTING.md: the log excerpt above is from a real install, and the test/typecheck/lint results are from real runs.