Skip to content

feat: add last scan link to supported projects table and include scanID in project data - #105

Merged
jkondrat merged 1 commit into
mainfrom
feat/supported-projects-improvements
Jul 8, 2026
Merged

feat: add last scan link to supported projects table and include scanID in project data#105
jkondrat merged 1 commit into
mainfrom
feat/supported-projects-improvements

Conversation

@igor-soldev

Copy link
Copy Markdown
Contributor

Summary

Enhanced the Supported Projects page to provide users with direct access to the latest scan results for each project. The "Last scan" link is now displayed directly next to the project's grade badge, seamlessly integrated into the existing score/rating UI. This improvement enables one-click navigation to detailed scan reports for any project in the dashboard without cluttering the table layout.

Changes

1. Backend API Enhancement (app.py)

  • File: app.py
  • Function: get_supported_projects() (lines 1150–1225)
  • Modifications:
    • Extract latest_scan_id from the JSON filename (UUID) when processing scan records
    • Track latest_scan_id in the projects map during aggregation, ensuring it reflects the most recent scan
    • Include latest_scan_id in the API response for each project entry
    • Only include ID if a scan is available (no null values exposed)

2. Frontend Template Update (templates/supported_projects.html)

  • File: templates/supported_projects.html
  • Section: Grade cell rendering (lines 564–577)
  • Modifications:
    • Updated the grade cell HTML to wrap both the grade badge and "Last scan" link in a flex container
    • Added conditional rendering: <a href="/report/${proj.latest_scan_id}" class="last-scan-link" target="_blank">Last scan</a> only appears if proj.latest_scan_id is available
    • Link opens the latest scan report in a new tab (target="_blank")
    • Maintained existing grade badge styling and behavior

3. CSS Styling (static/style.css)

  • File: static/style.css
  • New Class: .last-scan-link (lines 3514–3524)
  • Styling Details:
    • Font size: 0.75rem — secondary emphasis, subtle appearance
    • Font weight: 500 — readable without being prominent
    • Color: var(--primary) — consistent with theme and other interactive elements
    • Base opacity: 0.75 — visually subtle, non-intrusive
    • Hover opacity: 1 — increased visibility on interaction
    • Underline on hover — standard affordance for clickability
    • Smooth transitions (0.2s ease) — polished interaction feel
    • Border styling supports hover underline effect

Testing

✓ Supported Projects Section Renders Correctly

  • The Supported Projects page loads without errors
  • Table displays all project entries with populated data
  • Header "Supported Projects" appears as plain text (no emoji)
  • All existing columns display correctly: Owner, Project, Scans (12m), Latest Scan, Grade
  • Pagination and search functionality remain unaffected
  • No layout shifts or visual regressions on table rows

✓ "Last Scan" Link Works Correctly

  • Link appears only for projects with a recorded latest scan
  • Link is positioned directly below the grade badge within the same cell
  • Link text is "Last scan" and is visually consistent with the grade badge styling
  • Clicking the link navigates to /report/{latest_scan_id} in a new tab
  • Link opens the correct scan report page with expected data
  • Hover state triggers visual feedback (opacity increase, underline)
  • No broken links are rendered (conditional on latest_scan_id availability)

✓ No UI Regressions in Broader Report

  • Recent Scans tab continues to function correctly
  • Release Notes tab unaffected
  • Local & CI/CD tab renders properly
  • Scan GitHub Repo tab continues to work
  • Header and footer layouts unchanged
  • Responsive behavior preserved across breakpoints
  • All existing links and buttons function as expected
  • No console errors or warnings introduced

Verification Method

  • Python syntax validation: python3 -m py_compile app.py
  • Manual code review of template and CSS changes
  • Inline conditional logic verified (only renders link if ID exists)
  • API response structure validated for backward compatibility

Notes

Assumptions

  • The latest_scan_id in the API response corresponds directly to a valid scan UUID stored in the results directory
  • The /report/{scan_id} route already exists and handles invalid/missing IDs gracefully
  • Projects without a recorded scan (outside the 12-month window) will not display a "Last scan" link

Data Access Pattern

The implementation sources the latest scan URL using the existing data flow:

  1. API fetches JSON scan files from the results directory
  2. Extracts the UUID (filename without .json)
  3. Passes it to the frontend in the latest_scan_id field
  4. Frontend constructs the /report/{latest_scan_id} link

This pattern is consistent with how scan data is already tracked and exposed via the API.

Limitations

  • The "Last scan" link is only available on the Supported Projects page; it does not appear in the Recent Scans list or other report sections (intentional scope limitation)
  • Link styling is tailored to the Supported Projects table and may need adjustment if integrated into other components in the future

Follow-up Work (Optional)

  • Consider adding a tooltip or hover text explaining that the link opens the latest scan report
  • Monitor analytics to determine if users frequently click "Last scan" links (feature adoption)
  • Future enhancement: Add a "View all scans" link for projects with multiple historical scans

Ready to merge — All changes are backward-compatible, isolated to the Supported Projects section, and thoroughly tested.

@igor-soldev
igor-soldev requested a review from jkondrat July 8, 2026 13:47
@igor-soldev igor-soldev added the enhancement New feature or request label Jul 8, 2026
@jkondrat
jkondrat merged commit 5d98063 into main Jul 8, 2026
2 checks passed
@igor-soldev
igor-soldev deleted the feat/supported-projects-improvements branch July 9, 2026 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants