Skip to content

Commit 9f596a9

Browse files
eschuthoclaude
andcommitted
fix(filters): remove gap in horizontal filter bar and fix loading screen theming and sorting
- Remove top padding from horizontal filter bar to eliminate visual gap - Set themed background color on loading screen to respect dark mode - Remove fallback "Loading..." text to prevent Times New Roman display - Use colorBgBase theme token for proper light/dark mode support - Fix filter value sorting to preserve backend metric-based order when sortMetric is specified 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 36daa2d commit 9f596a9

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Horizontal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import crossFiltersSelector from './CrossFilters/selectors';
3232

3333
const HorizontalBar = styled.div`
3434
${({ theme }) => `
35-
padding: ${theme.sizeUnit * 3}px ${theme.sizeUnit * 2}px ${
35+
padding: 0 ${theme.sizeUnit * 2}px ${
3636
theme.sizeUnit * 3
3737
}px ${theme.sizeUnit * 4}px;
3838
background: ${theme.colorBgBase};

superset-frontend/src/filters/components/Select/SelectFilterPlugin.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,13 +317,20 @@ export default function PluginFilterSelect(props: PluginFilterSelectProps) {
317317

318318
const sortComparator = useCallback(
319319
(a: LabeledValue, b: LabeledValue) => {
320+
// When sortMetric is specified, the backend already sorted the data correctly
321+
// Don't override the backend's metric-based sorting with frontend alphabetical sorting
322+
if (formData.sortMetric) {
323+
return 0; // Preserve the original order from the backend
324+
}
325+
326+
// Only apply alphabetical sorting when no sortMetric is specified
320327
const labelComparator = propertyComparator('label');
321328
if (formData.sortAscending) {
322329
return labelComparator(a, b);
323330
}
324331
return labelComparator(b, a);
325332
},
326-
[formData.sortAscending],
333+
[formData.sortAscending, formData.sortMetric],
327334
);
328335

329336
// Use effect for initialisation for filter plugin

superset/templates/superset/spa.html

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
{% endblock %}
7070
</head>
7171

72-
<body {% if standalone_mode %}class="standalone"{% endif %}>
72+
<body {% if standalone_mode %}class="standalone"{% endif %} style="margin: 0; padding: 0; background-color: {{ tokens.get('colorBgBase', '#ffffff') }};">
7373

7474
{% block body %}
7575
<div id="app" data-bootstrap="{{ bootstrap_data }}">
@@ -85,14 +85,10 @@
8585
<!-- Custom URL from theme -->
8686
<img
8787
src="{{ tokens.brandSpinnerUrl }}"
88-
alt="Loading..."
88+
alt=""
8989
style="{{ spinner_style }}"
9090
/>
91-
{% else %}
92-
<!-- Fallback: This should rarely happen with new logic -->
93-
<div style="{{ spinner_style }}">
94-
Loading...
95-
</div>
91+
{# Remove fallback text - let React app handle loading state #}
9692
{% endif %}
9793
</div>
9894
{% endblock %}

0 commit comments

Comments
 (0)