33 Commits

Author SHA1 Message Date
Irtaza Akram
474dc71f0d chore: remove legacy problem studio view (#37795)
* fix: remove legacy problem studio view and resource templates
2026-01-08 13:07:15 +05:00
Irtaza Akram
c3e85426cb Autoformat Problem XBlock Source Files for Consistency (2/2) (#37487)
* fix: run prettier on problem block code

* fix: codeql issues
2025-12-08 20:01:42 +05:00
Stanislav Lunyachek
0d6c8339b1 fix: Video Xblock - position dropdown menus relative to control bar height 2025-12-03 14:22:40 -03:00
Muhammad Faraz Maqsood
0481d9a0b1 fix: accessibility issue on video transcripts (#37587)
This commit fixes accessibility issue for video transcripts as when a
video component's SRT file has an empty line, the transcript has an
empty link that is still interactive.

Empty links should not be interactive and should be hidden from
keyboard users as it takes extra click for them when an empty line
occurs in the transcript.

Co-authored-by: Muhammad Faraz  Maqsood <faraz.maqsood@A006-01130.local>
2025-11-26 11:17:48 -05:00
salmannawaz
7f0375b6b9 Remove branding related code from video xblock. (#37491)
* chore: remove branding related code from video_block class as it is stop being used, we have plan to remove the specialized VIDEO_CDN_URL in the next phase as after removing URL nothing will reference the branding code so we're removing it first.
2025-11-01 09:22:45 +05:00
Ihor Romaniuk
900706b1e5 fix: improve styling of headers+lists in LMS+Studio (#34867) 2025-10-20 17:26:03 -07:00
ihor-romaniuk
763a83779c fix: add missing styles 2025-09-17 15:43:18 -03:00
ihor-romaniuk
5972b40b2f fix: styles for share video functionality of the video xblock 2025-09-17 14:31:12 -03:00
kshitij.sobti
0fbfc1cf54 feat: Use dropdown for units when more then 15
When dealing with subsections that have a lot of units, show a dropdown for
unit selection to simplify navigation.
2025-08-21 17:42:02 +05:30
Rodrigo Martin
bf53eaa9bb fix: video transcript links wrapping up (#36428) 2025-03-25 10:56:23 -03:00
Rodrigo Martin
8d00b093c3 fix: video transcript links wrapping up (#36392) 2025-03-19 14:39:03 -03:00
Saad Yousaf
790fdcf05a fix: fix accessibility issue with video editor speed option selected speed 2025-03-03 13:21:45 +05:00
Muhammad Farhan Khan
95403c570d chore: Adds fallback values to the xmodule xblocks global css variables (#36183)
* chore: Adds fallback values to the xmodule builtin blocks global css variables
2025-02-11 19:41:34 +05:00
Muhammad Farhan Khan
26afafa81f chore: clean up built in blocks css (#35854)
* chore: clean up built in blocks css

* chore: Address PR change request
2024-11-18 10:10:18 +05:00
Muhammad Farhan Khan
421f28f25d Merge pull request #35811 from openedx/farhan/problem-sass-to-css
feat!: Drop sass support from problem/cappa xblocks
2024-11-13 12:03:38 +05:00
Muhammad Farhan Khan
0181068756 Merge pull request #35759 from openedx/farhan/sass-to-css-custom-tag-block-2
feat!: Replace sass with vanilla css in custom tag block
2024-11-13 11:58:18 +05:00
Rômulo Penido
31d170a687 fix: image aspect ratio on component preview (#35790)
Co-authored-by: Jillian Vogel <jill@opencraft.com>
2024-11-08 18:55:37 +05:30
farhan
9b4e805a0a feat!: Drop sass support from porblem/cappa xblocks 2024-11-08 17:22:48 +05:00
farhan
b29a51ecf9 feat!: Replace sass with vanilla css in custom tag block 2024-11-08 09:40:43 +05:00
M. Tayyab Tahir Qureshi
01985e0c32 feat! Dropping Sass support from builtin Sequence block (#35770)
feat!: Dropping Sass support from builtin sequence block

Co-authored by @ttqureshi
2024-11-05 17:27:12 +05:00
M. Tayyab Tahir Qureshi
b7d08fb61b feat! Dropping Sass support from builtin LTI block (#35769)
feat!: Dropping Sass support from builtin LTI block

Co-authored by @ttqureshi
2024-11-05 17:26:45 +05:00
Muhammad Farhan Khan
29845683f7 Merge pull request #35719 from openedx/farhan/sass-to-css-html-block-2
feat!: Dropping Sass support from builtin html block
2024-10-30 21:23:34 +05:00
farhan
f52050712c feat!: Dropping Sass support from builtin html block, replacing with vanilla CSS 2024-10-30 11:17:52 +05:00
farhan
55aeca65c2 feat!: Dropping Sass support from builtin poll block, replacing with vanilla CSS 2024-10-30 11:17:37 +05:00
Muhammad Farhan Khan
64d0d51072 Merge pull request #35717 from openedx/farhan/sass-to-css-wordcloud-block-2
feat!: Dropping Sass support from builtin word cloud block
2024-10-28 21:27:01 +05:00
farhan
7fce06a11b feat!: Dropping Sass support from builtin word cloud block, replacing with vanilla CSS 2024-10-28 20:24:19 +05:00
Muhammad Farhan Khan
1283fdde8e Dropping Sass support from builtin annotatable block (#35716)
* feat!: Dropping Sass support from builtin annotatable block, replacing with vanilla CSS
2024-10-28 20:22:06 +05:00
farhan
8fb5b778c3 feat!: Dropping Sass support from builtin video block, replacing with vanilla CSS 2024-10-23 18:40:30 +05:00
Kyle McCormick
127c5c1ce2 fix: make built-in XBlock Sass theme-aware again
In ~Palm and earlier, all built-in XBlock Sass was included into LMS and CMS
styles before being compiled. The generated CSS was coupled together with
broader LMS/CMS CSS. This means that comprehensive themes have been able to
modify built-in XBlock appearance by setting certain Sass variables. We say that
built-in XBlock Sass was, and is expected to be, "theme-aware".

Shortly after Palm, we decoupled XBlock Sass from LMS and CMS Sass [1]. Each
built-in block's Sass is now compiled into two separate CSS targets, one for
block editing and one for block display. The CSS, now located at
`common/static/css/xmodule`, is injected into the running Webpack context with
the new `XModuleWebpackLoader`. Built-in XBlocks already used
`add_webpack_to_fragment` in order to add JS Webpack bundles to their view
fragments, so when CSS was added to Webpack, it Just Worked.

This unlocked a slieu of simplifications for static asset processing [2];
however, it accidentally made XBlock Sass theme-*unaware*, or perhaps
theme-confused, since the CSS was targeted at `common/static/css/xmodule`
regardless of the theme. The result of this is that **built-in XBlock views will
use CSS based on the Sass variables _last theme to be compiled._** Sass
variables are only used in a handful of places in XBlocks, so the bug is subtle,
but it is there for those running off of master. For example, using edX.org's
theme on master, we can see that there is a default blue underline in the Studio
sequence nav [3]. With this bugfix, it becomes the standard edX.org
greenish-black [4].

This commit makes several changes, firstly to fix the bug, and secondly to leave
ourselves with a more comprehensible asset setup in the `xmodule/` directory.

* We remove the `XModuleWebpackLoader`, thus taking built-in XBlock Sass back
  out of Webpack.

* We compile XBlock Sass not to `common/static/css/xmodule`, but to:

  * `[lms|cms]/static/css` for the default theme, and
  * `<THEME_ROOT>/[lms|cms]/static/css`, for any custom theme.

  This is where the comprehensive theming system expects to find themable
  assets. Unfortunately, this does mean that the Sass is compiled twice, both
  for LMS and CMS. We would have liked to compile it once to somewhere in the
  `common/`, but comprehensive theming does not consider `common/` assets to be
  themable.

* We split `add_webpack_to_fragment` into two more specialized functions:
  * `add_webpack_js_to_fragment` , for adding *just* JS from a Webpack bundle,
    and
  * `add_sass_to_fragment`, for adding static links to CSS compiled themable
    Sass (not Webpack). Both these functions are moved to a new module
    `xmodule/util/builtin_assets.py`, since the original module
    (`xmodule/util/xmodule_django.py`) didn't make a ton of sense.

* In an orthogonal bugfix, we merge Sass `CourseInfoBlock`, `StaticTabBlock`,
  `AboutBlock` into the `HtmlBlock` Sass files. The first three were never used,
  as their styling was handled by `HtmlBlock` (their shared parent class).

* As a refactoring, we change Webpack bundle names and Sass module names to be
  less misleading:
  * student_view, public_view, and author_view: was `<Name>BlockPreview`, is now
    `<Name>BlockDisplay`.
  * studio_view: was `<Name>BlockStudio`, is now `<Name>BlockEditor`.

* As a refactoring, we move the contents of `xmodule/static` into the existing
  `xmodule/assets` directory, and adopt its simper structure. We now have:
  *  `xmodule/assets/*.scss`: Top-level compiled Sass modules. These could be
     collapsed away in a future refactoring.
  * `xmodule/assets/<blocktype>/*`: Resources for each block, including both JS
    modules and Sass includes (underscore-prefixed so that they aren't
    compiled). This structure maps closely with what externally-defined XBlocks
    do.
  * `xmodule/js` still exists, but it will soon be folded into the
    `xmodule/assets`.

* We add a new README [4] to explain the new structure, and also update a
  docstring in `openedx/lib/xblock/utils` which had fallen out of date with
  reality.

* Side note: We avoid the term "XModule" in all of this, because that's
  (thankfully) become a much less useful/accurate way to describe these blocks.
  Instead, we say "built-in XBlocks".

Refs:
1. https://github.com/openedx/edx-platform/pull/32018
2. https://github.com/openedx/edx-platform/issues/32292
3. https://github.com/openedx/edx-platform/assets/3628148/8b44545d-0f71-4357-9385-69d6e1cca86f
4. https://github.com/openedx/edx-platform/assets/3628148/d0b7b309-b8a4-4697-920a-8a520e903e06
5. https://github.com/openedx/edx-platform/tree/master/xmodule/assets#readme

Part of: https://github.com/openedx/edx-platform/issues/32292
2023-07-06 11:58:06 -04:00
Jesper Hodge
799c0bf8a8 fix: problem dropdown does not cover text anymore (#32605) 2023-06-29 12:51:26 -04:00
Kyle McCormick
a903230a74 revert build: common/static/css/xmodule -> xmodule/static/css (#32291)" (#32526)
This reverts commit 5671dab975.

The original PR is causing styling issues due to broken CSS references
on studio.edx.org.

See https://github.com/openedx/edx-platform/issues/32292 for follow-up.
2023-06-21 14:23:36 -04:00
Kyle McCormick
5671dab975 build: common/static/css/xmodule -> xmodule/static/css (#32291)
Now that all XModule SCSS is located in xmodule/static/sass,
it would make sense to co-locate the CSS there as well.

We also add a README to explain the purpose of this new folder.

In the future, we will move xmodule/js and xmodule/assets
into xmodule/static as well.

Part of: https://github.com/openedx/edx-platform/issues/32292
2023-06-20 08:05:05 -04:00
Kyle McCormick
0b455e0336 build: commit XModule SCSS entrypoints of generating them (#32290)
`xmodule_assets` generated a series of SCSS "entrypoint"
files, where each entrypoint file imported from the
SCSS "sources" in xmodule/css.

This process was more complicated up until very
recently (see PRs in issue linked below for more
context). Now that the process is simpler, though,
there is no reason to generate the SCSS entrypoints;
we can just commit them to the repository instead!
So, we go from this:

    # GENERATED: SCSS entrypoints files for CMS
    common/static/xmodule/descriptors:
       AboutBlockStudio.scss
       AnnotatableBlockStudio.scss
       ...
    # GENERATED: SCSS entrypoints files for LMS
    common/static/xmodule/modules:
       AboutBlockPreview.scss
       AnnotatableBlockPreview.scss
       ...
    # VERSION CONTROLLED: SCSS source files
    xmodule/css:
      annotatable/...
      capa/...
      ...

to this:

    # VERSION CONTROLLED: All XModule SCSS
    xmodule/static/sass:
      # Source files
      include:
        annotatable/...
        capa/...
        ...
      # CMS entrypoint files
      cms:
        AboutBlockStudio.scss
        AnnotatableBlockStudio.scss
        ...
      # LMS source files
      lms:
        AboutBlockPreview.scss
        AnnotatableBlockPreview.scss
        ...

Also, we are able to remove all SCSS-related logic from the
`xmodule_assets` script and from the `HTMLSnippet` class.
XModule JS assets still need processing, but we will address
those in a separate series of PRs.

Part of: https://github.com/openedx/edx-platform/issues/32292
2023-06-16 08:51:03 -04:00