Skip to content

style: Fixing nits about sync units [FC-0097] #2319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

ChrisChV
Copy link
Contributor

@ChrisChV ChrisChV commented Jul 22, 2025

Description

  • Stay visible the sync icon in the course outline
  • Update the message in the sync unit modal
  • Add warning banner about units in the libraries sync page

Supporting information

Testing instructions

  • Go to the library home of a library
  • Create a unit on a library. Publish the unit
  • Go to the course outline. Add the unit from the library.
  • Go to the library and update the unit name. Publish the unit
  • Go to the course outline and verify that the sync button stays visible on the unit card.
  • Click the sync button, verify the new message of the preview modal.
  • Go to Content > Library updated, and verify the new warning about unit updates

Other information

  • These changes are going to be backported to Teak

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).
  • Deprecated propTypes, defaultProps, and injectIntl patterns are not used 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.
  • Imports avoid using ../. To import from parent folders, use @src, e.g. import { initializeMocks } from '@src/testUtils'; instead of from '../../../../testUtils'

* Stay visible the sync icon in the course outline
* Update the message in the sync unit modal
* Add warning banner about units in the libraries sync page
@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Jul 22, 2025
@openedx-webhooks
Copy link

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.


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.

@ChrisChV ChrisChV requested a review from bradenmacdonald July 22, 2025 20:11
@ChrisChV
Copy link
Contributor Author

Hi @bradenmacdonald could you review this PR and the backport #2320?

Copy link

codecov bot commented Jul 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.47%. Comparing base (6ce7b86) to head (914cc23).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2319   +/-   ##
=======================================
  Coverage   94.47%   94.47%           
=======================================
  Files        1169     1169           
  Lines       25134    25138    +4     
  Branches     5367     5369    +2     
=======================================
+ Hits        23745    23749    +4     
  Misses       1324     1324           
  Partials       65       65           

☔ 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.

@bradenmacdonald
Copy link
Contributor

bradenmacdonald commented Jul 23, 2025

@ChrisChV CC @sdaitzman @edschema

Thanks! The code looks good but I notice some issues:

  1. The sync button has no tooltip nor explanation, so it may be confusing as to what it does. Only users with screen readers will get the explanation at the moment.
  2. The pencil "Edit" button for library-linked units (second one in the video) doesn't have the "blue circle" when you hover over it, but the pencil "Edit" button for regular units (first one in the video) does. I think they should both have the same hover effect.
  3. The "Draft" buttons are mis-aligned. Maybe that's fine, because it makes the sync button more obvious?
Screen.Recording.2025-07-23.at.10.22.39.AM.mov

This may be out of scope, but when I click the sync button, this dialog is very confusing: "The old version preview is the previous library version" (???). First of all, just parsing this sentence is hard. Is it saying "The old 'version preview' is the previous 'library version'?" or "The 'old version' preview is the 'previous' library version"? I can figure out what it means, but it's definitely confusing, and I think it's presented with way too much emphasis for such a subtle distinction. Plus, there is no actual preview at all (for units), so why do we care?

Screenshot 2025-07-23 at 10 26 19 AM

✅ This part looks good:

Screenshot 2025-07-23 at 10 27 53 AM

@edschema
Copy link

@bradenmacdonald thanks for the detailed look and review. I agree, the hover behavior should be consistent between library and locally created containers:

  • edit pencil should appear when hovering over the block header
  • if hovering over the edit pencil, the icon should have the blue hover circle state
    For library blocks, sync icon should persist, and change to hover state on hover.

I'm okay with the draft chip alignment shifting with the sync icon. Is that okay with you @sdaitzman?

On Unit sync: Agreed on the messaging and (non) utility with no available previews, but I want to hold off on making any suggestions until we have a bit more clarity on the scope sync in Ulmo..!

@ChrisChV
Copy link
Contributor Author

@bradenmacdonald @edschema

The pencil "Edit" button for library-linked units (second one in the video) doesn't have the "blue circle" when you hover over it, but the pencil "Edit" button for regular units (first one in the video) does. I think they should both have the same hover effect.

This happens because the "Edit" button is disabled for library-linked units. In this case, I think it would be better for the user to hide that button. Since adding the hover circle state, it would appear to be activated, but when the user clicks it, nothing happens; at first glance, it would seem like a bug. What do you think?

@bradenmacdonald
Copy link
Contributor

@ChrisChV I see. It's really not obvious to me that it's disabled. I think it needs to be more grey / faded out, or hidden altogether.

@mphilbrick211 mphilbrick211 added the FC Relates to an Axim Funded Contribution project label Jul 28, 2025
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Waiting on Author in Contributions Jul 28, 2025
@ChrisChV
Copy link
Contributor Author

I see. It's really not obvious to me that it's disabled. I think it needs to be more grey / faded out, or hidden altogether.

I agree. @edschema what do you think? Are you ok with hiding the "Edit" button?

@sdaitzman
Copy link

I think it's fine in this case to hide the "Edit" button as long as the objects include a library indicator (which I think is the case as of #2167).

In a lot of cases, it's good UX practice to leave core elements like this visible and mark them as non-unavailable/inactive (in this case probably using use a lighter gray in addition to removing the highlight circle). I think it's alright in this case as long as the library unit includes a library icon. That provides some context for why the edit button is missing.

Some design guidelines for reference:
https://www.nngroup.com/articles/button-states-communicate-interaction/
https://www.smashingmagazine.com/2024/05/hidden-vs-disabled-ux/

@ChrisChV
Copy link
Contributor Author

ChrisChV commented Aug 1, 2025

@bradenmacdonald It's ready for another review

@ChrisChV
Copy link
Contributor Author

ChrisChV commented Aug 4, 2025

Hi @sdaitzman, I used the light from the paragon styles. It's the most similar to a grey, what do you think?

image

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.

@ChrisChV looks good! Thanks.

@sdaitzman
Copy link

Hi @ChrisChV, a similar style to this would makes sense to me, but it looks a bit lighter than I would expect.

I wanted to confirm whether there's a standard Paragon style for this, or other platform examples we can match. @edschema found a similar example here under the group configuration: https://app.modular-learning-preview.opencraft.hosting/authoring/course/course-v1:eddieX+ed101+1/group_configurations

Would it be possible to match this style, with a tooltip text like "This object was added from a library, so it cannot be edited" or similar?

Screen.Recording.2025-08-08.at.4.39.15.PM.mov

Apologies for the back-and-forth on this UI issue, I've been trying to track down a clear Paragon/styleguide recommendation for this case and it's a bit inconsistent within the platform. I may look into proposing a consistent style for this case to simplify this.

@ChrisChV
Copy link
Contributor Author

@bradenmacdonald This last change is ready for a review 914cc23

@sdaitzman This is the result. Thanks for the example!

image

@bradenmacdonald
Copy link
Contributor

@ChrisChV As mentioned on Slack, if this is the outline page, I think that button is just for renaming so we do want to allow renaming units even if they're from a library (right?). But on the unit page, we don't want to allow edits to components that come from a library, and their edit button should look like that.

@ChrisChV
Copy link
Contributor Author

@ChrisChV As mentioned on Slack, if this is the outline page, I think that button is just for renaming so we do want to allow renaming units even if they're from a library (right?). But on the unit page, we don't want to allow edits to components that come from a library, and their edit button should look like that.

@bradenmacdonald CC @edschema I see, you are right, but in Teak, we should leave this button disabled for units in the course outline, right?

Another question: In the Teak branch, I've tested that editing library components in the unit outline (not a unit from a library) is enabled. Is that correct?

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.

6 participants