Description of bug
In the Web Stories editor, after uploading a new image or video, the item does not appear in the sidebar. The upload itself succeeds and the item can be inserted onto the canvas immediately through the upload flow, but it remains invisible in the sidebar until the page is fully reloaded.
To Reproduce
- In the Wagtail admin, open Web Stories and create or edit a story.
- Go to Insert, select Media.
- Upload a new image using the panel's own upload button.
- Confirm the image inserts correctly onto the canvas.
- Without reloading the page, scroll or reopen the sidebar.
- Observe: the newly uploaded image is not present in the list.
- Reload the page: the image now appears correctly.
Expected behavior
The newly uploaded image or video should appear in the sidebar immediately after upload, without requiring a full page reload.
Actual behaviour
The sidebar's list is not refreshed after an upload. The only observed way to force a refresh is changing the type filter drop down (All Types, Images, Videos), which is not a practical workaround for end users. Furthermore, on the first toggle after an upload, a brief visual duplication of thumbnails is observed. This is not a data issue, verified using the network tab that only one clean set of requests activates per filter change.
Desktop (please complete the following information):
- OS: Fedora 44
- Python: 3.12
- Django: 5.2.14
- Wagtail: 7.3.2
- wagtail-webstories-editor: 0.3.0
- Browser: Firefox 153.0
Additional context
This was investigated alongside a separate, fix-pending-review pagination bug in the Web Stories sidebar (wmo-raf/wagtail-webstories-editor, see: erick-otenyo/wagtail-webstories-editor#3), where images beyond the first 20 in the library never appeared at all. That issue is unrelated in root cause and this report covers the remaining, separate refresh behaviour.
Investigation notes
-
Switching sidebar tabs (Insert to Style and back) does not trigger a refresh.
-
Changing the media type filter does trigger a refresh. Confirmed via network tab, a fresh pair of paginated image requests activates when the filter changes, and the newly uploaded item appears afterward.
-
This filter-triggered refresh is not usable as a fix or workaround:
- The filter control has no stable identifier to target programmatically. Its DOM id is randomly generated per render, no
aria-label or data-testid present. Matching on its visible text is fragile given the UI supports multiple languages.
- Triggering it causes thumbnails to render duplicated on the first toggle after an upload. This is visual only, not a real duplication, confirmed one clean request pair per click, ruling out a network race. Subsequent toggles clear the duplication.
-
The upload flow inserts the new media directly onto the canvas without updating whatever internal state the sidebar's gallery component uses to track its current list, so the two go out of sync.
-
This behaviour traces to the Web Stories editor's underlying JavaScript library (@googleforcreators/story-editor, bundled via the wagtail-webstories-editor package that ClimWeb depends on for this feature) rather than to ClimWeb's own code.
Description of bug
In the Web Stories editor, after uploading a new image or video, the item does not appear in the sidebar. The upload itself succeeds and the item can be inserted onto the canvas immediately through the upload flow, but it remains invisible in the sidebar until the page is fully reloaded.
To Reproduce
Expected behavior
The newly uploaded image or video should appear in the sidebar immediately after upload, without requiring a full page reload.
Actual behaviour
The sidebar's list is not refreshed after an upload. The only observed way to force a refresh is changing the type filter drop down (All Types, Images, Videos), which is not a practical workaround for end users. Furthermore, on the first toggle after an upload, a brief visual duplication of thumbnails is observed. This is not a data issue, verified using the network tab that only one clean set of requests activates per filter change.
Desktop (please complete the following information):
Additional context
This was investigated alongside a separate, fix-pending-review pagination bug in the Web Stories sidebar (
wmo-raf/wagtail-webstories-editor, see: erick-otenyo/wagtail-webstories-editor#3), where images beyond the first 20 in the library never appeared at all. That issue is unrelated in root cause and this report covers the remaining, separate refresh behaviour.Investigation notes
Switching sidebar tabs (Insert to Style and back) does not trigger a refresh.
Changing the media type filter does trigger a refresh. Confirmed via network tab, a fresh pair of paginated image requests activates when the filter changes, and the newly uploaded item appears afterward.
This filter-triggered refresh is not usable as a fix or workaround:
aria-labelordata-testidpresent. Matching on its visible text is fragile given the UI supports multiple languages.The upload flow inserts the new media directly onto the canvas without updating whatever internal state the sidebar's gallery component uses to track its current list, so the two go out of sync.
This behaviour traces to the Web Stories editor's underlying JavaScript library (
@googleforcreators/story-editor, bundled via thewagtail-webstories-editorpackage that ClimWeb depends on for this feature) rather than to ClimWeb's own code.