fix(spa): render every ModelAdmin.actions entry on detail page (#618, #619) + release 1.4.11#621
Merged
Merged
Conversation
The 1.4.9 detail-page filter `object_actions.filter(target === 'detail')` dropped every batch-classified action on the floor — and since the stock Django pattern is `@admin.action(description=...)` with the `(modeladmin, request, queryset)` signature, virtually every consumer's actions were tagged `batch` and invisible on the detail page. That contradicted the documented "one declaration → two surfaces" contract. Drop the filter. The action runner endpoint already dispatches both shapes correctly — batch is invoked as `action(modeladmin, request, queryset_of_one)` against the detail page's single pk; detail-shaped actions stay called as `action(modeladmin, request, str(pk))`. Both work on the detail page. Also (#619): rewrite the README "Add custom admin actions" section so the default shape (queryset) is the example, and detail-only shape is the optional second path. The previous copy implied an exclusive split where batch was changelist-only — that was the mental model that produced this bug. Closes #618, closes #619. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Closes #618, closes #619.
#618 — drop the over-narrow detail-page filter
The 1.4.9
object_actions.filter(target === 'detail')filter dropped every batch-classified action on the floor. Since the stock Django pattern is@admin.action(description=...)with(modeladmin, request, queryset)— i.e.target: 'batch'— virtually every consumer's actions were invisible on the detail page. That contradicted the documented "one@admin.action→ two surfaces" contract.Fix: render every entry in
object_actions. The action runner endpoint already dispatches both shapes correctly — batch asaction(modeladmin, request, queryset_of_one)against the detail page's single pk, detail asaction(modeladmin, request, str(pk)). Both work; the filter was the bug.#619 — README copy matches the corrected behaviour
Rewrote the "Add custom admin actions" section. The default example is now the stock
(modeladmin, request, queryset)shape (it now correctly renders on both surfaces); the detail-only signature is documented as the optional second path. The previous copy implied an exclusive split (batch → changelist-only) — that mental model is what produced #618.Verification
pnpm -r typecheck✓pnpm lint(js + css + darkmode coverage) ✓pnpm test— 163 / 163 ✓pnpm -w build✓Not in this PR
redirect: "manual"'s opaque response. Tracked for the next release.🤖 Generated with Claude Code