Skip to content

ref(ui): Drop leftover unused optional args in drawer, table, and filters - #123259

Open
JonasBa wants to merge 1 commit into
getsentry:masterfrom
JonasBa:jonas/unused-args/leftover-2
Open

ref(ui): Drop leftover unused optional args in drawer, table, and filters#123259
JonasBa wants to merge 1 commit into
getsentry:masterfrom
JonasBa:jonas/unused-args/leftover-2

Conversation

@JonasBa

@JonasBa JonasBa commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Leftover unused-args after #123200#123237 and #123247#123248. These options are never passed (~95 LOC).

Summary

  • Drop unused DrawerOptions.onOpen, CreateTeamModal.onClose, CreateSampleEventButton.onClick, ProjectPageFilter.onReset, TimeSince.prefix, and Table.onColumnResize.
  • Same approach: delete args nothing passes; keep public hook bags, inherited Modal/SVG/Flex types, and API payloads that callers still construct.

Test plan

  • CI typecheck / frontend tests for this slice.
  • Spot-check drawer open, create-team modal, project filter reset, and table column resize.

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

…ters

Nothing passes these options. Keep public callbacks and inherited bags that callers still use.

Co-authored-by: Cursor <cursoragent@cursor.com>
@JonasBa
JonasBa requested a review from a team as a code owner August 31, 2026 22:17
@JonasBa

JonasBa commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

cc @TkDodo @nsdeschenes — leftover unused-args. Could not request review (fork token).

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Aug 31, 2026
Comment on lines 27 to 32
Footer,
Header,
organization,
onClose,
closeModal,
}: Props) {
const {mutateAsync: submitCreateTeam} = useMutation({

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The CreateTeamModal no longer accepts an onClose prop, so the callback passed by callers to receive the newly created team is never executed.
Severity: HIGH

Suggested Fix

Update the openCreateTeamModal function to follow the pattern used by other modal openers. Destructure the onClose callback from the options object and pass it as part of the second argument to the openModal function. This ensures the modal framework handles the onClose event correctly when the modal is closed.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: static/app/components/modals/createTeamModal.tsx#L27-L32

Potential issue: The `CreateTeamModal` component was refactored to no longer accept an
`onClose` prop. However, the `openCreateTeamModal` function still accepts an `onClose`
callback from its callers (e.g., in `TeamSelector`) and spreads it as a prop to the
modal component. Since the modal component no longer uses the `onClose` prop, the
callback is never invoked when a team is successfully created and the modal is closed.
This breaks the expected behavior for callers, which rely on this callback to receive
the newly created team object and resolve promises or trigger subsequent UI updates.

Also affects:

  • static/app/components/onboarding/createSampleEventButton.tsx:22~27
  • static/app/components/timeSince.tsx:41~46
  • static/app/components/core/table/table.tsx:107~112
  • static/app/components/pageFilters/project/projectPageFilter.tsx:49~54

Did we get this right? 👍 / 👎 to inform future reviews.

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit c65a096. Configure here.

})
);
closeModal();
onClose?.(team);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Team create callback still required

High Severity

CreateTeamModal no longer calls onClose after a successful create. TeamSelector and the settings team-select dropdown still pass that callback to add the new team to a project and resolve the create-team promise, so those flows hang and skip the follow-up work.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c65a096. Configure here.

}
},
[columns, onColumnResize]
[columns]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Table resize callback still used

High Severity

Table no longer accepts or invokes onColumnResize, and it always stores widths internally. GridEditable still passes that callback through DataTable.Grid so Discover, Performance, Insights, and Explore can persist column widths, so those resizes never reach the parent.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c65a096. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant