Skip to content

fix(home): refresh recent activity after dashboard/chart delete - #39528

Open
guptapuja wants to merge 7 commits into
apache:masterfrom
guptapuja:fix/home-recent-activity-refresh
Open

guptapuja wants to merge 7 commits into
apache:masterfrom
guptapuja:fix/home-recent-activity-refresh

Conversation

@guptapuja

Copy link
Copy Markdown

SUMMARY

After deleting a dashboard or chart, the Recent Activity section on the
Home page was not refreshing automatically. Users had to manually reload
the page to see updated activity.

Changes made:

  • Added refreshKey state in Home page to trigger re-fetch of activity data
  • Added onActivityRefresh callback prop to DashboardTable and ChartTable
  • Activity data now automatically updates after delete operations

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

  1. Go to Home page
  2. Delete a dashboard or chart from the Dashboards/Charts section
  3. Observe the Recent Activity / Recents section
  4. Verify it updates automatically without requiring a page reload

ADDITIONAL INFORMATION

@bito-code-review

bito-code-review Bot commented Apr 21, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #f91087

Actionable Suggestions - 0
Review Details
  • Files reviewed - 4 · Commit Range: af6f28e..af6f28e
    • superset-frontend/src/features/home/ChartTable.tsx
    • superset-frontend/src/features/home/DashboardTable.tsx
    • superset-frontend/src/pages/Home/index.tsx
    • superset-frontend/src/views/CRUD/types.ts
  • Files skipped - 0
  • Tools
    • Eslint (Linter) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@dosubot dosubot Bot added change:frontend Requires changing the frontend home:recent Related to the "recent" section of the Homepage labels Apr 21, 2026
@bito-code-review

bito-code-review Bot commented Apr 21, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #2288cb

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: af6f28e..32fc901
    • superset-frontend/src/features/home/ChartTable.tsx
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@codecov

codecov Bot commented May 12, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 64.70588% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.66%. Comparing base (483542e) to head (09c6709).
⚠️ Report is 156 commits behind head on master.

Files with missing lines Patch % Lines
superset-frontend/src/pages/Home/index.tsx 54.54% 10 Missing ⚠️
superset-frontend/src/features/home/ChartTable.tsx 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #39528      +/-   ##
==========================================
+ Coverage   85.65%   85.66%   +0.01%     
==========================================
  Files        3108     3111       +3     
  Lines      214739   214953     +214     
  Branches    50791    50915     +124     
==========================================
+ Hits       183927   184142     +215     
+ Misses      27393    27392       -1     
  Partials     3419     3419              
Flag Coverage Δ
javascript 82.34% <64.70%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rusackas

Copy link
Copy Markdown
Member

A few things to address here:

  1. Pre-commit is failing
  2. No tests added... would love to see something covering the new callback prop or the refreshKey increment logic.
  3. In ChartTable.tsx, the PR wraps refreshData in a new handleRefreshData arrow function to tack on the callback, then passes refreshData={handleRefreshData} to the inner component. This works, but it slightly diverges from the DashboardTable approach, where onActivityRefresh?.() is called directly at the call site. The two files should ideally follow the same pattern for consistency.

@rusackas

Copy link
Copy Markdown
Member

Thanks @guptapuja, the fix itself seems right, but some things from my last pass are still open so we can't merge as-is.

pre-commit is still red - the diff has a mis-indented handleRefreshActivity body and a stray blank line in ChartTable.tsx, plus trailing whitespace on the new prop in types.ts. Mind running pre-commit and pushing the reformat?

Still no test covering the new callback / refreshKey bump, and ChartTable wraps refreshData in handleRefreshData while DashboardTable calls onActivityRefresh?.() directly - would be nice to land on one pattern.

@netlify

netlify Bot commented Jul 1, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 61f18a7
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6aa04c8a815edd00086e86d7
😎 Deploy Preview https://deploy-preview-39528--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@bito-code-review

bito-code-review Bot commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #bb20bc

Actionable Suggestions - 0
Review Details
  • Files reviewed - 3 · Commit Range: 32fc901..8e709d2
    • superset-frontend/src/features/home/ChartTable.tsx
    • superset-frontend/src/pages/Home/index.tsx
    • superset-frontend/src/views/CRUD/types.ts
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@rusackas

Copy link
Copy Markdown
Member

Thanks @guptapuja! pre-commit is still failing, this time on types.ts: the latest push collapses the ImportResourceName union onto one line and prettier wants it multi-line. That hunk isn't related to this fix, so reverting it should clear things up.

As mentioned, a small test covering the refreshKey bump would be appreciated too. Holler if you want a hand with either. Happy to help get this across the finish line if you're OK with me pushing some commits here.

guptapuja and others added 3 commits July 20, 2026 11:53
- Added refreshKey state to trigger re-fetch of activity data
- Added onActivityRefresh callback prop to DashboardTable and ChartTable
- Activity section now updates automatically after delete operations

Fixes apache#39435
@rusackas
rusackas force-pushed the fix/home-recent-activity-refresh branch from 8e709d2 to 1c8572e Compare July 20, 2026 18:55
@bito-code-review

bito-code-review Bot commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #3f728a

Actionable Suggestions - 0
Review Details
  • Files reviewed - 4 · Commit Range: 058d235..1c8572e
    • superset-frontend/src/features/home/ChartTable.tsx
    • superset-frontend/src/features/home/DashboardTable.tsx
    • superset-frontend/src/pages/Home/index.tsx
    • superset-frontend/src/views/CRUD/types.ts
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@github-actions github-actions Bot added the requires:rebase Requires rebasing on top of current master label Aug 13, 2026
- DashboardTable: only fire onActivityRefresh once the delete actually
  succeeds and triggers a real refetch, instead of immediately alongside
  the fire-and-forget delete call (which could race ahead of the backend
  delete and refresh with stale data).
- Home/Welcome: guard the recent-activity effect against out-of-order
  responses when refreshKey changes again before an in-flight refresh
  resolves, so an older response can no longer overwrite newer state.

Addresses CodeAnt review feedback on PR apache#39528.
@pull-request-size pull-request-size Bot added size/M and removed size/S labels Sep 8, 2026
@rusackas

rusackas commented Sep 9, 2026

Copy link
Copy Markdown
Member

Heya @guptapuja, checking back in since it's been quiet a while. This has drifted out of sync with master and is showing conflicts now, so it needs a rebase before it can merge. Also still no test covering the refreshKey/callback wiring, which I'd asked about a few passes back. I'll see if I can tackle the rebase now...

@bito-code-review

bito-code-review Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #cae60e

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: 1c8572e..61f18a7
    • superset-frontend/src/features/home/DashboardTable.tsx
    • superset-frontend/src/pages/Home/index.tsx
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers an incremental AI Review.

  • /review full - Manually triggers a full AI Review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

rusackas and others added 2 commits November 19, 2026 13:32
Resolve conflict in pages/Home/index.tsx: master moved the Charts tab
behind the mobile consumption-mode guard; keep that structure and add
onActivityRefresh to the relocated ChartTable.

Co-Authored-By: Evan Rusackas <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
handleChartDelete refreshes the Favorite/Other tabs through getData, not
refreshData, so wrap getData in ChartTable the same way DashboardTable
does. This also puts both tables on one pattern for notifying Home.

Add tests for the delete-callback wiring in ChartTable and DashboardTable
(including that a failed chart delete does not notify) and for Home
refetching recent activity when a table reports a delete.

Co-Authored-By: Evan Rusackas <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot removed the requires:rebase Requires rebasing on top of current master label Nov 19, 2026
The Edited tab loads its own data in ActivityTable, so a delete from Home
left the deleted item listed there until a reload. Pass refreshKey down and
re-run that fetch when it changes.

Co-Authored-By: Evan Rusackas <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@rusackas

Copy link
Copy Markdown
Member

Heya @guptapuja, I went ahead and pushed the last bit (09c6709): the Recents "Edited" tab now refetches when refreshKey bumps, so a deleted item doesn't hang around there until a reload. Between that and the earlier commits I think this covers #39435.

Since a good chunk of the recent code here is mine, it'd be good to get another committer's eyes on it before it merges.

@codeant-ai-for-open-source

Copy link
Copy Markdown
Contributor

CodeAnt  CodeAnt PR Risk

🟢  Low Risk

  • The PR appears safe to merge; the delete refresh callbacks now run after successful deletion, and the activity fetch discards stale responses.
  • The optional refresh configuration is forwarded, preserving the existing list refresh behavior.

Assessed commit: 09c670974873

@mikebridge mikebridge left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approving. Thanks @guptapuja for the fix, and @rusackas for carrying it over the line. I read the full diff plus the delete handlers it hooks into, and this does what #39435 asks without side effects I could find.

What I checked

  • The activity refresh only fires after a successful delete. handleDashboardDelete and handleChartDelete call exactly one of refreshData / getData in their success branch (views/CRUD/utils.tsx:382-384 and :425-428), so each delete bumps refreshKey once, and a failed delete never does. The new tests cover both sides.
  • No stale-state or race problems. The isStale cleanup in pages/Home/index.tsx is tied to [otherTabFilters, refreshKey], and otherTabFilters is a stable memo, so only a newer refresh (or unmount) discards an in-flight response. isFetchingActivityData isn't re-entered on refresh, so the panels don't flash back to loading cards or remount the tables.
  • The Edited tab refetch in ActivityTable clears its loading flag on both resolve and cleanup, so it can't get stuck.
  • The refetch actually removes the deleted item: the recent activity endpoint outer-joins dashboards/charts and drops rows whose title comes back empty, so a deleted (or soft-deleted) object falls out of the Viewed list.
  • The new tests would fail without the change, which is what I want from a regression test.

Small, optional follow-ups (not blocking)

  • features/home/SavedQueries.tsx:178: the Recents "Created" tab also lists saved queries, but deleting a saved query from the Home page doesn't notify the activity feed, so it lingers there until reload. That's outside #39435's scope; the same onActivityRefresh wiring would cover it in a follow-up if anyone is keen.
  • pages/Home/index.tsx:320: each delete now re-runs the whole Home load (recent activity plus the editable-object lists), around 6 to 8 requests. That's fine for a user action behind a confirm dialog; just noting it in case Home grows more panels later.
  • features/home/ChartTable.test.tsx:306: the "delete fails" test waits a fixed 50 ms before asserting the callback wasn't called. It works, but waiting on the danger toast instead would make it deterministic.

CI is green on the current head and the branch merges cleanly with master.

This branch has not been deployed

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

Labels

change:frontend Requires changing the frontend home:recent Related to the "recent" section of the Homepage size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Delete Dashboard & Chart in Home page doesn't refresh/reload Recent activity

3 participants