Skip to content

Footer: Your Privacy Choices link and icon (phase 3 of #410) - #414

Merged
neuromechanist merged 6 commits into
stagingfrom
feature/issue-413-privacy-choices
Oct 5, 2026
Merged

neuromechanist merged 6 commits into
stagingfrom
feature/issue-413-privacy-choices

Conversation

@neuromechanist

@neuromechanist neuromechanist commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Phase 3 of #410. The footer's "Privacy settings" button becomes a "Your Privacy Choices" control with the standard blue-and-white toggle icon, at the end of the © … The Regents of the University of California · version · commit · Built with Astro on Cloudflare Pages line.

It is still a <button type="button" data-cookie-open>, so it opens the same analytics preference as before and ADR 0019's opt-out path is unchanged. CookieNotice.astro behavior and src/lib/cookie-consent.ts are untouched.

Refs #413, part of #410. Closing keywords do not fire on staging merges, so #413 is closed by hand after merge.

Changes

  • src/components/PrivacyChoicesIcon.astro (new, shared): hand-written inline SVG of the published opt-out icon, 30:14 proportions, fixed colors (#06f and white), aria-hidden="true" and focusable="false". Prop size is the CSS height in px (default 14); width follows the aspect ratio. Phase 1's embed imports it as <PrivacyChoicesIcon size={14} />.
  • src/components/Footer.astro: the button leaves the Project link list (the Privacy Policy link stays) and moves to the end of the bottom line as · [icon] Your Privacy Choices. The accessible name is the visible text; the icon is hidden from assistive technology. Link color and the hover underline match the other links on that line. The focus ring is a local 2px outline rather than the global box-shadow, because a shadow is dropped in forced-colors mode and the control would show no focus there; the 2px offset keeps the ring inside the row's inline padding so the clip below does not cut it.
  • Wrapping: the longer line would have stranded a separator dot at a line end between about 600 and 1000 px (a pre-existing flaw that this change widened, since the commit hash shows in production). Each separator now leads the item it precedes and the row uses overflow-x: clip to drop the one that lands at the start of a wrapped line. Below 600 px the row stacks without separators, as before.
  • src/components/CookieNotice.astro: a code comment that named the footer control now uses the new label. No behavior change.
  • test/footer-privacy-choices.test.ts (new): source-level wiring guard in the style of footer-explore-links.test.ts. It pins the data-cookie-open button's placement inside the copyright line after the Built with credit and outside any conditional, that it carries no hiding or renaming attributes, that it keeps a style rule for its class, that CookieNotice.astro still binds [data-cookie-open], and the icon's decorative root <svg>.
  • CHANGELOG.md: entry under [Unreleased] / Changed.

Decided and left alone: the Settings page keeps its own Privacy card and never names the footer control, so it is unchanged. ADR 0019 mentions "Privacy settings controls" generically in a dated decision record; ADRs are superseded rather than edited, so it is left as written.

The icon follows the artwork Cloudflare ships in its own footer: a white field with a blue check on the left and a blue field with a white cross on the right, inside a blue outline. Blue is 4.55:1 against the light footer background and 3.47:1 against the dark one (above the 3:1 non-text minimum), and the white half carries the dark footer, so no extra outline is drawn.

Sequencing dependency on the docs privacy policy

No test in this repository pins the footer label against the live privacy policy. copy-drift.ts and docs-contract-drift.ts compare account copy and docs-auth constants with the nemar-cli contract and never touch the footer. But the published policy (docs.nemar.org/policies/privacy) currently says "under Privacy settings in the website footer", which this PR makes stale on the footer. nemarOrg/docs#60 renames that reference, and per #410 it must merge before this reaches production. Merging this to staging is safe, since test.nemar.org does not serve the policy; the staging to main release PR should wait for docs#60, and the release checklist should confirm the policy text reads "Your Privacy Choices" first.

Verification

  • bun run lint: clean
  • bun run typecheck: 0 errors, 0 warnings (12 pre-existing hints)
  • bun run test: 123 files passed, 1 skipped; 2869 tests passed, 7 skipped (12 new); four manual mutations of Footer.astro (conditional wrapper, aria-label, renamed class, dropped hook) each fail one test
  • bun run build: complete
  • Playwright against bun run dev: footer in light and dark (system preference and data-theme forced via nemar:theme) at 1280 px and 360 px; the icon and its outline read on both footer backgrounds
  • Click opens the same cookie notice as before and moves focus to "Strict only"; dismissing returns focus to the footer control
  • Tab from "Cloudflare Pages" lands on the control, Enter opens the notice, and the accessibility tree names the button exactly "Your Privacy Choices" with no icon node exposed
  • No horizontal overflow at 320, 360, 600, 601, 700, 768, 900, 1024, 1100 px; wrapped rows show no stranded separator
  • Focus ring checked in Chromium with forcedColors: "active" and in normal mode, light and dark, at 1280, 900 and 700 px (at 900 px the control starts a wrapped line): a solid 2px outline shows in every case and is not clipped
  • Browser check on test.nemar.org after the staging deploy, both themes (gate for phase 3 in Epic: embeddable signal viewer, edge-counted embed calls, and Your Privacy Choices #410)
  • Firefox and WebKit (only Chromium was run locally; overflow-x: clip degrades to a visible dot where unsupported)

Decorative inline SVG of the published opt-out toggle, drawn at the
standard 30:14 proportions with fixed colors. Takes a `size` prop (CSS
height in px, default 14); width follows the aspect ratio. Shared by
the footer link and the embedded viewer (#410).

Checked on both footer backgrounds in a browser; not yet used here.
Move the "Privacy settings" button out of the Project link list to the
end of the copyright line as "Your Privacy Choices" with the toggle
icon. It stays a button carrying data-cookie-open, so it opens the same
analytics preference as before.

Separators now lead the item they precede and the row clips the one that
lands at a wrapped line start, so the longer line no longer strands a
dot at tablet widths. Stacks without separators below 600px as before.

Adds a source-level wiring test. Tested: lint, typecheck, vitest, build,
and Playwright in light and dark at 1280 and 360px (click, keyboard,
accessible name).

Refs #413
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

The moved button inherited the global button focus style, a box-shadow
that forced-colors mode drops, so it showed no focus there. Give it its
own 2px outline; the 2px offset stays inside the row's inline padding so
overflow-x: clip does not cut it on a wrapped line.

Also drop declarations that only repeated the global button reset and
correct the comment describing the rule.

Tested in Chromium with forcedColors active and normal, light and dark,
at 1280, 900 and 700px, including the wrapped-line case.

Refs #413
Call the footer item a control rather than a link, and describe the
embed use without naming a phase.

Refs #413
Pin placement inside the copyright line after the Built with credit and
outside any conditional, that the button carries no hiding or renaming
attributes, that it keeps a style rule for its class, and that the cookie
notice still binds [data-cookie-open]. Check aria-hidden and width on the
icon's root svg and forbid currentColor. Drop exact-string pins on the
size formula, focusable, and the separator markup.

Tested: each of four manual mutations of Footer.astro fails one test.

Refs #413
@neuromechanist
neuromechanist merged commit c199203 into staging Oct 5, 2026
5 checks passed
@neuromechanist
neuromechanist deleted the feature/issue-413-privacy-choices branch October 5, 2026 08:05
neuromechanist added a commit that referenced this pull request Oct 5, 2026
Last in the header, the shared PrivacyChoicesIcon from #414 links to
/privacy on the serving origin, in a new tab. Its accessible name is a
statement, "Privacy: how NEMAR counts embedded views", since nothing can
be chosen inside an embed. Narrow-frame header spacing tightens so the
header stays two lines at 360 px. Measured in Chromium: no document
scroll at 360x480, 800x560 and 1200x720.
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