Skip to content

Admin UI: the two-state toggle joins the ffc-control family #1748

Closed

Description

@rpgmem

Problem

#1745 introduced the ffc-control-* family and its shared state language (a halo for hover and pressed, the primary ring for focus, a disabled state with no opacity). The two-state toggle predates it and is out of step in three ways:

  1. Its class names belong to no family. It uses .ffc-toggle, .ffc-toggle-track and .ffc-toggle-label, while the steps control uses .ffc-control-steps*. CLAUDE.md "Controls" records this as planned.
  2. It has no hover or pressed state, and its disabled state fades through opacity: 0.5. That multiplies down contrast, and OpacityContrastTest has to carry it as an exception.
  3. A second toggle exists. The user dashboard's notification preferences build their own markup in JS (.ffc-toggle-label + .ffc-toggle-switch) with their own CSS, and hide the checkbox with display: none. That removes it from keyboard focus, so a keyboard user cannot change those preferences.

On/off is also told apart by colour and knob position only.

Acceptance criteria

All delivered by #1749.

  • Every toggle the plugin prints (PHP, templates, JS-built markup) uses .ffc-control-toggle, .ffc-control-toggle-track and .ffc-control-toggle-label, and no .ffc-toggle* class is left.
  • The user dashboard's notification toggles use the same markup and CSS, and their checkbox is reachable by keyboard; the second implementation is deleted.
  • Hover and pressed draw the shared halo; the disabled state uses no opacity, and its OpacityContrastTest entry is removed.
  • render_toggle() takes an optional mark parameter (default off) that draws a check or a cross on the knob. Both glyphs come from the Core\Icons registry.
  • Autosave keeps working; the badge still anchors after the toggle.
  • Tests, CHANGELOG and CLAUDE.md "Controls" and "Settings writes" are updated.

Activity

  1. added a commit that references this issue on Oct 13, 2026
    1d4e7bd
  2. added 2 commits that reference this issue on Oct 13, 2026
    e974519
    00eb9c8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions