feat: callback version of conflictBehavior#54
Open
skyboyer wants to merge 1 commit intoTanStack:mainfrom
Open
Conversation
skyboyer
commented
Mar 7, 2026
| <div class={styles().optionRow}> | ||
| <span class={styles().optionLabel}>conflictBehavior</span> | ||
| <span class={styles().optionValue}>{conflictBehavior()}</span> | ||
| <span class={styles().optionValue}>{serializeConflictBehavior(conflictBehavior())}</span> |
Author
There was a problem hiding this comment.
conflictBehavior() cannot be directly rendered in JSX any more. I considered String(conflictBehavior()) but it just dumps callback version as plain JS code which does not look good 😅
skyboyer
commented
Mar 7, 2026
| } | ||
|
|
||
| if (typeof conflictBehavior === 'function') { | ||
| conflictBehavior(keyDisplay, () => unregister(conflictingId)) |
Author
There was a problem hiding this comment.
I don't think it makes sense to expose conflictingId and unregister separately in this callback
| 'Mod+S', | ||
| expect.any(Function), | ||
| ) | ||
| handleConflictCallback.mock.calls[0]?.[1]() |
Author
There was a problem hiding this comment.
mimics custom async logic inside the callback, e.g. call unregisterConflicting after displaying a popup and user clicked "Confirm"
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.
🎯 Changes
As discussed in #47 we may want to do unregister conflicting hot key conditionally(e.g. after showing the confirmation popup) instead of doing it always. Or we may want to log conflict to a remote endpoint, not just show error locally.

Here is how it will be reflected in DevTools:
✅ Checklist
pnpm run test:pr.🚀 Release Impact