Skip to content

feat: add table search filter for PostgreSQL schema mode#132

Merged
debba merged 1 commit intodebba:mainfrom
midasism:feat/postgresql-table-search
Apr 15, 2026
Merged

feat: add table search filter for PostgreSQL schema mode#132
debba merged 1 commit intodebba:mainfrom
midasism:feat/postgresql-table-search

Conversation

@midasism
Copy link
Copy Markdown
Contributor

@midasism midasism commented Apr 14, 2026

Summary

PostgreSQL schema mode lacks table search/filter functionality, while MySQL multi-database mode and flat layouts already have it. This creates an inconsistent user experience when working with large PostgreSQL schemas.

Changes

Frontend (React/TypeScript)

src/components/layout/sidebar/SidebarSchemaItem.tsx:

  • Add Search and X icon imports from lucide-react
  • Add tableFilter state for search input
  • Implement filteredTables with case-insensitive filtering logic
  • Add search input UI (search icon + input + clear button)
  • Update table rendering to use filtered results
  • Show contextual empty states: "No tables" vs "No tables match your search"

The search box matches the UX pattern already present in:

  • SidebarDatabaseItem.tsx (MySQL multi-database mode)
  • ExplorerSidebar.tsx flat layout (MySQL/SQLite single database)

Screenshots

Before (no search box)

tabularis_03

After (with search functionality)

tabularis_01 tabularis_02

Test plan

  • Connect to PostgreSQL database
  • Expand any schema in the sidebar
  • Verify search input appears above table list (with search icon)
  • Type keywords to filter tables (case-insensitive)
  • Verify filtered results update in real-time
  • Click X button to clear search
  • Verify empty state shows "No tables match your search" when no results
  • Verify search doesn't affect Views or Routines sections
  • Verify UX consistency with MySQL database search

Add search/filter functionality to PostgreSQL schema table lists, bringing feature parity with MySQL multi-database mode for improved user experience.

Changes:
- Add Search and X icons import from lucide-react
- Add tableFilter state management
- Implement case-insensitive table filtering logic
- Add search input UI with search icon and clear button
- Update table rendering to use filtered results
- Show appropriate empty state messages (no tables vs no matches)

The search box appears above the table list when tables exist, matching the UX pattern already present in MySQL database items and flat table layouts.

Made-with: Cursor
@kilo-code-bot
Copy link
Copy Markdown

kilo-code-bot bot commented Apr 14, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 file)
  • src/components/layout/sidebar/SidebarSchemaItem.tsx
Review Notes

The PR adds table search/filter functionality for PostgreSQL schema mode, matching the existing UX pattern used in MySQL multi-database mode (SidebarDatabaseItem.tsx) and flat layouts (ExplorerSidebar.tsx).

Changes verified:

  • Search and X icons imported from lucide-react
  • tableFilter state added with proper initialization
  • ✅ Case-insensitive filtering logic: t.name.toLowerCase().includes(tableFilter.toLowerCase())
  • ✅ Search input UI with search icon, input field, and clear button
  • stopPropagation on input and button clicks to prevent accordion toggle
  • ✅ Contextual empty states: noTablesMatch vs noTables
  • ✅ Uses filteredTables for rendering table list
  • ✅ Translation keys (filterTables, noTablesMatch) exist in all locale files
  • ✅ Consistent styling with existing search implementations

Reviewed by kimi-k2.5-0127 · 129,438 tokens

@debba
Copy link
Copy Markdown
Owner

debba commented Apr 15, 2026

It works as expected, thanks a lot for your contribution, I will merge it.
Feel free to add new pull requests or provide issues.

@debba debba merged commit e67789c into debba:main Apr 15, 2026
2 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.

2 participants