Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Empty state refactor #31860

Merged
merged 3 commits into from
Jan 22, 2025
Merged

chore: Empty state refactor #31860

merged 3 commits into from
Jan 22, 2025

Conversation

mistercrunch
Copy link
Member

@mistercrunch mistercrunch commented Jan 15, 2025

  • making size a prop instead of one-component-per-size
  • fixing up the svg so its themable using currentColor
  • centralizing/fixing up references
  • simplify empty message in home page to simply "Nothing here yet" as the context in which the empty component shows up is clear enough, and the previous approach wast over-engineered

@dosubot dosubot bot added the change:frontend Requires changing the frontend label Jan 15, 2025
@geido geido self-requested a review January 15, 2025 11:34
@@ -113,7 +113,7 @@ const SqlEditorLeftBar = ({
'schema',
]);

const [emptyResultsWithSearch, setEmptyResultsWithSearch] = useState(false);
const [_emptyResultsWithSearch, setEmptyResultsWithSearch] = useState(false);
Copy link
Member

Choose a reason for hiding this comment

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

Do we actually need this?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we need setEmptyResultsWithSearch, and are flushing position 1 of the array. Code is a bit cryptic to me here. Not sure why we need setEmptyResultsWithSearch

Copy link
Member Author

Choose a reason for hiding this comment

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

Since it's meant to be flushed, I could put it in a _ to make it more clear (and keep the spread operator) or hard reference useState(false)[1], WDYT?

Copy link
Member

Choose a reason for hiding this comment

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

I am not sure that we need this. It looks that originally the PR that introduced this was just meant to show some alternate text. I did some testing and I could not see anything breaking with just removing this entirely.

- making `size` a prop instead of one-component-per-size
- fixing up the svg so its themable using `currentColor`
- centralizing/fixing up references
@mistercrunch
Copy link
Member Author

/testenv up

Copy link
Contributor

@mistercrunch Processing your ephemeral environment request here.

Copy link
Contributor

@mistercrunch Ephemeral environment spinning up at http://54.186.90.161:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@rusackas
Copy link
Member

/korbit-review

Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

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

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Fix Detected
Functionality Hardcoded Empty State Search Parameter ▹ view
Files scanned
File Path Reviewed
superset-frontend/src/SqlLab/components/SouthPane/Results.tsx
superset-frontend/src/features/datasets/AddDataset/DatasetPanel/MessageContent.tsx
superset-frontend/src/SqlLab/components/QueryHistory/index.tsx
superset-frontend/src/components/EmptyState/EmptyState.stories.tsx
superset-frontend/src/explore/components/DataTablesPane/components/SamplesPane.tsx
superset-frontend/src/features/allEntities/AllEntitiesTable.tsx
superset-frontend/src/explore/components/DataTablesPane/components/useResultsPane.tsx
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Vertical.tsx
superset-frontend/src/features/datasets/AddDataset/LeftPanel/index.tsx
superset-frontend/src/features/datasets/AddDataset/EditDataset/UsageTab/index.tsx
superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx
superset-frontend/src/features/home/EmptyState.tsx
superset-frontend/src/components/Chart/DrillDetail/DrillDetailPane.tsx
superset-frontend/src/SqlLab/components/TabbedSqlEditors/index.tsx
superset-frontend/src/components/Chart/Chart.tsx
superset-frontend/src/dashboard/components/gridComponents/Tab.jsx
superset-frontend/src/dashboard/components/DashboardGrid.jsx
superset-frontend/src/components/Chart/ChartRenderer.jsx
superset-frontend/src/components/Table/index.tsx
superset-frontend/src/components/EmptyState/index.tsx
superset-frontend/src/components/ListView/ListView.tsx
superset-frontend/src/explore/components/controls/DndColumnSelectControl/ColumnSelectPopover.tsx
superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricEditPopover/index.jsx
superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx
superset-frontend/src/SqlLab/components/SqlEditor/index.tsx
superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.jsx

Explore our documentation to understand the languages and file types we support and the files we ignore.

Need a new review? Comment /korbit-review on this PR and I'll review your latest changes.

Korbit Guide: Usage and Customization

Interacting with Korbit

  • You can manually ask Korbit to review your PR using the /korbit-review command in a comment at the root of your PR.
  • You can ask Korbit to generate a new PR description using the /korbit-generate-pr-description command in any comment on your PR.
  • Too many Korbit comments? I can resolve all my comment threads if you use the /korbit-resolve command in any comment on your PR.
  • Chat with Korbit on issues we post by tagging @korbit-ai in your reply.
  • Help train Korbit to improve your reviews by giving a 👍 or 👎 on the comments Korbit posts.

Customizing Korbit

  • Check out our docs on how you can make Korbit work best for you and your team.
  • Customize Korbit for your organization through the Korbit Console.

Current Korbit Configuration

General Settings
Setting Value
Review Schedule Automatic excluding drafts
Max Issue Count 10
Automatic PR Descriptions
Issue Categories
Category Enabled
Naming
Database Operations
Documentation
Logging
Error Handling
Systems and Environment
Objects and Data Structures
Readability and Maintainability
Asynchronous Processing
Design Patterns
Third-Party Libraries
Performance
Security
Functionality

Feedback and Support

Note

Korbit Pro is free for open source projects 🎉

Looking to add Korbit to your team? Get started with a free 2 week trial here

Copy link
Member

@geido geido left a comment

Choose a reason for hiding this comment

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

Looks great. Thanks for doing this. Just a few nits above but approving otherwise.

"version": "7.24.8",
"resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz",
"integrity": "sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==",
"version": "7.25.9",
Copy link
Member

Choose a reason for hiding this comment

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

Just double-checking. Are these bumps necessary here?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think I bumped babel-types (and maybe other libs (?)) to try and prevent some warning/console messages. I think they're not directly related to the PR but net-positive, will leave them in as they might be related to things I changed here.

@@ -113,7 +113,7 @@ const SqlEditorLeftBar = ({
'schema',
]);

const [emptyResultsWithSearch, setEmptyResultsWithSearch] = useState(false);
const [_emptyResultsWithSearch, setEmptyResultsWithSearch] = useState(false);
Copy link
Member

Choose a reason for hiding this comment

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

I am not sure that we need this. It looks that originally the PR that introduced this was just meant to show some alternate text. I did some testing and I could not see anything breaking with just removing this entirely.

@mistercrunch mistercrunch merged commit fcd1661 into master Jan 22, 2025
51 checks passed
@mistercrunch mistercrunch deleted the refactor_empty branch January 22, 2025 21:20
sfirke pushed a commit to sfirke/superset that referenced this pull request Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants