-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Fix column tag filter with server-side filtering #25106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Add state to track active tag filters (Classification and Glossary) - Fetch all columns on load to populate filter options from all pages - When tag filters are active, fetch all columns and apply client-side filtering - Update searchTagInData to handle array of tags for OR filtering - Connect filter changes to state via onChange handler - Paginate filtered results manually on client side Co-authored-by: chirag-madlani <[email protected]>
|
@copilot Please implement filter on server side for Tags and glossaryTerms instead manully doing it on FE |
- Add tags parameter to backend search APIs (TableResource and TableRepository) - Implement tag filtering logic in searchTableColumnsInternal - Update frontend to pass tags parameter to search API - Use search endpoint when tag filters are active - Maintain all columns fetch for filter dropdown options - Backend filters by comma-separated tag FQNs with OR logic Co-authored-by: chirag-madlani <[email protected]>
- Test filtering by single tag across pages - Test filtering by multiple tags with OR logic - Test clearing filters to show all columns - Test combining tag filter with search functionality - Verify server-side filtering with API response assertions Co-authored-by: chirag-madlani <[email protected]>
Implemented server-side filtering for tags and glossaryTerms as requested: Backend (commit 2d12fe3):
Frontend (commit 2d12fe3):
Playwright Tests (commit 2d12fe3):
All filtering now handled server-side. Backend returns only matching columns with proper pagination. |
Code Review 👍 Approved with suggestionsWell-implemented server-side tag filtering feature with proper pagination. One previous minor concern about upfront data fetching remains, while the pagination concern was addressed. Suggestions 💡 1 suggestionPerformance: Fetching all columns on every load adds overhead for tables without filtersThe Impact: Increased server load and slower initial page load for tables with many columns. Suggested fix: Consider lazy-loading the full column set only when the user opens the filter dropdown for the first time, or fetch tags separately via a lightweight endpoint: // Option 1: Lazy load on filter dropdown open
const [filterOptionsLoaded, setFilterOptionsLoaded] = useState(false);
const handleFilterDropdownOpen = async () => {
if (!filterOptionsLoaded) {
await fetchAllColumnsForFilters();
setFilterOptionsLoaded(true);
}
};
// Option 2: Only fetch when filters are actually used
// Move the fetch inside the filter dropdown componentResolved ✅ 1 resolvedPerformance: Re-fetching all 10k columns on every page change when filters are active
What Works WellClean separation of concerns between frontend state management and backend filtering logic. Proper null handling in Java tag filtering code. Comprehensive E2E test coverage for filter scenarios including multi-tag OR logic and search combination. OptionsAuto-apply is off Gitar will not commit updates to this branch. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | This comment will update automatically (Docs) |
Describe your changes:
Column tag filtering was limited to the currently visible page. For tables with 80+ columns across multiple pages, applying a tag filter would only show matches from the current page, hiding columns with the same tag on other pages.
Root cause: Filter options were built from paginated data (50 columns), and filtering was performed client-side on the current page only.
Solution: Implemented server-side tag filtering with backend API support:
tagsquery parameter to column search APIsChanges:
Backend:
TableResource.java: Addedtagsparameter tosearchTableColumnsByIdandsearchTableColumnsByFQNendpointsTableRepository.java: Implemented tag filtering insearchTableColumnsInternalwith comma-separated tag FQNs and OR logicFrontend:
SchemaTable.component.tsx: AddedactiveTagFiltersstate, builds tags parameter, uses search API when filters activetableAPI.ts: Addedtagsparameter toGetTableColumnsParamsinterfaceTests:
ColumnTagFilter.spec.ts: Comprehensive Playwright E2E tests covering filtering across pages, multiple tags, clearing filters, and search combinationPerformance: +1 API call on load (tags only for filter options). Backend handles all filtering efficiently. Proper server-side pagination of filtered results.
Type of change:
Checklist:
I have read the CONTRIBUTING document.
My PR title is
Fixes <issue-number>: <short explanation>I have commented on my code, particularly in hard-to-understand areas.
For JSON Schema changes: I updated the migration scripts or explained why it is not needed.
I have added a test that covers the exact scenario we are fixing. For complex issues, comment the issue number in the test for future reference.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.