Skip to content

Move mobile-nav background to CSS class (strict-CSP)#479

Merged
dereuromark merged 2 commits intomasterfrom
csp-strict-mobile-nav-bg
Apr 26, 2026
Merged

Move mobile-nav background to CSS class (strict-CSP)#479
dereuromark merged 2 commits intomasterfrom
csp-strict-mobile-nav-bg

Conversation

@dereuromark
Copy link
Copy Markdown
Owner

Summary

Drops the inline style="background: linear-gradient(...)" attribute on the mobile-nav offcanvas in favour of a .queue-mobile-nav-bg class defined in the layout's existing <style> block. The class reuses the existing --queue-sidebar-bg custom property, so the visual is unchanged.

This removes the style-src 'unsafe-inline' requirement for this element. The remaining inline styles in admin templates (static <th style="width:..."> widths, dynamic heatmap colors in QueuedJobs/heatmap.php) are left as follow-ups.

Files changed

  • templates/layout/queue.php — add .queue-mobile-nav-bg rule + swap style= for class=

Drops the inline `style="background: linear-gradient(...)"` attribute on the
mobile offcanvas in favour of a `.queue-mobile-nav-bg` class that reuses the
existing `--queue-sidebar-bg` custom property. Removes the
`style-src 'unsafe-inline'` requirement for this element.
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 26, 2026

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.17%. Comparing base (ef13c13) to head (e0ee6ab).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #479      +/-   ##
============================================
+ Coverage     77.14%   77.17%   +0.02%     
  Complexity      950      950              
============================================
  Files            45       45              
  Lines          3216     3202      -14     
============================================
- Hits           2481     2471      -10     
+ Misses          735      731       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Continues the strict-CSP cleanup on top of #479's gradient fix.

- Static `<th style="width:Npx">` widths in QueuedJobs/{view,migrate}.php
  and QueueProcesses/view.php → `.queue-col-w-50` / `.queue-col-w-200`
  classes in the layout.
- `<div style="position:relative;height:400px">` chart wrapper in
  QueuedJobs/stats.php → `.queue-chart-wrapper` class.
- Dynamic heatmap cell + legend colors in QueuedJobs/heatmap.php
  (`style="background-color:...;color:...;"`) → `data-bg-color` /
  `data-text-color` attributes; the layout's existing nonced `<script>`
  reads them and assigns to `el.style` (JS-driven style mutation is not
  subject to `style-src 'unsafe-inline'`).

Templates now contain zero inline `style=` attributes.
@dereuromark dereuromark merged commit 0294a06 into master Apr 26, 2026
16 checks passed
@dereuromark dereuromark deleted the csp-strict-mobile-nav-bg branch April 26, 2026 22:29
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