Skip to content

Conversation

@ChrisChV
Copy link
Contributor

@ChrisChV ChrisChV commented Dec 4, 2025

Description

  • Make section, subsection and unit cards selectable in course otuline.
  • Which user roles will this change impact? "Course Author".
image image image

Supporting information

Testing instructions

  • Go to the course outline of a course
  • Create this structure Section > Subsection > Units.
  • Click in the white part of the border of the Section card. Verify the selection.
  • Click in the white part of the border of the Subsection card. Verify the selection.
  • Click in the white part of the border of the Unit card. Verify the selection.

Other information

N/A

Best Practices Checklist

We're trying to move away from some deprecated patterns in this codebase. Please
check if your PR meets these recommendations before asking for a review:

  • Any new files are using TypeScript (.ts, .tsx).
  • Avoid propTypes and defaultProps in any new or modified code.
  • Tests should use the helpers in src/testUtils.tsx (specifically initializeMocks)
  • Do not add new fields to the Redux state/store. Use React Context to share state among multiple components.
  • Use React Query to load data from REST APIs. See any apiHooks.ts in this repo for examples.
  • All new i18n messages in messages.ts files have a description for translators to use.
  • Avoid using ../ in import paths. To import from parent folders, use @src, e.g. import { initializeMocks } from '@src/testUtils'; instead of from '../../../../testUtils'

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Dec 4, 2025
@openedx-webhooks
Copy link

openedx-webhooks commented Dec 4, 2025

Thanks for the pull request, @ChrisChV!

This repository is currently maintained by @bradenmacdonald.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@github-project-automation github-project-automation bot moved this to Needs Triage in Contributions Dec 4, 2025
@ChrisChV ChrisChV marked this pull request as draft December 4, 2025 20:37
@codecov
Copy link

codecov bot commented Dec 4, 2025

Codecov Report

❌ Patch coverage is 92.50000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.98%. Comparing base (2209242) to head (f26179d).

Files with missing lines Patch % Lines
src/course-outline/section-card/SectionCard.tsx 81.81% 2 Missing ⚠️
.../course-outline/subsection-card/SubsectionCard.tsx 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2732      +/-   ##
==========================================
- Coverage   94.99%   94.98%   -0.01%     
==========================================
  Files        1256     1256              
  Lines       28800    28835      +35     
  Branches     6538     6542       +4     
==========================================
+ Hits        27358    27390      +32     
- Misses       1384     1387       +3     
  Partials       58       58              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mphilbrick211 mphilbrick211 added the FC Relates to an Axim Funded Contribution project label Dec 11, 2025
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Waiting on Author in Contributions Dec 11, 2025
@ChrisChV ChrisChV changed the title Make sections/subsections/units selectable in course outline feat: Make sections/subsections/units selectable in course outline [FC-0114] Dec 16, 2025
@ChrisChV ChrisChV force-pushed the chris/FAL-4292-selection-states branch from 07ca2eb to 6a639d0 Compare December 19, 2025 19:41
@ChrisChV ChrisChV force-pushed the chris/FAL-4292-selection-states branch from 6a639d0 to e7903e9 Compare January 6, 2026 14:35
@ChrisChV ChrisChV marked this pull request as ready for review January 7, 2026 00:13
Copy link
Contributor

@navinkarkera navinkarkera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ChrisChV Nice work!

👍

  • I tested this: (Verified selection conditions)
  • I read through the code
  • I checked for accessibility issues
  • Includes documentation

to={titleLink}
title={title}
>
<span className={`${namePrefix}-card-title mb-0 truncate-1-line text-left`}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I forgot to update it. I added f26179d to meet the requirement The edit icon should be aligned next to the title with small titles

Copy link
Contributor

@bradenmacdonald bradenmacdonald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - just some minor questions / optional suggestions.

I'm also wondering if we should be storing the selected container in the URL (instead of the React state), so people can share links? Could be useful on courses with huge outlines.

Comment on lines +161 to +162
/* This is a special case; we can skip accessibility here since the
{Container}Card handles that. This onClick allows the user to select the card
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So can you "select" the card by tabbing onto it and pressing SPACE or something?

Also, this says Card handles that, but in this PR I see keyboard-related code is in SortableItem - is that what you're talking about or is that something else?

const [selectedContainerId, setSelectedContainerId] = useState<string | undefined>();

const openContainerInfoSidebar = useCallback((containerId: string) => {
if (getConfig().ENABLE_COURSE_OUTLINE_NEW_DESIGN?.toString().toLowerCase() === 'true') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Should/could we put getConfig().ENABLE_COURSE_OUTLINE_NEW_DESIGN?.toString().toLowerCase() === 'true' into a constant or a helper function somewhere? That seems complicated to write all that out every time we check this setting.

It could even be a waffle flag, then you can use useWaffleFlags and people can test it on a course-by-course basis. Not saying it needs to be though, this is fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FC Relates to an Axim Funded Contribution project open-source-contribution PR author is not from Axim or 2U

Projects

Status: Waiting on Author

Development

Successfully merging this pull request may close these issues.

5 participants