Skip to content

Conversation

tphakala
Copy link
Owner

@tphakala tphakala commented Jul 31, 2025

Summary

Implements Phase 1 frontend quality enhancements - essential infrastructure for automated code quality enforcement.

🛡️ Pre-commit Hooks

  • husky + lint-staged configured to run quality checks automatically
  • Prevents commits with formatting/linting issues
  • Runs prettier, eslint, and stylelint on staged files only

📊 Bundle Monitoring

  • bundlesize tool for bundle size regression detection
  • vite-bundle-analyzer for detailed bundle composition analysis
  • Configured thresholds: 250kb (gzipped) JS, 50kb CSS

🔄 CI/CD Quality Pipeline

  • Comprehensive .github/workflows/frontend-quality.yml workflow
  • Runs on all frontend code changes (push/PR)
  • Includes: type checking, linting, testing, security audit, bundle validation
  • Uploads build artifacts for review

🛠️ Developer Tools

  • task frontend-quality - one-command comprehensive validation
  • npm run audit:security - high-severity vulnerability scanning
  • npm run analyze:bundle:size - bundle size monitoring
  • npm run precommit:check - full pre-commit validation

What This Prevents

  • ❌ Runtime errors from TypeScript compilation issues
  • ❌ Performance regressions from bundle size growth
  • ❌ Security vulnerabilities from outdated dependencies
  • ❌ Code quality drift through automated enforcement
  • ❌ CI failures from formatting inconsistencies

Infrastructure-Only Commit

This PR contains NO formatting changes - only essential infrastructure files:

  • Configuration files (package.json, Taskfile.yml)
  • CI/CD workflow (.github/workflows/frontend-quality.yml)
  • Pre-commit hooks (.husky/pre-commit)
  • Package dependencies (package-lock.json)

Existing linting issues in codebase were intentionally excluded to keep this PR focused and reviewable.

Test Plan

  • Pre-commit hooks prevent commits with linting errors
  • Bundle size analysis works (npm run analyze:bundle:size)
  • Security audit runs (npm run audit:security)
  • Quality task works (task frontend-quality)
  • CI workflow validates on GitHub Actions

Next Steps (Phase 2)

  • Enhanced TypeScript strictness configuration
  • Dependency vulnerability scanning automation
  • Performance regression detection with Lighthouse CI

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Introduced automated frontend quality checks in the development workflow, including linting, type checking, testing, accessibility, security audits, and bundle size analysis.
    • Added pre-commit hooks to enforce code style and linting before commits.
    • Enforced bundle size limits and provided tools for bundle analysis.
    • Automated dependency and security checks for the frontend.
  • Chores

    • Updated task runner and package scripts to support new quality assurance processes and automated checks.

Core infrastructure changes only:
- Add pre-commit hooks with husky + lint-staged configuration
- Install bundle size monitoring with bundlesize tool
- Create comprehensive frontend quality CI/CD pipeline
- Add frontend-quality task to Taskfile for local development
- Add security audit and dependency check scripts
- Configure bundle analysis tools for performance monitoring

This commit contains NO formatting changes - only essential
infrastructure to enforce quality on future commits.

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

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link
Contributor

coderabbitai bot commented Jul 31, 2025

Warning

Rate limit exceeded

@tphakala has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 8 minutes and 55 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 4c8fc31 and 8792354.

📒 Files selected for processing (2)
  • .github/workflows/frontend-quality.yml (1 hunks)
  • frontend/package.json (3 hunks)

Walkthrough

This update introduces comprehensive frontend quality assurance automation. It adds a new GitHub Actions workflow for frontend checks, pre-commit linting via Husky, enhanced Taskfile tasks for type checking and quality, and expands the frontend's package.json with scripts and configurations for linting, auditing, bundle analysis, and size enforcement. The root package.json gains a Husky setup script.

Changes

Cohort / File(s) Change Summary
GitHub Actions Workflow
.github/workflows/frontend-quality.yml
Adds a new workflow to automate frontend quality checks on pushes and PRs, including linting, testing, auditing, build, and artifact upload.
Pre-commit Hook
.husky/pre-commit
Introduces a pre-commit script to run lint-staged on staged frontend files before committing.
Taskfile Enhancements
Taskfile.yml
Adds frontend-typecheck and frontend-quality tasks; updates frontend-build to depend on type checking for stricter build validation.
Frontend Package Scripts & Config
frontend/package.json
Adds scripts for Husky setup, bundle analysis, security auditing, dependency checks, and lint-staged/Stylelint integration. Adds bundle size limits and new devDependencies.
Root Package Script
package.json
Adds a "prepare": "husky" script to support Husky Git hooks setup.

Sequence Diagram(s)

sequenceDiagram
    participant Dev as Developer
    participant Git as Git (pre-commit)
    participant Husky as Husky
    participant LintStaged as lint-staged
    participant CI as GitHub Actions
    participant Task as Taskfile
    participant NPM as npm scripts

    Dev->>Git: git commit
    Git->>Husky: Run pre-commit
    Husky->>LintStaged: Lint staged files
    LintStaged-->>Husky: Report/fix issues
    Husky-->>Git: Allow/deny commit

    Dev->>CI: Push/PR triggers
    CI->>Task: Run frontend-quality
    Task->>NPM: Run quality scripts (typecheck, lint, test, audit, build, analyze)
    NPM-->>Task: Results
    Task-->>CI: Pass/fail, upload artifacts
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~18 minutes

Poem

A bunny hops through fields of code,
With lint and tests, the standards grow.
Husky guards each little commit,
While workflows check that all will fit.
Bundles weighed, security tight—
This garden’s frontend shines so bright!
🐇✨

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/frontend-quality-phase1

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

socket-security bot commented Jul 31, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​husky@​9.1.71001005980100
Addednpm/​bundlesize@​0.18.29910010077100
Addednpm/​lint-staged@​16.1.29910010088100

View full report

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 76c2cea and 7d6fb0e.

⛔ Files ignored due to path filters (1)
  • frontend/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (6)
  • .github/workflows/frontend-quality.yml (1 hunks)
  • .husky/pre-commit (1 hunks)
  • Taskfile.yml (2 hunks)
  • frontend/.husky/pre-commit (1 hunks)
  • frontend/package.json (3 hunks)
  • package.json (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
{.github/workflows/*,.gitlab-ci.yml}

📄 CodeRabbit Inference Engine (.cursor/rules/go.mdc)

Set up CI/CD pipelines with linter checks and tests.

Files:

  • .github/workflows/frontend-quality.yml
🧠 Learnings (7)
📓 Common learnings
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{svelte,css} : Run `npm run lint:css` for Tailwind/CSS issues and fix major violations before commit
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Run `npm run check:all` before commits
Learnt from: CR
PR: tphakala/birdnet-go#0
File: .cursor/rules/go.mdc:0-0
Timestamp: 2025-07-18T14:45:53.478Z
Learning: Applies to {.github/workflows/*,.gitlab-ci.yml} : Set up CI/CD pipelines with linter checks and tests.
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: NEVER COMMIT CODE WITH: TypeScript compilation errors, ESLint errors, critical security issues, major CSS/style violations, missing imports or undefined variables, component type mismatches, or accessibility violations
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.a11y.test.{ts,js} : Run accessibility tests regularly using axe-core and ensure no accessibility violations in test files
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/features/settings/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:32:20.392Z
Learning: Implement automated TypeScript interface validation in CI/CD.
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{ts,svelte} : Review `eslint-plugin-security` warnings, especially for regex and filesystem usage
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{ts,svelte} : Verify all imports resolve correctly
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.test.{ts,js} : Validate test file syntax and imports
.husky/pre-commit (10)

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Run npm run check:all before commits

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{svelte,css} : Run npm run lint:css for Tailwind/CSS issues and fix major violations before commit

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/features/settings/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:32:20.392Z
Learning: Use 'npm run build' to verify actual compilation versus IDE errors.

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.a11y.test.{ts,js} : Run accessibility tests regularly using axe-core and ensure no accessibility violations in test files

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.test.{ts,js} : Write and run Vitest tests

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/tools/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:32:43.506Z
Learning: Always run screenshot.js from the /frontend/tools directory (cd to the tools directory first before running the script)

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{ts,svelte} : Verify all imports resolve correctly

Learnt from: CR
PR: tphakala/birdnet-go#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T12:31:02.363Z
Learning: Run golangci-lint run -v before EVERY commit

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.test.{ts,js} : Validate test file syntax and imports

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{ts,svelte} : Review eslint-plugin-security warnings, especially for regex and filesystem usage

package.json (1)

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Run npm run check:all before commits

Taskfile.yml (16)

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.test.{ts,js} : Validate test file syntax and imports

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.svelte : Use TypeScript for all components

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/features/settings/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:32:20.392Z
Learning: Implement automated TypeScript interface validation in CI/CD.

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{ts,svelte} : Verify all imports resolve correctly

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.a11y.test.{ts,js} : Run accessibility tests regularly using axe-core and ensure no accessibility violations in test files

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Run npm run check:all before commits

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{ts,svelte} : Ensure no any types without proper eslint-disable comments

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{svelte,css} : Run npm run lint:css for Tailwind/CSS issues and fix major violations before commit

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/features/settings/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:32:20.392Z
Learning: Applies to frontend/src/lib/desktop/features/settings/**/*.{ts,svelte} : Apply type assertions strategically for complex derived scenarios to resolve TypeScript errors.

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{ts,svelte} : Review eslint-plugin-security warnings, especially for regex and filesystem usage

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/features/settings/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:32:20.392Z
Learning: Use 'npm run build' to verify actual compilation versus IDE errors.

Learnt from: CR
PR: tphakala/birdnet-go#0
File: .cursor/rules/go.mdc:0-0
Timestamp: 2025-07-18T14:45:53.478Z
Learning: Applies to {README*,CONTRIBUTING*} : Document build and test procedures.

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.test.{ts,js} : Write and run Vitest tests

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/components/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:16.387Z
Learning: Applies to frontend/src/lib/desktop/components/components/**/*.test.{ts,svelte} : Include comprehensive tests for each component

Learnt from: CR
PR: tphakala/birdnet-go#0
File: .cursor/rules/go.mdc:0-0
Timestamp: 2025-07-18T14:45:53.478Z
Learning: Applies to **/*.go : Run golangci-lint regularly with appropriate linters (durationcheck, errcheck, errorlint, gocognit, gocritic, gosimple, ineffassign, staticcheck, unconvert).

Learnt from: CR
PR: tphakala/birdnet-go#0
File: .cursor/rules/go.mdc:0-0
Timestamp: 2025-07-18T14:45:53.478Z
Learning: Applies to {.github/workflows/*,.gitlab-ci.yml} : Set up CI/CD pipelines with linter checks and tests.

frontend/.husky/pre-commit (12)

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Run npm run check:all before commits

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.test.{ts,js} : Validate test file syntax and imports

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.a11y.test.{ts,js} : Run accessibility tests regularly using axe-core and ensure no accessibility violations in test files

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{svelte,css} : Run npm run lint:css for Tailwind/CSS issues and fix major violations before commit

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/components/ui/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:28.981Z
Learning: Applies to frontend/src/lib/desktop/components/ui/**/*.test.ts : When creating a new component, create a .test.ts file

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: NEVER COMMIT CODE WITH: TypeScript compilation errors, ESLint errors, critical security issues, major CSS/style violations, missing imports or undefined variables, component type mismatches, or accessibility violations

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{ts,svelte} : Verify all imports resolve correctly

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.test.{ts,js} : Write and run Vitest tests

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/components/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:16.387Z
Learning: Applies to frontend/src/lib/desktop/components/components/**/*.test.{ts,svelte} : Include comprehensive tests for each component

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/components/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:16.387Z
Learning: Applies to frontend/src/lib/desktop/components/components/**/*.test.{ts,svelte} : Each component should have corresponding test files: Unit tests: .test.ts, Component tests: .test.svelte

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/features/settings/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:32:20.392Z
Learning: Use 'npm run build' to verify actual compilation versus IDE errors.

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.a11y.test.{ts,js} : Create accessibility tests with 'Accessibility' in the describe block name and use expectNoA11yViolations utility

.github/workflows/frontend-quality.yml (3)

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.a11y.test.{ts,js} : Run accessibility tests regularly using axe-core and ensure no accessibility violations in test files

Learnt from: CR
PR: tphakala/birdnet-go#0
File: .cursor/rules/go.mdc:0-0
Timestamp: 2025-07-18T14:45:53.478Z
Learning: Applies to {.github/workflows/*,.gitlab-ci.yml} : Set up CI/CD pipelines with linter checks and tests.

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{svelte,css} : Run npm run lint:css for Tailwind/CSS issues and fix major violations before commit

frontend/package.json (14)

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{svelte,css} : Run npm run lint:css for Tailwind/CSS issues and fix major violations before commit

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Run npm run check:all before commits

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{ts,svelte} : Review eslint-plugin-security warnings, especially for regex and filesystem usage

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{ts,svelte} : Verify all imports resolve correctly

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.test.{ts,js} : Validate test file syntax and imports

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.test.{ts,js} : Write and run Vitest tests

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{ts,svelte} : Ensure no any types without proper eslint-disable comments

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.a11y.test.{ts,js} : Run accessibility tests regularly using axe-core and ensure no accessibility violations in test files

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/components/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:16.387Z
Learning: Applies to frontend/src/lib/desktop/components/components/**/*.test.{ts,svelte} : Include comprehensive tests for each component

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/features/settings/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:32:20.392Z
Learning: Use 'npm run build' to verify actual compilation versus IDE errors.

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/features/settings/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:32:20.392Z
Learning: Implement automated TypeScript interface validation in CI/CD.

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/components/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:16.387Z
Learning: Applies to frontend/src/lib/desktop/components/components/**/*.test.{ts,svelte} : Each component should have corresponding test files: Unit tests: .test.ts, Component tests: .test.svelte

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: NEVER COMMIT CODE WITH: TypeScript compilation errors, ESLint errors, critical security issues, major CSS/style violations, missing imports or undefined variables, component type mismatches, or accessibility violations

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.svelte : Follow Svelte 5 patterns (runes, snippets)

🪛 YAMLlint (1.37.1)
.github/workflows/frontend-quality.yml

[warning] 3-3: truthy value should be one of [false, true]

(truthy)


[error] 26-26: trailing spaces

(trailing-spaces)


[error] 30-30: trailing spaces

(trailing-spaces)


[error] 37-37: trailing spaces

(trailing-spaces)


[error] 41-41: trailing spaces

(trailing-spaces)


[error] 45-45: trailing spaces

(trailing-spaces)


[error] 49-49: trailing spaces

(trailing-spaces)


[error] 53-53: trailing spaces

(trailing-spaces)


[error] 57-57: trailing spaces

(trailing-spaces)


[error] 61-61: trailing spaces

(trailing-spaces)


[error] 65-65: trailing spaces

(trailing-spaces)


[error] 70-70: trailing spaces

(trailing-spaces)


[error] 74-74: trailing spaces

(trailing-spaces)


[error] 78-78: trailing spaces

(trailing-spaces)


[error] 83-83: trailing spaces

(trailing-spaces)


[error] 90-90: no new line character at the end of file

(new-line-at-end-of-file)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: unit-tests
🔇 Additional comments (8)
package.json (1)

7-10: LGTM - Correct Husky integration setup.

The addition of the prepare script properly initializes Husky during package installation, aligning with the broader pre-commit hook infrastructure being established across the project.

.husky/pre-commit (1)

1-2: LGTM - Well-structured pre-commit hook for lint-staged.

The hook correctly changes to the frontend directory and runs lint-staged via npx, ensuring quality checks are applied to staged files before commits.

frontend/.husky/pre-commit (1)

1-1: Consider running comprehensive quality checks instead of just tests.

Based on the project's quality standards, this hook should run more comprehensive checks to align with the established learning that npm run check:all should be run before commits.

-npm test
+npm run check:all

This would ensure type checking, linting, tests, and other quality checks are all validated before commits, providing better coverage than tests alone.

Taskfile.yml (3)

157-167: LGTM - Well-structured TypeScript type checking task.

The task correctly depends on frontend-install, specifies appropriate sources for change detection, and integrates seamlessly with the build pipeline.


171-171: Excellent addition of type checking as a build dependency.

Enforcing strict type checking before building ensures type safety and aligns with the project's quality standards from the retrieved learnings.


218-229: Comprehensive frontend quality task covers all essential checks.

The task properly orchestrates all quality checks in the right sequence: linting, testing, security audits, circular dependency analysis, building, and bundle size validation. This aligns perfectly with the CI/CD pipeline being established.

.github/workflows/frontend-quality.yml (2)

66-69: Appropriate use of continue-on-error for security audits.

Using continue-on-error: true for security audits allows the pipeline to proceed while still logging security issues, which is a good balance for Phase 1 implementation.


79-82: Good approach for bundle size monitoring.

Using continue-on-error: true for bundle size checks allows monitoring without blocking deployments during the initial implementation phase, which aligns with the Phase 1 objectives.

- Remove duplicate husky directory in frontend (was auto-generated)
- Fix lint-staged duplicate Svelte processing - now *.css only for stylelint
- Remove vitest from pre-commit hooks for faster commits
- Update bundle size thresholds based on actual build output:
  - charts.js: 75kb gzipped (current: 70.74kb)
  - index.js: 65kb gzipped (current: 58.40kb)
  - Settings.js: 45kb gzipped (current: 42.17kb)
  - Other JS files: 25kb gzipped
  - index.css: 30kb gzipped (current: 27.77kb)
- Add missing CI path triggers: package.json, package-lock.json, Taskfile.yml
- Remove slow precommit:check script (was running full test suite + audit)

These changes improve developer experience by making commits faster
while maintaining code quality through targeted pre-commit checks.

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

Co-Authored-By: Claude <noreply@anthropic.com>
@tphakala
Copy link
Owner Author

@coderabbitai review

Copy link
Contributor

coderabbitai bot commented Jul 31, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

♻️ Duplicate comments (3)
.github/workflows/frontend-quality.yml (1)

30-96: Strip trailing whitespace and add missing EOF newline to satisfy YAML linters

yamllint is still flagging trailing-space errors on multiple lines (32, 36, 43, 47, 51, 55, 59, 63, 67, 71, 76, 80, 84, 89) and the missing newline at the end of the file.
These keep the workflow from passing “strict” repo-level linters and make future diffs noisy.

-runs-on: ubuntu-latest␠␠
+runs-on: ubuntu-latest-      retention-days: 7␠␠
+      retention-days: 7
+

Removing the spaces and ensuring the file ends with a newline is mechanical but prevents CI failures on repos that enforce yamllint -d strict.

frontend/package.json (2)

40-43: bundlesize is unmaintained – prefer size-limit

This repeats the earlier feedback: bundlesize hasn’t been updated since 2019 and often mis-reports modern Vite chunks. size-limit (or rollup-plugin-visualizer) is actively maintained and supports Brotli.

No action taken in this commit – please reconsider the switch.


81-119: Version ranges still use ^ for critical tooling

Caret ranges (^) on husky, lint-staged, bundlesize, and vite-bundle-analyzer allow unnoticed minor releases to break the quality gate.
Pin exact versions (or tilde) and rely on Renovate/Dependabot for upgrades.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7d6fb0e and 4c8fc31.

📒 Files selected for processing (2)
  • .github/workflows/frontend-quality.yml (1 hunks)
  • frontend/package.json (3 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{svelte,css} : Run `npm run lint:css` for Tailwind/CSS issues and fix major violations before commit
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Run `npm run check:all` before commits
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/features/settings/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:32:20.392Z
Learning: Implement automated TypeScript interface validation in CI/CD.
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{ts,svelte} : Review `eslint-plugin-security` warnings, especially for regex and filesystem usage
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.a11y.test.{ts,js} : Run accessibility tests regularly using axe-core and ensure no accessibility violations in test files
Learnt from: CR
PR: tphakala/birdnet-go#0
File: .cursor/rules/go.mdc:0-0
Timestamp: 2025-07-18T14:45:53.478Z
Learning: Applies to {.github/workflows/*,.gitlab-ci.yml} : Set up CI/CD pipelines with linter checks and tests.
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.test.{ts,js} : Validate test file syntax and imports
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{ts,svelte} : Verify all imports resolve correctly
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: NEVER COMMIT CODE WITH: TypeScript compilation errors, ESLint errors, critical security issues, major CSS/style violations, missing imports or undefined variables, component type mismatches, or accessibility violations
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{ts,svelte} : Ensure no `any` types without proper eslint-disable comments
.github/workflows/frontend-quality.yml (8)

Learnt from: CR
PR: tphakala/birdnet-go#0
File: .cursor/rules/go.mdc:0-0
Timestamp: 2025-07-18T14:45:53.478Z
Learning: Applies to {.github/workflows/*,.gitlab-ci.yml} : Set up CI/CD pipelines with linter checks and tests.

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.a11y.test.{ts,js} : Run accessibility tests regularly using axe-core and ensure no accessibility violations in test files

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{svelte,css} : Run npm run lint:css for Tailwind/CSS issues and fix major violations before commit

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{ts,svelte} : Review eslint-plugin-security warnings, especially for regex and filesystem usage

Learnt from: tphakala
PR: #770
File: internal/errors/README.md:1-445
Timestamp: 2025-06-25T16:32:01.944Z
Learning: For markdown files in this repository, ignore minor formatting issues such as missing blank lines around lists and headings, missing trailing newlines, and similar linting-style issues. Focus on substantive content, structure, and significant readability concerns instead.

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Run npm run check:all before commits

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: NEVER COMMIT CODE WITH: TypeScript compilation errors, ESLint errors, critical security issues, major CSS/style violations, missing imports or undefined variables, component type mismatches, or accessibility violations

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: MANDATORY: Run static analysis before EVERY commit - Check IDE diagnostics panel

frontend/package.json (31)

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{svelte,css} : Run npm run lint:css for Tailwind/CSS issues and fix major violations before commit

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{ts,svelte} : Review eslint-plugin-security warnings, especially for regex and filesystem usage

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Run npm run check:all before commits

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{ts,svelte} : Verify all imports resolve correctly

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.svelte : Document all components - Include comprehensive HTML comments at the top of each component describing purpose, usage, features, and props

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{ts,svelte} : Ensure no any types without proper eslint-disable comments

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.test.{ts,js} : Validate test file syntax and imports

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.svelte : Use TypeScript for all components

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.test.{ts,js} : Write and run Vitest tests

Learnt from: CR
PR: tphakala/birdnet-go#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T12:31:02.363Z
Learning: Run golangci-lint run -v before EVERY commit

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: NEVER COMMIT CODE WITH: TypeScript compilation errors, ESLint errors, critical security issues, major CSS/style violations, missing imports or undefined variables, component type mismatches, or accessibility violations

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: MANDATORY: Run static analysis before EVERY commit - Check IDE diagnostics panel

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.a11y.test.{ts,js} : Run accessibility tests regularly using axe-core and ensure no accessibility violations in test files

Learnt from: CR
PR: tphakala/birdnet-go#0
File: .cursor/rules/go.mdc:0-0
Timestamp: 2025-07-18T14:45:53.478Z
Learning: Applies to {.github/workflows/*,.gitlab-ci.yml} : Set up CI/CD pipelines with linter checks and tests.

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.svelte : Follow Svelte 5 patterns (runes, snippets)

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/components/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:16.387Z
Learning: Applies to frontend/src/lib/desktop/components/components/**/*.svelte : Follow Svelte 5 patterns (runes, snippets)

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.svelte : For TypeScript type assertions in Svelte bindings, use <!-- prettier-ignore --> comments to avoid Prettier formatting issues

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.svelte : ALWAYS use centralized icons from $lib/utils/icons.ts - NEVER create inline SVGs

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/features/settings/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:32:20.392Z
Learning: Applies to frontend/src/lib/desktop/features/settings/**/*.svelte : Align change detection paths with the actual store structure to ensure correct change detection logic.

Learnt from: tphakala
PR: #1055
File: frontend/package.json:56-67
Timestamp: 2025-07-31T07:21:18.767Z
Learning: Always raise issues when encountering unmaintained packages in package.json dependencies and suggest actively maintained alternatives with better support for modern features.

Learnt from: tphakala
PR: #770
File: internal/errors/README.md:1-445
Timestamp: 2025-06-25T16:32:01.944Z
Learning: For markdown files in this repository, ignore minor formatting issues such as missing blank lines around lists and headings, missing trailing newlines, and similar linting-style issues. Focus on substantive content, structure, and significant readability concerns instead.

Learnt from: CR
PR: tphakala/birdnet-go#0
File: .cursor/rules/go.mdc:0-0
Timestamp: 2025-07-18T14:45:53.478Z
Learning: Applies to go.mod : Pin dependency versions.

Learnt from: tphakala
PR: #793
File: internal/observability/metrics/myaudio_test.go:69-82
Timestamp: 2025-06-27T09:02:44.970Z
Learning: Added comprehensive testing guidelines to CLAUDE.md including t.Parallel() recommendations for the birdnet-go project to ensure consistent modern Go testing practices.

Learnt from: tphakala
PR: #1054
File: frontend/src/lib/desktop/components/ui/Card.test.ts:7-10
Timestamp: 2025-07-31T06:48:16.616Z
Learning: Always raise and flag TypeScript type safety issues when encountered, including improper use of 'any' types, missing type annotations, and violations of strict typing guidelines.

Learnt from: tphakala
PR: #793
File: internal/observability/metrics/myaudio_test.go:97-106
Timestamp: 2025-06-27T09:01:30.848Z
Learning: User tphakala requested to update CLAUDE.md file with instructions to use range instead of for loop, indicating preference for modern Go 1.24+ range syntax in AI-generated code suggestions.

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/features/settings/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:32:20.392Z
Learning: Implement automated TypeScript interface validation in CI/CD.

Learnt from: tphakala
PR: #770
File: CLAUDE.md:236-236
Timestamp: 2025-06-25T16:31:25.487Z
Learning: CLAUDE.md file should be ignored for linting and formatting issues as it is intended for AI tools, not human consumption, per user tphakala's preference.

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/components/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:16.387Z
Learning: Applies to frontend/src/lib/desktop/components/components/**/*.test.{ts,svelte} : Include comprehensive tests for each component

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/features/settings/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:32:20.392Z
Learning: Use 'npm run build' to verify actual compilation versus IDE errors.

Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/components/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:16.387Z
Learning: Applies to frontend/src/lib/desktop/components/components/**/*.test.{ts,svelte} : Each component should have corresponding test files: Unit tests: .test.ts, Component tests: .test.svelte

Learnt from: CR
PR: tphakala/birdnet-go#0
File: .cursor/rules/go.mdc:0-0
Timestamp: 2025-07-18T14:45:53.478Z
Learning: Applies to {README*,CONTRIBUTING*} : Document build and test procedures.

🪛 YAMLlint (1.37.1)
.github/workflows/frontend-quality.yml

[warning] 3-3: truthy value should be one of [false, true]

(truthy)


[error] 32-32: trailing spaces

(trailing-spaces)


[error] 36-36: trailing spaces

(trailing-spaces)


[error] 43-43: trailing spaces

(trailing-spaces)


[error] 47-47: trailing spaces

(trailing-spaces)


[error] 51-51: trailing spaces

(trailing-spaces)


[error] 55-55: trailing spaces

(trailing-spaces)


[error] 59-59: trailing spaces

(trailing-spaces)


[error] 63-63: trailing spaces

(trailing-spaces)


[error] 67-67: trailing spaces

(trailing-spaces)


[error] 71-71: trailing spaces

(trailing-spaces)


[error] 76-76: trailing spaces

(trailing-spaces)


[error] 80-80: trailing spaces

(trailing-spaces)


[error] 84-84: trailing spaces

(trailing-spaces)


[error] 89-89: trailing spaces

(trailing-spaces)


[error] 96-96: no new line character at the end of file

(new-line-at-end-of-file)

Comment on lines 54 to 79
"bundlesize": [
{
"path": "./dist/charts.js",
"maxSize": "75kb",
"compression": "gzip"
},
{
"path": "./dist/index.js",
"maxSize": "65kb",
"compression": "gzip"
},
{
"path": "./dist/Settings.js",
"maxSize": "45kb",
"compression": "gzip"
},
{
"path": "./dist/*.js",
"maxSize": "25kb",
"compression": "gzip"
},
{
"path": "./dist/index.css",
"maxSize": "30kb",
"compression": "gzip"
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Overlapping bundlesize entries add noise

You already list explicit files (charts.js, index.js, Settings.js) with generous limits, then a wildcard *.js with a lower limit (25 KB).
The generic rule will run on the same files again and fail immediately, so the specific entries are never evaluated.

Either drop the wildcard or raise its limit above the specific ones.

🤖 Prompt for AI Agents
In frontend/package.json between lines 54 and 79, the bundlesize configuration
has overlapping entries where specific JS files have higher size limits but a
wildcard *.js entry has a lower limit of 25kb, causing the wildcard rule to fail
on those files first. To fix this, either remove the wildcard entry for *.js or
increase its maxSize limit to be higher than the largest specific file limit,
ensuring the specific entries are evaluated properly without immediate failure.

- Removed the `continue-on-error` option from the bundle size check in the GitHub Actions workflow to enforce stricter quality control.
- Updated the `prepare` script in `package.json` to explicitly use `husky install` for better clarity.
- Swapped the max size thresholds for JavaScript and CSS files in the bundle size configuration to ensure proper monitoring of file sizes.

These changes enhance the reliability of the frontend quality checks and improve the clarity of the package configuration.
Copy link

@tphakala tphakala merged commit 577906d into main Jul 31, 2025
10 of 12 checks passed
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.

1 participant