Skip to content

[73968, 73089] Extend and improve design of WorkPackageCardComponent#23175

Open
HDinger wants to merge 1 commit into
devfrom
feature/73089-restyled-work-package-card-in-backlogs-and-sprints-view
Open

[73968, 73089] Extend and improve design of WorkPackageCardComponent#23175
HDinger wants to merge 1 commit into
devfrom
feature/73089-restyled-work-package-card-in-backlogs-and-sprints-view

Conversation

@HDinger
Copy link
Copy Markdown
Contributor

@HDinger HDinger commented May 12, 2026

Ticket

https://community.openproject.org/wp/73968
https://community.openproject.org/wp/73089

What are you trying to accomplish?

Layout & Structure

  • Card uses a consistent 3-row layout: metadata row, subject row, optional footer row
    • Footer row is only rendered when it has content (parent link or bottom line slot)
    • Drag handle became optional

Metadata Row (Row 1)

  • Always shows: type, work package ID, status, and actions menu
  • Optional: assignee avatar + name (show_assignee)
  • Optional: priority badge (show_priority)
  • Optional: numeric metric e.g. story points (with_metric slot)
  • Optional: custom actions menu replacing the default (with_menu slot)

Status Display

  • Default scheme renders status as a color-highlighted badge
  • Secondary scheme renders status as a neutral label

Footer Row (Row 3)

  • Optional link to the parent work package (show_parent_link) - only rendered when a parent exists
  • Optional arbitrary content via with_bottom_line slot (e.g. time tracking, custom metadata)
  • Both can coexist in the same footer row

Lookbook Documentation

  • Documentation page and previews added

Mobile behaviour

  • The card reacts to different container sizes
    • Priority and assignee hide their text labels

Screenshots

Bildschirmfoto 2026-05-12 um 15 11 56

@HDinger HDinger added this to the 17.5.x milestone May 12, 2026
@HDinger HDinger force-pushed the feature/73089-restyled-work-package-card-in-backlogs-and-sprints-view branch from 25d8a87 to add05fb Compare May 13, 2026 06:48
@HDinger HDinger force-pushed the feature/73089-restyled-work-package-card-in-backlogs-and-sprints-view branch from add05fb to 91de331 Compare May 13, 2026 06:51
@HDinger HDinger marked this pull request as ready for review May 13, 2026 06:55
@HDinger HDinger changed the title [73968, 73089] Extend and improve desing of WorkPackageCardComponent [73968, 73089] Extend and improve design of WorkPackageCardComponent May 13, 2026
@myabc myabc requested review from Copilot and myabc May 16, 2026 15:41
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 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.

if @show_status
flex.with_column(ml: 2) do
render WorkPackages::StatusBadgeComponent.new(status: @work_package.status)
render WorkPackages::StatusBadgeComponent.new(status: @work_package.status, scheme: @status_scheme)
Comment on lines +91 to +101
<% if show_parent_link && work_package.parent.present? %>
<% flex.with_row do %>
<%= render(
Primer::Beta::Link.new(
href: work_package_path(work_package.parent),
underline: false,
color: :default
)
) do %>
<%= render(Primer::Beta::Text.new(color: :subtle)) { "#{t('.parent')}: " } %>
<%= work_package.parent.subject %>
Comment on lines +60 to +62
show_assignee: true,
show_priority: true,
show_parent_link: true,
) do |grid| %>
<% if show_drag_handle %>
<% grid.with_area(:drag_handle) do %>
<%= render(Primer::Beta::Octicon.new(icon: :grabber, "aria-label": t(".drag_handle.label"))) %>
Copy link
Copy Markdown
Contributor

@myabc myabc May 16, 2026

Choose a reason for hiding this comment

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

⚠️ Why not use Primer::OpenProject::DragHandle?

This was what was used prior to prior to #22838 being merged (e.g. here)


<% grid.with_area(:subject) do %>
<%= render(Primer::Beta::Text.new(font_weight: :semibold)) { work_package.subject } %>
<%= render(Primer::Beta::Link.new(href: work_package_path(work_package), font_weight: :semibold)) { work_package.subject } %>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can this link be optional?

Making this a link will make this work less well when the whole card is draggable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

3 participants