diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..d09aec6 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,70 @@ +name: Code Quality Checks + +on: + push: + branches: [ main, develop ] + pull_request: + branches: [ main, develop ] + workflow_dispatch: + +jobs: + check: + name: ${{ matrix.check-name }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - check-name: "TypeScript & Svelte Check" + command: "npm run check" + description: "Verify TypeScript types and Svelte components" + - check-name: "Build" + command: "npm run build" + description: "Verify project builds successfully" + - check-name: "Lint" + command: "npm run lint" + description: "Check code style and quality with ESLint" + # - check-name: "Format Check" + # command: "npm run format:check" + # description: "Verify code formatting with Prettier" + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '18' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Run ${{ matrix.check-name }} + run: ${{ matrix.command }} + env: + NODE_OPTIONS: "--max_old_space_size=8192" + + - name: Quality Summary + run: | + echo "## 📊 Quality Check Results" >> $GITHUB_STEP_SUMMARY + echo "| Check | Status |" >> $GITHUB_STEP_SUMMARY + echo "|-------|--------|" >> $GITHUB_STEP_SUMMARY + + checks=( + "TypeScript & Svelte Check" + "Build" + "Lint" + "Format Check" + "Tests" + "Test Coverage" + ) + + for check in "${checks[@]}"; do + if [[ "${{ needs.check.result }}" == "success" ]]; then + echo "| $check | ✅ Passed |" >> $GITHUB_STEP_SUMMARY + else + echo "| $check | ❌ Failed |" >> $GITHUB_STEP_SUMMARY + fi + done diff --git a/src/lib/components/furniture/SearchFilter.svelte b/src/lib/components/furniture/SearchFilter.svelte index 966d979..dd22d53 100644 --- a/src/lib/components/furniture/SearchFilter.svelte +++ b/src/lib/components/furniture/SearchFilter.svelte @@ -7,7 +7,7 @@ searchQuery: string; } = $props(); - let searchInput: HTMLInputElement = $state(); + let searchInput: HTMLInputElement | undefined = $state(); let isSearchOpen: boolean = $state(false); // Weight different match types for relevance scoring diff --git a/src/lib/components/global/GlobalSearch.svelte b/src/lib/components/global/GlobalSearch.svelte index 4606c8a..0a56cb5 100644 --- a/src/lib/components/global/GlobalSearch.svelte +++ b/src/lib/components/global/GlobalSearch.svelte @@ -11,7 +11,7 @@ let query = $state(''); let results = $state([]); let selectedIndex = $state(0); - let searchInput: HTMLInputElement = $state(); + let searchInput: HTMLInputElement | undefined = $state(); const isMac = browser && navigator.platform.toUpperCase().indexOf('MAC') >= 0; const shortcutKey = isMac ? '⌘' : 'Ctrl'; @@ -61,7 +61,7 @@ .slice(0, 8); } - function open() { + function showSearch() { isOpen = true; setTimeout(() => searchInput?.focus(), 0); } @@ -107,7 +107,7 @@ function handleGlobalKeydown(e: KeyboardEvent) { if ((e.metaKey || e.ctrlKey) && e.key === 'k') { e.preventDefault(); - open(); + showSearch(); } } @@ -122,11 +122,11 @@ return () => document.removeEventListener('keydown', handleGlobalKeydown); }); - export { open }; + // export { showSearch as open }; - @@ -134,7 +134,7 @@ {#if isOpen}
{ if (e.key === 'Escape' || e.key === 'Enter' || e.key === ' ') close(); }} role="button" tabindex="-1" aria-label="Close search"> -
e.stopPropagation()}> +
e.stopPropagation()} onkeydown={(e) => { if (e.key === 'Escape') close(); e.stopPropagation(); }} role="dialog" aria-modal="true" tabindex="-1">
- +
- Protocol + Domain + updateRecord(record.id, 'name', (e.target as HTMLInputElement).value)} placeholder="example.com" @@ -277,9 +280,10 @@
- - Priority + updateRecord(record.id, 'priority', parseInt((e.target as HTMLInputElement).value))} min="0" @@ -288,8 +292,9 @@
- - Weight + updateRecord(record.id, 'weight', parseInt((e.target as HTMLInputElement).value))} @@ -299,9 +304,10 @@
- - Port + updateRecord(record.id, 'port', parseInt((e.target as HTMLInputElement).value))} min="1" @@ -310,9 +316,10 @@
- - Target (FQDN) + updateRecord(record.id, 'target', (e.target as HTMLInputElement).value)} placeholder="server.example.com." @@ -545,7 +552,7 @@ .priority-weight-row { display: grid; gap: var(--spacing-sm); - + label { display: block; font-size: var(--font-size-xs); @@ -553,8 +560,8 @@ color: var(--text-secondary); margin-bottom: var(--spacing-xs); } - - input, select { + + input { width: 100%; padding: var(--spacing-xs); border: 1px solid var(--border-primary); @@ -566,7 +573,16 @@ .service-protocol-row { grid-template-columns: 2fr 1fr 2fr; - + + select { + width: 100%; + padding: var(--spacing-xs); + border: 1px solid var(--border-primary); + border-radius: var(--radius-sm); + background: var(--bg-primary); + font-size: var(--font-size-sm); + } + @media (max-width: 768px) { grid-template-columns: 1fr; } diff --git a/src/lib/components/tools/DSGenerator.svelte b/src/lib/components/tools/DSGenerator.svelte index 5ab8a1c..7699c9e 100644 --- a/src/lib/components/tools/DSGenerator.svelte +++ b/src/lib/components/tools/DSGenerator.svelte @@ -313,26 +313,6 @@