[NTH - FE] Keep subsection competency pills inside their cards at narrow widths
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 88/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- react, scss, typescript
- Área
- accessibility, frontend
Línea de trabajo
Empieza con src/taxonomy/competency-management/course-search/CourseOutlineSubtree.tsx y CourseSearchBrowse.scss, donde el issue identifica los estilos de las filas y las píldoras de las subsecciones. Revisa las reglas existentes para los títulos de cursos y secciones, y luego observa el esquema a 375px y con la columna del curso en escritorio más estrecha. El trabajo está terminado cuando las píldoras permanecen dentro de sus tarjetas, los IDs largos se truncan con etiquetas completas para lectores de pantalla y los IDs cortos permanecen junto al nombre de la subsección cuando hay espacio.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
User Story
As a course author working in a narrow window, I want each subsection's competency pill to stay inside its card, in order to read the subsection name and use the associate button without anything spilling off the edge.
Description
In the Courses & Content panel, each graded subsection card shows its competency pill to the right of the subsection name. At phone width (375px), or when the course column is dragged narrow on desktop, the pill sticks out past the card and the name runs into it. The pill should drop below the name when the two don't fit side by side, and a competency ID that's still too long should be shortened with an ellipsis.
Context
- Nice-to-have: responsive and mobile layouts aren't a requirement for Studio.
- Found during the browser check of https://github.com/openedx/frontend-app-authoring/pull/3376, but the layout is on
master. The blocked pill from that PR uses the same pill classes, so this covers it too.
UX Design
No Figma frame for the narrow case yet. The Acceptance Criteria describe the layout.
- Screenshot of the current overflow at 375px:
Acceptance Criteria
Scenario: Pills stay inside their cards at phone width
Given Competency Management at a 375px wide viewport
And a selected competency with a long external ID, such as "Oral Communication"
When I expand a course and a section that has graded subsections
Then every subsection's pill sits inside its card
And the page does not scroll sideways
Scenario: A wide card keeps the pill beside the name
Given a desktop-width viewport and a selected competency with a short external ID, such as "CCRS-1.3"
When I expand a course and a section that has graded subsections
Then each subsection's pill sits on the same line as its name, aligned to the right of the card
Scenario: A narrow card moves the pill below the name
Given a subsection card too narrow to fit its name and its pill side by side
When I view that subsection
Then the pill sits on its own line below the name
And the name wraps onto more lines without overlapping the pill
Scenario: An ID too long for the card is shortened inside the pill
Given a selected competency whose external ID is wider than the subsection card
When I view a subsection's applied or associate pill
Then the ID ends in an ellipsis inside the pill
And the competency icon, and the add icon on an associate pill, stay fully visible
Scenario: Screen readers still get the full ID
Given a subsection pill whose ID is shortened with an ellipsis
When a screen reader reads the associate button or the applied pill
Then it announces the full external ID
Scenario: A narrow course column at desktop width
Given a desktop-width viewport
And the divider between the competency tree and the course column dragged as far right as it goes
When I expand a course and a section that has graded subsections
Then every subsection's pill sits inside its card
Technical Details
This is a suggested approach, not the source of truth. The User Story, Description, and Acceptance Criteria define what must be true when the work is done.
Approach
SubsectionRow in CourseOutlineSubtree.tsx renders the card as one non-wrapping flex row (d-flex align-items-center justify-content-between) of an unstyled name <span> and the pill. The pill has flex-shrink: 0 and no max-width, the ID isn't truncated, and the name keeps the flex default min-width: auto, so neither can give way.
- On
&__subsection, addflex-wrap: wrapand agap(spacer 1 vertical, spacer 2 horizontal), so the pill can drop to a second line with space around it. - Give the name span a new
&__subsection-titleclass withflex: 1 1 10rem; min-width: 0; overflow-wrap: anywhere. The10rembasis decides the wrap: the pill stays beside the name while the name gets at least 10rem, and drops below it otherwise. - On
&__subsection-pill, keepflex-shrink: 0and addmin-width: 0; max-width: 100%. Keep the pill's icons and&__subsection-pill-divideratflex-shrink: 0; match the icon selectors to the rendered DOM ofCompetencyIconand Paragon'sIcon. - On
&__subsection-pill-id, addmin-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap. The associate button'saria-labeland the applied pill'ssr-onlytext already carry the full ID, so only the visible text is cut. - The blocked pill from https://github.com/openedx/frontend-app-authoring/pull/3376 shares these classes and needs no separate change.
- jsdom doesn't do layout, so check the scenarios in a browser at 375px, at desktop with the divider dragged right, and with a 40-character ID with no spaces.
Files to create and modify
| File | Change |
|---|---|
| src/taxonomy/competency-management/course-search/CourseSearchBrowse.scss | modified: wrap and gap on the row, new title class, pill and ID truncation |
| src/taxonomy/competency-management/course-search/CourseOutlineSubtree.tsx | modified: title class on the subsection name span |
Additional context
&__course-titleand&__section-titleinCourseSearchBrowse.scssalready usemin-width: 0andoverflow-wrap: anywherefor long titles in the same outline.- The "Demonstrate mastery for" heading at the top of the same column (
CriteriaAssociationsSection.tsx) already truncates the competency name and its ID badge (.competency-row__badgewithtext-truncate) with an ellipsis.
- Lenguaje dominante
- Python
- Estrellas
- 10
- Forks
- 35
- Merge medio
- 4 d 14 h
- PR fusionados (30 d)
- 20
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de openedx/openedx-core
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
openedx/openedx-core#934 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
openedx/openedx-core#922 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
openedx/openedx-core#831 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
openedx/openedx-core#827 ·
Los mantenedores suelen responder en 1 día
-
[FE] Close disabled-control tooltips with EscapePosiblemente ocupada @illiphilli la tomó hace 1 día. Abierto
openedx/openedx-core#941 · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de openedx/openedx-core
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
mozilla-ai/cq#601 ·
Los mantenedores suelen responder en 1 día
-
Bump Python to 3.14 or 3.15Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
intcomma returns exponential notation for large floatsPosiblemente ocupada @Omarinho12345 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
python-humanize/humanize#521 ·
Los mantenedores suelen responder en 1 día
-
LUCJ pass manager raises NoEdgeBetweenNodes when an edge is bad for two two-qubit gatesPosiblemente ocupada @hat-im la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
opensubtitlescom: provider rejects pt-PT even though its own converter maps itPosiblemente ocupada @paulo-0308 la tomó hoy. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Diaoul/subliminal#1405 ·