feat(course-outline): add unit title link in expanded outline view - #103
Merged
Conversation
…tionality - Updated TitleButton to support external and internal links, allowing the title to be clickable. - Added hover and focus styles for linked titles in CardHeader.scss. - Implemented tests to verify link rendering and interaction behavior in UnitCard. - Ensured that clicking the title link does not expand the unit card, while the expand button still functions as intended.
viv-helix
approved these changes
Jun 16, 2026
- Added margin-top to the CardHeader component when it has a link for improved spacing. - Replaced fragment with Stack component for better layout management of title and icon button in CardHeader.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR makes the unit title clickable in the expanded Course Outline view in Studio, allowing Course Authors to navigate directly to a unit without first expanding it.
TitleButtonnow accepts an optionaltitleLinkprop:titleLinkis not provided, the button renders exactly as before — clicking anywhere on it toggles expand/collapse.titleLinkis provided:Hyperlinkfor absolute/external URLs, or areact-router-dom-backedButton(as={Link}) for internal routes — determined by a newisExternalTitleLinkcheck (/^[a-z][a-z\d+\-.]*:/i).Buttonis overlaid across the full row (position-absolute,w-100 h-100, transparent background), so clicking anywhere except the title link toggles the unit's expanded state, while clicking the title navigates to the unit.ExpandIconvariable (previously an inlineisExpanded ? ArrowDownIcon : ArrowRightIconternary) and a sharedtitleTextelement.New
--with-linkmodifier styles inCardHeader.scss:focus-within.:focus-visibleoutline on the expand control for keyboard users.pgn__icondoesn't intercept pointer events, and fixes truncation (truncate-1-line) for the linked title content.UnitCard.tsxpassestitleLink={getTitleLink(id)}toTitleButton, wiring this new behavior into unit cards in the expanded outline view.User roles impacted: Course Author (Studio – Course Outline page).
Supporting information
Testing instructions
Other information
getTitleLink(id)already existed; this PR wires it intoTitleButton.Hyperlink,OverlayTrigger,Stack, andTooltipare existing@openedx/paragoncomponents already used elsewhere in this codebase.:focus-visiblestyling on the expand control.release-ulmorather than the default branch — double-check whether it also needs to land on the main development branch.Best Practices Checklist
.ts,.tsx) — N/A, no new files added.propTypes,defaultProps, andinjectIntlpatterns are not used in any new or modified code.src/testUtils.tsx(initializeMocks).descriptionfor translators — N/A, no new i18n messages added.../.