Skip to content

refactor: slash-and-burn Word Cloud BuiltIn XBlock - #38745

Open
irfanuddinahmad wants to merge 5 commits into
masterfrom
irfanuddinahmad/slash-and-burn-word-cloud-block
Open

irfanuddinahmad wants to merge 5 commits into
masterfrom
irfanuddinahmad/slash-and-burn-word-cloud-block

Conversation

@irfanuddinahmad

@irfanuddinahmad irfanuddinahmad commented Jun 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Removes the built-in Word Cloud XBlock. xblock_word_cloud.WordCloudBlock has been the default since USE_EXTRACTED_WORD_CLOUD_BLOCK = True, so the built-in code no longer runs.

Step 2 of 8 of the Slash-n-Burn Built-In XBlocks epic. Closes openedx/public-engineering#534

Merge status: ⏸️ ready for re-review; merge after openedx/xblocks-core#335 is released. The 2026-11-17 review comments are addressed in 6ab3d7ded0.
Known gap: the extracted block doesn't declare multi_device support, so mobile apps would stop rendering Word Cloud inline. The fix is openedx/xblocks-core#335. The built-in block had it.
Translations: ✅ confirmed, no hold. openedx/xblocks-core#329 and openedx/openedx-translations#85196 are merged. On a local Tutor stack (2026-11-19), pull_xblock_translations + compile_xblock_translations give xblock_word_cloud its own catalog (ar, es_419 and fr fully translated), and at runtime the block's i18n service loads it.

Changes

Deleted: xmodule/word_cloud_block.py, xmodule/assets/word_cloud/ (JS, D3 vendor libs, its own webpack.config.js), lms/templates/word_cloud.html, WordCloudBlockDisplay.css, the WordCloudBlockDisplay/WordCloudBlockEditor webpack entries, and the USE_EXTRACTED_WORD_CLOUD_BLOCK toggle.

Changed: the word_cloud entrypoint in pyproject.toml is re-pointed from xmodule.word_cloud_block:WordCloudBlock to xblock_word_cloud:WordCloudBlock. It isn't removed, because xblocks-core only registers _word_cloud_extracted (for testing), so existing word_cloud content needs this name.

Tests:

  • Kept: xmodule/tests/test_word_cloud.py and lms/djangoapps/courseware/tests/test_word_cloud.py now run against xblock_word_cloud.WordCloudBlock. Only the BuiltIn twin classes, toggle overrides and built-in-only branches were dropped. Test names and assertions are unchanged, including the pre-seeded all_words merge path in test_good_ajax_request.
  • Modified: in lms/djangoapps/courseware/tests/test_word_cloud.py, _TestWordCloudBase + TestWordCloudExtracted are now one TestWordCloud class. The plugin.PLUGIN_CACHE reset, which was only needed for the removed importlib.reload, is gone. Test bodies are unchanged.
  • Removed: none.
  • Extra coverage in xblocks-core (not required by this PR): test: port missing Word Cloud test coverage from openedx-platform xblocks-core#273 and Studio - truncates longer course settings sharing urls #318.

Epic Step 1: Post-extraction commit review

Toggle flipped 2025-12-16 (e662394398). All 3 later commits to word_cloud_block.py are cosmetic (deprecation markers #38174, import sorting, lint-amnesty). Nothing to port.

Test plan

Tested on a local Tutor nightly (master 6f85d63c7f + xblocks-core 2.0.0) through the REST APIs and a headless browser, because PR sandboxes aren't deploying (open-craft/pr-sandbox-automation#28). A box is ticked only if that flow actually ran.

Testing notes and edge cases (local Tutor nightly, 2026-11-12):

  • Empty block: a freshly created Word Cloud with no submissions renders in a V2 library preview, a course unit and the LMS. The extracted block doesn't parse data, so it doesn't hit the Annotatable empty-data 500 (Annotatable: newly created empty block in a Content Library V2 fails to render (XMLSyntaxError: Document is empty) xblocks-core#323).
  • Editor round-trip: edit → save → reload → reopen the library editor keeps every field (L2/W1, the Extracted WordCloud XBlock won't edit in a Content Library V2 xblocks-core#123 regression).
  • Submissions: a learner submits words on a reused library copy; the cloud renders and includes earlier submissions (W2). The kept tests cover the rest: several users submitting and their counts merging, plus the "already voted" error on a second submit (test_collective_users_submits), seeded all_words merging (test_good_ajax_request), unicode (test_unicode), and the Studio save handler and OLX import/export cycle (xmodule/tests/test_word_cloud.py).
  • OLX: both inline <word_cloud …/> and pointer-tag import work, and export writes a pointer tag.
  • Sync and override: a library edit syncs into the course copy (accept and ignore both work), and a course-side title override survives the sync.
  • Export vs built-in (L10): The same OLX course (every block type, inline and as a pointer tag) was imported and exported on master with USE_EXTRACTED_*_BLOCK = False (built-in) and on this branch; the word_cloud files and its unit are identical. Checked 2026-11-19.
  • Not covered: the mobile apps themselves (only the API flag; see fix: declare multi_device support on Word Cloud student_view xblocks-core#335).
V2 Library checklist: 12/12 pass

Content Libraries V2: smoke tests (historically the most fragile area for extracted blocks: openedx/xblocks-core#123, openedx/xblocks-core#132, openedx/xblocks-core#243, openedx/xblocks-core#274)

  • L1. Create the block in a V2 library; the preview renders with no 500 or console errors
  • L2. Edit → save → reload the page → reopen the editor: every field kept its value
  • L3. Publish the component; its status changes to Published
  • L4. Copy to clipboard from the library, then paste into the library and into a course unit
  • L5. In a library unit: add the block as new content, then add it as existing library content (watch for "There was an error linking the content to this container", [Test failure] TC-00338: Libraries: Unable to add existing component to a unit wg-build-test-release#556)
  • L6. Reuse in a course: add it through "Library content" in a unit, and reuse a library unit containing it from the course outline. Both render in Studio and in the LMS student view
  • L7. Sync: edit and publish in the library, then accept the update in the course and also ignore one
  • L8. Override the title on the reused copy in the course
  • L9. Library search: filtering by content type finds the block
  • L10. OLX: import as a pointer tag and inline, export as a pointer tag, and diff the export against master (which still has the built-in block) — the same OLX course (every block type, inline and as a pointer tag) was imported and exported on master with USE_EXTRACTED_*_BLOCK = False (built-in) and on this branch; the word_cloud files and its unit are identical.

Word Cloud-specific:

Library checklist compiled from the Aximprovements manual test doc (Extracted Block Tests tab) and the Ulmo test sheet's library cases. Generated using Claude Code.

Screenshots

5 screenshots (LMS, Studio unit, V2 Library)

Local Tutor nightly, 2026-11-12

Captured automatically during the local smoke tests (the sandbox isn't reachable yet, see open-craft/pr-sandbox-automation#28). All images: irfanuddinahmad/edx-platform@snb-smoke-screenshots/38745.

LMS student view (imported block) Studio course unit (authoring MFE)
lms_inline studio_unit
V2 library home V2 library component preview
library_home lib_preview
LMS: copy reused from the library (after sync + title override)
lms_reused

🤖 Generated with Claude Code

Settings

# Workaround for open-craft/pr-sandbox-automation#28: the openedx-permissions image name gets mangled.
DOCKER_IMAGE_PERMISSIONS: docker.io/overhangio/openedx-permissions:23.0.0-main

@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 Jun 11, 2026
@openedx-webhooks

openedx-webhooks commented Jun 11, 2026 •

Copy link
Copy Markdown

Thanks for the pull request, @irfanuddinahmad!

This repository is currently maintained by @openedx/wg-maintenance-openedx-platform-oncall.

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 Jun 11, 2026
@irfanuddinahmad
irfanuddinahmad force-pushed the irfanuddinahmad/slash-and-burn-word-cloud-block branch from db987da to ed55494 Compare June 11, 2026 12:52
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Waiting on Author in Contributions Jun 11, 2026
@irfanuddinahmad
irfanuddinahmad force-pushed the irfanuddinahmad/slash-and-burn-word-cloud-block branch 2 times, most recently from 19618f9 to 3313f57 Compare June 12, 2026 16:55
@farhan farhan linked an issue Jul 3, 2026 that may be closed by this pull request
10 of 11 tasks
@farhan
farhan force-pushed the irfanuddinahmad/slash-and-burn-word-cloud-block branch from 3313f57 to 4a47320 Compare July 3, 2026 08:04
@farhan

farhan commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

@irfanuddinahmad I have rebased the branch with master checks are failing.

Adding screenshots of testing word cloud block of xblocks-core will be great.

@farhan

farhan commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

Test coverage gap for the extracted Word Cloud block

After the extraction of the Word Cloud block into xblocks-contrib (openedx/xblocks-core#4), #36199 was merged in this repo, adding Studio editing support (studio_submit handler) so the Word Cloud block editor renders and saves in a Libraries v2 context (the handler was later generalized into EditingMixin by #36265). It also added test_studio_submit_handler to xmodule/tests/test_word_cloud.py, which this PR deletes.

The extracted block was never updated with this change — it uses StudioEditableXBlockMixin (submit_studio_edits) instead of the legacy studio_submit pathway, and xblocks-contrib has no equivalent test coverage for it.

The following scenarios from #36199 should be thoroughly tested against the extracted block before removing the built-in one:

  1. Studio editor rendering in a Libraries v2 context — the original bug fixed by fix: Render Word cloud block editor in libraries [FC-0076] #36199 was that the editor did not render for the word cloud block in libraries.
  2. Saving settings through the Studio editor (equivalent of test_studio_submit_handler) — submit display_name, instructions, num_inputs, num_top_words, and display_student_percents via the editor and verify each value persists on the block.
  3. Boolean field handling on save — the legacy handler received display_student_percents as the string 'True'/'False'; verify the submit_studio_edits pathway persists the correct boolean value.
  4. Save and Cancel buttons in the editor work correctly (added as part of the fix: Render Word cloud block editor in libraries [FC-0076] #36199 fix).

-- Comment has been written assisted with @claude

@farhan farhan Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it shouldn't be removed and test should run testing xblocks-core word cloud block.

It can also be moved to xblocks-core here if feasible.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Confirmed — the extracted block's tests (xblocks_contrib/word_cloud/tests/test_word_cloud.py) didn't have equivalent coverage for the scenarios this file exercises against the extracted block. Ported them in openedx/xblocks-core#273 (OLX import/export, indexibility, AJAX handler dispatch, submit_studio_edits). See the summary comment above for the full analysis.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I am not seeing any test from this file moved to xblocks-core.
Can you please look into?

@farhan farhan Jul 8, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Confirmed — none of the six integration tests from this file were migrated in xblocks-core#273. That PR only ports unit-level scenarios from xmodule/tests/test_word_cloud.py. Full breakdown and next steps are in #38745 (comment). Any new coverage will go in a separate PR.

| Generated using Claud Code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done. This file is kept in openedx-platform and now tests only the extracted block.

  • All 6 integration tests are unchanged in name and logic. They still run through BaseTestXmodule with the multi-user clients.
  • Removed only: TestWordCloudBuiltIn, the override_settings decorators, importlib.reload(word_cloud_block), and the if settings.USE_EXTRACTED_WORD_CLOUD_BLOCK: / else: branches (collapsed to the extracted path that already existed).

CI is green on d4fd4a8815.

| Generated using Claude Code

Comment thread xmodule/tests/test_word_cloud.py Resolved
@irfanuddinahmad

Copy link
Copy Markdown
Contributor Author

Thanks for the detailed write-up, @farhan — really useful. I dug into this and wanted to share what I found before we decide what (if anything) still needs to change here.

Why no source-code port is needed

The studio_submit/EditingMixin machinery added in #36199 and generalized in #36265 only applies to the legacy XModule-style editing descriptors (MetadataOnlyEditingDescriptor / SequenceDescriptor) — see the xblock_iframe.html diff in #36199, where the manual metadata-editor JS and the studio_submit handler call are explicitly gated on data['xmodule-type'] being one of those two. That code path only ever applied to the built-in word_cloud_block.py (and the pre-extraction lti_block.py).

The extracted xblocks_contrib.word_cloud.WordCloudBlock uses StudioEditableXBlockMixin instead — a different, already-standard editing pathway with its own submit_studio_edits handler that's used across many other XBlocks. It never goes through EditingMixin.studio_submit at all, so there's nothing from #36199/#36265 to port into it.

The other half of #36199 — the RequireJS/baseURL fix in xblock_iframe.html — is generic, platform-owned infrastructure, not tied to the specific block implementation. The extracted block already benefits from it automatically since it's rendered through the same iframe template.

But the test-coverage gap was real

You're right that this repo's xmodule/tests/test_word_cloud.py and lms/djangoapps/courseware/tests/test_word_cloud.py currently exercise the extracted block too (via @override_settings(USE_EXTRACTED_WORD_CLOUD_BLOCK=True)), and this PR deletes those files with no replacement. Comparing against xblocks_contrib/word_cloud/tests/test_word_cloud.py, these scenarios genuinely had no equivalent there:

  • OLX import/export round-trip
  • Search indexing (index_dictionary)
  • Handler-dispatch-level AJAX calls (going through block.handle(...), not just calling the method directly)
  • The submit_studio_edits Save pathway, including the boolean handling for display_student_percents — this is exactly scenario 2/3 from your list above, and it was already being exercised against the extracted block by the very test this PR deletes.

I opened openedx/xblocks-core#273 to port those scenarios into this repo's own suite before they're lost. All 13 tests (8 existing + 5 new) pass, and the full xblocks_contrib suite is unaffected (839 passed, no regressions).

Manual verification (scenarios 1 and 4)

Editor rendering in a Library v2 context and the Save/Cancel buttons were never covered by automated tests even in the original #36199 fix — they were verified manually, which lines up with your screenshot request from 2026-07-03. I did that manual pass in a local Tutor devstack:

  1. Created a v2 Content Library and added a Word Cloud component to it.
  2. The Studio editor rendered correctly with all 5 fields (Display Name, Inputs, Instructions, Maximum Words, Show Percents).
  3. Edited display_name, instructions, num_inputs (5→3), and display_student_percents (True→False), clicked Save — all changes persisted (confirmed via the Preview tab, which immediately showed the new title, instructions text, and exactly 3 input boxes).
  4. Clicked Cancel after making an unsaved edit — got an "Exit the editor? Any unsaved changes will be lost" confirmation, and "Discard Changes and Exit" correctly reverted to the last-saved state.

Screenshots of each step:

Library created library created
Word Cloud component added component added
Student preview renders in Library v2 student preview
Studio editor renders with correct defaults editor renders
Fields edited (incl. boolean toggle) fields edited
Save persisted correctly save persisted
Cancel — unsaved edit in progress cancel in progress
Cancel discarded the change cancel discarded

(full gist: https://gist.github.com/irfanuddinahmad/df358e2dc74bdf7b6c73db1d99b4abaf)

Given all of the above, I think this is safe to merge once #273 lands. Let me know if you'd like anything else checked.

@irfanuddinahmad
irfanuddinahmad requested a review from farhan July 7, 2026 10:24
@farhan

farhan commented Jul 8, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for the work on openedx/xblocks-core#273. I reviewed what was migrated from the two test files this PR deletes. Sharing a clearer breakdown below.

Migrated in openedx/xblocks-core#273 (from xmodule/tests/test_word_cloud.py)

Original test Migrated as Notes
test_xml_import_export_cycle test_xml_import_export_cycle ✅ Ported
test_indexibility test_indexibility ✅ Ported
test_bad_ajax_request test_bad_dispatch_request ✅ Ported (adapted for @json_handler / NoSuchHandlerError)
test_studio_submit_handler test_submit_studio_edits ✅ Ported (adapted for submit_studio_edits handler)
test_good_ajax_request test_handle_submit_state_request ⚠️ Partially ported — see below

Gap: test_good_ajax_request → test_handle_submit_state_request

The original test seeds pre-existing learner aggregate data before submit:

'all_words': {'cat': 10, 'dog': 5, 'mom': 1, 'dad': 2},

and asserts the merged result (total_count == 22, global student_words, top_words including mom/dad). The migrated test uses a fresh block with empty all_words, so it only asserts total_count == 4 — it no longer exercises the merge-with-existing-aggregates path that the original test was written for.

Not migrated (from lms/djangoapps/courseware/tests/test_word_cloud.py)

None of the integration tests from this file appear in xblocks-core#273:

  • test_initial_state
  • test_post_words
  • test_collective_users_submits
  • test_unicode
  • test_handle_ajax_incorrect_dispatch
  • test_word_cloud_constructor

These are platform integration tests (mongo modulestore, multi-user HTTP clients, fragment rendering via BaseTestXmodule) and cannot be dropped into xblocks-core as-is. We should decide separately whether a slim extracted-block-only version stays in openedx-platform, or whether that coverage is acceptable to lose.

Guidelines for completing the migration

For the remaining gaps, we will open a new PR (separate from #273 / #38745). When doing that:

  1. Keep original test names where possible — e.g. prefer test_good_ajax_request over renaming to test_handle_submit_state_request within the scope of a migration PR.
  2. Keep the original test logic as intact as possible — adapt only what the extracted block API requires (handler name, request format), not the assertions or setup unless strictly necessary.
  3. Reference the migration PR — tests ported from openedx-platform should note they originate from openedx/xblocks-core#273 / the deleted xmodule/tests/test_word_cloud.py and lms/djangoapps/courseware/tests/test_word_cloud.py files.

Once the test_good_ajax_request gap is fixed and we have a plan for the lms integration coverage, I think we can unblock this PR.

| Generated using Claud Code

@mphilbrick211 mphilbrick211 moved this from Waiting on Author to In Eng Review in Contributions Jul 13, 2026
@irfanuddinahmad
irfanuddinahmad force-pushed the irfanuddinahmad/slash-and-burn-word-cloud-block branch from e5ec0e9 to d4fd4a8 Compare November 4, 2026 11:10
@irfanuddinahmad

Copy link
Copy Markdown
Contributor Author

@farhan thanks for the detailed review. I've addressed it by keeping both test files in openedx-platform and pointing them at the extracted block, rather than relying on the port in xblocks-core#273. The branch is also rebased onto current master.

File Tests (master → this PR) What changed
xmodule/tests/test_word_cloud.py 5 → 5, same names reset_class() → WordCloudBlock; removed the TestWordCloudBuiltIn twin, override_settings and built-in-only branches
lms/djangoapps/courseware/tests/test_word_cloud.py 6 → 6, same names Removed TestWordCloudBuiltIn, override_settings, importlib.reload and built-in-only branches

Assertions on the extracted path are unchanged, including the pre-seeded all_words merge path in test_good_ajax_request that you flagged. Nothing else in either file was modified. Both test files are now listed under Changes in the PR description.

All 46 checks pass on d4fd4a8815. Could you take another look when you have a moment?

Separately, I'll update xblocks-core#273 so it doesn't duplicate this coverage.

| Generated using Claude Code

@irfanuddinahmad irfanuddinahmad added the create-sandbox open-craft-grove should create a sandbox environment from this PR label Nov 5, 2026
irfanuddinahmad added a commit to irfanuddinahmad/xblocks-core that referenced this pull request Nov 10, 2026
… seed and assertions

Restores the pre-seeded all_words/top_words merge path that the
handler-level port in openedx#273 (test_handle_submit_state_request) does not
assert. Name, setup and assertions match
openedx-platform xmodule/tests/test_word_cloud.py (openedx/openedx-platform#38745).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Irfan Ahmad and others added 4 commits November 10, 2026 12:58
Removes the built-in Word Cloud XBlock and all associated assets now that
USE_EXTRACTED_WORD_CLOUD_BLOCK has been True, making xblocks_contrib the
active implementation.

- Remove USE_EXTRACTED_WORD_CLOUD_BLOCK toggle from common.py
- Remove word_cloud entrypoint from pyproject.toml
- Delete xmodule/word_cloud_block.py (built-in class + shim)
- Delete xmodule/assets/word_cloud/ (JS assets including D3 vendor libs
  and custom webpack config)
- Delete lms/templates/word_cloud.html
- Delete xmodule/static/css-builtin-blocks/WordCloudBlockDisplay.css
- Remove WordCloudBlockDisplay/WordCloudBlockEditor webpack entries from
  webpack.builtinblocks.config.js and webpack.common.config.js
- Delete xmodule/tests/test_word_cloud.py and
  lms/djangoapps/courseware/tests/test_word_cloud.py

Closes openedx/public-engineering#534

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…dBlock

Per review on this PR, keep xmodule/tests/test_word_cloud.py and
lms/djangoapps/courseware/tests/test_word_cloud.py in openedx-platform
instead of deleting them. They already exercised the extracted block
(USE_EXTRACTED_WORD_CLOUD_BLOCK=True), and xblocks-core does not yet have
equivalent coverage (openedx/xblocks-core#273 is still open; the LMS
integration tests cannot move there as-is).

Only the BuiltIn variants, the toggle overrides and the built-in-only
branches are removed. Test names and assertions are unchanged, including
the pre-seeded all_words merge path in test_good_ajax_request.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
xblocks-core 2.0.0 (#38473) removed the xblocks_contrib package. Point the
platform entrypoint, imports and mock.patch targets at the new per-block
packages (e.g. xblocks_contrib.video.video -> xblock_video.block).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@irfanuddinahmad
irfanuddinahmad force-pushed the irfanuddinahmad/slash-and-burn-word-cloud-block branch from d4fd4a8 to 4f87536 Compare November 10, 2026 10:25

@farhan farhan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Done with the initial code review.

I am expecting testing of Extracted Word Cloud block on this PR is done, sharing testing notes/edge-cases will be great.

'error': 'Unknown Command!'
})

@XBlock.supports('multi_device')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Mobile apps lose inline rendering: the extracted block reports student_view_multi_device: false. Add this in xblocks-core src/xblock_word_cloud/block.py, and link that PR here:

@XBlock.supports("multi_device")
def student_view(self, context=None):

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Confirmed. The built-in block declares @XBlock.supports("multi_device") on student_view and the extracted one doesn't. Fixed in openedx/xblocks-core#335 (decorator plus a regression test that fails without the fix). I checked the other blocks too: only Word Cloud lost it (HTML and Problem keep theirs, and the rest never had it). The description now lists this as a known gap, and the merge waits until #335 is released.

Generated using Claude Code

Comment thread openedx/envs/common.py
# .. toggle_use_cases: temporary
# .. toggle_creation_date: 2024-11-10
# .. toggle_target_removal_date: 2026-04-10
USE_EXTRACTED_WORD_CLOUD_BLOCK = True

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verawood dev/op notes announced this removal for Willow. Add it under Deprecations & Removals in Willow dev/op notes, or confirm one entry covers all 8 blocks:

* **Removed the built-in Word Cloud block.** ``xmodule.word_cloud_block`` and the
  ``USE_EXTRACTED_WORD_CLOUD_BLOCK`` setting are removed. The Word Cloud block from
  `xblocks-core <https://github.com/openedx/xblocks-core>`_ is always used.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Opened one entry for all 8 blocks: openedx/docs.openedx.org#1554. It's a draft until the platform PRs land, so the list matches what actually ships in Willow.

Generated using Claude Code

Comment thread openedx/envs/common.py Outdated
# .. toggle_creation_date: 2024-11-10
# .. toggle_target_removal_date: 2026-04-10
USE_EXTRACTED_WORD_CLOUD_BLOCK = True

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: double blank line.

Suggested change

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 6ab3d7d.

Generated using Claude Code

Comment thread webpack.common.config.js
]
},

{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: leftover blank line.

Suggested change
{

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 6ab3d7d.

Generated using Claude Code

Comment thread pyproject.toml
videoalpha = "xmodule.video_block:VideoBlock"
videodev = "xmodule.template_block:TranslateCustomTagBlock"
word_cloud = "xmodule.word_cloud_block:WordCloudBlock"
word_cloud = "xblock_word_cloud:WordCloudBlock"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Update the "Remove the entrypoint" item in openedx/public-engineering#534 to say re-pointed, and list this under a "Changed" heading in the PR description.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done. openedx/public-engineering#534 now says "Re-point the entrypoint" (xblock_word_cloud:WordCloudBlock), and the description has a Changed heading for it.

Generated using Claude Code


@override_settings(USE_EXTRACTED_WORD_CLOUD_BLOCK=False)
class TestWordCloudBuiltIn(_TestWordCloudBase):
class TestWordCloudExtracted(_TestWordCloudBase):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit (optional): only one subclass is left, and the cache reset was only needed for the removed importlib.reload:

-class _TestWordCloudBase(BaseTestXmodule):
+class TestWordCloud(BaseTestXmodule):
     """Integration test for Word Cloud Block."""
-    __test__ = False
     ...
-        plugin.PLUGIN_CACHE = {}
 ...
-
-
-class TestWordCloudExtracted(_TestWordCloudBase):
-    __test__ = True

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in 6ab3d7d: one TestWordCloud class, without __test__ or the PLUGIN_CACHE reset (and without the now-unused from xblock import plugin). Test bodies are unchanged; 6 passed locally.

Generated using Claude Code

- Drop the extra blank lines left behind in openedx/envs/common.py and
  webpack.common.config.js.
- Collapse _TestWordCloudBase/TestWordCloudExtracted into TestWordCloud.
  The plugin cache reset was only needed for the removed
  importlib.reload, so it goes too. Test bodies are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@irfanuddinahmad

Copy link
Copy Markdown
Contributor Author

@farhan thanks for the review. Summary of the changes:

Translations: openedx/xblocks-core#329 and openedx/openedx-translations#85196 are merged and the xblock_word_cloud catalogs exist. Still to confirm: a pull_xblock_translations run.

Generated using Claude Code

irfanuddinahmad added a commit that referenced this pull request Nov 19, 2026
Same nits as reviewed on #38745:
- Drop the extra blank line left in openedx/envs/common.py after the toggle removal.
- Drop the blank line left between rules in webpack.common.config.js.
- Collapse the toggle-era base class + __test__ subclass back into the
  original test class name(s). The plugin cache reset was only needed for
  the removed importlib.reload. Test bodies are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
irfanuddinahmad added a commit that referenced this pull request Nov 19, 2026
Same nits as reviewed on #38745:
- Drop the extra blank line left in openedx/envs/common.py after the toggle removal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
irfanuddinahmad added a commit that referenced this pull request Nov 19, 2026
Same nits as reviewed on #38745:
- Drop the extra blank line left in openedx/envs/common.py after the toggle removal.
- Drop the blank line left between rules in webpack.common.config.js.
- Collapse the toggle-era base class + __test__ subclass back into the
  original test class name(s). The plugin cache reset was only needed for
  the removed importlib.reload. Test bodies are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
irfanuddinahmad added a commit that referenced this pull request Nov 19, 2026
Same nits as reviewed on #38745:
- Drop the extra blank line left in openedx/envs/common.py after the toggle removal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
irfanuddinahmad added a commit that referenced this pull request Nov 19, 2026
Same nits as reviewed on #38745:
- Drop the extra blank line left in openedx/envs/common.py after the toggle removal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
irfanuddinahmad added a commit that referenced this pull request Nov 19, 2026
Same nits as reviewed on #38745:
- Drop the extra blank line left in openedx/envs/common.py after the toggle removal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
irfanuddinahmad added a commit that referenced this pull request Nov 19, 2026
Same nits as reviewed on #38745:
- Drop the extra blank line left in openedx/envs/common.py after the toggle removal.
- Collapse the toggle-era base class + __test__ subclass back into the
  original test class name(s). The plugin cache reset was only needed for
  the removed importlib.reload. Test bodies are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@irfanuddinahmad

Copy link
Copy Markdown
Contributor Author

@farhan I ran your translation steps on a local Tutor stack (2026-11-19):

rm -rf conf/plugins-locale/xblock.v1/*
python manage.py lms pull_xblock_translations --verbose
python manage.py lms compile_xblock_translations
  • Pull: all 9 xblocks-core/xblock_* catalogs were found and copied (34–40 languages each). ar, es_419 and fr are fully translated, e.g. xblock_word_cloud 20/20, xblock_problem 214/214 and xblock_video 128/128, and every .mo compiled.
  • Runtime: for all 8 block types, with ar active, XBlockI18nService(block) loads the block's own catalog, and strings translate ("Display Name" → "الاسم الظاهر"). This stack's conf/locale has no platform ar catalog, so these strings were translated only through the new block catalogs, which is the situation once the built-ins are removed.
  • No JS catalogs were built, as expected: no block sets i18n_js_namespace (i18n: strings that bypass the block catalog (JS namespace, remote_exec, lti_form) xblocks-core#332).

So the translation hold is lifted for Word Cloud, Poll, HTML and Discussion. Annotatable, Video and Problem still wait on #332 for their JS strings (plus remote_exec.py for Problem), and LTI for lti_form.html. The PR descriptions are updated.

Generated using Claude Code

This branch has not been deployed

No deployments
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). create-sandbox open-craft-grove should create a sandbox environment from this PR open-source-contribution PR author is not from Axim or 2U

Projects

Status: In Eng Review

Development

Successfully merging this pull request may close these issues.

[Refactor] Slash-n-Burn Word Cloud BuiltIn XBlock

3 participants