Skip to content

Delete the legacy theme layer and dead code (#2660) - #2715

Merged
jh-RLI merged 3 commits into
developfrom
feature-2660-legacy-cleanup
Oct 13, 2026
Merged

jh-RLI merged 3 commits into
developfrom
feature-2660-legacy-cleanup

Conversation

@jh-RLI

@jh-RLI jh-RLI commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

What and why

The last ticket of the stage-2 design spec (#2632), and its contract step. Every
theme partial has now moved into scss/components/, so the legacy layer goes.
Dead code is deleted, not restyled.

Closes #2660

What changed

The legacy layer is gone. theming/scss/legacy/ held one last partial,
_controls.scss (.controls-container). It is deleted, along with its line in
oepstrap.scss, its REUSE entry and the text in theming/README.md and
docs/dev/frontend/design-system.md that described the layer. Only one of its
classes was still in a template: controls-container__tags on the table list's
tag select (dataedit/filter.html). It set flex: 1 inside #tags, which is
not a flex container, so it did nothing and is removed. The rebuilt
bootstrap.min.css loses only .controls-container* rules (892 bytes), checked
rule by rule.

Dead code deleted. I grepped each item across templates, Python, JS, SCSS
and every app's static/ dir before deleting it. That covered render,
template_name, {% include %} and Django's implicit class-based-view template
names.

Deleted Why it was dead
login/: activate, detach, generic_form, oepuser_create_form no view or include renders them
login/delete_account.html + AccountDeleteView_TODO_UNUSED (and its two now-unused imports) the class was not routed. login:account-delete still answers 404, as intended; test_profile_owner_rule pins that
modelview/: overview, form_element_factory, widgets/dynamic_array, widgets/dynamic_edit, widgets/multiwidget no view, include or widget names them
dataedit/: admin, url_list_field, tag_form nothing renders them; no Create/UpdateView on Tag that would load tag_form implicitly
modelview/static/css/custom_alert.css loaded by nothing
.panel-heading rules in mv-style.css (Bootstrap 3 glyphicons) and the rule-less fill-div class in modellist.html no panel-heading anywhere. #2655 left both for this ticket
the user-select-none mixin no @include
REUSE entries for all of the above, plus the one for legacy/_headers.scss #2640 deleted that file but left its entry behind

The comment in base/tests/test_page_lint.py that listed the unrendered pages
"for #2660" is gone with them.

Found still in use, and kept:

  • .reviewer-item (layouts/_review.scss). The issue lists it as dead, but
    it is not. updateFieldDescription in peer_review/ui/field_description.js
    builds it, and both peer review pages call that function
    (opr_reviewer.js:269, opr_contributor.js:210). This is the one item on the
    issue's list that is deliberately not deleted.
  • .login__*. Every rule left in layouts/_login.scss (wrap, logo, heading,
    field, hint, separation, alternative, verification) has a user since Fields and account forms: one field look, allauth element overrides #2642.

Already gone before this branch: .btn--xs (#2641 inlined it), .pagination-nav
(#2647), the empty-state mixin (#2646), account/_login.html (#2642), and
tagged_field.html.

How it was tested

  • Full suite, on its own test databases (test_oep_django_2660,
    test_oedb_2660): 2,284 tests, 106 skipped, 1 failure. The failure is
    oekg…LightImportTest, which fails under the isolated-settings setup because
    it overwrites PYTHONPATH for its subprocess. Run alone it passes. The page
    lint is part of the suite.
  • check_catalogue: 20 entries, rendered in both token modes.
  • Literal scan: 77 OEP colours, 0 painted under ?tokens=bootstrap.
  • Theme: npm run build:theme on the base commit reproduces develop's
    files byte for byte. On the branch, stock_tokens.css is unchanged and
    bootstrap.min.css differs only by the removed rules.
  • Homepage comparison (benchmarks/homepage/compare.mjs, 1440 and 390 px,
    signed out and in, whole page, plus the open menu and the burger). Before and
    after: 8 of 8 shots byte-identical, no difference. The server ran with
    COMPRESS_ENABLED = False and an empty STATIC_ROOT, and serves the rebuilt
    theme.
  • reuse lint passes. mkdocs build passes (its one warning predates this
    branch).

Deploy notes

None.

For reviewers

  • Start reading at: the commit message of 8b37d7fca. The diff is almost
    entirely deletions.
  • Decisions I'd like checked: keeping .reviewer-item. The spec calls it
    dead; the code shows it is live.
  • Deliberately left out:
    • dataedit/static/dataedit/metadata.js. No template or module loads
      it, so the whole file is dead. It is not on the issue's list, and a whole
      file deserves its own decision, so it is named here rather than deleted.
    • Bootstrap configuration that Underline tabs and house dropdowns #2648's review routed here:
      $dropdown-border-radius: 0 (overridden by components/_dropdown.scss),
      $nav-tabs-* (nav-tabs is retired and a source scan forbids it) and the
      .nav-pills remap in _remap.scss. These are not dead files. Changing
      them changes compiled values outside what the homepage comparison covers,
      and .nav-pills may still be live through the vendored jsoneditor on the
      metadata editor. Not on the issue's list either.
    • The account-delete route itself. It now only answers 404. Removing it
      or building the feature is a separate decision.

Checklist

Author

  • 🐙 Followed the workflow in
    CONTRIBUTING.md
  • 📝 Added a line to
    versions/changelogs/current.md
    under the right heading, ending with the PR number (#…)
  • 📙 Updated the
    documentation, or none
    is needed
  • 🧪 Added or updated tests, and the test suite passes (no new test: the
    change only deletes code)
  • 🔌 Changed an API route or serializer? Regenerated the API reference (n/a)
  • 🎨 UI change: uses components from the
    catalogue, or adds one with
    an entry (no visible change)
  • 🤖 Used AI tools? Disclosed any changes you do not fully understand, as
    the
    AI covenant
    asks (written with Claude Code; every deletion re-checked by grep)
  • 👀 Assigned a reviewer

Reviewer

  • 🐙 Followed the
    reviewer guidelines
  • 💻 Checked out the branch and ran it
  • 💬 Gave feedback, and some appreciation for the work done

🤖 Generated with Claude Code

jh-RLI and others added 2 commits October 13, 2026 16:25
The contract step of the stage-2 design spec (#2632): every component has
moved into scss/components/, so theming/scss/legacy/ goes with its last
partial, _controls.scss. Its one class still in a template,
controls-container__tags on the table list's tag select, set flex: 1 on an
element whose parent is not a flex container, so it is removed there too.
The compiled theme loses only .controls-container rules.

Dead code deleted rather than restyled, each re-checked by grep across
templates, Python, JS and the apps' static/ dirs:

- templates no view or include renders: login activate, detach,
  generic_form, oepuser_create_form, delete_account (with the unused
  AccountDeleteView_TODO_UNUSED that named it; the account-delete route
  keeps answering 404); modelview overview, form_element_factory and the
  three widget templates; dataedit admin, url_list_field, tag_form
- modelview/static/css/custom_alert.css, loaded by nothing
- mv-style.css's Bootstrap 3 .panel-heading rules and the rule-less
  fill-div class on the factsheet list (both left for this ticket by #2655)
- the unused user-select-none mixin
- REUSE.toml entries for every deleted file, plus the one _headers.scss
  left behind when #2640 deleted it

Kept, because they are in use: .reviewer-item (both peer review pages
render it through updateFieldDescription), the .login__* rules (every
class in _login.scss has a user since #2642). .btn--xs, .pagination-nav,
the empty-state mixin, account/_login.html and tagged_field.html were
already gone.

Homepage comparison: 8 of 8 shots byte-identical. check_catalogue: 20
entries. Literal scan: 0.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
/code-review: the old comment pointed at a place that no longer exists.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@jh-RLI jh-RLI self-assigned this Oct 13, 2026
@jh-RLI
jh-RLI merged commit b614f45 into develop Oct 13, 2026
6 of 7 checks passed
@jh-RLI
jh-RLI deleted the feature-2660-legacy-cleanup branch October 13, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Delete the legacy theme layer and dead code

1 participant