Skip to content

feat: Pathways strip in course pages [FC-0137] - #2159

Open
ChrisChV wants to merge 20 commits into
openedx:masterfrom
open-craft:chris/fal-4397-course-pathway-strip
Open

ChrisChV wants to merge 20 commits into
openedx:masterfrom
open-craft:chris/fal-4397-course-pathway-strip

Conversation

@ChrisChV

@ChrisChV ChrisChV commented Oct 5, 2026 •

Copy link
Copy Markdown

Description

image image image

Supporting information

Testing instructions

  • Apply this patch to add dummy data: dev-pathways-dummy-data-2.patch
  • Verify that the new strip matches the design
  • Verify that you can see the hidden pathways by clicking the count button.
  • Verify the behaviour of this strip by resizing the screen.

Notes

Stack

ChrisChV and others added 6 commits October 4, 2026 14:16
Show, above the learning header, the pathways that include the current
course and in which the learner is enrolled. The labels that do not fit
are moved to a "+N" popover, following the same logic as the course card
strip in the learner dashboard.

- Add the `course-pathways` data layer: `getPathwaysByCourse` in the API
  layer, which returns an empty map until the backend exists, and the
  `useCoursePathways` hook, which extracts the course pathways from it.
- Add the `CoursePathwaysStrip` and `MorePathwaysPopover` components and
  the `useVisiblePathways` hook to split the visible and hidden pathways.
- Add the `org.openedx.frontend.learning.course_pathways_strip.v1` plugin
  slot, rendered by `TabPage` once the course page has loaded.
- Add mock pathways as test fixtures.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Oct 5, 2026
@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @ChrisChV!

This repository is currently maintained by @openedx/committers-frontend-app-learning.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@ChrisChV ChrisChV changed the title feat: Pathways strip in course pages feat: Pathways strip in course pages [FC-0137] Oct 5, 2026
@rpenido rpenido closed this Oct 6, 2026
@github-project-automation github-project-automation Bot moved this from Needs Triage to Done in Contributions Oct 6, 2026
@rpenido rpenido reopened this Oct 6, 2026

@rpenido rpenido left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM 👍
Thank you for your work, @ChrisChV!

  • I tested this using the instructions from the PR
  • I read through the code
  • I checked for accessibility issues
  • Includes documentation

Note: I think the code here is missing the fix that you applied here: openedx/frontend-app-learner-dashboard@5a5fd87

What are your thoughts on creating a @openedx/frontend-component-pathways for our shared code?
This and openedx/frontend-app-learner-dashboard#875 share a lot of components and functions. Handling it in two places in the long term would be a pain.

@codecov

codecov Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.28%. Comparing base (9b69394) to head (cd6dbcf).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2159   +/-   ##
=======================================
  Coverage   99.27%   99.28%           
=======================================
  Files         373      383   +10     
  Lines        5505     5581   +76     
  Branches     1465     1433   -32     
=======================================
+ Hits         5465     5541   +76     
  Misses         40       40           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rpenido

rpenido commented Oct 7, 2026

Copy link
Copy Markdown

@ChrisChV Could you add the issue to the PR description? #2165

@ChrisChV

ChrisChV commented Oct 7, 2026

Copy link
Copy Markdown
Author

@rpenido

Note: I think the code here is missing the fix that you applied here: openedx/frontend-app-learner-dashboard@5a5fd87

It's in the code: d80d6e6

…over and align it to the end of the strip

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rpenido

rpenido commented Oct 9, 2026

Copy link
Copy Markdown

Hi @kdmccormick and @ormsbee! This is ready for review!

@rpenido
rpenido requested review from kdmccormick and ormsbee October 9, 2026 19:09
@kdmccormick
kdmccormick removed the request for review from ormsbee October 9, 2026 19:16
@kdmccormick kdmccormick added create-sandbox open-craft-grove should create a sandbox environment from this PR and removed create-sandbox open-craft-grove should create a sandbox environment from this PR labels Oct 9, 2026

@kdmccormick kdmccormick left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thanks for the PR!

Comment thread README.rst Outdated
Comment on lines +160 to +165
ENABLE_PATHWAY_PILOT_UI
Enables the pathways pilot UI: the strip above the course header that lists the pathways, in which
the learner is enrolled, that include the course. Disabled by default; set it to 'true' to enable it.
When disabled, the pathways are not requested and the ``org.openedx.frontend.learning.course_pathways_strip.v1``
plugin slot is not rendered.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This flag seem redundant to me for two reasons:

  1. If operators don't want to see the pathway strip, then they shouldn't create pathways
  2. If operators want create pathways and still don't want the strip, they can override the plugin slot

In the spirit of reducing complexity, can we avoid adding this new config flag?

@rpenido rpenido Oct 9, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hi @kdmccormick!
The idea behind the feature flag is to allow us to merge some WIP code (like this one, missing the backend implementation) in main, instead of having a bunch of open PRs in a chain and/or conflicting with each other. We can will remove it once we have the full feature in place.
What do you think about that? Do you see a better way to handle it?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you make the app gracefully degrade if the REST API is not available? i.e., it would try to hit the getPathwayByCourse API, see the 404, and then log a console warning that it cannot render the pathway strip.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I removed the flag in b4369de. For now, there is no REST API call to degrade from: getPathwaysByCourse is a stub that returns an empty map until the backend endpoint exists, so the app never makes a request, and the strip is simply not rendered.

Comment thread src/course-pathways/data/types.ts Outdated
Comment on lines +8 to +15
courseCount: number;
category?: string;
categoryLabel?: string;
categoryBackgroundColor?: string;
categoryTextColor?: string;
};
progress?: {
completedCourseCount: number;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Perhaps this discussion is better suited for the backend PRs, but these APIs must not assume that Pathways are built of courses. Pathways are built of Items, so we should have fields like itemCount and completedItemCount rather than courseCount and completedCourseCount

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Updated in 585c008

@@ -0,0 +1,55 @@
# Course Pathways Strip Slot

### Slot ID: `org.openedx.frontend.learning.course_pathways_strip.v1`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am somewhat inclined to stay that these strips could have other uses beyond pathways-- things like Your trial course access ends in 6 days or You are viewing an archived run of this course. To earn credit, view this new run <link>.

So maybe the Pathways info should just be the default content of a new generic org.openedx.frontend.learning.course_info_strip.v1 slot?

But I can also see the counterargument: if the slot is too generic, it will get misused and/or it becomes harder to understand. The org.openedx.frontend.learning.course_pathways_strip.v1 has an obvious purpose, and that's a good thing.

@brian-smith-tcril , could I get your opinion on this?

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.

I am somewhat inclined to stay that these strips could have other uses beyond pathways

100% agree.

Having the pathways strip as the default content in a org.openedx.frontend.learning.course_info_strip.v1 slot would definitely make sense to me!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

actually, before you make this change @ChrisChV , Brian highlighted a deeper issue: frontend-base assumes that the header is the topmost element and the footer is the bottom-most element, with app content all sandwiched between those. So, if we made the plugin slot part of frontend-app-learning, then we would immediately hit an issue when trying to migrate this repo to frontend-base (which is happening in parallel as we speak).

the fix would be to make a generic info-strip slot within the header itself, and have frontend-app-learning push the pathways info into that slot (feel free to chime in Brian if I'm describing that wrong).

that would be a bit more work, so I think we should check with product about whether it's important that this strip must be above the course header, or whether it could potentially be below the course header instead, which would avoid the whole issue. I'll ask in Cassie in Slack when I'm back in office Tuesday morning, or if you're working Monday feel free to ask her.

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.

the fix would be to make a generic info-strip slot within the header itself, and have frontend-app-learning push the pathways info into that slot

That's the gist of it.

In frontend-base we'd need to make it so an app can "put something into" a new info strip slot (as opposed to having the app directly render it).

Replicating the "put something into" in frontend-platform/frontend-build/frontend-plugin-framework land would be a little more complicated (but doable). The first idea that comes to mind would be to have the slot live in frontend-component-header, and have the slot render default content that is passed in as a prop from the consuming application (so every app other than frontend-app-learning just doesn't pass anything and the slot is empty, but frontend-app-learning passes the pathways strip.

@cassiezamparini cassiezamparini Oct 13, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

that would be a bit more work, so I think we should check with product about whether it's important that this strip must be above the course header, or whether it could potentially be below the course header instead, which would avoid the whole issue. I'll ask in Cassie in Slack when I'm back in office Tuesday morning, or if you're working Monday feel free to ask her.

@kdmccormick @ChrisChV What exactly constitutes the course header: the course title only, or course title + course navigation?

@ali-hugo and I had a look, and think it could work if it's just below the course title, i.e:

Screenshot 2026-10-13 at 11 38 44

FYI: I'm on leave from tomorrow and will be back on Monday.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

^ that works great, thanks @cassiezamparini !

@ChrisChV , could we go with a org.openedx.frontend.learning.course_info_strip.v1 below the course header?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Updated in e8f73ea

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.

After digging into this a bit more it seems my original worry about the placement wasn't justified. It would be possible for frontend-app-learning to insert a widget with a slot (and default content) into the frontend-base header slot (as we can have multiple widgets in there) so we could PREPEND and have the strip above the header.

@cassiezamparini @ali-hugo would you prefer the strip to be at the very top?

Comment on lines +3 to +8
// TODO The backend is missing.
// This endpoint should receive a list of course IDs and return a map
// containing the pathways in which the learner is enrolled for each course.
// The response must be mapped here to the `PathwayData` shape.
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export const getPathwaysByCourse = async (_courseIds: string[]): Promise<PathwaysByCourse> => ({});

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

when there is a version of the backend ready, could you try making a sandbox for this PR by adding the create-sandbox label using the PR description to point it at the backend branch? https://github.com/open-craft/pr-sandbox-automation/tree/main/docs#custom-configuration

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I started a PR for a sandbox for the whole pathways here: openedx/openedx-platform#39205
The blocker right now is that we need a patch to apply the mock with dummy data to actually test it.

@rpenido

rpenido commented Oct 28, 2026

Copy link
Copy Markdown

@rpenido could you complete a code review?

Sure! I'll do it first thing tomorrow.

@rpenido rpenido left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM 👍

  • I tested this using the instructions from the PR
  • I read through the code
  • I checked for accessibility issues
  • Includes documentation

One note on the test instructions: CC @ChrisChV

  • The patch references the old course-pathways/data folder. I had to manually update it before applying

The strip blends with the instructor's toolbar. Maybe a separator would make the separation clear? But I think we should refine it in a follow-up task CC @cassiezamparini

Image

Comment on lines +9 to +12
category?: string;
categoryLabel?: string;
categoryBackgroundColor?: string;
categoryTextColor?: string;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Just a note: I think it is safe to assume these fields are not undefined. But we can revisit it when we add the backend

@kdmccormick kdmccormick left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The approach, visual changes, the testing report all look good to me 👍🏻

@brian-smith-tcril , this is ready for you to give a technical sweep.

@ChrisChV

Copy link
Copy Markdown
Author

The patch references the old course-pathways/data folder. I had to manually update it before applying

@rpenido, thanks for the review! I updated the description with the correct path

@brian-smith-tcril

Copy link
Copy Markdown
Contributor

Question for design (@cassiezamparini @ali-hugo):

Figma shows the overflow link directly after the last item in the strip
image

This PR has it all the way to the right
image

Is that a design decision that hasn't made it into Figma or a mismatch between design and implementation?

@ChrisChV

Copy link
Copy Markdown
Author

Is that a design decision that hasn't made it into Figma or a mismatch between design and implementation?

I followed the same response of the strip in the course cards: https://www.figma.com/design/JlEMcenU1JwPsFTHAHDwR3/Pathways?node-id=2293-7212#1948384543

@cassiezamparini what do you think?

@cassiezamparini

Copy link
Copy Markdown

@brian-smith-tcril Somehow I missed your ping. Please feel free to ping me again if you don't hear from me.

Hmmm that looks really strange. @ChrisChV asked me what we should do in the case of a truncated Pathway title. ie. should it also show in the +N list. I felt this was quite strange UX wise, so suggested we don't truncate Pathway titles and if they don't fit, they move automatically to the dropdown. BUT then we should move the dropdown closer to the list, see below:
699978800-02a007fa-1fbf-47d7-9920-677ecf07d550

Does that make sense? @brian-smith-tcril anything else we can do from a technical perspective to better this UX?

@ChrisChV what font (underlined in yellow) is being used? The design community creates our Figma mockups using Inter. @brian-smith-tcril Maybe you can shed some light for me?

@brian-smith-tcril

Copy link
Copy Markdown
Contributor

@cassiezamparini re: fonts

Paragon uses the Bootstrap native font stack.

There was an attempt to switch to Inter with openedx/brand-openedx#40, but the MFEs were not prepared for that change and layouts broke. We reverted to the version that still uses the native stack openedx/public-engineering#508

@ChrisChV

Copy link
Copy Markdown
Author

Updated:

image

@@ -0,0 +1,54 @@
.course-pathways-strip {

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.

Adding custom scss instead of using out-of-the-box Paragon is generally something I like to avoid. I tried to see what it would look like to rework this component to better use out-of-the-box Paragon a bit but nothing I tried felt like a good solution.

After thinking about it more I realized that this strip should probably be a Paragon component.

With that in mind, I think the best path forward here would be to:

  • Create an issue on the Paragon repo proposing a new component
  • Update the implementation in this PR to not be pathways-specific. This means we'd have a version of this component that is generic and easy to move to Paragon, but getting the component added to Paragon won't block this PR.

Once the generic version of the component is in place, CoursePathwaysStrip.tsx can just use the generic version and provide the appropriate pathways data.

Then later we can actually add the component to Paragon and have CoursePathwaysStrip.tsx use the Paragon version instead with minimal changes.

Does that work for you? Please let me know if you have any concerns/questions!

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Update the implementation in this PR to not be pathways-specific. This means we'd have a version of this component that is generic and easy to move to Paragon, but getting the component added to Paragon won't block this PR.

Hi @brian-smith-tcril! Do you mind if we do the other way around? We reference the Paragon here with a FIXME:and refactor it once we have the component or in the product/design review rounds.

I'm asking because we have a big stack of open PRs and we're starting to get tight on our budget.

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.

@rpenido I'm not sure what you mean by "the other way around" here.

My suggestion is to make the generic component here, have it live in this MFE and land in this PR, and then make the Paragon issue to port the generic component to Paragon in the future.

I had Claude throw together a diff to demonstrate what I'm thinking

Diff making it generic
diff --git a/src/pathways/pathways-strip/CoursePathwaysStrip.scss b/src/generic/info-strip/InfoStrip.scss
similarity index 84%
rename from src/pathways/pathways-strip/CoursePathwaysStrip.scss
rename to src/generic/info-strip/InfoStrip.scss
index cdcf8c0..530eacc 100644
--- a/src/pathways/pathways-strip/CoursePathwaysStrip.scss
+++ b/src/generic/info-strip/InfoStrip.scss
@@ -1,17 +1,17 @@
-.course-pathways-strip {
-  .course-pathways-strip-container {
+.info-strip {
+  .info-strip-container {
     position: relative;
     flex: 1;
     min-width: 0;
     overflow: hidden;
   }
 
-  .course-pathways-strip-label {
+  .info-strip-label {
     flex-shrink: 0;
     white-space: nowrap;
 
     // Labels are separated by a vertical line
-    & + .course-pathways-strip-label {
+    & + .info-strip-label {
       margin-inline-start: 0.75rem;
       padding-inline-start: 0.75rem;
       border-inline-start: 1px solid var(--pgn-color-light-700);
@@ -19,7 +19,7 @@
   }
 
   // "+N" trigger, right after the last visible label and separated from it by a vertical line
-  .course-pathways-strip-trigger {
+  .info-strip-trigger {
     flex-shrink: 0;
     margin-inline-start: 0.75rem;
     padding-top: 0;
@@ -43,7 +43,7 @@
   }
 
   // Hidden copy of every label, only used to measure their natural width
-  .course-pathways-strip-measure {
+  .info-strip-measure {
     position: absolute;
     top: 0;
     left: 0;
diff --git a/src/generic/info-strip/InfoStrip.tsx b/src/generic/info-strip/InfoStrip.tsx
new file mode 100644
index 0000000..de5c964
--- /dev/null
+++ b/src/generic/info-strip/InfoStrip.tsx
@@ -0,0 +1,43 @@
+import type { ReactNode } from 'react';
+
+import { MoreItemsPopover } from './MoreItemsPopover';
+import { useVisibleItems } from './hooks';
+import type { InfoStripItem } from './types';
+
+export interface InfoStripProps {
+  label: ReactNode;
+  items: InfoStripItem[];
+  getMoreItemsLabel: (count: number) => string;
+}
+
+export const InfoStrip = ({ label, items, getMoreItemsLabel }: InfoStripProps) => {
+  const {
+    containerRef,
+    measureRef,
+    visibleItems,
+    hiddenItems,
+  } = useVisibleItems(items);
+
+  return (
+    <div className="info-strip bg-primary text-white small">
+      <div className="container-xl d-flex align-items-center py-2">
+        <span className="text-gray-200 flex-shrink-0 mr-3">
+          {label}
+        </span>
+        <div ref={containerRef} className="info-strip-container d-flex align-items-center">
+          {visibleItems.map((item) => (
+            <span key={item.id} className="info-strip-label">{item.label}</span>
+          ))}
+          {hiddenItems.length > 0 && (
+            <MoreItemsPopover items={hiddenItems} label={getMoreItemsLabel(hiddenItems.length)} />
+          )}
+          <div ref={measureRef} className="info-strip-measure d-flex align-items-center" aria-hidden>
+            {items.map((item) => (
+              <span key={item.id} className="info-strip-label">{item.label}</span>
+            ))}
+          </div>
+        </div>
+      </div>
+    </div>
+  );
+};
diff --git a/src/pathways/pathways-strip/MorePathwaysPopover.tsx b/src/generic/info-strip/MoreItemsPopover.tsx
similarity index 55%
rename from src/pathways/pathways-strip/MorePathwaysPopover.tsx
rename to src/generic/info-strip/MoreItemsPopover.tsx
index c2e8306..0846bbb 100644
--- a/src/pathways/pathways-strip/MorePathwaysPopover.tsx
+++ b/src/generic/info-strip/MoreItemsPopover.tsx
@@ -1,15 +1,12 @@
 import { useState } from 'react';
-import { useIntl } from '@edx/frontend-platform/i18n';
 import {
   Badge, Button, ModalPopup, useToggle,
 } from '@openedx/paragon';
 import { ArrowDropDown } from '@openedx/paragon/icons';
 
-import type { PathwayData } from '../data/types';
-import messages from './messages';
+import type { InfoStripItem } from './types';
 
-export const MorePathwaysPopover = ({ pathways }: { pathways: PathwayData[] }) => {
-  const { formatMessage } = useIntl();
+export const MoreItemsPopover = ({ items, label }: { items: InfoStripItem[]; label: string }) => {
   const [isOpen, open, close] = useToggle(false);
   const [target, setTarget] = useState<HTMLButtonElement | null>(null);
 
@@ -20,11 +17,11 @@ export const MorePathwaysPopover = ({ pathways }: { pathways: PathwayData[] }) =
         variant="inverse-tertiary"
         size="sm"
         iconAfter={ArrowDropDown}
-        className="course-pathways-strip-trigger pl-2"
-        aria-label={formatMessage(messages.morePathways, { count: pathways.length })}
+        className="info-strip-trigger pl-2"
+        aria-label={label}
         onClick={open}
       >
-        <Badge pill variant="light">{pathways.length}</Badge>
+        <Badge pill variant="light">{items.length}</Badge>
       </Button>
       <ModalPopup
         positionRef={target}
@@ -35,9 +32,8 @@ export const MorePathwaysPopover = ({ pathways }: { pathways: PathwayData[] }) =
       >
         <div className="bg-white px-4 py-3 rounded shadow small">
           <ul className="mb-0 pl-3">
-            {pathways.map((pathway) => (
-              // TODO Link to the pathway outline once its URL is known
-              <li key={pathway.pathway.id}>{pathway.pathway.content.displayName}</li>
+            {items.map((item) => (
+              <li key={item.id}>{item.label}</li>
             ))}
           </ul>
         </div>
diff --git a/src/pathways/pathways-strip/hooks.ts b/src/generic/info-strip/hooks.ts
similarity index 80%
rename from src/pathways/pathways-strip/hooks.ts
rename to src/generic/info-strip/hooks.ts
index c30986b..961738e 100644
--- a/src/pathways/pathways-strip/hooks.ts
+++ b/src/generic/info-strip/hooks.ts
@@ -1,35 +1,35 @@
 import { useLayoutEffect, useRef, useState } from 'react';
 
-import type { PathwayData } from '../data/types';
+import type { InfoStripItem } from './types';
 
 // Width kept free after the last visible label for the "+N" popover trigger, including its
 // 0.75rem (12px) start margin
 const COUNTER_RESERVED_WIDTH = 86;
 
 /**
- * Splits the course pathways into the ones that fit in the strip and the ones that go to the
+ * Splits the items into the ones that fit in the strip and the ones that go to the
  * "+N" popover. Only the labels that fit entirely are shown, so a label that would be cut goes to
  * the popover, even if it is the first one. The split is recalculated whenever the strip resizes.
  */
-export const useVisiblePathways = (pathways: PathwayData[]) => {
+export const useVisibleItems = (items: InfoStripItem[]) => {
   // Goes on the element whose width is available for the labels and the trigger
   const containerRef = useRef<HTMLDivElement>(null);
   // Goes on a hidden row that renders every label at its natural width
   const measureRef = useRef<HTMLDivElement>(null);
-  const [visibleCount, setVisibleCount] = useState(pathways.length);
+  const [visibleCount, setVisibleCount] = useState(items.length);
 
   useLayoutEffect(() => {
     const container = containerRef.current;
     const measure = measureRef.current;
     if (!container || !measure || typeof ResizeObserver === 'undefined') {
-      setVisibleCount(pathways.length);
+      setVisibleCount(items.length);
       return undefined;
     }
 
     const calculate = () => {
       const available = container.clientWidth;
       if (measure.offsetWidth <= available) {
-        setVisibleCount(pathways.length);
+        setVisibleCount(items.length);
         return;
       }
       // A label is visible if it ends before the space kept for the "+N" trigger
@@ -49,12 +49,12 @@ export const useVisiblePathways = (pathways: PathwayData[]) => {
     // The labels change width without resizing the container, e.g. when the web font loads
     observer.observe(measure);
     return () => observer.disconnect();
-  }, [pathways]);
+  }, [items]);
 
   return {
     containerRef,
     measureRef,
-    visiblePathways: pathways.slice(0, visibleCount),
-    hiddenPathways: pathways.slice(visibleCount),
+    visibleItems: items.slice(0, visibleCount),
+    hiddenItems: items.slice(visibleCount),
   };
 };
diff --git a/src/generic/info-strip/types.ts b/src/generic/info-strip/types.ts
new file mode 100644
index 0000000..e09e232
--- /dev/null
+++ b/src/generic/info-strip/types.ts
@@ -0,0 +1,6 @@
+import type { ReactNode } from 'react';
+
+export interface InfoStripItem {
+  id: string;
+  label: ReactNode;
+}
diff --git a/src/index.scss b/src/index.scss
index 0e49db1..c74d3ca 100755
--- a/src/index.scss
+++ b/src/index.scss
@@ -465,4 +465,4 @@
 @import "course-tabs/course-tabs-navigation.scss";
 @import "courseware/course/sidebar/common/SidebarBase.scss";
 @import "courseware/course/sidebar/sidebars/course-outline/CourseOutlineTray.scss";
-@import "pathways/pathways-strip/CoursePathwaysStrip.scss";
+@import "generic/info-strip/InfoStrip.scss";
diff --git a/src/pathways/pathways-strip/CoursePathwaysStrip.tsx b/src/pathways/pathways-strip/CoursePathwaysStrip.tsx
index 76c081d..51ef59e 100644
--- a/src/pathways/pathways-strip/CoursePathwaysStrip.tsx
+++ b/src/pathways/pathways-strip/CoursePathwaysStrip.tsx
@@ -1,57 +1,32 @@
-import { FormattedMessage } from '@edx/frontend-platform/i18n';
+import { useMemo } from 'react';
+import { useIntl } from '@edx/frontend-platform/i18n';
 
+import { InfoStrip } from '@src/generic/info-strip/InfoStrip';
 import { useCoursePathways } from '../data/apiHooks';
-import type { PathwayData } from '../data/types';
-import { MorePathwaysPopover } from './MorePathwaysPopover';
-import { useVisiblePathways } from './hooks';
 import messages from './messages';
 
-interface PathwayLabelProps {
-  pathway: PathwayData;
-}
-
 export interface CoursePathwaysStripProps {
   courseId?: string;
 }
 
-const PathwayLabel = ({ pathway }: PathwayLabelProps) => (
-  // TODO Link to the pathway outline once its URL is known
-  <span className="course-pathways-strip-label">
-    {pathway.pathway.content.displayName}
-  </span>
-);
-
 export const CoursePathwaysStrip = ({ courseId }: CoursePathwaysStripProps) => {
+  const { formatMessage } = useIntl();
   const { data: pathways = [] } = useCoursePathways(courseId);
-  const {
-    containerRef,
-    measureRef,
-    visiblePathways,
-    hiddenPathways,
-  } = useVisiblePathways(pathways);
+  const items = useMemo(() => pathways.map(({ pathway }) => ({
+    id: pathway.id,
+    // TODO Link to the pathway outline once its URL is known
+    label: pathway.content.displayName,
+  })), [pathways]);
 
   if (!pathways.length) {
     return null;
   }
 
   return (
-    <div className="course-pathways-strip bg-primary text-white small">
-      <div className="container-xl d-flex align-items-center py-2">
-        <span className="text-gray-200 flex-shrink-0 mr-3">
-          <FormattedMessage {...messages.includedIn} />
-        </span>
-        <div ref={containerRef} className="course-pathways-strip-container d-flex align-items-center">
-          {visiblePathways.map((pathway) => (
-            <PathwayLabel key={pathway.pathway.id} pathway={pathway} />
-          ))}
-          {hiddenPathways.length > 0 && <MorePathwaysPopover pathways={hiddenPathways} />}
-          <div ref={measureRef} className="course-pathways-strip-measure d-flex align-items-center" aria-hidden>
-            {pathways.map((pathway) => (
-              <PathwayLabel key={pathway.pathway.id} pathway={pathway} />
-            ))}
-          </div>
-        </div>
-      </div>
-    </div>
+    <InfoStrip
+      label={formatMessage(messages.includedIn)}
+      items={items}
+      getMoreItemsLabel={(count) => formatMessage(messages.morePathways, { count })}
+    />
   );
 };

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@brian-smith-tcril What I meant was merging it as-is with a FIXME: comment and refactoring it in later review rounds. We have about 17 open PRs for the frontend alone now, and without them being sorted out, it would be hard to set up a sandbox and start the product/design reviews.
Having these reviews late may impact our deadline.

Also (not that it is the specific case here), we may have changes once product/design evaluate the whole flow, which could mean dropping/refactoring some of the work we are polishing here.

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.

@rpenido I understand that, and reviewing the frontend PRs for Pathways is my top priority now.

That being said, I don't feel landing this PR as-is is a good option.

As I mentioned in #2159 (comment)

Adding custom scss instead of using out-of-the-box Paragon is generally something I like to avoid.

and

I tried to see what it would look like to rework this component to better use out-of-the-box Paragon

Unfortunately it doesn't seem like the info strip is something that can easily be made by composing existing out-of-the-box Paragon components and instead requires custom styles.

The true "happy path" (given unlimited time) for this type of thing would be to propose the new component in Paragon, review the proposed component for usability and a11y, land the new component in Paragon, and then use the new component in the MFE.

I recognized that wasn't a viable option here, so I instead proposed having the component live in the MFE for now.

This would just mean separating the Pathways specific logic out from the info strip logic, it wouldn't mean having the new info strip component go through the entire Paragon component review process as part of this PR.

The proposal on the Paragon side could then simply point to the info strip component in this MFE, and the more in-depth review of it would happen there while the MFE was already using it.

If your issue is with making changes to this PR specifically, I could be open to landing this as-is if there was a Paragon PR (or draft) proposing the info strip component there.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Update the implementation in this PR to not be pathways-specific. This means we'd have a version of this component that is generic and easy to move to Paragon, but getting the component added to Paragon won't block this PR.

Hi @brian-smith-tcril! Do you mind if we do the other way around? We reference the Paragon here with a FIXME:and refactor it once we have the component or in the product/design review rounds.

I'm asking because we have a big stack of open PRs and we're starting to get tight on our budget.

@rpenido and @cassiezamparini - Let's touch base on the project hours, where we are today with what hours have been used, what work have left, and discuss if you have any concerns about completing the project with the hours that currently remain.

@arbrandes

Copy link
Copy Markdown
Contributor

master is now the frontend-base app: the conversion landed in #2267, and the MFE this PR targets now lives on legacy-mfe.

Generally speaking, if this PR introduces a new feature, it should be ported onto the new frontend-base app in the master branch. Once it lands there, we can consider backporting it to legacy-mfe. In other words, unless there's a specific reason for it, it should land in master first.

If it's a bug fix, please check if the bug still exists in master, and fix it there first. If it's already gone there, it's fine to simply retarget the PR to legacy-mfe.

Apologies for the churn!

@ChrisChV ChrisChV moved this from Done to Blocked in Contributions Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

open-source-contribution PR author is not from Axim or 2U

Projects

Status: Blocked
Status: Upstream review

Development

Successfully merging this pull request may close these issues.

8 participants