Skip to content

[#74684] Rename WorkPackageCardListComponent, Extract BorderBoxListComponent#23074

Draft
myabc wants to merge 2 commits intodevfrom
implementation/74684-extract-border-box-list-component
Draft

[#74684] Rename WorkPackageCardListComponent, Extract BorderBoxListComponent#23074
myabc wants to merge 2 commits intodevfrom
implementation/74684-extract-border-box-list-component

Conversation

@myabc
Copy link
Copy Markdown
Contributor

@myabc myabc commented May 5, 2026

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) from WorkPackageCardListComponent (which takes a work_packages: param, only shows WP and iterates manually).

Screenshots

What approach did you choose and why?

Merge checklist

  • Added/updated tests
  • Added/updated documentation in Lookbook (patterns, previews, etc)
  • Tested major browsers (Chrome, Firefox, Edge, ...)

myabc added 2 commits May 5, 2026 18:30
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
Copy link
Copy Markdown
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 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::WorkPackageCardBoxComponent to OpenProject::Common::WorkPackageCardListComponent (including nested Header/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_state slot still talks about “items” / “automatic item builds”, but the component now renders rows directly from work_packages (and validates based on work_packages.empty?). Please update the comment to match the current behavior so it stays accurate.

@myabc myabc changed the title [#74684] Rename WorkPackageCardListComponent [#74684] Rename WorkPackageCardListComponent, Extract BorderBoxListComponent May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants