Close the phone filter drawer when a body of problems is picked - #390
Merged
Conversation
On a phone the problem archive's filter sidebar is a slide-out drawer. Picking in the list picker applied the filter but left the drawer covering the results, because the drawer's close callback never reached past the drawer itself. Thread it down to the picker, where all three kinds of pick now dismiss the drawer: they switch which body of problems you are browsing rather than narrowing it, so the results are what you want to see next. The other facets keep the drawer open for the footer button, as before. The manage-lists modal now closes before it selects, so the nested dialogs unwind top-down instead of the drawer tearing down around one that has not started leaving. Naming a new list also existed twice, in the picker and in the manage modal, with the two copies disagreeing on when the field resets. Both now share one hook and one row component, settled on keeping the field until the new list is in the cache. Escape in that field cancels the naming and leaves the popover open, which the field's own stopPropagation could not do: Radix listens for Escape in the capture phase, so the popover's onEscapeKeyDown is the only lever that reaches it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
On a phone the problem archive's filter sidebar is a slide-out drawer. Picking in the list picker applied the filter but left the drawer covering the results:
ProblemsLibraryowned the open state and handed the setter only to the drawer's ownonClose, so there was no path from a list click to the drawer.Threading that callback down to the picker fixes it. All three kinds of pick (All problems, Liked, a named list) dismiss the drawer, since each switches which body of problems you are browsing rather than narrowing it. The other facets leave it open, which is what the "Apply filters" footer is for. Desktop renders the same
SearchFilterswithout the callback, so the sidebar is untouched.The manage-lists modal now closes before it selects. It is nested inside the drawer's dialog, and the old order tore down the outer one while the inner had not started leaving.
Naming a new list existed twice, in the picker and in the manage modal, down to a byte-identical class string. The two copies had drifted apart on one thing: the picker reset the field in the mutation's
onSuccess, the modal reset it the instant the request fired, so the field blanked before the list appeared. Both now go throughuseNewListFormplus a sharedNewListInput, settled on the picker's timing.Escape in that field now cancels the naming and leaves the popover open. The field's
stopPropagationnever achieved this because Radix listens for Escape in the capture phase at document level, so it fires before the input's handler; the popover'sonEscapeKeyDownis the lever that actually reaches it. The manage modal already behaved correctly, as HeadlessUI listens in the bubble phase.🤖 Generated with Claude Code