Skip to content

fix(metrics): stop clipping the Month/Year/Organization fields on the counts forms - #17125

Merged
Maffooch merged 1 commit into
DefectDojo:devfrom
skywalke34:fix/counts-form-select-clipping
Dec 3, 2026
Merged

Maffooch merged 1 commit into
DefectDojo:devfrom
skywalke34:fix/counts-form-select-clipping

Conversation

@skywalke34

Copy link
Copy Markdown
Contributor

Description

On Organization Counts (/metrics/organization/counts) and Asset Tag Counts (/metrics/asset/tag/counts), the period form's Month, Year and Organization / Asset Tag fields clip their own text. You can't read the selected values, and the fields have no dropdown arrow.

pt_counts.html pins form.biweekly-metrics select to height: 27px and sets background-image: none. That was fine under Bootstrap 3. The Tailwind form base now gives selects 8px top and bottom padding and a 24px line height (border-box), so a fixed 27px leaves about 9px for 24px-tall text. The rule only exists in this template.

The fix removes the override, so these selects get the same styling as every other select in the app: 42px tall, with the dropdown arrow. The submit button stays vertically centered on the fields.

Before After
before after

Test results

  • New unittests/test_counts_form_select_height.py (2 tests): neither counts page's form CSS forces a fixed select height. Both fail on current dev (they match height: 27px) and pass with this change.
  • Existing metrics suites still pass.
  • Verified live: all three fields are 42px tall, show their values, and have the arrow.
  • ruff check (0.16.10) passes.

Documentation

None needed (bug fix).

Checklist

  • Rebased against the latest dev.
  • Submitted against the dev branch.
  • Meaningful PR name.
  • Ruff compliant.
  • Python 3.13 compliant.
  • New feature documentation: n/a, bug fix.
  • Migrations: n/a, no model changes.
  • Unit tests added.
  • Labels and milestone applied.

Generated with Claude Code under the direction of T. Walker (skywalke34) - DefectDojo

… counts forms

pt_counts.html pinned `form.biweekly-metrics select` to `height: 27px` and
removed its background image. That suited Bootstrap 3; the Tailwind form
base now gives selects 8px vertical padding and a 24px line height, so the
fixed height left ~9px for the text and the selected Month, Year and
Organization / Asset Tag values were cut off, with no dropdown arrow.
Drop the override so these selects use the same styling as every other
select in the app.

Authored by T. Walker - DefectDojo
@dryrunsecurity

dryrunsecurity Bot commented Dec 1, 2026

Copy link
Copy Markdown

DryRun Security

This pull request contains a critical finding where a sensitive template file was modified by an unauthorized author.

🔴 Configured Sensitive Codepath Modified by Non-Allowed Author in dojo/templates/dojo/pt_counts.html (drs_d5bb959d)
Vulnerability Configured Sensitive Codepath Modified by Non-Allowed Author
Description File 'dojo/templates/dojo/pt_counts.html' matches configured sensitive codepath pattern 'dojo/templates/**/*.html' and was modified by 'skywalke34' (commit aec7779) who is not in the allowed authors list.

We've notified @mtesauro.


Comment to provide feedback on these findings.

Report false positive: @dryrunsecurity fp [FINDING ID] [FEEDBACK]
Report low-impact: @dryrunsecurity nit [FINDING ID] [FEEDBACK]

Example: @dryrunsecurity fp drs_90eda195 This code is not user-facing

All finding details can be found in the DryRun Security Dashboard.

@Maffooch Maffooch 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.

Review: #17125 fix(metrics): stop clipping the Month/Year/Organization fields on the counts forms

Verdict: approve
Head SHA reviewed: aec7779
Profile: code change (CSS removal in one template + new unit test)
Base / milestone: dev, 3.6.0 (correct)

Gates

  • ruff 0.16.10: all checks passed.
  • CI: 40 of 40 pass.

New test vs base

  • unittests.test_counts_form_select_height on the PR head: 2 tests OK.
  • With pt_counts.html reverted to origin/dev: both fail, matching height: 27px.

Break attempts

  1. Rendered height and arrow, base vs PR. Browser at 1440px on /metrics/organization/counts?month=12&year=2026&product_type=2. On dev, Month, Year and Organization are 27px tall (reproduces the bug). On the PR all three are 42px, show their selected text (December, 2026, R&D + 100% #1), and have the SVG arrow background-image. No break.
  2. Asset Tag Counts uses the same template and rule. Covered by the PR's test. The page renders 200 on the combined tree. No break.
  3. Scope of the removed rule. form.biweekly-metrics select was defined only in pt_counts.html, and the remaining input rule is untouched. The form has no other selects that relied on the 27px height. No break.
  4. Integration tests. tests/product_tag_metrics_test.py finds selects by tag name, not by size, so it is unaffected. No break.
  5. Interaction with #17122 / #17124 in the same file: no conflict. 35 tests OK on the combined tree. No break.

Blocking

None.

Nice-to-haves

  • The test greps the inline <style> for form.biweekly-metrics select { ... height: ... }. It would not catch a fixed height reintroduced under a different selector. That is acceptable for a CSS regression guard.

Verified hands-on

Tests on the PR head and with the fix reverted. Browser measurements on dev vs the combined PR tree.

Statically only

Other consumers of the selector.

Could not reproduce

Nothing outstanding.

@Maffooch
Maffooch added this pull request to the merge queue Dec 3, 2026
Merged via the queue into DefectDojo:dev with commit 6885658 Dec 3, 2026
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants