[#74684] Rename WorkPackageCardListComponent, Extract BorderBoxListComponent#23074
Draft
[#74684] Rename WorkPackageCardListComponent, Extract BorderBoxListComponent#23074
Conversation
Add a reusable static BorderBox list wrapper under OpPrimer and refactor the work package card list into a collection-oriented wrapper around it. Move the backlogs inbox to the generic list so its show-more row can stay interleaved with work package rows. https://community.openproject.org/wp/74684
Contributor
There was a problem hiding this comment.
Pull request overview
This PR completes a rename/refactor of the work package “card box” UI into a WorkPackageCardListComponent, updates Backlogs to use the renamed component/item class, and introduces a reusable OpPrimer::BorderBoxListComponent wrapper to standardize BorderBox list rendering (header/rows/footer/empty rows).
Changes:
- Rename
OpenProject::Common::WorkPackageCardBoxComponenttoOpenProject::Common::WorkPackageCardListComponent(including nestedHeader/Item) and update associated styles and I18n keys. - Add
OpPrimer::BorderBoxListComponent(with content/empty/work-package row bridges) and wire the work package card list to render via this component. - Update Backlogs (bucket/sprint/inbox) rendering and specs to use the new list + item components and updated accessibility labels.
Reviewed changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| spec/components/open_project/common/work_package_card_list_component/item_spec.rb | Updates spec namespace for the renamed Item component and related test doubles. |
| spec/components/open_project/common/work_package_card_list_component/header_spec.rb | Updates spec namespace for the renamed Header component. |
| spec/components/open_project/common/work_package_card_list_component_spec.rb | Updates spec namespace for the renamed list component and removes coverage for removed manual-slot behavior. |
| spec/components/op_primer/border_box_list_component_spec.rb | Adds unit coverage for the new OpPrimer::BorderBoxListComponent behavior. |
| modules/backlogs/spec/support/pages/backlog.rb | Updates I18n key for counter accessible label; minor Capybara matcher adjustment. |
| modules/backlogs/spec/components/backlogs/work_package_card_list_item_component_spec.rb | Updates spec to the renamed Backlogs item component. |
| modules/backlogs/spec/components/backlogs/bucket_component_spec.rb | Updates I18n key used for the counter aria-label. |
| modules/backlogs/app/components/backlogs/work_package_card_list_item_component.rb | Renames Backlogs work package item component to inherit from the renamed common list item. |
| modules/backlogs/app/components/backlogs/sprint_component.html.erb | Switches sprint rendering to WorkPackageCardListComponent and renamed Backlogs item component. |
| modules/backlogs/app/components/backlogs/inbox_component.html.erb | Reworks inbox rendering to use OpPrimer::BorderBoxListComponent directly and updates CSS class name. |
| modules/backlogs/app/components/backlogs/bucket_component.html.erb | Switches bucket rendering to WorkPackageCardListComponent and renamed Backlogs item component. |
| lookbook/previews/open_project/common/work_package_card_list_component_preview.rb | Renames preview class and updates it to render the renamed list component; removes manual-item preview. |
| lookbook/previews/op_primer/border_box_list_component_preview.rb | Adds Lookbook preview coverage for the new BorderBoxListComponent. |
| config/locales/en.yml | Renames translation namespace from work_package_card_box_component to work_package_card_list_component. |
| app/components/open_project/common/work_package_card_list_component/item.rb | Renames outer component constant for the nested Item and keeps item row bridging behavior. |
| app/components/open_project/common/work_package_card_list_component/header.sass | Renames header CSS class from ...card-box... to ...card-list.... |
| app/components/open_project/common/work_package_card_list_component/header.rb | Renames outer component constant for the nested Header. |
| app/components/open_project/common/work_package_card_list_component/header.html.erb | Updates header wrapper class to the renamed CSS class. |
| app/components/open_project/common/work_package_card_list_component.sass | Renames base CSS class from ...card-box... to ...card-list.... |
| app/components/open_project/common/work_package_card_list_component.rb | Renames the component class and simplifies rendering/validation to “work_packages-driven” list rendering. |
| app/components/open_project/common/work_package_card_list_component.html.erb | Adds a dedicated template that renders via OpPrimer::BorderBoxListComponent. |
| app/components/op_primer/border_box_list_component/work_package_item.rb | Replaces incorrect/spec-like content with the actual WorkPackageItem bridge implementation. |
| app/components/op_primer/border_box_list_component/empty_item.rb | Moves/implements EmptyItem bridge under OpPrimer::BorderBoxListComponent. |
| app/components/op_primer/border_box_list_component/content_item.rb | Moves/implements ContentItem bridge under OpPrimer::BorderBoxListComponent. |
| app/components/op_primer/border_box_list_component.rb | Introduces the new BorderBox list wrapper component API. |
| app/components/op_primer/border_box_list_component.html.erb | Updates rendering to use rows and render header/footer via stored bridge objects. |
| app/components/_index.sass | Updates Sass imports to the renamed work package card list component styles. |
Comments suppressed due to low confidence (2)
app/components/open_project/common/work_package_card_list_component/item.rb:36
- The class-level comment still refers to a “card box”, but the constant is now
WorkPackageCardListComponent. Please update the wording (and any similar occurrences) to avoid confusion for future readers and to reflect the renamed component accurately.
app/components/open_project/common/work_package_card_list_component.rb:140 - The surrounding documentation for the
empty_stateslot still talks about “items” / “automatic item builds”, but the component now renders rows directly fromwork_packages(and validates based onwork_packages.empty?). Please update the comment to match the current behavior so it stays accurate.
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.
Ticket
https://community.openproject.org/wp/74684
What are you trying to accomplish?
Extracts out a
BorderBoxListComponent(a list of heterogeneous items, including WP card boxes) fromWorkPackageCardListComponent(which takes awork_packages:param, only shows WP and iterates manually).Screenshots
What approach did you choose and why?
Merge checklist