Skip to content

Conversation

@navinkarkera
Copy link
Contributor

@navinkarkera navinkarkera commented May 26, 2025

Description

  • Adds section and subsection library pages.
  • Refactors routing to support them and fix routing from collections page to other pages.
  • Refactors library context to reliably set component, unit, and other container ids even when the url changes when user goes back in history rapidly.

Useful information to include:

  • Which edX user roles will this change impact? Common user roles are "Learner", "Course Author"
    "Developer", and "Operator".
2025-05-30.11-57-52.mp4

Supporting information

Testing instructions

Other information

Include anything else that will help reviewers and consumers understand the change.

  • Does this change depend on other changes elsewhere?
  • Any special concerns or limitations? For example: deprecations, migrations, security, or accessibility.

@openedx-webhooks openedx-webhooks added open-source-contribution PR author is not from Axim or 2U core contributor PR author is a Core Contributor (who may or may not have write access to this repo). labels May 26, 2025
@openedx-webhooks
Copy link

openedx-webhooks commented May 26, 2025

Thanks for the pull request, @navinkarkera!

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.

@navinkarkera navinkarkera marked this pull request as ready for review June 3, 2025 09:48
@navinkarkera navinkarkera requested a review from rpenido June 3, 2025 09:48
@navinkarkera
Copy link
Contributor Author

@rpenido Ready for another round of review.

*/
export function getBlockType(usageKey: string): string {
if (usageKey && usageKey.startsWith('lb:')) {
if (usageKey && (usageKey.startsWith('lb:') || usageKey.startsWith('lct:'))) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This change means we don't really need getContainerTypeFromId -- since it's only really used in one place, could we move its tests over to this method and remove it entirely?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. aea42e8

Copy link
Contributor

@rpenido rpenido left a comment

Choose a reason for hiding this comment

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

LGTM 👍
Thank you for your work, @navinkarkera!

  • I tested this using the instructions from the PR
  • I read through the code
  • I checked for accessibility issues
  • Includes documentation

Comment on lines 13 to 14
children?: React.ReactNode | null,
actions: React.ReactNode | null,
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: ReactNode typing already includes null

Suggested change
children?: React.ReactNode | null,
actions: React.ReactNode | null,
children?: React.ReactNode,
actions: React.ReactNode,

}
}
navigateTo({ [`${containerType}Id`]: containerKey });
}, [containerKey, infoSidebarIsOpen]);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit

Suggested change
}, [containerKey, infoSidebarIsOpen]);
}, [containerKey, infoSidebarIsOpen, navigateTo]);

@ChrisChV
Copy link
Contributor

ChrisChV commented Jun 4, 2025

@navinkarkera Do you think you can solve this issue in this task? It's the same as #2008 (comment)

Captura desde 2025-06-03 22-22-05

@ChrisChV
Copy link
Contributor

ChrisChV commented Jun 4, 2025

@navinkarkera I found the following issue:

  • Create two sections
  • Create a subsection and add it to both sections
  • Open one section.
  • Open the other section.
  • Edit the title of the subsection
  • Return to the first section. Bug: The new tittle of the subsection is not reflected, you need to refresh the page.

Copy link
Contributor

@ChrisChV ChrisChV left a comment

Choose a reason for hiding this comment

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

Looks good! I left some comments and nits

});
} catch (err) {
showToast(intl.formatMessage(containerMessages.updateContainerErrorMsg));
throw err;
Copy link
Contributor

Choose a reason for hiding this comment

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

@navinkarkera is it necessary to throw the error? Doesn't this cause errors to be displayed in the interface?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

This was used to rollback the optimistic update on the edit component, but I it doesn't seem to used anymore.
@navinkarkera If you have some time, could you remove this throw?
We can also remove the catch block from the component, but we need remove all throws from the handle functions.

Copy link
Contributor

Choose a reason for hiding this comment

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

I removed/updated this on 0658029

Copy link
Contributor

Choose a reason for hiding this comment

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

@rpenido Because of this broken test, I prefer to keep the catch block, for any error thrown, intentional or unintentional

@navinkarkera
Copy link
Contributor Author

@navinkarkera I found the following issue:

* Create two sections

* Create a subsection and add it to both sections

* Open one section.

* Open the other section.

* Edit the title of the subsection

* Return to the first section. Bug: The new tittle of the subsection is not reflected, you need to refresh the page.

@ChrisChV Good catch!. Fixed it by invalidating all container queries on save: a905019

@navinkarkera navinkarkera requested a review from ChrisChV June 4, 2025 05:54
@navinkarkera
Copy link
Contributor Author

@navinkarkera Do you think you can solve this issue in this task? It's the same as #2008 (comment)

Captura desde 2025-06-03 22-22-05

I'll try and create a new PR for it. Don't want to delay this one.

Copy link
Contributor

@ChrisChV ChrisChV left a comment

Choose a reason for hiding this comment

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

Looks good! Great work!

@ChrisChV ChrisChV enabled auto-merge (squash) June 4, 2025 17:06
@ChrisChV ChrisChV merged commit dd6780f into openedx:master Jun 4, 2025
7 checks passed
@github-project-automation github-project-automation bot moved this from Waiting on Author to Done in Contributions Jun 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core contributor PR author is a Core Contributor (who may or may not have write access to this repo). open-source-contribution PR author is not from Axim or 2U

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants