Skip to content

Conversation

@Flo0807
Copy link
Collaborator

@Flo0807 Flo0807 commented Nov 21, 2025

depends on #1688

@Flo0807 Flo0807 self-assigned this Nov 21, 2025
@Flo0807 Flo0807 added the feature New feature label Nov 21, 2025
@Flo0807 Flo0807 marked this pull request as draft November 21, 2025 13:14
@Flo0807 Flo0807 mentioned this pull request Nov 21, 2025
4 tasks
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enables item actions to be displayed on the show view, allowing users to perform actions on individual items from the detail page. The implementation refactors existing item action logic into shared functions to maintain consistency between index and show views.

  • Adds item action support to the show view with modal confirmation support
  • Extracts common item action handling logic into reusable Backpex.ItemAction functions
  • Creates a new Backpex.HTML.ItemAction component for the action confirmation modal

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
lib/backpex/live_resource/show.ex Adds item action handling to show view including action assignment, event handlers, and navigation logic
lib/backpex/live_resource/index.ex Refactors to use shared item action functions from Backpex.ItemAction module
lib/backpex/item_actions/item_action.ex Adds shared handle_item_action and assign_action_changeset functions for reuse across views
lib/backpex/live_components/form_component.ex Renames handle_item_action to handle_form_item_action to avoid naming conflicts and changes navigation method
lib/backpex/html/item_action.ex New component module providing the reusable action confirmation modal
lib/backpex/html/resource/resource_show.html.heex Includes the action confirmation modal in the show view template
lib/backpex/html/resource/resource_index_table.html.heex Updates to use the new filter_item_actions function for consistency
lib/backpex/html/resource/resource_index.html.heex Extracts action modal into reusable component
lib/backpex/html/resource.ex Refactors item action filtering into a single public filter_item_actions function and updates visibility check to public action_visible?
lib/backpex/live_resource.ex Updates show page title template to render item actions as buttons
guides/actions/item-actions.md Documents the new :show placement option and fixes grammar
demo/lib/demo_web/live/tag_live.ex Adds :show to duplicate action visibility configuration as a demo

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Flo0807 Flo0807 marked this pull request as ready for review November 22, 2025 10:09
@Flo0807 Flo0807 requested a review from pehbehbeh November 22, 2025 10:09
@pehbehbeh
Copy link
Member

After using the edit action I would have expected to return to the show view after "save" (and especially after "go back"). Could we maybe add that via the return_to functionality?

@Flo0807 Flo0807 force-pushed the feature/show-item-actions-on-show-view branch from a4bb784 to ddcbb9e Compare December 5, 2025 08:21
@Flo0807 Flo0807 changed the base branch from develop to feature/fix-return-to December 5, 2025 08:22
@Flo0807
Copy link
Collaborator Author

Flo0807 commented Dec 5, 2025

After using the edit action I would have expected to return to the show view after "save" (and especially after "go back"). Could we maybe add that via the return_to functionality?

This is also broken on develop. I fixed it here #1688

(I've added some tests for item actions in this PR to make sure they work and redirect as expected)

@Flo0807 Flo0807 requested a review from pehbehbeh December 5, 2025 12:18
@Flo0807
Copy link
Collaborator Author

Flo0807 commented Dec 5, 2025

I've added a bunch of additional tests.

Copy link
Member

@pehbehbeh pehbehbeh left a comment

Choose a reason for hiding this comment

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

👍 👍 👍

Base automatically changed from feature/fix-return-to to develop December 6, 2025 14:51
@pehbehbeh pehbehbeh added this pull request to the merge queue Dec 6, 2025
Merged via the queue into develop with commit 1d94aa5 Dec 6, 2025
7 checks passed
@pehbehbeh pehbehbeh deleted the feature/show-item-actions-on-show-view branch December 6, 2025 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants