Content
View differences
Updated by Alexander Coles 27 days ago
Follow-up to #74088. With the row-card primitives renamed (`WorkPackageCardComponent` / `WorkPackageCardBoxComponent`) and the polymorphic container adapter (sibling WP) extracted, the deferred row-menu components are the last asymmetric pair in this rename family.
## Naming inconsistency
After the #74088 rename pass, the deferred menus still read as legacy:
* - `Backlogs::InboxMenuComponent` (`inbox_menu_component.{rb,html.erb}`)
*
- `Backlogs::StoryMenuListComponent` (`story_menu_list_component.{rb,html.erb}`)
Issues:
* "Story" - "Story" terminology survives only here; the rest of the page now talks about work packages and cards.
*
- One is `*MenuComponent`, the other is `*MenuListComponent` — — different suffixes for the same thing (a `Primer::Alpha::ActionMenu::List` for a single row).
*
- Neither name reflects that these belong to a row card.
## Duplication
The two classes are 95% the same:
* - Identical predicates: `show_move_submenu?`, `show_move_items?`, `show_move_to_sprint?`, `allowed_to_manage_sprint_items?`, `first_item?`, `last_item?`.
*
- Identical `build_move_menu` / `build_move_item` shape; only the route helper differs (`reorder_project_backlogs_inbox_path` vs `reorder_project_backlogs_work_package_path`).
*
- Templates are near-clones — — same item ids, same icons, same submenu structure; only the move and move-to-sprint-dialog hrefs differ.
## Proposed direction
Consolidate into a single `Backlogs::WorkPackageCardMenuComponent` (working name) that takes `work_package`, the polymorphic `container_adapter`, `max_position`, `open_sprints_exist`, and `current_user`. The route helpers become `container_adapter.reorder_path(...)` and `container_adapter.move_to_sprint_dialog_path(...)`.
Rendering controllers (`Backlogs::InboxController#menu` and `Backlogs::WorkPackagesController#menu`) keep their distinct turbo-frame endpoints but render the same component with their own adapter instance.
Translation keys live under one shared namespace; current keys differ only cosmetically.
## Out of scope
* - Any change to the row-card menu **trigger** (`work_package_card_component/menu.rb`) — that's — that's the in-card icon button, not the deferred list, and is already shared.
*
- DnD reorder semantics; this WP only renames and de-duplicates the menu list.
## Acceptance
* - Single component class drives both the inbox-context and sprint-context deferred menus.
*
- Old class names deleted (no compatibility aliases).
*
- Existing component specs converge into one suite, parameterised over container kind.
*
- Visual diff against Lookbook previews shows no change.
<br>
Depends on: #74554 (sibling WP "Extract a polymorphic container adapter for shared card primitives").
Parent: #74088
## Naming inconsistency
After the #74088 rename pass, the deferred menus still read as legacy:
*
*
-
* "Story"
*
-
*
-
The two classes are 95% the same:
*
*
-
*
-
Consolidate into a single `Backlogs::WorkPackageCardMenuComponent` (working name) that takes `work_package`, the polymorphic `container_adapter`, `max_position`, `open_sprints_exist`, and `current_user`. The route helpers become `container_adapter.reorder_path(...)` and `container_adapter.move_to_sprint_dialog_path(...)`.
Rendering controllers (`Backlogs::InboxController#menu` and `Backlogs::WorkPackagesController#menu`) keep their distinct turbo-frame endpoints but render the same component with their own adapter instance.
Translation keys live under one shared namespace; current keys differ only cosmetically.
## Out of scope
*
*
-
*
*
-
*
-
*
-
<br>
Depends on: #74554 (sibling WP "Extract a polymorphic container adapter for shared card primitives").
Parent: #74088