Skip to content

Refactor filter logic#167

Merged
stylessh merged 1 commit intomainfrom
tembo/refactor-improve-readability-performance
Apr 22, 2026
Merged

Refactor filter logic#167
stylessh merged 1 commit intomainfrom
tembo/refactor-improve-readability-performance

Conversation

@tembo
Copy link
Copy Markdown
Contributor

@tembo tembo Bot commented Apr 21, 2026

Summary

Extracted reusable filter logic into a new filter-helpers.ts module to eliminate duplication across issue and pull request filters. Consolidated status filter definitions and simplified filter matching logic using helper functions and metadata constants.

Changes

  • New file: filter-helpers.ts - Extracted extractRepoOptions(), extractAuthorOptions(), repoFilterDef, and authorFilterDef for reuse
  • issue-filters.ts: Refactored status filter using issueStatus() helper and ISSUE_STATUS_META constant; removed 86 lines of duplicated code
  • pull-filters.ts: Refactored status filter using pullStatus() helper and PULL_STATUS_META constant; removed 89 lines of duplicated code
  • pull-detail-sidebar.tsx: Optimized reviewer/team lookups using useMemo Maps instead of .find() calls for O(1) access

Test Plan

  • Verify filters work correctly in issue and pull request lists
  • Confirm repo and author filters display properly across all views
  • Test status filter options render with correct icons and colors
  • Validate reviewer toggle performance improvements

Screenshots

Before After
Duplicated filter logic across files Centralized, reusable filter helpers

Want tembo to make any changes? Add a review or comment with @tembo and i'll get back to work!

View on Tembo View Agent Settings

@tembo tembo Bot added the tembo Pull request created by Tembo label Apr 21, 2026
@tembo
Copy link
Copy Markdown
Contributor Author

tembo Bot commented Apr 21, 2026

Requesting review from @stylessh who has experience with the following files modified in this PR:

  • apps/dashboard/src/components/filters/pull-filters.ts
  • apps/dashboard/src/components/filters/issue-filters.ts
  • apps/dashboard/src/components/pulls/detail/pull-detail-sidebar.tsx

@tembo tembo Bot requested a review from stylessh April 21, 2026 18:15
@stylessh stylessh merged commit 51f759d into main Apr 22, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tembo Pull request created by Tembo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant