Skip to content

Replace URL text filter with dropdown selection in redirects#13010

Open
ericholscher wants to merge 4 commits into
mainfrom
claude/update-redirects-url-filter-ThC5x
Open

Replace URL text filter with dropdown selection in redirects#13010
ericholscher wants to merge 4 commits into
mainfrom
claude/update-redirects-url-filter-ThC5x

Conversation

@ericholscher
Copy link
Copy Markdown
Member

@ericholscher ericholscher commented Apr 30, 2026

Summary

Changed the redirect URL filter from a text-based search field to a dropdown selection using FilteredModelChoiceFilter. This provides a more structured way to filter redirects by selecting specific redirect objects rather than searching by URL substring.

Implementation Details

  • The filter now uses label_attribute="from_url" to display the from_url field in the dropdown
  • The to_field_name="pk" ensures filtering is done by the redirect's primary key
  • The UI changes from a text input to a dropdown selection, improving data integrity and user experience

https://claude.ai/code/session_01E11C1jDS4cAwiCY6t6oN2k

claude added 2 commits April 29, 2026 21:04
Mirror the version filter pattern in RedirectListFilterSet so the URL
filter is a searchable model choice dropdown instead of a free-text
icontains field.

Generated by AI.
@ericholscher ericholscher marked this pull request as ready for review April 30, 2026 01:00
@ericholscher ericholscher requested a review from a team as a code owner April 30, 2026 01:00
@ericholscher ericholscher requested a review from stsewd April 30, 2026 01:00
Copy link
Copy Markdown
Member

@stsewd stsewd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is exposing a URL filter, but than using the PK to do the actual filtering.

Image

@stsewd stsewd requested a review from agjohnson May 4, 2026 18:37
@ericholscher
Copy link
Copy Markdown
Member Author

This still solves the problem, so seems better than the current state?

Addresses review feedback: the filter is labeled "URL" so the URL
parameter should also be a URL, not a primary key.

Generated by AI.
@agjohnson
Copy link
Copy Markdown
Contributor

Yeah I agree with @stsewd, we should keep the patterns on filters consistent. The code looks close now though, but it would be good to add visual proof of this change here. This branch throws an exception for me locally because my migrations are ahead of this branch.

Copy link
Copy Markdown
Contributor

@agjohnson agjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tentative +1, still need to see what this looks like.

But the code looks about what I'd expect and more closely matches the patterns we've used on all other filters now.

@read-the-docs-community
Copy link
Copy Markdown

Documentation build overview

📚 dev | 🛠️ Build #32968862 | 📁 Comparing 2307d63 against latest (0cd076b)

  🔍 Preview build  

6 files changed · ± 6 modified

± Modified

@read-the-docs-community
Copy link
Copy Markdown

Documentation build overview

📚 docs | 🛠️ Build #32968864 | 📁 Comparing 2307d63 against latest (e08ef8f)

  🔍 Preview build  

54 files changed · + 1 added · ± 53 modified

+ Added

± Modified

@ericholscher
Copy link
Copy Markdown
Member Author

ericholscher commented Jun 3, 2026

Screenshot 2026-06-03 at 12 11 08 PM

This is how it looks locally now.

I worry a little bit about including the URL in the URL, which could lead to some encoding weirdness or security issues, but hopefully it's fine?

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.

4 participants