Skip to content

Remove the footer's inline script and SVG's inline style (CSP)#1986

Closed
maebeale wants to merge 1 commit into
mainfrom
maebeale/csp-footer-svg-cleanup
Closed

Remove the footer's inline script and SVG's inline style (CSP)#1986
maebeale wants to merge 1 commit into
mainfrom
maebeale/csp-footer-svg-cleanup

Conversation

@maebeale

Copy link
Copy Markdown
Collaborator

🤖 suggested review level: 3 Read 📖 small markup→Stimulus/utility swap, one new controller, no data changes

What is the goal of this PR and why is this important?

Every page logged two report-only CSP violations from the global layout: the floating help button's inline <script> (script-src) and the SVG sprite's inline style= (default-src). Removing our own inline script/style keeps the strict CSP enforceable later without 'unsafe-inline'.

How did you approach the change?

Follow the #1948 precedent — fix the violating markup, keep the strict policy:

  • Move the FAB toggle to a fab Stimulus controller (fab#toggle, menu/button targets).
  • Move the SVG sprite's positioning to utility classes (absolute w-0 h-0 overflow-hidden).

Split out of #1976 (resources-clickable) so that PR stays focused on callout resources.

Anything else to add?

The one remaining console CSP entry is a <style> injected by a JS library (Turbo's progress bar), which would need a CSP nonce to silence — out of scope here.

Every page (now including the resource-preview flow this PR reworks) logged two
report-only CSP violations from the global layout: the floating help button's
inline <script> (script-src) and the SVG sprite's inline style= (default-src).

Follow the #1948 precedent — fix the violating markup, keep the strict policy:
move the FAB toggle to a Stimulus controller (fab) and the sprite's positioning
to utility classes. The remaining console CSP entry is a <style> injected by a
JS library (Turbo's progress bar), which would need a CSP nonce to silence.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 14, 2026 22:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@maebeale

Copy link
Copy Markdown
Collaborator Author

🤖 From Claude: Duplicate of #1985 (identical diff, created earlier). Closing this one; keeping #1985.

@maebeale maebeale closed this Jul 14, 2026
@maebeale maebeale deleted the maebeale/csp-footer-svg-cleanup branch July 14, 2026 22:26
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.

2 participants