https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42902

            Bug ID: 42902
           Summary: Dark-mode regression guards for the staff interface
   Initiative type: ---
        Sponsorship ---
            status:
           Product: Koha
           Version: Main
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: Staff interface
          Assignee: [email protected]
          Reporter: [email protected]
        QA Contact: [email protected]
                CC: [email protected]
  Target Milestone: ---

This patch adds automated guard rails so the dark-mode work does not
regress and future contributions do not re-introduce hardcoded colours in
areas that have been migrated to the Koha colour tokens. This is the
capstone of the dark-mode series and should be applied once the component
migrations are in place (bugs 42898, 42899, 42900, 42901).

Cypress (t/cypress/integration/Theme_spec.ts):
Confirms the correct theme is applied before the page is interactive
(no flash of the wrong theme). Round-trips Light / Dark / Auto through
the switcher and a reload and checks the resolved theme on the page each
time. Reads the actual computed surface/text colours and asserts they
differ between light and dark, i.e. the theme really flips. Drives the
header switcher UI and checks the active state follows. Loads several
representative pages in each mode.

Stylelint (.stylelintrc.json):
A "no hardcoded hex colour" rule scoped to the migrated staff SCSS,
emitted as a warning (it does not fail the build) pointing reviewers at
the colour tokens. Files not yet migrated, and the files that
intentionally hold the colour values, are excluded; as more areas are
migrated their entries are removed and the rule starts guarding them.
The OPAC is out of scope.

Depends on: bug 42898, bug 42899, bug 42900, bug 42901

Test plan:

1) Apply the patch (after bugs 42898, 42899, 42900, 42901).

2) Cypress: run t/cypress/integration/Theme_spec.ts against a built
   instance. All assertions should pass.

3) Stylelint warns on a new hex literal:
     echo '.foo { color: #BADA55; }' \
       > koha-tmpl/intranet-tmpl/prog/css/src/_demo.scss
     npx stylelint koha-tmpl/intranet-tmpl/prog/css/src/_demo.scss
   Expect a warning pointing at the colour tokens. Remove _demo.scss
   afterwards.

4) Stylelint stays quiet on an already-migrated file:
     npx stylelint koha-tmpl/intranet-tmpl/prog/css/src/_root.scss
   Expect no hex-colour warnings.

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to