Skip to content

fix(loading): improve loading screen theming for dark mode support#35129

Merged
eschutho merged 6 commits into
masterfrom
fix/loading-screen-dark-mode-theming
Oct 3, 2025
Merged

fix(loading): improve loading screen theming for dark mode support#35129
eschutho merged 6 commits into
masterfrom
fix/loading-screen-dark-mode-theming

Conversation

@eschutho
Copy link
Copy Markdown
Member

@eschutho eschutho commented Sep 13, 2025

SUMMARY

This PR improves the loading screen experience for users with dark mode preferences and enhances accessibility.

Changes:

  • Added CSS styles to support system dark mode preference (@media (prefers-color-scheme: dark))
  • Improved accessibility by using aria-label="Loading" instead of alt text for spinner images
  • Ensures loading indicators work properly in both light and dark themes

The changes provide a better initial loading experience that respects user's system theme preferences before the main application loads and eliminates jarring white flashes in dark mode.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Screen.Recording.2025-09-15.at.1.43.15.PM.mov

TESTING INSTRUCTIONS

  1. Set your system to dark mode preference
  2. Load a Superset page and observe the loading screen
  3. Verify the loading screen background/text matches your system theme
  4. Test with screen reader to confirm "Loading" is announced properly
  5. Verify no white flash occurs during page load in dark mode

ADDITIONAL INFORMATION

  • Changes UI

🤖 Generated with Claude Code

Copy link
Copy Markdown

@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.

I've completed my review and didn't find any issues.

Check out our docs on how you can make Korbit work best for you and your team.

Loving Korbit!? Share us on LinkedIn Reddit and X

@dosubot dosubot Bot added change:frontend Requires changing the frontend global:theming Related to theming Superset labels Sep 13, 2025
@eschutho eschutho added the 🎪 ⚡ showtime-trigger-start Create new ephemeral environment for this PR label Sep 13, 2025
@github-actions github-actions Bot added 🎪 6f6d925 🚦 building and removed 🎪 ⚡ showtime-trigger-start Create new ephemeral environment for this PR labels Sep 13, 2025
@github-actions
Copy link
Copy Markdown
Contributor

🎪 Showtime is building environment on GHA for 6f6d925

@github-actions
Copy link
Copy Markdown
Contributor

🎪 Showtime deployed environment on GHA for 6f6d925

Environment: http://44.251.170.59:8080 (admin/admin)
Lifetime: 24h auto-cleanup
Updates: New commits create fresh environments automatically

@github-actions
Copy link
Copy Markdown
Contributor

🎪 Showtime is building environment on GHA for 39d832c

@github-actions
Copy link
Copy Markdown
Contributor

🎪 Showtime deployed environment on GHA for 7e44735

Environment: http://35.87.124.232:8080 (admin/admin)
Lifetime: 48h auto-cleanup
Updates: New commits create fresh environments automatically

@eschutho eschutho changed the base branch from 6.0-bug-fixes to master September 24, 2025 22:00
Copy link
Copy Markdown
Member

@msyavuz msyavuz left a comment

Choose a reason for hiding this comment

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

I think there is some cleanup needed

Comment on lines 376 to 377
error: AntdModal.error,
warning: AntdModal.warning,
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.

Should these two use the themed version as well?

<GlobalStyles />
<ConfigProvider theme={themeState.antdConfig}>
{children}
<App>{children}</App>
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.

This provides some reset styles that could mess up other parts of the ui.

Comment on lines +320 to +333
// When sortMetric is specified, the backend already sorted the data correctly
// Don't override the backend's metric-based sorting with frontend alphabetical sorting
if (formData.sortMetric) {
return 0; // Preserve the original order from the backend
}

// Only apply alphabetical sorting when no sortMetric is specified
const labelComparator = propertyComparator('label');
if (formData.sortAscending) {
return labelComparator(a, b);
}
return labelComparator(b, a);
},
[formData.sortAscending],
[formData.sortAscending, formData.sortMetric],
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.

This looks like leftover code from another pr

Comment thread superset/embedded/view.py
Comment on lines -92 to -94
bootstrap_data=json.dumps(
bootstrap_data, default=json.pessimistic_json_iso_dttm_ser
),
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.

Getting rid of this will make it so there will be errors when the serialization fails

Comment thread superset/templates/superset/spa.html
@eschutho
Copy link
Copy Markdown
Member Author

I think Claude did a bad rebase.. will clean up.

eschutho and others added 4 commits October 2, 2025 09:27
Fixes white flash in dark mode and removes fallback "Loading..." text
that was displaying in Times New Roman font.

Changes:
- Set themed background color on body using colorBgBase token
- Supports both light (#ffffff) and dark mode backgrounds
- Remove "Loading..." alt text from branded spinner image
- Remove fallback "Loading..." text div entirely
- Let React app handle loading state instead of HTML fallback

This eliminates the white background flash when loading in dark mode
and removes the unstyled "Loading..." text that appeared briefly.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Added dark mode styling and improved loading indicators.
Removed fallback loading message from spa.html.
Add aria-label to loading spinner image for screen reader accessibility while keeping empty alt text to prevent fallback display if image fails to load.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Oct 2, 2025

🎪 Showtime is building environment on GHA for 951b48d

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Oct 2, 2025

🎪 Showtime deployed environment on GHA for 951b48d

Environment: http://44.249.56.21:8080 (admin/admin)
Lifetime: 48h auto-cleanup
Updates: New commits create fresh environments automatically

@eschutho
Copy link
Copy Markdown
Member Author

eschutho commented Oct 3, 2025

@msyavuz this is ready for review now. Thanks!

Copy link
Copy Markdown

@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.

I've completed my review and didn't find any issues.

Files scanned
File Path Reviewed
superset/templates/superset/spa.html

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.

Loving Korbit!? Share us on LinkedIn Reddit and X

Copy link
Copy Markdown
Member

@msyavuz msyavuz left a comment

Choose a reason for hiding this comment

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

LGTM!

Remove trailing whitespace from the style block to comply with pre-commit hooks.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Oct 3, 2025

🎪 Showtime is building environment on GHA for 1faaa21

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Oct 3, 2025

🎪 Showtime deployed environment on GHA for 1faaa21

Environment: http://44.243.219.226:8080 (admin/admin)
Lifetime: 48h auto-cleanup
Updates: New commits create fresh environments automatically

Replace `waitFor` with `getByText` pattern with `findByText` which automatically
waits for the element to appear. This follows React Testing Library best practices
and eliminates flaky test failures caused by timing issues with fake/real timers.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Oct 3, 2025

🎪 Showtime is building environment on GHA for 032abe7

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Oct 3, 2025

🎪 Showtime deployed environment on GHA for 032abe7

Environment: http://35.90.97.68:8080 (admin/admin)
Lifetime: 48h auto-cleanup
Updates: New commits create fresh environments automatically

expect(
await screen.findByText(PRE_FILTER_REQUIRED_REGEX),
).toBeInTheDocument();
}, 50000); // Slow-running test, increase timeout to 50 seconds.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

fix for a flaky test

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

Labels

🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels change:frontend Requires changing the frontend global:theming Related to theming Superset packages preset-io review:draft size/M v6.0 Label added by the release manager to track PRs to be included in the 6.0 branch 🍒 6.0.0 Cherry-picked to 6.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants