You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by el...@apache.org on 2025/09/19 00:07:14 UTC
(superset) branch remove-favorite-column created (now 320cc6831c)
This is an automated email from the ASF dual-hosted git repository.
elizabeth pushed a change to branch remove-favorite-column
in repository https://gitbox.apache.org/repos/asf/superset.git
at 320cc6831c feat: hide favorite column when no items are favorited
This branch includes the following new commits:
new 320cc6831c feat: hide favorite column when no items are favorited
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(superset) 01/01: feat: hide favorite column when no items are favorited
Posted by el...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
elizabeth pushed a commit to branch remove-favorite-column
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 320cc6831cfcc8b5665b1fd5c2586e35e7af96a4
Author: Elizabeth Thompson <es...@gmail.com>
AuthorDate: Thu Sep 18 17:06:40 2025 -0700
feat: hide favorite column when no items are favorited
Hide the favorite column in chart and dashboard list views when none
of the items on the current page have been marked as favorites. This
improves the UI by removing empty, non-functional columns.
Changes:
- Add memoized hasFavoritesOnPage helper to detect when favorites exist
- Update column hidden condition to include favorite availability check
- Apply consistently to both ChartList and DashboardList components
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <no...@anthropic.com>
---
superset-frontend/src/pages/ChartList/index.tsx | 10 +++++++++-
superset-frontend/src/pages/DashboardList/index.tsx | 10 +++++++++-
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/superset-frontend/src/pages/ChartList/index.tsx b/superset-frontend/src/pages/ChartList/index.tsx
index 6f2bfa29af..6402b79a4d 100644
--- a/superset-frontend/src/pages/ChartList/index.tsx
+++ b/superset-frontend/src/pages/ChartList/index.tsx
@@ -315,6 +315,14 @@ function ChartList(props: ChartListProps) {
};
};
+ const hasFavoritesOnPage = useMemo(
+ () =>
+ charts.length > 0 &&
+ Object.keys(favoriteStatus).length === charts.length &&
+ Object.values(favoriteStatus).some(status => status === true),
+ [charts.length, favoriteStatus],
+ );
+
const columns = useMemo(
() => [
{
@@ -334,7 +342,7 @@ function ChartList(props: ChartListProps) {
id: 'id',
disableSortBy: true,
size: 'xs',
- hidden: !userId,
+ hidden: !userId || !hasFavoritesOnPage,
},
{
Cell: ({
diff --git a/superset-frontend/src/pages/DashboardList/index.tsx b/superset-frontend/src/pages/DashboardList/index.tsx
index e141bd31f5..47ab7d2e32 100644
--- a/superset-frontend/src/pages/DashboardList/index.tsx
+++ b/superset-frontend/src/pages/DashboardList/index.tsx
@@ -300,6 +300,14 @@ function DashboardList(props: DashboardListProps) {
);
}
+ const hasFavoritesOnPage = useMemo(
+ () =>
+ dashboards.length > 0 &&
+ Object.keys(favoriteStatus).length === dashboards.length &&
+ Object.values(favoriteStatus).some(status => status === true),
+ [dashboards.length, favoriteStatus],
+ );
+
const columns = useMemo(
() => [
{
@@ -319,7 +327,7 @@ function DashboardList(props: DashboardListProps) {
id: 'id',
disableSortBy: true,
size: 'xs',
- hidden: !user?.userId,
+ hidden: !user?.userId || !hasFavoritesOnPage,
},
{
Cell: ({