fix(board header): replace loading icon with spinner

This commit is contained in:
Tommaso Casaburi
2026-05-23 23:30:51 +07:00
parent f5039285a7
commit 0df81b598e
3 changed files with 41 additions and 1 deletions
@@ -200,4 +200,18 @@ describe('BoardHeader', () => {
expect(container.querySelector('[data-testid="tooltip"]')?.getAttribute('data-content')).toBe('Board offline');
expect(container.querySelector('img')?.getAttribute('src')).toBe('banner-a.png');
});
it('renders the board loading indicator while online status is still loading', async () => {
testState.useIsCommunityOfflineValue = {
isOffline: false,
isOnlineStatusLoading: true,
offlineIconClass: 'yellowOfflineIcon',
offlineTitle: 'downloading board...',
};
await renderHeader('/mu');
expect(container.querySelector('[data-testid="tooltip"]')?.getAttribute('data-content')).toBe('downloading board...');
expect(container.querySelector('.yellowOfflineIcon')).not.toBeNull();
});
});
+27 -1
View File
@@ -57,13 +57,39 @@ hr {
}
.yellowOfflineIcon {
background-image: url('/assets/icons/offline-blue.png');
background-image: none;
border: 1px solid currentColor;
border-right-color: transparent;
border-bottom-color: transparent;
border-radius: 50%;
box-sizing: border-box;
-webkit-animation: offline-loading-spin 800ms steps(8, end) infinite;
animation: offline-loading-spin 800ms steps(8, end) infinite;
}
.redOfflineIcon {
background-image: url('/assets/icons/offline-red.png');
}
@keyframes offline-loading-spin {
to {
transform: rotate(360deg);
}
}
@-webkit-keyframes offline-loading-spin {
to {
-webkit-transform: rotate(360deg);
}
}
@media (prefers-reduced-motion: reduce) {
.yellowOfflineIcon {
-webkit-animation: none;
animation: none;
}
}
@media (max-width: 640px) {
.button {
font-size: var(--button-font-size-mobile);