Repository navigation
feat(embedded): Add setDataMask API method - #35754
Conversation
Code Review Agent Run #f9a9a8Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
There was a problem hiding this comment.
Review by Korbit AI
Korbit automatically attempts to detect when you fix issues in new commits.
| Category | Issue | Status |
|---|---|---|
| Lack of batched updates for data mask ▹ view | ✅ Fix detected |
Files scanned
| File Path | Reviewed |
|---|---|
| superset-frontend/src/embedded/api.tsx | ✅ |
| superset-frontend/src/embedded/index.tsx | ✅ |
Explore our documentation to understand the languages and file types we support and the files we ignore.
Check out our docs on how you can make Korbit work best for you and your team.
|
@gerbermichi mind adding tests? or do you think the existing tests already cover all the use cases? |
|
looks like this needs some conflicts resolved. Holler when those are cleared, and we'll go from there! Thanks! |
e651ac7 to
1f45501
Compare
|
Thanks for updating! Pinging @villebro and adding a couple more reviewers for good measure. |
1f45501 to
fa71d88
Compare
Sequence DiagramThis PR adds a new setDataMask method to the embedded dashboard API so parent applications can programmatically update native filter states. The flow sends data mask updates from the SDK into the embedded page, batches Redux updates, and applies filter changes to the dashboard. sequenceDiagram
participant ParentApp
participant EmbeddedSDK
participant EmbeddedPage
participant ReduxStore
participant Dashboard
ParentApp->>EmbeddedSDK: Call setDataMask with filter values
EmbeddedSDK->>EmbeddedPage: Send setDataMask message
EmbeddedPage->>ReduxStore: Batch update data mask for each filter
ReduxStore->>Dashboard: Apply updated filter states
Dashboard-->>ParentApp: Filters and charts reflect new mask
Generated by CodeAnt AI |
Code Review Agent Run #220848Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Code Review Agent Run #c4b822Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
|
@gerbermichi this looks like a nice complement to |
d84b871 to
f2e4dbc
Compare
Addresses review feedback on apache#35754. The observeDataMask payload carries the crossFiltersChanged/nativeFiltersChanged flags alongside the mask, so feeding it straight back into setDataMask pushed those flags through as filter ids. Filter ids from a different dashboard had the same problem: updateDataMask inserted them into the store, where the active-filter derivation treats them as globally scoped and applies them to charts. The SDK now drops non-object entries before emitting, and the embedded API only dispatches ids the dashboard already knows about, warning about the rest instead of applying them silently.
|
Thanks for the nudge @rusackas — rebased onto master, and the What the red job actually was: master migrated While I was in here, I also worked through the review feedback:
Tests: 4 new tests in Ready for another look — @villebro whenever you have a moment. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #35754 +/- ##
==========================================
+ Coverage 65.33% 65.35% +0.01%
==========================================
Files 2803 2803
Lines 158490 158515 +25
Branches 36178 36182 +4
==========================================
+ Hits 103557 103590 +33
+ Misses 52922 52914 -8
Partials 2011 2011
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Code Review Agent Run #cee052Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
rusackas
left a comment
There was a problem hiding this comment.
Looks like this handles the batched updates plus unknown-filter-id case cleanly, with tests to match. Approving. Thanks!
|
Let us know if you have time to look into the latest bot review comments @gerbermichi, or if you want a hand. |
Addresses review feedback on apache#35754. The observeDataMask payload carries the crossFiltersChanged/nativeFiltersChanged flags alongside the mask, so feeding it straight back into setDataMask pushed those flags through as filter ids. Filter ids from a different dashboard had the same problem: updateDataMask inserted them into the store, where the active-filter derivation treats them as globally scoped and applies them to charts. The SDK now drops non-object entries before emitting, and the embedded API only dispatches ids the dashboard already knows about, warning about the rest instead of applying them silently.
Send setDataMask over switchboard's get instead of emit, so an embedded page that predates the method rejects the call instead of dropping it silently. On the iframe side, hold a mask requested before HYDRATE_DASHBOARD and replay it once hydration lands, instead of discarding every filter id as unknown against a store that has no filter entries yet.
088103b to
ff41296
Compare
Code Review Agent Run #9625a9Actionable Suggestions - 0Additional Suggestions - 2
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
|
Went back through this before merging. All the CodeAnt threads that were still open turned out to already be fixed in code, the pre-hydration race, unknown-filter-id handling, change-trigger-flag stripping, and the emit vs get version-skew gap, so I replied and resolved them. Each has its own test on both the SDK and frontend side, plus the jest-config thread is moot now that the SDK's on Vitest. The one open design question (partial-update vs full-replace on LGTM, merging. |
User description
SUMMARY
Adds a new
setDataMaskmethod to the embedded dashboard API, allowing parent applications to programmatically set filter data masks in embedded dashboards.This complements the existing
getDataMaskmethod and enables bidirectional data mask control - parent applications can now both read and write data masks to control embedded dashboard filters.The implementation dispatches
updateDataMaskactions for each filter in the provided data mask, updating the Redux store and triggering filter changes in the embedded dashboard.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A - API change only
TESTING INSTRUCTIONS
embedDashboard.setDataMask({ filterId: { filterState: { value: [...] } } })embedDashboard.getDataMask()to confirm the data mask was set correctlyADDITIONAL INFORMATION
CodeAnt-AI Description
Add setDataMask API to embedded dashboard for programmatic filter updates
What Changed
Impact
✅ Can set embedded dashboard filters from parent applications✅ Charts refresh after external filter updates✅ Easier embedding integration testing💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.