Skip to content

React python 3.14 - #2199

Open
zzacharo wants to merge 50 commits into
mainfrom
react-python-3.14
Open

zzacharo wants to merge 50 commits into
mainfrom
react-python-3.14

Conversation

@zzacharo

Copy link
Copy Markdown
Contributor

No description provided.

zzacharo and others added 30 commits November 14, 2026 14:22
The subtitles of a preview file are (uri, language, autogenerated)
triples, which made the template fail with a ValueError whenever a video
with subtitles was previewed without THEOplayer (e.g. locally).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmfTf2TMh3FihoVLSA
Port every page of the bootstrap3 (AngularJS) theme to a semantic-ui
theme built with React, keeping the same look and behaviour:

* page layout, header search with suggestions, footer and announcements
* home page widgets and search page (react-searchkit with the CDS facets,
  year histogram, sort and pagination)
* video and project record pages (player, share, downloads, chapters,
  transcripts, related videos, statistics)
* deposit index and deposit editor (project and videos, Formik forms with
  Semantic UI fields, uploads, tasks, actions and validation errors)
* report numbers, record deletion, login, settings and error pages

The new theme lives in cds/modules/theme/assets/semantic-ui and in the
semantic-ui template folders. It is selected with
APP_THEME = ["semantic-ui"], so both interfaces can run side by side on
the same database with scripts/semantic-ui.

Other changes:

* invenio-search-ui 3.0.1 (the Python side is the same as 2.9.1) for
  react-searchkit
* SETTINGS_TEMPLATE points to a CDS template so that each theme gets its
  own settings layout

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmfTf2TMh3FihoVLSA
Make the React and Semantic UI interface the only one:

* APP_THEME is now ["semantic-ui"] and the webpack bundle only has the
  semantic-ui theme, so none of the AngularJS, Bootstrap 3,
  invenio-search-js and angular-schema-form packages are installed
* remove the bootstrap3 assets, the AngularJS templates served from the
  static folders and the angular-schema-form forms of the deposit
* remove the Jinja templates replaced by their semantic-ui versions, and
  the AngularJS only invenio_deposit and deposit header templates
* remove the configuration of the AngularJS templates
* remove scripts/semantic-ui, only needed to run both interfaces

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmfTf2TMh3FihoVLSA
Move the package metadata, dependencies and entry points from setup.cfg
and setup.py to pyproject.toml (PEP 621), and lock the dependencies in
uv.lock, as cds-rdm does:

* uv.lock has the exact versions of requirements.txt, which is removed.
  It also locks the dependencies of marshmallow-utils that
  requirements.txt did not pin, at the versions pip installed
* declare srt-to-vtt, imported by the deposit, and setuptools<82, as
  pkg_resources is still imported at runtime
* the tests extra becomes the dev dependency group, without its
  importlib-metadata<8 cap, so that the tests run with the production
  version (8.5.0)
* .python-version selects Python 3.9 for uv, and .venv is ignored
* the license metadata is the SPDX expression of the LICENSE file
* scripts, CI and the Docker image install with uv sync
* the pytest configuration moves to pytest.ini, since pytest 5 does not
  read pyproject.toml

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmfTf2TMh3FihoVLSA
Replace the loading spinners of the React interface with Semantic UI
placeholders shaped like the content that is loading, so the pages keep
their layout until the data arrives:

* search page: the video grid, the result count and the facets
* deposit list: the projects and the facets
* home page: the featured video player and the recent videos, masked
  with the colors of their dark sections
* deposit form: the project and video panels while an existing project
  loads, instead of the upload area of a new project

The facets show placeholders on the first load only, later searches keep
them in place. The related videos of a record still load silently.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmfTf2TMh3FihoVLSA
The loading bar of the deposit form waited for the requests that run in
the background, so it stayed until the video players had loaded:

* the refresh of the project right after it is shown, which competes
  with the video streams of the players
* the polling of the task statuses, every 5 seconds while tasks run
* the upload of the video and the start of its workflow, whose progress
  is already shown in the video panel

These requests now use ``ignoreLoadingBar``. The bar still shows while
the project loads, and while saving, publishing or deleting.

The bar also missed the requests started before it was mounted, so on
page load it mostly showed the background refresh. It now picks up the
requests already pending when it subscribes, which also brings back the
bar on the first load of the search pages.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmfTf2TMh3FihoVLSA
The edit page now embeds the project, serialized like
``GET /api/deposits/project/<pid>``, so the form and the titles show from
the first render instead of after that request. The links are built from
the configuration, as the REST endpoints only exist in the API
application. Nothing is embedded for users who can not read the project.

While the rest loads:

* a Semantic UI placeholder covers each video player until it has loaded
* the descriptions are shown in a box of the size of the editor until
  CKEditor is ready
* the form placeholder is still shown if the project is not embedded

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmfTf2TMh3FihoVLSA
The form shows placeholders while it loads, and its own spinner and
disabled buttons during saving, publishing and deleting, so the loading
bar is not mounted on it any more. The search pages keep it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmfTf2TMh3FihoVLSA
Each video panel waited 1.5 seconds for the upload of its file, with a
striped "Loading ..." bar, also when the video was already uploaded (as
in the AngularJS uploader). Only the videos with files in the upload
queue wait now, so the panels of existing videos show at once.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmfTf2TMh3FihoVLSA
Remove the rules of the CDS stylesheets that no template, React component
or Python configuration uses any more, most of them left over from the
AngularJS interface:

* cds.scss: the sort handle of angular-schema-form arrays, the line
  clamp, facets and side navigation of the AngularJS templates, the old
  record detail and upload status boxes, and a few classes that were
  already unused on main
* toaster: the positions other than top right, the close button and the
  AngularJS enter and leave animations

The 404 and 500 pages keep their styles, which they took from two of the
removed classes with ``@extend``.

The utility classes (spacing, colors, decorators, social), the grid and
the styles of third party markup (video player, charts, Invenio settings
menu) are kept. The compiled CSS only lost the removed rules and the
pages are pixel identical.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmfTf2TMh3FihoVLSA
The CDS stylesheets now use LESS, like the Semantic UI theme next to
them: ``scss/`` becomes ``less/cds``, ``less/cds_previewer`` and
``less/cds_records`` (without the leading underscore of the Sass
partials). The bundles stay the same, with the same names and order.

* Sass variables, mixins and interpolations become their LESS
  equivalents, divisions are in parentheses (LESS 4) and the grid loop
  uses ``each(range(12))``
* Font Awesome 4 is imported from its LESS sources, with
  ``@fa-font-path`` set after the import (LESS variables are lazy, the
  last definition wins)
* The deposit ``cds-clearfix`` mixin is dropped: in LESS the
  ``.cds-clearfix`` class of the layout is the mixin, and both would
  have been output
* The styles of invenio-charts-js are SCSS, so the stats bundle lists
  them before ``stats.less`` instead of importing them
* MANIFEST.in no longer includes ``*.scss``, ``*.less`` was already in

The compiled CSS has the same rules in the same order (apart from
number precision, color notation and the IE filters of Font Awesome),
the previewer and stats bundles are byte identical, and the pages are
pixel identical.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmfTf2TMh3FihoVLSA
The webpack configuration of Invenio inlines every SVG in the CSS,
including the SVG versions of the icon fonts, which only very old iOS
Safari used: the browsers load the woff2 fonts.

* Font Awesome: ``vendor/font-awesome.less`` imports the parts of
  ``font-awesome.less`` with its own ``@font-face`` without the SVG font
* Semantic UI: ``site/elements/icon.variables`` sets the sources of the
  Icons, outline-icons and brand-icons fonts without the SVG fonts, with
  the path of the package (a relative ``@fontPath`` would resolve from
  the site folder)

``cds_theme_styles`` goes from 583 KB to 95 KB and the Semantic UI theme
from 1.47 MB to 558 KB. Only the four ``@font-face`` rules change, the
font files are the same and the pages are pixel identical.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmfTf2TMh3FihoVLSA
The links of a video record resolved the deposit of its project with
project_resolver, which builds a Project. Its constructor updates the
status of the tasks and dumps the files of all the videos of the project,
about 350 SQL queries, and the links factory runs twice per request. The
links only need the identifier and the access of the deposit, so they
now read it as plain metadata. GET /api/record/<id> drops from about
0.35 s to 0.06 s with the same response.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmfTf2TMh3FihoVLSA
The record page rendered placeholders and waited for GET
/api/record/<id> before showing the metadata and the player, so the
related videos showed up first. The page now embeds the record as the
API returns it, with the same read permission and the same links (built
through the /api mount), so the metadata and the player render at once.
Users who can not read the record get nothing embedded and the page
fetches it as before.

The player shows a black placeholder until its page has loaded.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmfTf2TMh3FihoVLSA
The specs in tests/e2e cover the home page, search (facets, sort, query),
video and project pages (metadata, previewer, share and embed, downloads,
keywords, transcript), JSON export, 404, login and logout, the uploads
list and the upload form (upload, category and type, save, delete).

The same specs run against the AngularJS interface of main ("angularjs"
project, port 5000) and the React one ("react" project, port 5001), as
compare-ui.sh starts them. They locate elements by role and text, which
both share, and read the records to check from the REST API, so they work
with any data. The controls that differ have helpers in support.js.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmfTf2TMh3FihoVLSA
The year histogram of the search page draws with d3 v3, which was in a
chunk shared by every page that shows search results (all of them, with
the home and related videos widgets): 147 KB, 51 KB gzipped. The facet
now imports the histogram when it first renders, so d3 loads only on the
search page, in parallel with the results.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmfTf2TMh3FihoVLSA
react-searchkit points bundlers to its CommonJS build through the
"browser" field of its package.json. That build requires the CommonJS
build of axios, a second copy next to the ES modules one of CDS, and
keeps all of semantic-ui-react since nothing can be tree shaken. An
alias now resolves react-searchkit to its ES modules build.

Together with the lazy d3, the JavaScript of a page drops from 975 KB to
614 KB (gzip 307 KB to 190 KB) on the home and search pages, 1048 KB to
717 KB (327 KB to 221 KB) on the record page and 1789 KB to 1458 KB
(538 KB to 432 KB) on the deposit form.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmfTf2TMh3FihoVLSA
CKEditor 4 was imported by the fields module, so its 620 KB were part of
the deposit bundle and parsed before the form could render. The editor
field now imports it when it mounts and shows its loading box meanwhile
(as it already did while CKEditor loads its plugins and skin). The
deposit page JavaScript drops from 1458 KB to 837 KB (gzip 432 KB to
250 KB). The end to end tests check that the editors load.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmfTf2TMh3FihoVLSA
* Remove serializeParams, titlecase, toMinutes and angularOrderBy, which
  nothing uses.
* onReady and parseJSON move to js/cds/dom.js. The page scripts imported
  them from the search mount module, and the theme script had its own
  copy of onReady.
* The deposit components share one show() helper.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmfTf2TMh3FihoVLSA
cds.modules.theme.webpack:rspack_project builds the same bundles with
rspack instead of webpack. Enable it with WEBPACKEXT_PROJECT, for example
INVENIO_WEBPACKEXT_PROJECT=cds.modules.theme.webpack:rspack_project
./scripts/build-assets. The build takes about 9 seconds instead of 70.

The project is the one of Invenio-Assets 3.2 (rspack-package.json and
rspack.config.js) with the CDS fixes, since the installed Invenio-Assets
3.1 has none and 3.2 can not be installed as is:

* rspack is pinned to 1.x. The ">1.0.0" of Invenio-Assets 3.2 now
  resolves to rspack 2, which conflicts with css-loader 6 (npm ERESOLVE)
  and needs Node.js 20.19.
* The Node.js polyfills of its resolve.fallback are declared.

The output passes the end to end tests and renders the same 33 pages.
Images are files instead of inlined data URLs, and SWC and Lightning CSS
minify a bit more (the JavaScript of the home page is 592 KB instead of
615 KB, the theme CSS 490 KB instead of 544 KB). It needs Node.js 18.12
or later, the Docker image still installs Node.js 16, so webpack stays
the default.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmfTf2TMh3FihoVLSA
The deposit page kept its state in store.js, a port of the AngularJS
controllers with a mutable object per deposit and a subscribe/notify
loop. It now uses Redux with thunks, the same stack as the Invenio
deposit forms (redux, react-redux and redux-thunk, already bundled
through react-searchkit and now declared in webpack.py).

* state/reducer.js keeps the page and one immutable entry per deposit.
* state/records.js holds the pure helpers on records (status, master
  file, schema defaults, inherited metadata).
* The side effects are thunks: deposit actions and saves, task polling,
  permissions, uploads and the page setup. store.js, uploader.js and
  actions.js are removed.
* The deposit actions go through a queue, so a save always sends the
  latest record. This fixes the type lost when the category and the
  type were saved at the same time.
* Components take a deposit id and read the state with useSelector.

The edit flow sends the same requests and saves the same records as
before, and the e2e suite passes on both interfaces.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmfTf2TMh3FihoVLSA
The deposit preview files listed their subtitles as (uri, language)
pairs while the templates of both players read (uri, language,
autogenerated) triples, like the subtitles of records. Previewing a
draft video with subtitles failed with "Cannot preview file". The
deposit subtitles are now triples too.

The HTML5 previewer test now covers a subtitle for records, embeds and
deposits.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmfTf2TMh3FihoVLSA
The new job builds the assets, starts the services with
docker-services-cli, prepares an instance with tests/e2e/setup.sh,
starts the server and runs the Playwright tests of the React interface.
The report, the traces and the server log are uploaded on failure.

* setup.sh does what scripts/setup does on empty services, without the
  keywords harvested from home.cern, then runs seed.py.
* seed.py creates a published project with two videos and a draft
  project with one, with the files of processed videos made from the
  test clip.
* The form test opens a draft project with videos and checks that the
  preview of a processed video plays.
* The upload test deletes its project in an afterEach hook, so a failed
  run leaves no project and no video behind.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmfTf2TMh3FihoVLSA
BytesIO comes from io. Imports sorted with isort.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmfTf2TMh3FihoVLSA
The application fixture always used the invenio database. It keeps that
default, as docker-services-cli sets it, and takes another database from
the environment, so two runs do not share one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmfTf2TMh3FihoVLSA
Python dependencies (uv.lock, Python 3.12):
* Latest major versions of every Invenio module, as in cds-rdm: Flask
  3.1, Werkzeug 3.1, SQLAlchemy 2.0, Flask-SQLAlchemy 3.1,
  invenio-base 2.4, invenio-records-rest 6, invenio-files-rest 6,
  invenio-accounts 9, invenio-pages 11. marshmallow stays on 3.x
  (marshmallow-utils).
* Pins removed: Flask, Werkzeug, SQLAlchemy, itsdangerous, WTForms,
  pluggy, jsonschema, setuptools, arrow, CairoSVG. webargs is declared
  (invenio-records-rest dropped it). Tests use pytest 8 and
  pytest-invenio.

Code:
* PartialDraft4Validator follows $ref with its own class. Since
  jsonschema 4.10 a referenced schema declaring draft 4 switched back to
  the full Draft4Validator, so drafts failed on required fields.
* Invenio-IIIF 1.2.0 imports pkg_resources in its handlers module. The
  configuration points Flask-IIIF to copies in cds.modules.files.iiif.
* Invenio-Pages 11: the fixtures use PageModel, the pages get explicit
  routes (its 404 fallback is replaced by the one of Invenio-Theme) and
  a missing page answers 404.
* Configuration: CACHE_TYPE RedisCache (Flask-Caching 2), TRUSTED_HOSTS
  instead of APP_ALLOWED_HOSTS, IIIF_CACHE_TIME as a number.
* Scripts and CI set FLASK_DEBUG (Flask 3 ignores FLASK_ENV). Without
  it the login page only offers CERN SSO.

Frontend: React 18 (createRoot), semantic-ui-react 3 and
react-searchkit 4, the versions Invenio-Search-UI 6 requires.

Tests: each application context has its own session with
Flask-SQLAlchemy 3, so the tests that use two applications commit
before switching and compare objects of tasks by key. Checksums use the
algorithm:value format Invenio-Files-REST checks now.

CI uses Python 3.12 and Node.js 24. The Docker image installs the Python
of .python-version with uv in a virtualenv in /opt/cds_videos (the same
instance path), with uWSGI 2.0.31, and Node.js 24.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmfTf2TMh3FihoVLSA
Invenio-Pages 11 moved its page editor to Invenio-Administration. CDS
keeps it in the Invenio-Admin panel at the same URL (/admin/page/), with
the URL, language, title, description, HTML content and template of
each page.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmfTf2TMh3FihoVLSA
* .python-version, requires-python and the classifiers say 3.14. The
  lock resolves to the same versions. CI uses 3.14, and the Docker image
  installs it from .python-version.
* The regular expressions with an escaped dot are raw strings (Python
  warns about invalid escape sequences since 3.12).
* The home page test looks for the trend and channel links by their
  exact name, as a video of the seed has "Higgs" in its title.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmfTf2TMh3FihoVLSA
Invenio-Assets 4 ships a working rspack project (rspack 2), so the copy
of the Invenio-Assets 3.2 template with rspack 1 in the theme is
removed. CDS builds with it by default, as cds-rdm: the build takes
about 11 seconds instead of 100 with webpack. It needs Node.js 20.19 or
later (CI and Docker use 24). webpack stays available with
WEBPACKEXT_PROJECT = "invenio_assets.webpack:project".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmfTf2TMh3FihoVLSA
zzacharo and others added 20 commits November 15, 2026 12:09
cds alembic upgrade heads alone fails on a database of the previous
stack. scripts/upgrade-database:

* stamps the Invenio-Access revision f9843093f686. It is applied, but
  the new revision graph no longer reaches it from the Invenio-Accounts
  head, so alembic would run it again on string role ids.
* stamps the Invenio-Pages revision 145402e8523a, as Invenio-Pages
  1.0.0a7 created its tables without alembic.
* runs alembic upgrade heads.
* converts the encrypted token columns of Invenio-OAuth2Server and
  Invenio-OAuthClient from binary to text, as in a new database. The
  tokens read either way.
* creates the unique index of the head object versions, which an
  Invenio-Files-REST recipe drops while new databases have it.

Each step checks the database first, so it can run again. On a copy of
the demo database the result has the same tables, columns, indexes and
constraints as a new database, the existing personal and remote tokens
still decrypt, and the e2e tests pass.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmfTf2TMh3FihoVLSA
* Function components take their defaults as default parameters
  instead of defaultProps, which React 18.3 deprecates for function
  components and React 19 removes (62 components, moved with a codemod).
  The array and object defaults do not reach hook dependencies.
* The deposit index no longer checks for Internet Explorer: React 18
  does not run there, so the warning could never show.
* Unused code removed: the selectDeposit selector and the defaultSortBy
  prop of the sort box, which nothing passes.
* bytesToHumanReadable compares with constants instead of dividing the
  limit inside its conditions (same results).
* The header search bar declares its props.

ESLint reports no errors besides the jsx-a11y rules of the Invenio
config, and the screenshots are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmfTf2TMh3FihoVLSA
The panel of Invenio-Admin (Flask-Admin with AdminLTE) is written for
Bootstrap 3, which the Semantic UI theme does not load. Its header,
tabs, dropdowns, tables and forms lost their layout and the actions of
the lists their icons.

Add the few Bootstrap rules these pages use, Font Awesome 4 for the
icons, the toggle of the dropdowns and a stub of the tooltip that
Flask-Admin calls before it sets up the filters. Register select2 on
jQuery too: the wrapper of Invenio-Theme expects the package to do it,
which it does not when built with rspack.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmfTf2TMh3FihoVLSA
Publishing a video saved only the video, so the changes of the project
that were not saved yet (a new contributor for example) were lost.

Every publish now saves the draft videos and the project first, as the
publish of a project already did. A deposit that is not a draft, like
the project of a new video once published, is not saved.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmfTf2TMh3FihoVLSA
CKEditor 4 is end of life since June 2023 and the 4.12.1 of the
deposit form has known security issues fixed only in later versions.
The descriptions now use HugeRTE, the editor of the Invenio forms
(react-invenio-forms). Invenio-Administration already installs it and
copies its skins.

The field keeps the format of the existing descriptions: lines
separated by <br> without a paragraph around them, and non-breaking
spaces as entities. The toolbars have the same buttons (paste as text,
bold, italic, strike, subscript and superscript, links on videos, text
color, lists, quote, undo and redo, find and replace, remove format,
source). The editor still loads with the first one, behind the same
kind of placeholder.

The copy of CKEditor in the deposit static folder (273 files, 2.7 MB)
and its base path in the page are removed. The editor chunk grows from
637 KB to 1 MB (187 KB to 353 KB gzipped), on the deposit form only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmfTf2TMh3FihoVLSA
The same output in fewer lines (Fields.js, VideoPanel.js and
Uploaders.js from 2788 to 2545 lines, 193 lines less in all):

* class names with clsx, already bundled by semantic-ui-react,
  instead of joining arrays of names by hand
* the fields that repeated the markup of FormGroup use it
* DialogModal takes its buttons (label, color and action), each one
  also closes it
* prevent(fn) for the links that run an action instead of navigating
* one Publish button for a video, one restart link for the tasks,
  TipsBox for every "Tips and suggestions", one header and one search
  row for the file tables

Checked by comparing the HTML of 50 states of the deposit pages
(project and video tabs, published project, new upload, as an owner and
as an admin) before and after: identical.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmfTf2TMh3FihoVLSA
An uncaught error of the page failed a test with "[Object]" as the
only detail: compare the messages instead. HugeRTE is about 1 MB, which
took more than 10 seconds to show with three workers on a development
server.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmfTf2TMh3FihoVLSA
The deposit actions, uploads, tasks and page setup, the autocompletes,
the VTT parser, the search suggestions and the announcement read top
to bottom with async and await instead of nested then callbacks (90
lines less). chainedActions loses its unused [function, callback]
form.

The single then of a React effect stays: it needs its cancellation
flag either way. So do createQueue, which is a promise queue, and the
two requests of initPage, which returns its cleanup function.

Checked: same HTML of the deposit pages, and the same requests, toasts
and stored records on a fresh instance before and after for a save,
an upload, a removal, a restart, the access autocomplete and a publish
without saving.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmfTf2TMh3FihoVLSA
The React code kept the folders of the AngularJS bundles (cds,
cds_deposit, cds_records, cds_search_ui): cds/ held both the header
app and every shared helper, cds_search_ui/ a single file. Everything
is now under js/cds, by feature:

* entries/: one file per webpack entry (theme, search, deposit,
  record, recordStats), the entry names are unchanged
* shared/: the HTTP client, DOM helpers, utils and the generic
  components (dialogs, toasts, popups, loading bar)
* header/: the search bar with suggestions
* search/: the search app, plus the widgets and video templates of
  the home page and the related videos, which are search results too
* record/: the record page (project/, video/)
* deposit/: the upload form (project/, video/, uploads/, fields/,
  state/) and the list of uploads (list/, was index/)

Imports use relative paths within a feature and @js/cds/... across
features. The @js/cds_deposit, @js/cds_records and @js/cds_search_ui
aliases are gone.

Only file moves and import paths: the five entries bundle to the same
bytes before and after (esbuild, minified, packages external).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmXnZDWPhbeYYMRCDr
Files that gathered unrelated code are split, one component or one
topic per file:

* shared/utils.js: shared/utils/{collections,records,images,text,
  dates,urls,languages}.js, prevent and show in shared/dom.js
* search/components.js: search/components/, one file per component
  (status, facets, range, select box, pagination, results), next to
  the widget, the video templates and the placeholders
* record/common.js: record/components/{Badges,Keywords,TrustedHtml}.js
* record/helpers.js: record/video/{metadata,playback}.js
* VideoDetail.js: Licenses, Translations, Chapters and PlayerFrame
  in their own files (VideoDetail.js from 911 to 603 lines)
* deposit/components/common.js: one file per component
* Uploaders.js: ProjectUploader.js, VideoUploader.js, FileTable.js
  and UploadDialogs.js
* VideoPanel.js: VideoActions, ExtractedMetadata, VideoSidebar,
  RestartTasks, VideoTabs and VideoForm in their own files
* Fields.js: formContext.js (context and hooks), FormGroup, Fieldset,
  BasicFields, RichTextField, KeywordsField, RemoteSelectField,
  ArrayField, ContributorsField and LicensesField
* entries/theme.js only mounts: the announcement and the navbar are
  in header/

Names that only made sense with AngularJS:

* angularFilter and angularFilterBy are filterByText and
  filterByFields, limitTo is truncate
* deposit/filters.js is deposit/taskStatus.js (parseAutocomplete went
  to fields/autocomplete.js)
* the two Html components are TrustedHtml (record pages, rendered as
  is) and SanitizedHtml (deposit, through DOMPurify): they never did
  the same thing
* comments pointing to the deleted AngularJS templates and directives
  describe the code instead

Removed as unused: removeBy, encodeURIComponentFilter, the shared
toInt and the Panel component.

The code itself is unchanged: apart from these renames and removals,
every top level statement is identical before and after (compared
without comments), every import resolves, and eslint finds no
undefined or unused names. Review with git show --color-moved.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmXnZDWPhbeYYMRCDr
VideoDetail was a single 541 line component. It now only holds the
state of the page and lays out the sections, which take everything as
props and have no hooks:

* VideoDetail.js: the "In this video" panel and its tab, the expanded
  description, the playback highlights, seeking and scrolling
* useTranscripts.js: loads the VTT files, the selected language and
  the transcript search
* VideoPlayerSection.js: the player, with the panel as its children
* VideoHeader.js: edit link, access, DOI, report number, title,
  copyright, licence, date, duration and views
* VideoDescription.js: the description and its show more button
* DescriptionDetails.js: contributors, licences, language and
  project, related links and related identifiers
* TranscriptsTeaser.js: the button opening the transcripts

The JSX is moved as is. Checked: the old and the new component render
the same HTML in jsdom for six records (with and without chapters,
transcripts, subformats, master file, restricted, two preview
lengths), on first render, after show more, after a click on a
timestamp, with the transcripts open and after a transcript search,
with the same console messages.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmXnZDWPhbeYYMRCDr
show(condition) hid elements with display: none, the way ng-show did.
Most of its 55 uses (status icons, progress texts, table rows, sort
arrows, buttons, panels) now render only when they are shown, as
{condition && ...}.

Five stay hidden instead of removed, with a comment saying why:

* the brief and detail views of the video form and their wrapper:
  unmounting them would reload the player preview iframe, restart the
  description editor and reset the open tab
* the cell of the current master file and the "no files" row of the
  additional files: the panel tables style the first row and the
  first and last cells by position, which counts hidden elements but
  not removed ones

The upload progress of a new video uses Boolean(percentage), so 0
renders nothing instead of "0".

Checked: the deposit components (video panels, video and project
uploaders) rendered in jsdom with a seeded store, for five videos
(processing, published, done, failed, waiting for an upload at 0 and
40 percent), as admin and as another user, then after clicking each
visible link and button in turn: the visible HTML (without the
elements under display: none) is the same before and after in all
278 states.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmXnZDWPhbeYYMRCDr
The details of a published video are collapsed with a "Hide details"
button at the bottom of its form, which is far below once expanded.
The sticky header of the video now has the same button, next to Edit,
while the details are shown. When the top of the video was scrolled
out of view, collapsing scrolls back to it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJmXnZDWPhbeYYMRCDr
xrootdpyfs 3 (in uv.lock) no longer depends on PyFilesystem2, but
invenio-xrootd 2.0.0a2 still imports `fs`, so the application failed to
start with the xrootd extra that the production image installs.
invenio-xrootd 3.1 is the release for xrootdpyfs 3. The CDS code only
uses `open`, `move` and `xrd_checksum` of XRootDPyFS, which are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJoQPcUEnh4hdEnJunT
As zenodo-rdm and the Invenio base image: the package.json generated by
`cds webpack create` and its pnpm-lock.yaml are committed, and the
JavaScript packages are installed from the lock file with pnpm
(WEBPACKEXT_NPM_PKG_CLS = "pynpm:PNPMPackage").

* scripts/build-assets fails when the generated package.json differs from
  the committed one, then installs with `pnpm install --frozen-lockfile`
* scripts/lock-assets updates both files after a change of the JavaScript
  dependencies, starting from the current lock file
* CI sets up pnpm 11 and Node.js 24 with pnpm/setup

Same 35 entries and versions of the main packages as the npm build.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJoQPcUEnh4hdEnJunT
As zenodo-rdm: ghcr.io/inveniosoftware/invenio:debian-python3.14 brings
Python 3.14, Node.js 24, pnpm, uv, the invenio user and the instance
layout, so the image only adds OpenLDAP for python-ldap and FFmpeg 5.0.

* Dependencies of uv.lock in their own layer, then the application with
  the xrootd extra and uWSGI in /opt/invenio/src/.venv
* Assets with scripts/build-assets (frozen pnpm install, fails when the
  generated package.json differs from the committed one), the assets
  folder is removed afterwards
* Group writable for the arbitrary UID of OpenShift
* docker-compose paths move from /opt/cds_videos to /opt/invenio

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJoQPcUEnh4hdEnJunT
The deposit API answers 304 while the revision of a record is unchanged,
but the task states it returns come from the workflows and change without
a new revision. refreshDeposits, which runs when the page starts, so the
browser cached that answer, and every later refresh (after an upload, a
publish or a restart) put the task states of the page start back on the
project and its videos. AngularJS loaded the deposits with resolveJSON,
which sends no-cache headers. refreshDeposits now sends the same
headers (NO_CACHE_HEADERS, shared with resolveJSON).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJoQPcUEnh4hdEnJunT
parse_video_chapters looks for a timestamp at the start of a line. CKEditor
4 wrote a newline after each <br>, HugeRTE does not, so descriptions saved
with the new editor had no chapters: none on the record page and no chapter
frames on publish. <br>, paragraph, div and list item tags now count as line
breaks, which also finds a first chapter right after <p>.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJoQPcUEnh4hdEnJunT
Every time in a description became a link seeking the player, also in
sentences like "Coffee will be served at 10:30" (as in the AngularJS
page). Only a timestamp starting a line is linked now: at the start of the
description, or after a newline, a <br> or an opening p, div or li, the
same lines as the chapters of parse_video_chapters.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJoQPcUEnh4hdEnJunT
A tiny Semantic UI info message under the video description gives the
chapter syntax: a line starting with a time and a title, e.g.
"0:00 Introduction", and a time inside a sentence is not a chapter.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UiZpJoQPcUEnh4hdEnJunT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant