The course bar selects no tab in courseware

Aperta
#359 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
38/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
react, typescript
Ambito
frontend

Direzione di ricerca

Start with CourseTabsNavigation and findActiveTab in frontend-base, then compare their URL matching with the Learning routes and the activeTabSlug behavior described in the issue. The issue leaves open how pages should identify their tab, so first resolve that design question with maintainers. Done when courseware pages, including course exit, consistently select the intended Course tab.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

The course bar selects no tab in courseware. On Learning's master, the Course tab is selected there.

Found while porting Learning's courseware container to frontend-base (openedx/frontend-app-learning#2195, part of openedx/frontend-app-learning#1905). Related to #332.

[!NOTE]
The details below were generated by Claude (Claude Code) and reviewed before posting.

Claude Plan

How the course bar picks the selected tab

  • CourseTabsNavigation marks as active the tab that findActiveTab(resolvedTabs, location.pathname) returns.
  • findActiveTab "Returns the tab whose URL pathname is the longest prefix match against pathname, or null if none match."
  • The tabs and their URLs come from the course_metadata response. The Course tab (CoursewareTab, type courseware) links to default_course_url, which by default is get_learning_mfe_home_url(course_key, url_fragment='home'): Learning's course home, …/learning/course/<course>/home.
  • Learning's courseware pages are at …/learning/course/<course>, …/<sequence> and …/<sequence>/<unit>, with the same under …/learning/preview/course/<course>, and its course exit page is at …/learning/course/<course>/course-end (routes.tsx on Learning's frontend-base branch). None of those addresses is under a tab's URL, so findActiveTab returns null and no tab is marked.

What Learning does on master

  • Each page names its tab. The courseware container renders its tab page with activeTabSlug="courseware", and so does the course exit page.
  • isActiveTab marks the tab whose id equals that slug. The Course tab's id is its type, courseware (xmodule/tabs.py: tab_dict.get('tab_id', getattr(self, 'tab_id', self.type))), so the Course tab is selected on every courseware page. The course home passes outline, which the same function maps to the Course tab: "Users see one "Course" tab."

How it was seen

  • 2026-11-18, on the branch that ports Learning's courseware container (openedx/frontend-app-learning#2195), against Tutor dev: on a unit's page the course bar showed no tab as selected. On the course home, the same course bar shows the Course tab as selected.
  • It is the first Learning page on frontend-base whose address is under none of the tabs' URLs; until that port the courseware routes rendered a placeholder.

Questions

  • Which tab, if any, should the course bar mark on a course page whose address is under no tab's URL?
  • What tells the course bar which tab a page belongs to: the tabs' URLs, something the page's app declares, or the tab data?
Lingua principale
TypeScript
Stelle
4
Fork
13
Merge medio
3g 5h
PR unite (30g)
4

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di openedx/frontend-base

Tutte le issue di openedx/frontend-base

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.