Skip to content

Close the phone filter drawer when a body of problems is picked - #390

Merged
PatrikBak merged 1 commit into
mainfrom
patrik/close-filter-drawer-on-list-pick
Aug 22, 2026
Merged

Close the phone filter drawer when a body of problems is picked#390
PatrikBak merged 1 commit into
mainfrom
patrik/close-filter-drawer-on-list-pick

Conversation

@PatrikBak

Copy link
Copy Markdown
Owner

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: ProblemsLibrary owned the open state and handed the setter only to the drawer's own onClose, 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 SearchFilters without 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 through useNewListForm plus a shared NewListInput, settled on the picker's timing.

Escape in that field now cancels the naming and leaves the popover open. The field's stopPropagation never achieved this because Radix listens for Escape in the capture phase at document level, so it fires before the input's handler; the popover's onEscapeKeyDown is the lever that actually reaches it. The manage modal already behaved correctly, as HeadlessUI listens in the bubble phase.

🤖 Generated with Claude Code

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>
@vercel

vercel Bot commented Aug 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
math-comps Ready Ready Preview Aug 22, 2026 7:26pm

@PatrikBak
PatrikBak enabled auto-merge August 22, 2026 19:25
@PatrikBak
PatrikBak merged commit f79d71d into main Aug 22, 2026
5 checks passed
@PatrikBak
PatrikBak deleted the patrik/close-filter-drawer-on-list-pick branch August 22, 2026 19:34
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