Skip to content

fix: measure filter apply#9319

Closed
royendo wants to merge 5 commits into
mainfrom
royendo/fix-measure-filter-apply
Closed

fix: measure filter apply#9319
royendo wants to merge 5 commits into
mainfrom
royendo/fix-measure-filter-apply

Conversation

@royendo
Copy link
Copy Markdown
Contributor

@royendo royendo commented Apr 28, 2026

Fix bug where the alert modal for measure filter was unable to apply. Likely due to Svelte 5 upgrade

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

royendo and others added 5 commits April 28, 2026 10:09
Match the explicit `onsubmit` pattern used by `AlertForm` and
`BaseScheduledReportForm`. With Svelte 5 + bits-ui v2, `use:enhance`
alone no longer reliably catches submit events when the form is
portaled out of the document tree by `Popover.Content`.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The `Select` component in this form doesn't render a named `<input>`,
so the default FormData-based submission misses `dimension` and
`operation`. Validation then fails silently and `onUpdate` returns
early, leaving the popover open with no visible feedback. Match the
pattern used in `AlertForm` so superforms validates against the
`$form` store directly.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Replace the `submitForm` Apply button + `submit()` call with a direct
onClick handler that runs `validateForm` and applies the filter. The
prior pattern silently failed under Svelte 5 + bits-ui v2 + portaled
popover content.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Temporary instrumentation to confirm whether the Apply button is
actually rendered and receiving click events.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Remove the form wrapper, `use:enhance`, and `onsubmit` handler now
that the Apply button calls `submit` directly. The popover never
posted to a server, so the form/enhance machinery was redundant.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@royendo royendo requested a review from a team as a code owner April 28, 2026 15:03
@royendo royendo requested a review from AdityaHegde April 28, 2026 15:03
},
);

async function submit() {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do we need this? Cant we just use the old onUpdate with dataType: "json"?

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.

testing without

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.

yeah idk when i revert to 10ac1c4, it doesnt close the modal and apply; tried a few variations and the one i landed on works;

lmk if you want to take over a look at it properly

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is because of nested forms with measure filter dropdown. Making sure measure filter form submits correctly instead here: #9322

That way it will also work with reports.

@royendo royendo requested a review from AdityaHegde April 28, 2026 15:27
@royendo
Copy link
Copy Markdown
Contributor Author

royendo commented Apr 28, 2026

close in favor of #9322

@royendo royendo closed this Apr 28, 2026
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