Repository navigation
refactor: port the outline tab to frontend-base - #2252
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## frontend-base #2252 +/- ##
=================================================
+ Coverage 96.81% 97.05% +0.24%
=================================================
Files 485 520 +35
Lines 7469 7986 +517
Branches 1780 1884 +104
=================================================
+ Hits 7231 7751 +520
+ Misses 223 222 -1
+ Partials 15 13 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
2a1a017 to
09d40b8
Compare
8f5d7ff to
84f00e5
Compare
arbrandes
left a comment
There was a problem hiding this comment.
Approved with one suggestion inline.
| navigate({ | ||
| pathname: location.pathname, | ||
| search: `?${currentParams.toString()}`, | ||
| replace: true, | ||
| }); |
There was a problem hiding this comment.
I'd move replace: true into the second argument of navigate, as the goal card's cleanup now does. Where it is, react-router ignores it.
A learner who arrives from the enrollment email and then presses Back lands on the ?start_course=1 address again, so the page seems not to go back and the email-click event is sent a second time.
This is master's line, untouched by the port, so it's fine to leave it for a follow-up. I mention it here because this PR fixed the same cleanup in the goal card and added a case for this one that would pass either way.
There was a problem hiding this comment.
Follow-up issue to fix it in the frontend-platform/frontend-build version: #2265
0e9a8e2 to
791ef1b
Compare
7d13fb9 to
c705cf7
Compare
c705cf7 to
44147f4
Compare
44147f4 to
7160205
Compare
course-home/outline-tab moves to the same path under frontend-base/src and the home route loads it lazily in place of its stub, in the learning-outline chunk. Platform imports become @openedx/frontend-base ones; LMS_BASE_URL reads become getSiteConfig().lmsBaseUrl, and LEGACY_THEME_NAME and SUPPORT_URL_ID_VERIFICATION are read from the app config, the first a new key with master's default of null. A sequence title links to getSequenceUrl(courseId, id) where master wrote /course/<course>/<sequence>, a path at the root of its own site; the block's lms_web_url still decides whether the title is a link. The dates widget's all-dates link and the scheduled content alert's button take useDatesTabUrl() where master read the outline response's datesTabLink, and render through getLinkProps, so they open the dates tab in the site; a course whose tab list has no dates tab gets neither (#2250). The certificate alert's button renders through getLinkProps too, which makes its link to the progress tab a router link and leaves the certificate and support links as plain hrefs. The handouts and welcome message frames carry their three rules inline. master's frame document links <BASE_URL>/static/LmsHtmlFragment.css, which its webpack config copies out of public/static; nothing serves a package's file at the site's base URL, so the rules are written into the document in a style element where the link stood, after the theme's lms-main.css as before. The stylesheet file is dropped in the manifest. The weekly goal card's flags are img elements: frontend-base has no SVGR loader, and its migration guide asks for the default URL import in an img. The three SVGs move into widgets/assets, which the package's build copies into dist. The card clears weekly_goal from the address with react-router's navigate, since frontend-base exports no history. The start_course effect lists the two values it reads beside location.search, which the package's lint reports and master's, with the rule off, does not. It passes replace: true as navigate's second argument: master has it in the first, where react-router ignores it, so clearing start_course added a history entry. SequenceTitle builds its link only for a title that shows one. A read of the outline or course metadata query loses its `?? {}` where the next statement destructures or reads through the result: with no data the code threw with the fallback and throws without it. Nine go, in OutlineTab, the certificate, course end and scheduled content hooks, CourseDates, StartOrResumeCourseCard, CourseTools and WelcomeMessage; the four whose fallback changes what renders stay. Conditions that were always true where they stood are written out: two else-if arms of ProctoringInfoPanel become else, the certificate alert's chain over its three awarded statuses becomes a switch, and its button takes its action as onClick, since every button it renders has one. The two outline slots are placeholders until #2185: the section outline slot renders its default content, and the tab notifications slot, which has none, renders nothing. On master the first passed plugins expandAll, sectionIds and sections, the second courseId and model: 'outline'. Their READMEs and images are dropped with the plugin-framework contract they document. The suite fails on console output, so the warnings the tab raised on master are fixed in the components: DateSummary, LmsHtmlFragment and WeeklyLearningGoalCard lose their defaultProps (the last two take default parameters, since their defaults are read), WelcomeMessage's ref prop type names HTMLElement where it named HTMLInputElement for a ref that is a button, and the certificate alert and the course tools render an icon only when they have one. For the package's lint, eleven messages gain a description, disable comments for rules it does not have go, and WelcomeMessage's show-more button gains a key. style.scss loads the DateSummary, FlagButton and ProctoringInfoPanel partials and takes the one rule of master's index.scss that styles this tab, the card header under the extra-small breakpoint. The outlineTabData, block and courseBlocks factories port, and the two factory indexes import them. courseBlocks.factory.js keeps buildSimpleCourseBlocks and buildBinaryCourseBlocks commented out until #2195, whose suites are their first callers. The package declares truncate-html, lodash.camelcase and the regular Font Awesome icons at master's versions. The test render helpers put the authenticated user in the site context. They mounted no SiteContext provider, so a component reading the context saw its default, no user, while getAuthenticatedUser() returned the mock user; the private course alert is the first ported code whose tested outcome depends on it. The outline test reaches the page through the route array and asserts the page rules there. Three cases that render the instructor toolbar are skipped until #2194 and the slot's test-id case until #2185. Cases are added for what this commit changes: where the in-page links go, the frame document, the flag images, and the address after weekly_goal and start_course. Tests that add coverage follow in their own commit. Two of master's alert cases, the certificate status alert's first and the scheduled content alert's, wait for the alert's text with findByText where master asserts with queryByText on the line after the render helper. Here the tab is reached through its lazy route, and the alert, a lazy component added in an effect, can reach the page after the helper's waits are satisfied; under load both cases failed. Part of #2191. Co-Authored-By: Claude <noreply@anthropic.com>
Cases for lines of the outline tab that no case on master runs: a section opening and closing on its title and its icon button; the start or resume button's click event, and no card without a resume URL; each course tool's icon, a tool without one, and a tool's click event; the click events of the certificate alert's certificate and grades buttons; the past-due onboarding button; and the frame's height being set again when its document reports a resize. Two cases run factory code the suite had no call for: an outline built from the course blocks factory's defaults, which include a unit, and a sequence block built with its own URLs. More cases take the branches those lines left untaken: a date with a linked title and a description, and one that is not the upgrade deadline; a completed sequence, a sequence without a URL, and dates with no time zone set; an anonymous visitor and an enterprise learner; an outline response without course goals, certificate data or an enroll alert; a proctoring status the panel does not know; a weekly goal changed, and the reminder switch while masquerading; a frame message of another type; and the course blocks factory given its sequences as one block. OutlineTabComponents.test.tsx renders components alone in states the route never gives them, as ProgressTabComponents.test.tsx does: the certificate alert with a status it does not know and with a time zone in its payload, its hook without course metadata, the course end alert with a time zone, the private course alert and the goal card without course metadata, the handouts without an outline, and the frame without a class name and under a page with and without a dir attribute. Part of #2191. Co-Authored-By: Claude <noreply@anthropic.com>
7160205 to
0dc777a
Compare
Summary
The outline tab, the course home under the "Course" tab, now runs in Learning's frontend-base package. At
/learning/course/:courseId/homea learner sees the section and sequence outline, the start or resume card, the weekly goal card, the course tools, dates and handouts, the welcome message and the tab's alerts, inside the tab-page frame from #2234. No user-facing change onmaster: the legacy tree undersrc/is untouched.Part of #1905. Resolves #2191. Stacked above #2251.
Note
For reviewers: two commits, meant to be read apart. The first is the port, with
master's tests adapted. The second only adds tests, for codemaster's own suite leaves unrun. The ported files are added underfrontend-base/src/as new files, so this diff cannot show what changed frommaster; theport-diffscript in #2234's description prints that diff, fromfrontend-base/manifest.tsv. Fourteen of the ported files are identical tomaster's.What changed
course-home/outline-tab/moves to the same path underfrontend-base/src/, and thehomeroute loads it lazily in place of its stub, in thelearning-outlinechunk. Platform imports become@openedx/frontend-baseones;LMS_BASE_URLreads becomegetSiteConfig().lmsBaseUrl;SUPPORT_URL_ID_VERIFICATIONandLEGACY_THEME_NAMEare read from the app config, the second a new key withmaster's default ofnull.getSequenceUrl.masterwrites/course/<course>/<sequence>, a path at the root of its own site. The block'slms_web_urlstill decides whether a title is a link. Until Port the courseware container and redirects to frontend-base #2195 the link lands on the courseware stub.useDatesTabUrl()wheremasterreads the outline response'sdatesTabLink, and render throughgetLinkProps, so the click stays in the site. The certificate alert's link to the progress tab becomes a router link the same way.master's frame document links<BASE_URL>/static/LmsHtmlFragment.css, copied out ofpublic/static/by its webpack config. Nothing serves a package's file at the site's base URL, so the three rules are written into the document in a<style>element where the<link>stood.LEGACY_THEME_NAMEstill selects thelms-main.csslinked before them. The stylesheet file isdroppedin the manifest.<img>. The three SVGs move intowidgets/assets/, which the package's build copies intodist/.weekly_goalthrough the router, since frontend-base exports nohistory.start_coursereplaces the history entry.masterpassesreplace: trueinnavigate's first argument, where React Router ignores it, so the cleanup adds an entry (Course home: clearingstart_courseadds a history entry #2265). Here it is the second argument, as in the goal card's cleanup, and the case for it asserts that the router's last navigation was a replace.defaultProps;WelcomeMessage's ref prop type namesHTMLElementwhere it namedHTMLInputElementfor a ref that is a button; the certificate alert and the course tools render an icon only when they have one; thestart_courseeffect lists the values it reads; eleven messages gain adescription.?? {}fallbacks on query reads that only moved a throw; twoelse ifinProctoringInfoPanel.jsxthat repeated the negation of the condition before them; the certificate alert's chain over its three awarded statuses, now aswitch; and the guard around its button's action. No behavior changes (decision log entries 16 and 17).style.scssloads theDateSummary,FlagButtonandProctoringInfoPanelpartials and takes the one rule ofmaster'sindex.scssthat styles this tab.outlineTabData,blockandcourseBlocksfactories port.courseBlocks.factory.jskeeps two builders commented out until Port the courseware container and redirects to frontend-base #2195, whose suites are their first callers. The package declarestruncate-html,lodash.camelcaseand the regular Font Awesome icons atmaster's versions.SiteContextprovider, so a component reading the context saw no user. The private course alert is the first ported code whose tested outcome depends on it.Known differences from
mastermastershows the scheduled content alert's button for a course whose Dates tab is hidden, where it opens a dates page with no dates, and shows both links to a learner the entrance exam still gates.Hyperlinkwithmaster's classes;masterhas a bare anchor.LmsHtmlFragment.cssin its build has to restyle the frames through the theme'slms-main.css.masterclearingstart_courseadds a history entry, so Back returns to the?start_course=1address and the email-click event is sent again (Course home: clearingstart_courseadds a history entry #2265).Testing
At the layer's head and at the port commit alone, in
frontend-base/: lint, the tests,buildandbuild:cipass. Lint ran with the package's.jsxfiles included (openedx/frontend-base#327).Two of
master's alert cases, "Certificate Available Alert › appears" and "Scheduled Content Alert › appears correctly", wait for the alert's text withfindByTextwheremasterasserts withqueryByText. Both failed intermittently under load: the tab is reached through its lazy route here, and the alert can reach the page after the render helper's waits are satisfied (decision log entry 20).Coverage. The package is at 100% of lines at the head, against its 96.15% bar, and at 98.4% at the port commit alone. Counted as codecov counts a patch, against #2251's head, the layer adds 526 lines with none missed and none partly covered.
Manual testing on the package's dev site against tutor dev, with one enrolled learner in the demo course: the page and its styles in the shell, the console, a sequence title, the all-dates link, the welcome message frame, the narrow card header, and the progress tab's outline links. Not run in the app: the goal card's flags, and the handouts frame. The flags' image form was compared with
master's inline form in headless Chrome, outside the app: the screenshots are byte-identical. The record is below.Decisions
What was decided while building this layer; the scope and the import and config mapping are in #2191.
Full decision log
Decisions: the outline tab (#2252)
Decisions made while building this layer of #2191. The scope and the
import and config mapping are in #2191's plan and are not repeated.
The top layer of two, in two commits. The shared modules are
refactor: port the modules the outline tab shares to frontend-base #2251. This layer's first commit is the port, with
master's testsand the cases for what the port changes; the second holds the cases
that add coverage, so the port's diff shows only what the port
changes.
A sequence title links to
getSequenceUrl(courseId, id).masterwrites/course/<course>/<sequence>, a path at the root ofits own site; under the shell Learning's routes sit below
/learning. The element stays react-router'sLink, and theblock's
lms_web_url(showLink) still decides whether the titleis a link.
useParams()types the course id as possibly undefined. Thetitle is a link when
showLink && courseId, in one expression,with no non-null assertion.
masterbuilt the link element firstand chose after;
getSequenceUrlthrows when no route providesthe courseware role, so here it runs only for a title that shows
a link.
The two dates links read
useDatesTabUrl().masterreadsdatesTabLinkfrom the outline response, which the outline viewbuilds as
get_learning_mfe_home_url(course_key, url_fragment='dates'): Learning's dates tab, reached by a full pageload. The hook resolves the dates role for the course, and both
links render through
getLinkProps, so the switch stays in thesite.
tabshas nodates tab, and then neither link renders. That is the fix for
Outline tab links to a hidden dates tab #2250:
mastershows the scheduled content alert's button for acourse whose Dates tab is hidden, and both links to a learner the
entrance exam still gates.
Hyperlinkcarryingmaster'sclasses, as refactor: port the progress tab to frontend-base #2247 made the progress tab's subsection titles;
masterhas a bare anchor. The scheduled content alert'sButtontakes the link props directly.
The certificate alert's button renders through
getLinkPropsinone line.
{...(buttonLink && getLinkProps(buttonLink))}standswhere
masterhashref={buttonLink}. The certificate web viewand the ID verification support URL are absolute, so they stay
plain
hrefs; the progress tab's URL is a path in the site andbecomes a router link; an empty or missing link renders a button,
as
master's falsyhrefdid.The frames' three rules are inline, and the stylesheet file is
dropped.master's frame document links<BASE_URL>/static/LmsHtmlFragment.css, a file itswebpack.prod.config.jscopies out ofpublic/static/. The packageis a library a site bundles: nothing serves a file of its at the
site's base URL, frontend-base's webpack gives every
.cssimportto its stylesheet rule (the host page, not the frame's document),
and no rule returns a file's text. The rules are written into
LmsHtmlFragment.jsxin a<style>element where the<link>stood.
LEGACY_THEME_NAME(fix: add support for legacy theme static for the 'LmsHtmlFragment' #785), which selects thelms-main.csslinked before these rules; a
<style>element in the<link>'splace has the same position and specificity in the cascade.
Learning's API, so this is not called a breaking change. A search
of public GitHub for files named
LmsHtmlFragment.cssfinds onlycopies of this repository, each holding the unchanged file.
public/static/LmsHtmlFragment.csstodropped. A line pointing at the component would give thattarget two legacy files, on which the
port-diffscript stops.The goal card's flags are images under
widgets/assets/.masterimports each SVG'sReactComponent, which frontend-build's@svgr/webpackrule provides. frontend-base's migration guide(
docs/how_tos/migrate-frontend-app.md, "SVGR "ReactComponent"imports have been removed") says: "Please replace that export with
the default URL export and set the URL as the source of an
<img>tag, rather than using
ReactComponent." The same guide'sbuildtarget copies
*.scssfiles and files under anassets/directoryinto
dist/, which is all the package publishes, so the three filesmove there; the manifest carries the move. The package's own dev
site and CI build bundle from
src/and would not show a filemissing from
dist/.The goal card clears
weekly_goalthrough the router.mastercalls
history.replace({ search })on frontend-platform'shistory, an instance of its own beside the router's, so theaddress bar changes and the router's location does not.
frontend-base exports no
history. The effect callsnavigate({ search }, { replace: true }); the router's locationthen changes, the effect runs once more and finds no
weekly_goal.The goal is saved once either way, and a case holds that.
The
start_courseeffect lists the values it reads. Itsdependency list on
masteris[location.search], though it alsoreads
location.pathnameandnavigate.master's lint hasreact-hooks/exhaustive-depsturned off; the package's reports itas a warning. The two are added to the list instead of a disable
comment. When the effect runs again
start_courseis already outof the address, so nothing changes, and a case holds that the event
is sent once. The two other
exhaustive-depscomments in thisdirectory (
Section.tsx,WeeklyLearningGoalCard.jsx) aremaster's and stay: adding dependencies there would change whenthose effects run.
Console output fixed in the components.
DateSummary,LmsHtmlFragmentandWeeklyLearningGoalCardlose their
defaultProps. The last two take default parameters,since their defaults are read (a class name written into the
frame document, a goal compared with
null).WelcomeMessage'snextElementRefprop type namesHTMLElementwhere it named
HTMLInputElement. The tab passes the "Expand all"button's ref, so every re-render failed the check. The type came
in with fix: accessibility issues on outline and unit pages #1580 and is
HTMLInputElementin all of its commits,while the ref is on the button in all of them and the case it
added asserts the button has focus; nothing in that PR says why
an input. The component only calls
.focus(). Prop types arechecked in React's development build only, so nothing else
changes.
CertificateStatusAlertandCourseToolsrender their icon onlywhen they have one. The not-passing variant of the alert has no
icon, and a tool with an analytics id the widget does not know
has none either; react-fontawesome reports an icon it cannot
find. Course tools come from a plugin point
(
CourseToolsPluginManager), so an unknown id can occur.Lint. Eleven messages gain a
description, their ids anddefault messages untouched: six in
messages.ts, two in thecertificate alert's, three inline in the scheduled content alert
and one inline in the certificate alert.
eslint-disablecommentsfor rules the package's lint does not have or does not report are
removed, each with its whole line.
HiddenSequenceLink.tsxdropsan empty
Propsinterface, andWelcomeMessage's show-morebutton, an element in an array, gains a
key.courseBlocks.factory.jsports with two builders commentedout. The outline suite uses
buildMinimalCourseBlocksonly.buildSimpleCourseBlocksandbuildBinaryCourseBlocksare firstcalled by courseware suites, so they are line-commented under
Port the courseware container and redirects to frontend-base #2195's URL. Factories count toward coverage here, as on
master,and the package is at 100% of lines below this layer. Uncommented,
the file is
master's apart from two lint comments.The test render helpers put the authenticated user in the site
context.
renderandrenderRoutesmounted noSiteContextprovider, so
useContext(SiteContext)gave the context's default,no user, while
getAuthenticatedUser()returned the mock user.master'sAppProviderput the user inAppContext. The privatecourse alert is the first ported code whose tested outcome depends
on it, and four outline cases failed. Both helpers now wrap their
tree in a
SiteContext.ProviderholdinggetAuthenticatedUser(),read at render time. No other suite changed result.
The outline test through the route array.
fetchAndRenderkeeps itspathargument for the query-stringcases and waits for the level-one heading with
hidden: true:the account activation modal hides the page behind it from the
accessibility tree.
it.skipunder Wire up the frontend-base masquerade bar #2194's URL: the two access expiration bannercases and the request count with the toolbar mounted. The case
that asserts the plugin slot's test id is
it.skipunderPort slots to frontend-base #2185's URL.
preventNavigation. The upgrade button callslocation.replaceitself, which a prevented click does not stop, so its case stubs
the location with
mockLocation, as the dates suite does forthe same button.
LEGACY_THEME_NAMEresets it insideactwhile the page is still mounted, as the progress suite resets
its flag.
Cases for what the port changes, in the first commit: the
sequence title's
href; the dates widget link (itshref, and aclick staying in the site) and the scheduled content button, each
also absent without a dates tab; the not-passing alert's link to
the progress tab; the frame document (base, stylesheet link, the
three rules, the theme name); each goal button's flag image;
weekly_goalandstart_coursegone from the router's location,with one save and one event; the page-rule assertion, moved from
routes.test.tsx. The three lines refactor: port the dates tab to frontend-base #2234 left for this suite arerun by
master's own cases once ported.Cases that add coverage, in the second commit: a section's
toggles; the start or resume button's click event and its absence
without a URL; each tool's icon, an unknown tool, a tool click;
the certificate and grades buttons' click events; the past-due
onboarding button; the frame's resize message. Two cases run
factory code: an outline built from the course blocks factory's
defaults, which include a unit, and a sequence block built with
its own URLs.
More cases take the branches those lines left untaken, so that no
added line is partly covered: a date with a linked title and a
description, and a link that is not the upgrade deadline; a
completed sequence, a sequence without a URL, and dates with no
time zone set; an anonymous visitor and an enterprise learner; an
outline response without course goals, certificate data or an
enroll alert; a proctoring status the panel does not know; a
weekly goal changed, and the reminder switch while masquerading; a
frame message of another type; and the course blocks factory given
its sequences as one block, the side of its two helpers no caller
used.
OutlineTabComponents.test.tsxrenders components alone in statesthe route never gives them, as
ProgressTabComponents.test.tsxdoes for the progress tab: the certificate alert with a status it
does not know and with a time zone in its payload; its hook
without course metadata; the course end alert with a time zone;
the private course alert and the goal card without course
metadata; the handouts without an outline; and the frame without a
class name and under a page with and without a
dirattribute.A
?? {}on a query read goes where it only moves a throw.masterreads the outline and course metadata queries as.data ?? {}. Where the same or the next statement destructures anested key or reads through the result, the code throws with the
fallback and throws without it, so the fallback has no outcome of
its own and no test can take its side. Nine go: both reads in
OutlineTab.jsx, the outline read in the certificate hook, thecourse end and scheduled content hooks,
CourseDates,StartOrResumeCourseCard,CourseToolsandWelcomeMessage.Four stay, because they change what renders, each with a case that
renders the component alone: the certificate hook's metadata read
(no alert),
PrivateCourseAlert(a welcome with no course title),CourseHandouts(nothing) andWeeklyLearningGoalCard(itrenders).
Conditions that were always true where they stood are written
out. Each is
master's, and each left a branch no input cantake. No behavior changes.
ProctoringInfoPanel.jsx:else if (!isNotYetReleased(releaseDate))and
else if (readableStatus !== …otherCourseApproved)eachrepeat the negation of the condition before them, and become
else.CertificateStatusAlert.jsx:renderCertAwardedStatusruns onlyfor the three awarded statuses, picked by the
switchbelow it,so the last
else ifof its chain was never false. The chain isa
switchover the same three statuses, which keeps eachstatus's name on its arm; it has no
default, as the chain hadno final
else.CertificateStatusAlert.jsx: the button's handler wasif (buttonAction) { buttonAction(); }.buttonVisibleandbuttonActionare set only in this file, in the same fourobjects, so every button it renders has an action; the handler
is
onClick={buttonAction}. The progress tab'sCertificateStatus.jsxkeeps its own guard, which it needs: itsbutton can render with a link and no action.
The certificate and course end alerts get no time zone, as on
master. Their hooks readuserTimezonefrom the outline data,which has no such key; the course metadata carries it (The outline tab's course end and certificate status alerts ignore the learner's time zone preference #2253).
The port keeps the read. The two cases that reach the alerts' time
zone branch hand the component a payload.
Checks (2026-11-12). At the first commit:
npm run lintclean,with the package's
.jsxfiles included(
openedx lintdoes not lint.jsxfiles frontend-base#327);npm test, 41 suites, 525 passed, 11skipped, lines 98.4. At the second: lint clean; 42 suites, 569
passed, 11 skipped; lines 100 for the package. Counted as codecov
counts a patch, against refactor: port the modules the outline tab shares to frontend-base #2251's head: 526 added lines, none missed
and none partly covered.
npm run buildandnpm run build:cipass at both;
dist/holds the three flag images, and the CIbuild emits them and the
learning-outlinechunk.Two of
master's alert cases wait for the alert's text(2026-11-18, after the layer was up). "Certificate Available
Alert › appears" and "Scheduled Content Alert › appears correctly"
assert with
expect(await screen.findByText(…))wheremasterhasexpect(screen.queryByText(…))on the line afterfetchAndRender(). The change is in the port commit, with thecases it adapts.
full runs of the package's tests on the layers above this one,
and never when its suite ran alone. Under load it reproduces on
this layer: with eight copies of the outline suite running at
once on eight cores, 18 of 40 runs failed the certificate case
and 5 the scheduled content case, each with
queryByTextreturning
null. Alone under the same load each failed nearlyevery run (14 of 16, 15 of 16); with no other copy running,
neither failed.
master's own certificate case under the same load: 0 of 24.The case bodies are the same; the helpers differ.
master'srenders the tab inside
await act(async () => render(…)). Theport's reaches it through the lazy route and waits for the
heading and for the spinner to go. The alert reaches the page
after both are true:
useAlertadds it in an effect,AlertListrenders it inside<Suspense fallback={null}>, andits component is
React.lazy, which suspends the first time itrenders in a test file. Both cases are the first in the file to
show their alert. What exactly keeps
master's helper clear ofthe race was not established.
master'sactput back around the port's renderlowered the rate and did not remove it (7 of 24). An empty
await act(async () => {})after the helper's waits was notrun: React's
actpage shows no empty callback ("async actFn:An async function wrapping renders or interactions for
components being tested",
Parameters),
and it waits a tick, not for the alert. Testing Library's answer
for content that appears later is the one taken: "
findByqueries work when you expect an element to appear but the change
to the DOM might not happen immediately"
(Async Methods).
The course start alert's cases already assert that way.
alone, 0 of 24 for the certificate block's five cases, 0 of 40
for the suite.
certificate alert ("renders verification alert", "Certificate
(web) Complete Alert", "Requesting Certificate Alert") keep
queryByText. The component is loaded by the time they run. Oneof them failed once in 24 runs of its block before the change,
and none in 64 runs after it.
Checks after entry 20 (2026-11-18). At the port commit alone:
npm run lintclean, with the package's.jsxfiles included(
openedx lintdoes not lint.jsxfiles frontend-base#327);npm test, 41 suites, 525 passed, 11skipped, lines 98.39;
npm run buildandnpm run build:cipass.At the head: lint clean; 42 suites, 569 passed, 11 skipped; lines
100 for the package; both builds pass. The counts are those of
entry 19: the change adds and removes no case. The three layers
above were replayed onto the amended layer with their own patches
unchanged, and each passes its tests and both builds.
The
start_courseeffect replaces the history entry (review,2026-11-18).
masterwritesnavigate({ pathname, search, replace: true }). React Router'snavigatetakesreplacein its second argument and ignores it inthe first, so the cleanup adds a history entry. Back then returns to
the
?start_course=1address, where the effect sendsenrollment.email.clicked.startcourseagain and navigates forwardagain. Here the call is
navigate({ pathname, search }, { replace: true }), the form entry 7gave the goal card.
master's, from feat: upgrade react router to v6 #1128 (2023-10-05), which convertedhistory.replace({ search })to thenavigatecall. The port hadchanged only the effect's dependency list (entry 8).
(refactor: port the outline tab to frontend-base #2252 (comment))
raised it and said a follow-up would do. Brian chose to fix it in
this layer and to file the bug for
masteras well: Course home: clearingstart_courseadds a history entry #2265, whosestatus line says the frontend-base package has the fix here.
mastera learner can meet: after arrivingfrom the enrollment email, Back leaves the page.
start_courseisgone from the router's location, which a push satisfies as well. It
now also asserts that the router's last navigation was a replace.
master's callleft as it was, the case fails,
router.state.historyActionbeingPUSH. With the fix it passes. What Back then does in a browserhas not been watched.
the port, and the fix is folded into that commit, whose message
gains a sentence for it. The second commit is unchanged.
Checks after entry 22 (2026-11-18). At the port commit alone:
npm run lintclean, with the package's.jsxfiles included(
openedx lintdoes not lint.jsxfiles frontend-base#327);npm test, 41 suites, 522 passed, 11skipped, lines 98.39;
npm run buildandnpm run build:cipass.At the head: lint clean; 42 suites, 566 passed, 11 skipped; lines
100 for the package,
OutlineTab.jsxat 100 lines and branches;both builds pass. Counted as codecov counts a patch, against refactor: port the modules the outline tab shares to frontend-base #2251's
head, the layer adds 526 lines with none missed and none partly
covered. Each count is three under entry 21's: two cases went from
the progress suites in fix: stop the progress tab's certificate card reading the entrance exam status #2249 and one from the course start alert's
in refactor: port the modules the outline tab shares to frontend-base #2251, and entry 22 adds an assertion, not a case. The layers
above were not rerun.
Manual testing
Manual testing — the outline tab (#2191)
One section per layer of the stack. A layer's section asks only for what that layer changes
and a test cannot see, and says what each step needs beyond the page itself.
Shared modules (#2251)
Nothing to do. No route renders these modules until the next layer.
The outline tab layer
Drafted 2026-11-12 before the pass. The boxes are Brian's ticks; what was and was not
observed is under Record, below the steps.
What needs eyes: the page in the real shell with real data, its styles, the flags, the
two frames, the in-page links navigating inside the site, and a real browser's console.
What depends on particular data (the five alerts, the proctoring panel's statuses, the
account activation cookie, the not-enrolled view) is left to the suite, listed at the end.
Setup
The same as for the progress tab; nothing new.
bsmith/outline-tab:cd frontend-base && nvm use && npm ci && npm run dev, served athttp://apps.local.openedx.io:2000/learning/, with tutor dev'smfeservice stopped so the port is free.LEARNING_MICROFRONTEND_URLpointing atapps.local.openedx.io:2000/learning, as for Port the dates tab to frontend-base #2189.course-v1:OpenedX+DemoX+DemoCourse.The page
Open
http://apps.local.openedx.io:2000/learning/course/course-v1:OpenedX+DemoX+DemoCourse/homeas the enrolled learner.
Course tab selected: the title, the start or resume card, the section list with
its "Expand all" button, and the right column (goal card if the course has goals
on, course tools, dates, handouts). The cards have a soft shadow and no border.
Why here: the route now loads the real page;
style.scssgains three partialsand the card-header rule copied from
master'sindex.scss.Learning's code.
becomes
/learning/course/<course>/<sequence id>and the courseware stub shows,with no page load (the Network tab shows no document request).
Why here: the title's link is
getSequenceUrl's wheremasterwrote/course/<course>/<sequence>.dates tab with no page load. Before clicking, compare its look with the links
around it: it is a Paragon
Hyperlinknow wheremasterhas a bare anchor.Needs: a course with at least one date, so the widget shows.
(outline, half grey, black), and selecting one gives it the selected border.
Needs: weekly learning goals on for the course: the outline view sets
weekly_learning_goal_enabledwhenENABLE_COURSE_GOALSis enabled for the course(
lms/djangoapps/course_home_api/outline/views.py), the waffle flagcourse_experience.enable_course_goals, off by default. Skip and say so if it is off.Why here: the flags are
<img>elements now; the button styles come fromFlagButton.scssthroughstyle.scss.links coloured and, in the welcome message, underlined; the handouts text is
smaller than the page's.
Needs: a welcome message and a handout for the course. The outline response's
welcome_message_htmlis the course's current update (get_current_update_for_userin the outline view), so both are added in Studio; the record names the page and
controls as they read when it is done.
Why here: the three rules are inline in the frame document where
masterlinkeda stylesheet file.
resume card's button sits under its title, not beside it.
Why here: the one
index.scssrule copied intostyle.scss.that refactor: port the progress tab to frontend-base #2247 left on the stub now open this page with no page load.
Record
2026-11-12, Brian, on the dev site, on
bsmith/outline-tab.those steps ask about were not noted and stay unrecorded: how the all-dates link
looked beside the links around it (step 4), whether the console held warnings that
are not Learning's (step 2), and whether the welcome message held a link (step 6).
pain". So the goal card, its three flag images and its
FlagButton.scssstyles havenot been seen in the app. The suite checks that each goal button holds an image
whose source is the SVG's URL, with the SVG import mocked; the CI site build emits
the three files; and the image form was compared with the inline form outside the
app (below).
do anything for handouts". So the handouts frame, and with it the
smallrule, hasnot been seen in a browser.
Checked outside the app
layout, once with each SVG inline, as
masterrenders it, and once as<img src>of the same file, as this layer does, and rendered in headless Chrome157 at 560 by 220 pixels: the two screenshots are byte-identical, with the
outline, half-grey and black flags in place and the middle button selected. The
page used stand-in styles for the button and its layout classes, the same in both
renderings, not Paragon's or the app's stylesheet. So this holds that an image
draws what the inline SVG drew; it does not show the card in the app, which
step 5 would have.
2a1a017b) and at its portcommit alone (
c2315c2d), 2026-11-12: all pass. Head: 41 suites, 543 passed, 11skipped, 100% of lines. Port commit: 525 passed, 11 skipped, 98.4% of lines. The
CI site build emits the three flag files and the
learning-outlinechunk.Left to the suite
OutlineTab.test.jsx, "Alert List" and "Links to Learning pages"OutlineTab.test.jsx, "Links to Learning pages"OutlineTab.test.jsx, "Proctoring Info Panel"AccountActivationAlert.test.tsx(#2251) andOutlineTab.test.jsx, "Account Activation Alert"OutlineTab.test.jsx, "Private Course Alert"weekly_goalandstart_coursein the addressOutlineTab.test.jsx, "Weekly Learning Goal"OutlineTab.test.jsx, "Handouts and welcome message frames"🤖 Generated with Claude Code