department-of-veterans-affairs / va.gov-cms

Editor-centered management for Veteran-centered content.
https://prod.cms.va.gov
GNU General Public License v2.0
97 stars 69 forks source link

Breadcrumbs: Update to follow content / DS guidance #16902

Open jilladams opened 9 months ago

jilladams commented 9 months ago

Aggregating a variety of breadcrumb-related issues.

Driving principles

  1. Per CAIA: We should be consistent with the standard breadcrumb component in the design system, which states:

Each breadcrumb segment should match the H1 of the corresponding page. When writing H1s for a page, follow the content styleguide for writing page titles.

(Except on multi-step forms.)

  1. Design system components are being forced to V3 on Feb 16, 2024 (announcement), and we will need to request exceptions for cases where we cannot adopt V3 without negative impact on the DS timeline. This includes breadcrumbs.

Breadcrumb implementation today

Pages that don't come from Drupal

Pages that do not originate in Drupal may have various breadcrumb implementations.

  1. Using breadcrumbs liquid template, deriving their details from the URL
  2. Using breadcrumbs "automagically" created through content-build's application registry (pure React app)
  3. Using a custom breadcrumbs implementation in vets-website

Drupal pages

Per https://prod.cms.va.gov/admin/structure/cm_document/note/126/breadcrumbs:

  • Easy Breadcrumb does the handling for nodes with no menu. It has all the settings for breadcrumb generation at the link provided. Because the primary vehicle for populating breadcrumbs, the menu_breadcrumbs module, is not configured for all content types the easy_breadcrumb module has been added. The easy_breadcrumb module fills in the gap left by menu_breadcrumbs by populating breadcrumbs based on path for content types without breadcrumb data.
  • Computed Breadcrumb is the other module we added. It doesn't have any configurable settings, but it takes the breadcrumbs generated for any node (whether easy breadcrumb or menu-managed) and shoves them into a hidden field. That field data is what shows up in JSON:API

Ownership

jilladams commented 9 months ago

Re: v3 breadcrumb component: https://dsva.slack.com/archives/C03R5SBELQM/p1705507430814609?thread_ts=1705503589.174489&cid=C03R5SBELQM

are there any components that your team knows of that will straight up break if they’re defaulted to v3 and haven’t been “properly” switched over? From what I know, breadcrumbs won’t work correctly if data is passed through in a “v1 way” but I’m curious if there are others. That info might help teams who are still in the process of migrating prioritize things.

Regarding the breadcrumbs component specifically, we recently added support to pass things in the v1 way, so that should be covered.