Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
5f92fb9
feat: add the course pathways strip above the course header
ChrisChV Oct 4, 2026
3a903df
fix: recalculate the visible pathways when the labels change width
ChrisChV Oct 4, 2026
8a0ecd3
style: Add plugin images
ChrisChV Oct 4, 2026
d80d6e6
fix: measure the pathway labels from the start edge in RTL
ChrisChV Oct 4, 2026
4f0f65b
style: Nits on the code
ChrisChV Oct 5, 2026
8fea1e6
feat: add the ENABLE_PATHWAY_PILOT_UI flag to show the course pathway…
ChrisChV Oct 5, 2026
cca472a
fix: Broken tests
ChrisChV Oct 5, 2026
45ffc32
fix: move the pathway labels that do not fit entirely to the "+N" pop…
ChrisChV Oct 7, 2026
e8f73ea
refactor: turn the pathways strip slot into a generic course info str…
ChrisChV Oct 16, 2026
585c008
refactor: rename the pathway course counts to item counts
ChrisChV Oct 16, 2026
b4369de
refactor: remove the ENABLE_PATHWAY_PILOT_UI flag
ChrisChV Oct 16, 2026
fc95bb5
refactor: move the course pathways code to src/pathways with the stri…
ChrisChV Oct 23, 2026
696901a
Merge remote-tracking branch 'origin/master' into chris/fal-4397-cour…
ChrisChV Oct 28, 2026
3201351
fix: Styles with the more popover
ChrisChV Nov 19, 2026
113f3b3
Merge branch 'master' into chris/fal-4397-course-pathway-strip
ChrisChV Dec 3, 2026
6d3e24e
refactor: import i18n from frontend-base in the pathways strip
ChrisChV Dec 3, 2026
216a935
test: adapt the pathways strip tests to the frontend-base test setup
ChrisChV Dec 3, 2026
c1143e8
refactor: migrate the course info strip slot to frontend-base
ChrisChV Dec 3, 2026
39e6890
fix: render the course info strip above the course tabs
ChrisChV Dec 3, 2026
cd6dbcf
fix: align the pathways strip with the header
ChrisChV Dec 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/app.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
} from '@openedx/frontend-base';

import { learningApp } from './index';
import { courseInfoStripApp } from './widgets/CourseInfoStrip';
import { coursewareSearchApp } from './widgets/CoursewareSearch';
import { coursewareTabApp } from './widgets/CoursewareTab';
import { datesTabApp } from './widgets/DatesTab';
Expand All @@ -35,6 +36,7 @@ describe('learningApp', () => {
expect(learningApp.appId).toBe('org.openedx.frontend.app.learning');
expect(learningApp.slots).toEqual([
...(learningHeaderApp.slots ?? []),
...(courseInfoStripApp.slots ?? []),
...(coursewareSearchApp.slots ?? []),
...(discussionsSidebarApp.slots ?? []),
...(outlineTabApp.slots ?? []),
Expand Down
70 changes: 70 additions & 0 deletions src/pathways/data/__fixtures__/pathways.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import type { PathwayData, PathwaysByCourse } from '../types';

export const dataEngineering: PathwayData = {
pathway: {
id: 'pathway-1',
content: { displayName: 'Data Engineering Fundamentals' },
itemCount: 6,
category: 'bootcamp',
categoryLabel: 'Bootcamp',
},
progress: { completedItemCount: 0 },
provider: { name: 'MIT OpenCourseWare' },
};

export const machineLearning: PathwayData = {
pathway: {
id: 'pathway-2',
content: { displayName: 'Introduction to Machine Learning' },
itemCount: 12,
category: 'tutorial',
categoryLabel: 'Tutorial',
categoryBackgroundColor: '#FCE4F3',
categoryTextColor: '#9B1766',
},
progress: { completedItemCount: 0 },
provider: { name: 'Stanford' },
};

export const loremIpsum: PathwayData = {
pathway: {
id: 'pathway-3',
content: { displayName: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod' },
itemCount: 4,
category: 'tutorial',
categoryLabel: 'Tutorial',
},
progress: { completedItemCount: 1 },
provider: { name: 'Stanford' },
};

export const sedUt: PathwayData = {
pathway: {
id: 'pathway-4',
content: { displayName: 'Sed ut perspiciatis unde omnis iste natus' },
itemCount: 3,
category: 'tutorial',
categoryLabel: 'Tutorial',
},
progress: { completedItemCount: 0 },
};

export const nemoEnim: PathwayData = {
pathway: {
id: 'pathway-5',
content: { displayName: 'Nemo enim ipsam voluptatem' },
itemCount: 5,
category: 'certificate',
categoryLabel: 'Certificate',
},
progress: { completedItemCount: 2 },
};

export const courseIdWithPathways = 'course-v1:edX+DemoX+Demo_Course';
export const courseIdWithManyPathways = 'course-v1:edX+Many+Pathways';
export const courseIdWithoutPathways = 'course-v1:edX+No+Pathways';

export const pathwaysByCourse: PathwaysByCourse = {
[courseIdWithPathways]: [dataEngineering, machineLearning],
[courseIdWithManyPathways]: [dataEngineering, machineLearning, loremIpsum, sedUt, nemoEnim],
};
10 changes: 10 additions & 0 deletions src/pathways/data/api.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { getPathwaysByCourse } from './api';

describe('course-pathways api', () => {
describe('getPathwaysByCourse', () => {
// Until the backend exists, no course has pathways
it('returns an empty map', async () => {
await expect(getPathwaysByCourse(['course-v1:edX+DemoX+Demo_Course'])).resolves.toEqual({});
});
});
});
8 changes: 8 additions & 0 deletions src/pathways/data/api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import type { PathwaysByCourse } from './types';

// 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> => ({});
81 changes: 81 additions & 0 deletions src/pathways/data/apiHooks.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import { renderHook, waitFor } from '@testing-library/react';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';

import { getPathwaysByCourse } from './api';
import { useCoursePathways } from './apiHooks';
import {
courseIdWithPathways,
courseIdWithoutPathways,
dataEngineering,
machineLearning,
pathwaysByCourse,
} from './__fixtures__/pathways';

jest.mock('./api', () => ({
getPathwaysByCourse: jest.fn(),
}));

const mockGetPathwaysByCourse = getPathwaysByCourse as jest.MockedFunction<typeof getPathwaysByCourse>;

const buildWrapper = () => {
const queryClient = new QueryClient({
defaultOptions: { queries: { retry: false } },
});
const wrapper = ({ children }) => (
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
);
return { wrapper };
};

describe('course-pathways apiHooks', () => {
beforeEach(() => {
mockGetPathwaysByCourse.mockReset();
});

describe('useCoursePathways', () => {
it('requests the pathways of the given course', async () => {
mockGetPathwaysByCourse.mockResolvedValue(pathwaysByCourse);
const { wrapper } = buildWrapper();
const { result } = renderHook(() => useCoursePathways(courseIdWithPathways), { wrapper });

await waitFor(() => expect(result.current.isSuccess).toBe(true));
expect(mockGetPathwaysByCourse).toHaveBeenCalledWith([courseIdWithPathways]);
});

it('returns only the pathways of the given course', async () => {
mockGetPathwaysByCourse.mockResolvedValue(pathwaysByCourse);
const { wrapper } = buildWrapper();
const { result } = renderHook(() => useCoursePathways(courseIdWithPathways), { wrapper });

await waitFor(() => expect(result.current.isSuccess).toBe(true));
expect(result.current.data).toEqual([dataEngineering, machineLearning]);
});

it('returns an empty list when the course has no pathways', async () => {
mockGetPathwaysByCourse.mockResolvedValue(pathwaysByCourse);
const { wrapper } = buildWrapper();
const { result } = renderHook(() => useCoursePathways(courseIdWithoutPathways), { wrapper });

await waitFor(() => expect(result.current.isSuccess).toBe(true));
expect(result.current.data).toEqual([]);
});

it('does not request anything without a course', () => {
const { wrapper } = buildWrapper();
const { result } = renderHook(() => useCoursePathways(undefined), { wrapper });

expect(result.current.fetchStatus).toBe('idle');
expect(result.current.data).toBeUndefined();
expect(mockGetPathwaysByCourse).not.toHaveBeenCalled();
});

it('exposes the error when the request fails', async () => {
mockGetPathwaysByCourse.mockRejectedValue(new Error('network error'));
const { wrapper } = buildWrapper();
const { result } = renderHook(() => useCoursePathways(courseIdWithPathways), { wrapper });

await waitFor(() => expect(result.current.isError).toBe(true));
expect(result.current.data).toBeUndefined();
});
});
});
17 changes: 17 additions & 0 deletions src/pathways/data/apiHooks.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { appId } from '@src/constants';
import { skipToken, useQuery } from '@tanstack/react-query';

import { getPathwaysByCourse } from './api';
import type { PathwayData } from './types';

export const coursePathwaysQueryKeys = {
all: [appId, 'coursePathways'] as const,
course: (courseId: string) => [...coursePathwaysQueryKeys.all, courseId] as const,
};

// Pathways in which the learner is enrolled that include the given course.
export const useCoursePathways = (courseId?: string) => useQuery({
queryKey: coursePathwaysQueryKeys.course(courseId!),
queryFn: courseId ? () => getPathwaysByCourse([courseId]) : skipToken,
select: (pathwaysByCourse): PathwayData[] => pathwaysByCourse[courseId!] ?? [],
});
22 changes: 22 additions & 0 deletions src/pathways/data/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// The shape the UI needs. The API layer is in charge of mapping the backend response to it.
export interface PathwayData {
pathway: {
id: string;
content: {
displayName: string;
};
itemCount: number;
category?: string;
categoryLabel?: string;
categoryBackgroundColor?: string;
categoryTextColor?: string;
Comment on lines +9 to +12

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

};
progress?: {
completedItemCount: number;
};
provider?: {
name: string;
};
}

export type PathwaysByCourse = Record<string, PathwayData[]>;
54 changes: 54 additions & 0 deletions src/pathways/pathways-strip/CoursePathwaysStrip.scss
Original file line number Diff line number Diff line change
@@ -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.

.course-pathways-strip-container {
position: relative;
flex: 1;
min-width: 0;
overflow: hidden;
}

.course-pathways-strip-label {
flex-shrink: 0;
white-space: nowrap;

// Labels are separated by a vertical line
& + .course-pathways-strip-label {
margin-inline-start: 0.75rem;
padding-inline-start: 0.75rem;
border-inline-start: 1px solid var(--pgn-color-light-700);
}
}

// "+N" trigger, right after the last visible label and separated from it by a vertical line
.course-pathways-strip-trigger {
flex-shrink: 0;
margin-inline-start: 0.75rem;
padding-top: 0;
padding-bottom: 0;
border-inline-start: 1px solid var(--pgn-color-light-700);
border-radius: 0;

.badge {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 1.25rem;
height: 1.25rem;
padding: 0;
margin-inline-start: 0.5rem;
}

.btn-icon-after {
margin-inline-start: 0;
}
}

// Hidden copy of every label, only used to measure their natural width
.course-pathways-strip-measure {
position: absolute;
top: 0;
left: 0;
width: max-content;
visibility: hidden;
pointer-events: none;
}
}
Loading
Loading