Remove the footer's inline script and SVG's inline style (CSP)#1985
Open
maebeale wants to merge 3 commits into
Open
Remove the footer's inline script and SVG's inline style (CSP)#1985maebeale wants to merge 3 commits into
maebeale wants to merge 3 commits into
Conversation
jmilljr24
reviewed
Jul 15, 2026
jmilljr24
left a comment
Collaborator
There was a problem hiding this comment.
Can we use the dropdown controller instead of adding a new one?
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>
Per review feedback, drop the new fab controller and drive the floating help menu with the existing dropdown controller instead — it already toggles class strings on elements by id via a payload param, which is exactly the menu-hidden / button-rotate toggle the FAB needs (and it adds click-outside / escape-to-close for free). Reverts the AGENTS.md controller count and index.js registration for the removed controller. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
b8bd27d to
4930cdc
Compare
Collaborator
Author
|
🤖 From Claude: Good call — dropped the new |
Verifies the shared dropdown controller opens/closes the floating help menu, guarding the CSP refactor that removed the inline script. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
maebeale
commented
Jul 15, 2026
| <button id="fab-button" | ||
| type="button" | ||
| data-action="dropdown#toggle" | ||
| data-dropdown-payload-param='[{"fab-menu":"hidden"}, {"fab-button":"rotate-45"}]' |
Collaborator
Author
There was a problem hiding this comment.
🤖 From Claude: Reusing dropdown's payload API instead of a bespoke controller: each object maps an element id to the class(es) to toggle — hidden on the menu, rotate-45 on the button. Same pattern as the accordion callers.
jmilljr24
approved these changes
Jul 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 suggested review level: 3 Read 📖 small markup→Stimulus refactor in the global footer + one utility-class swap
Why
Every page logs two report-only CSP violations from the global layout:
<script>(script-src)style=(default-src)What
Following the #1948 precedent — fix the violating markup, keep the strict policy (no
unsafe-inline):dropdowncontroller (data-action="dropdown#toggle"+ apayloadparam togglinghiddenon the menu androtate-45on the button) — no new controller. Also gives close-on-outside-click / escape for free.absolute w-0 h-0 overflow-hidden).Notes
<style>injected by a JS library (Turbo's progress bar), which would need a CSP nonce to silence — out of scope here.