fix: resolve architecture validation errors and warnings

- Move database operations from API to service layer:
  - Add create_pending_scan() method to code_quality_service
  - Add get_running_scans() method to code_quality_service
  - Update API to use service methods instead of direct db queries
- Replace inline SVG spinner with $icon('spinner', ...) helper
- Add comment documenting custom dropdown exception

Validation now passes with 0 errors.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-21 21:07:18 +01:00
parent 4f97c00860
commit d50b154823
3 changed files with 46 additions and 21 deletions

View File

@@ -14,7 +14,7 @@
{% block content %}
{% call page_header_flex(title='Code Quality Dashboard', subtitle='Unified code quality tracking: architecture, security, and performance') %}
{{ refresh_button(variant='secondary') }}
<!-- Scan Dropdown -->
{# Custom dropdown: disabled state + template switching not supported by macro #}
<div x-data="{ scanDropdownOpen: false }" class="relative">
<button @click="scanDropdownOpen = !scanDropdownOpen"
:disabled="scanning"
@@ -65,10 +65,7 @@
x-transition
class="flex items-center p-4 mb-4 text-sm text-blue-800 rounded-lg bg-blue-50 dark:bg-gray-800 dark:text-blue-400"
role="alert">
<svg class="animate-spin -ml-1 mr-3 h-5 w-5 text-blue-500" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
</svg>
<span x-html="$icon('spinner', 'w-5 h-5 mr-3 text-blue-500')"></span>
<span x-text="scanProgress">Running scan...</span>
<span class="ml-2 text-xs text-gray-500 dark:text-gray-400">(You can navigate away - scan runs in background)</span>
</div>