[73968, 73089] Extend and improve design of WorkPackageCardComponent#23175
Conversation
25d8a87 to
add05fb
Compare
add05fb to
91de331
Compare
There was a problem hiding this comment.
Pull request overview
This PR extends the shared work package card component with richer metadata, footer support, status styling variants, and Lookbook documentation/previews, then applies the enhanced card presentation to Backlogs.
Changes:
- Adds card options for assignee, priority, drag handle, parent footer link, bottom-line slot, custom metric/menu placement, and status scheme.
- Updates Backlogs to render the enhanced card with assignee, priority, parent link, and secondary status style.
- Adds Lookbook documentation/previews and supporting locale/style updates.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
app/components/open_project/common/work_package_card_component.rb |
Adds new card options and bottom-line slot. |
app/components/open_project/common/work_package_card_component.html.erb |
Renders the new metadata/action/footer layout. |
app/components/open_project/common/work_package_card_component.sass |
Updates grid layout, responsive behavior, and action/footer styling. |
app/components/open_project/common/work_package_card_component/menu.html.erb |
Makes the menu button small. |
app/components/work_packages/info_line_component.rb |
Adds a status scheme option. |
app/components/work_packages/info_line_component.html.erb |
Passes the status scheme to the status badge. |
app/components/work_packages/status_badge_component.rb |
Adjusts highlight-class behavior when a Primer label scheme is provided. |
modules/backlogs/app/components/backlogs/work_package_card_component.rb |
Enables enhanced card metadata/footer options for Backlogs. |
frontend/src/global_styles/layout/_colors.sass |
Adds a small inline highlight dot variant. |
config/locales/en.yml |
Adds card labels for drag handle and parent. |
lookbook/docs/components/work-packages/card.md.erb |
Adds WorkPackageCard documentation. |
lookbook/previews/open_project/common/work_package_card_component_preview.rb |
Adds and updates component previews. |
lookbook/previews/open_project/common/work_package_card_component_preview/playground.html.erb |
Adds interactive playground rendering. |
lookbook/previews/open_project/common/work_package_card_component_preview/with_bottom_line.html.erb |
Adds bottom-line slot preview rendering. |
| show_assignee: true, | ||
| show_priority: true, | ||
| show_parent_link: true, |
myabc
left a comment
There was a problem hiding this comment.
This looks good overall. It's definitely a massive improvement on the Backlogs page. 💯
I've left lots of comments in line. Most important things IMO to address before merging:
- menu sizes
- CSS and slot naming: I'm still working on better suggestions.
additional_detailsmight be better thanbottom_linehowever. - making subject linking optional
"Nice to haves" would be:
- a
PriorityBadgeComponentrather than inline styling. - Lookbook or Yarddocs for
InfoLineComponentitself.
| "aria-label": button_aria_label || t(".label_actions"), | ||
| tooltip_direction: :se | ||
| tooltip_direction: :se, | ||
| size: :small |
There was a problem hiding this comment.
I'm not against doing this in principle, but this will break alignment with BorderBoxListComponent headers.. so we should discuss and/or allow callers to customise size.
There was a problem hiding this comment.
The reason I did this was that the default button blows up the height of the first row (givent that it is 32px heigh). However due to the invisible style, this looks like a larger gap between the first two rows.
Keeping the spaces consistent becomes cumbersome very quickly. I found a way to circumvent this, but it is far from ideal. I guess, it makes sense to talk about it.
| show_assignee: true, | ||
| show_priority: true, | ||
| show_parent_link: true, |
06d0f66 to
f9c92cc
Compare
…ghting is ignored. Include some further review feedback
f9c92cc to
adc7ac4
Compare
|
Hi @myabc I adressed all of your commits, I guess two things require a deeper look from you |
| def self.for_project(project) | ||
| where(project:).order_alphabetically.includes(:displayed_work_packages) | ||
| where(project:).order_alphabetically.includes(displayed_work_packages: %i[assigned_to priority parent]) | ||
| end |
There was a problem hiding this comment.
I'm not sure if it makes sense to call includes from a scope method like this, or leave it up to the caller? / @dombesz
… n+1 queries when the WorPackageCardComponent is called
adc7ac4 to
5691c55
Compare
…-work-package-card-in-backlogs-and-sprints-view
…acklogs-and-sprints-view
…acklogs-and-sprints-view


Ticket
https://community.openproject.org/wp/73968
https://community.openproject.org/wp/73089
What are you trying to accomplish?
Layout & Structure
Metadata Row (Row 1)
show_assignee)show_priority)with_metricslot)with_menuslot)Status Display
Footer Row (Row 3)
show_parent_link) - only rendered when a parent existswith_bottom_lineslot (e.g. time tracking, custom metadata)Lookbook Documentation
Mobile behaviour
Screenshots