Skip to content

refac: defer queries until the AssetActionMenu is actually opened#33078

Merged
SpencerWhitehead7 merged 2 commits into
masterfrom
spencer/fe-1016-refactor-queries-that-run-before-asset-action-menu-is
Dec 31, 2025
Merged

refac: defer queries until the AssetActionMenu is actually opened#33078
SpencerWhitehead7 merged 2 commits into
masterfrom
spencer/fe-1016-refactor-queries-that-run-before-asset-action-menu-is

Conversation

@SpencerWhitehead7

Copy link
Copy Markdown
Contributor

Summary & Motivation

Hammer the backend less with ASSETS_PERMISSIONS_QUERYs

How I Tested These Changes

Checked visually and logged the rendering behavior of the relevant components with console.log

Comment thread js_modules/dagster-ui/packages/ui-core/src/assets/useWipeDialog.tsx Outdated
@SpencerWhitehead7 SpencerWhitehead7 force-pushed the spencer/fe-1016-refactor-queries-that-run-before-asset-action-menu-is branch 2 times, most recently from 2036b4a to 3303704 Compare December 18, 2025 15:27

@hellendag hellendag 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.

This looks good! Just a few more comments/requests inline.

export const Popover = (props: BlueprintPopoverProps) => {
return (
<Popover2
<BlueprintPopover

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.

Cool, these seem like fair changes here. Some of this is probably residual from refactoring from Popover to Popover2 ages ago, and it's appropriate to clean it up.

type DeleteDynamicPartitionsMenuItemProps = {
assetKeys: AssetKeyInput[];
locationName: string;
setIsShowing: Dispatch<SetStateAction<boolean>>;

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.

This prop could be simpler, especially since it always just opens the dialog. e.g. onClick: () => void, and have the callsite use:

onClick={() => setIsShowing(true)}

And then you don't need the Dispatch and SetStateAction imports.

refresh?: () => void,
) {
const [showing, setShowing] = useState(false);
refresh?: VoidFunction,

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.

I think these are clearer as () => void. (We're also not using VoidFunction elsewhere, plus it's undocumented.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I never realized VoidFunction only exists in dom types, I thought it was language level.

/>
))
: undefined}
<MenuDivider />

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.

I guess this could just be rendered if wipe.dropdownOptions.length || deletePartitions.dropdownOptions.length, so that way we're not rendering a rogue divider when there's nothing below it.

type WipeDialogMenuItemProps = {
assetKeys: AssetKeyInput[];
locationName: string;
setIsShowing: Dispatch<SetStateAction<boolean>>;

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.

Same comment as above re: this handler.

@SpencerWhitehead7 SpencerWhitehead7 force-pushed the spencer/fe-1016-refactor-queries-that-run-before-asset-action-menu-is branch from 3303704 to 8acaa67 Compare December 31, 2025 17:26

SpencerWhitehead7 commented Dec 31, 2025

Copy link
Copy Markdown
Contributor Author

Merge activity

  • Dec 31, 6:00 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Dec 31, 6:00 PM UTC: @SpencerWhitehead7 merged this pull request with Graphite.

@SpencerWhitehead7 SpencerWhitehead7 merged commit 5397228 into master Dec 31, 2025
5 of 8 checks passed
@SpencerWhitehead7 SpencerWhitehead7 deleted the spencer/fe-1016-refactor-queries-that-run-before-asset-action-menu-is branch December 31, 2025 18:00
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