Skip to content

Add boolean field filtering support#39

Merged
kueda merged 1 commit intomainfrom
claude/issue-33-hHtKu
Mar 10, 2026
Merged

Add boolean field filtering support#39
kueda merged 1 commit intomainfrom
claude/issue-33-hHtKu

Conversation

@kueda
Copy link
Owner

@kueda kueda commented Mar 6, 2026

Summary

This PR adds support for filtering records by boolean fields in the database search functionality. Boolean columns can now be filtered using a dropdown selector in the UI that allows users to select "true", "false", or "Any" (no filter).

Key Changes

  • Backend (Rust): Added boolean field filtering logic in the database search query builder that directly compares boolean columns to TRUE/FALSE values, with case-insensitive string matching for filter input
  • Frontend (Svelte): Implemented a dropdown filter component for boolean columns that appears in the filter panel alongside existing filter types
  • Type definitions: Added 9 boolean field definitions to SearchParams interface and exported a BOOLEAN_COLUMNS constant for identifying which columns should use boolean filtering
  • Tests: Added two comprehensive test cases validating filtering by boolean fields for both true and false values

Implementation Details

  • Boolean filter values are matched case-insensitively ("true"/"false" strings) and invalid values are silently skipped
  • The UI dropdown provides three options: "Any" (clears filter), "true", and "false"
  • Boolean columns include: captive, hasCoordinate, hasGeospatialIssues, hasTaxonomicIssue, hasNonTaxonomicIssue, identificationCurrent, isInvasive, isSequenced, and repatriated

https://claude.ai/code/session_01PxRHnUPkPJB8mGTgjbeMgq

- Backend: add BOOLEAN case to WHERE clause builder so filtering by
  boolean fields (captive, hasCoordinate, etc.) uses = TRUE / = FALSE
  instead of falling through to ILIKE, which doesn't work on BOOLEAN columns
- Frontend: render a select dropdown (Any / true / false) for boolean
  columns instead of a text input
- Add boolean field names to SearchParams interface and BOOLEAN_COLUMNS
  export in filterCategories.ts
- Add backend tests for filtering by boolean fields (true and false)

https://claude.ai/code/session_01PxRHnUPkPJB8mGTgjbeMgq
@kueda kueda merged commit 9efed70 into main Mar 10, 2026
3 of 4 checks passed
@kueda kueda deleted the claude/issue-33-hHtKu branch March 10, 2026 19:42
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.

2 participants