Skip to content

Keep the sort order after deleting or editing a redirect - #216

Merged
frederikvig merged 2 commits into
masterfrom
fix/keep-sort-after-delete
Nov 7, 2026
Merged

frederikvig merged 2 commits into
masterfrom
fix/keep-sort-after-delete

Conversation

@frederikvig

Copy link
Copy Markdown
Member

Part of #73. It doesn't close it, as column filters and deleting several rows at once are still missing.

The Redirects tab already kept the search and the page after deleting or editing a redirect, but not the sort, so a sorted list went back to the default order. The buttons now pass on the sort too. A failed update also showed the unsearched first page, and now shows the list the editor was on.

IndexModel.OnGet now takes the sort from RedirectsRequest instead of separate parameters. The query string stays the same.

Testing

Admin pages have no unit tests, so I ran 12 checks against the sandbox with the real pages, on a searched and sorted second page of 120 redirects:

Check master This branch
Delete button carries the sort fails passes
After a delete: same sort, search and page fails passes
Update button carries the sort fails passes
After an update: same sort, search and page fails passes
After a failed update: same list fails passes
Other 7, such as the confirmation, the edit being saved, and sorting from the query string passes passes

Unit tests: 342/342.

Not changed

  • Adding a redirect still goes back to the first page in the default order, as there's no guarantee the new row is on the page you were on.
  • The Regex, Ignored and Deleted tabs still lose their page and sort after a change. I can do those too if you want them.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GUDE6qHSSrhDDLNMCQ5suJ

frederikvig and others added 2 commits November 7, 2026 11:42
The delete and update buttons passed on the search and the page, but not
the sort, so the list went back to the default order. A failed update also
showed the unsearched first page, instead of the list the editor was on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GUDE6qHSSrhDDLNMCQ5suJ
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GUDE6qHSSrhDDLNMCQ5suJ
@frederikvig
frederikvig merged commit 23b6310 into master Nov 7, 2026
1 check passed
@frederikvig
frederikvig deleted the fix/keep-sort-after-delete branch November 7, 2026 21:20
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