From cfdee4e346905ebb5592f08fd126cf49a71e1acf Mon Sep 17 00:00:00 2001 From: Ryan Albrecht Date: Mon, 20 Apr 2026 10:56:42 -0700 Subject: [PATCH 1/3] ref(seer): Refactor Seer Autofix Project table to remove internal abstractions --- .../projectTable/seerProjectTable.tsx | 221 ++++++------------ 1 file changed, 69 insertions(+), 152 deletions(-) diff --git a/static/gsApp/views/seerAutomation/components/projectTable/seerProjectTable.tsx b/static/gsApp/views/seerAutomation/components/projectTable/seerProjectTable.tsx index 0cb831b1674f61..7dea3373e6d321 100644 --- a/static/gsApp/views/seerAutomation/components/projectTable/seerProjectTable.tsx +++ b/static/gsApp/views/seerAutomation/components/projectTable/seerProjectTable.tsx @@ -18,9 +18,7 @@ import {SimpleTable} from 'sentry/components/tables/simpleTable'; import {IconSearch} from 'sentry/icons/iconSearch'; import {t, tct} from 'sentry/locale'; import {ProjectsStore} from 'sentry/stores/projectsStore'; -import type {Project} from 'sentry/types/project'; import {useFetchAllPages} from 'sentry/utils/api/apiFetch'; -import type {Sort} from 'sentry/utils/discover/fields'; import {ListItemCheckboxProvider} from 'sentry/utils/list/useListItemCheckboxState'; import {useInfiniteQuery, useQuery, useQueryClient} from 'sentry/utils/queryClient'; import type {ApiQueryKey} from 'sentry/utils/queryClient'; @@ -193,166 +191,85 @@ export function SeerProjectTable() { return filtered; }, [sortedProjects, searchTerm, agentFilter, autofixSettingsByProjectId]); - if (fetching) { - return ( - - - - - - ); - } - - if (fetchError) { - return ( - - - - - - ); - } - return ( project.id)} queryKey={queryKey} > - - {filteredProjects.length === 0 ? ( - - {searchTerm - ? agentFilter - ? tct('No projects found matching [searchTerm] with [agentFilter]', { - searchTerm: {searchTerm}, - agentFilter: {getFilteredCodingAgentName(agentFilter)}, - }) - : tct('No projects found matching [searchTerm]', { - searchTerm: {searchTerm}, - }) - : agentFilter - ? tct('No projects found with [agentFilter]', { - agentFilter: {getFilteredCodingAgentName(agentFilter)}, - }) - : t('No projects found')} - - ) : ( - filteredProjects.map(project => ( - + + {codingAgentCompactSelectOptions.data?.length ? ( + + trigger={triggerProps => ( + + {agentFilter ? triggerProps.children : t('All')} + + )} + options={codingAgentCompactSelectOptions.data ?? []} + onChange={option => setAgentFilter(option.value || null)} + value={agentFilter ?? ''} /> - )) - )} - - - ); -} + ) : null} -function ProjectTable({ - agentFilter, - codingAgentCompactSelectOptions, - children, - onSortClick, - projects, - searchTerm, - setAgentFilter, - setSearchTerm, - sort, - updateBulkAutofixAutomationSettings, -}: { - agentFilter: null | PreferredAgentProvider; - children: React.ReactNode; - codingAgentCompactSelectOptions: Array<{ - label: React.ReactNode; - value: '' | PreferredAgentProvider; - }>; - onSortClick: (sort: Sort) => void; - projects: Project[]; - searchTerm: string; - setAgentFilter: ReturnType>[1]; - setSearchTerm: ReturnType>[1]; - sort: Sort; - updateBulkAutofixAutomationSettings: ReturnType< - typeof useUpdateBulkAutofixAutomationSettings - >['mutate']; -}) { - return ( - - - {codingAgentCompactSelectOptions.length ? ( - - trigger={triggerProps => ( - - {agentFilter ? triggerProps.children : t('All')} - - )} - options={codingAgentCompactSelectOptions} - onChange={option => setAgentFilter(option.value || null)} - value={agentFilter ?? ''} - /> - ) : null} - - - - - - - setSearchTerm(e.target.value, {limitUrlUpdates: debounce(125)}) - } + + + + + + setSearchTerm(e.target.value, {limitUrlUpdates: debounce(125)}) + } + /> + + + + - - - - - {children} - - + {fetching ? ( + + ) : fetchError ? ( + + ) : filteredProjects.length === 0 ? ( + + {searchTerm + ? agentFilter + ? tct('No projects found matching [searchTerm] with [agentFilter]', { + searchTerm: {searchTerm}, + agentFilter: {getFilteredCodingAgentName(agentFilter)}, + }) + : tct('No projects found matching [searchTerm]', { + searchTerm: {searchTerm}, + }) + : agentFilter + ? tct('No projects found with [agentFilter]', { + agentFilter: {getFilteredCodingAgentName(agentFilter)}, + }) + : t('No projects found')} + + ) : ( + filteredProjects.map(project => ( + + )) + )} + + + ); } From ebd42d5b12e1bd633a144fd78dde7e1498c33a18 Mon Sep 17 00:00:00 2001 From: Ryan Albrecht Date: Mon, 20 Apr 2026 11:05:54 -0700 Subject: [PATCH 2/3] Apply suggestion from @ryan953 --- .../seerAutomation/components/projectTable/seerProjectTable.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/gsApp/views/seerAutomation/components/projectTable/seerProjectTable.tsx b/static/gsApp/views/seerAutomation/components/projectTable/seerProjectTable.tsx index 7dea3373e6d321..8e46b2ef77db06 100644 --- a/static/gsApp/views/seerAutomation/components/projectTable/seerProjectTable.tsx +++ b/static/gsApp/views/seerAutomation/components/projectTable/seerProjectTable.tsx @@ -228,7 +228,7 @@ export function SeerProjectTable() { Date: Mon, 20 Apr 2026 11:07:09 -0700 Subject: [PATCH 3/3] Apply suggestion from @ryan953 --- .../components/projectTable/seerProjectTable.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/static/gsApp/views/seerAutomation/components/projectTable/seerProjectTable.tsx b/static/gsApp/views/seerAutomation/components/projectTable/seerProjectTable.tsx index 8e46b2ef77db06..75fe6b0cc8a553 100644 --- a/static/gsApp/views/seerAutomation/components/projectTable/seerProjectTable.tsx +++ b/static/gsApp/views/seerAutomation/components/projectTable/seerProjectTable.tsx @@ -235,9 +235,13 @@ export function SeerProjectTable() { /> {fetching ? ( - + + + ) : fetchError ? ( - + + + ) : filteredProjects.length === 0 ? ( {searchTerm