Skip to content

Commit 66bdad8

Browse files
authored
fix: DH-14657 Disconnect handling increase debounce timeout (#1347)
DH-14657 Increases the timeout to 1s. Immediately shows the disconnect icon on the user settings icon when disconnect happens and changes the tooltip (although it will be extremely difficult for the user to trigger that tooltip since the modal will block access to it 1 second later) Here's how to test w/ ngrok (I couldn't switch between wired and wireless on my PC b/c I need to fix some wifi drivers apparently) ``` ngrok http 10000 VITE_CORE_API_URL=https://ngrok.link/jsapi npm start ``` Then open `localhost:4000` in firefox and enable work offline from the File menu
1 parent b0b6b05 commit 66bdad8

1 file changed

Lines changed: 27 additions & 6 deletions

File tree

packages/code-studio/src/main/AppMainContainer.tsx

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ import {
6868
dhShapes,
6969
dhPanels,
7070
vsDebugDisconnect,
71+
dhSquareFilled,
7172
} from '@deephaven/icons';
7273
import dh from '@deephaven/jsapi-shim';
7374
import type {
@@ -891,12 +892,32 @@ export class AppMainContainer extends Component<
891892
})}
892893
onClick={this.handleSettingsMenuShow}
893894
icon={
894-
<FontAwesomeIcon
895-
icon={vsGear}
896-
transform="grow-3 right-1 down-1"
897-
/>
895+
<span className="fa-layers">
896+
<FontAwesomeIcon
897+
icon={vsGear}
898+
transform="grow-3 right-1 down-1"
899+
/>
900+
{isDisconnected && !isAuthFailed && (
901+
<>
902+
<FontAwesomeIcon
903+
icon={dhSquareFilled}
904+
color={ThemeExport.background}
905+
transform="grow-2 right-8 down-8.5 rotate-45"
906+
/>
907+
<FontAwesomeIcon
908+
icon={vsDebugDisconnect}
909+
color={ThemeExport.danger}
910+
transform="shrink-5 right-6 down-6"
911+
/>
912+
</>
913+
)}
914+
</span>
915+
}
916+
tooltip={
917+
isDisconnected && !isAuthFailed
918+
? 'Server disconnected'
919+
: 'User Settings'
898920
}
899-
tooltip="User Settings"
900921
/>
901922
</div>
902923
</div>
@@ -957,7 +978,7 @@ export class AppMainContainer extends Component<
957978
/>
958979
<DebouncedModal
959980
isOpen={isDisconnected && !isAuthFailed}
960-
debounceMs={250}
981+
debounceMs={1000}
961982
>
962983
<InfoModal
963984
icon={vsDebugDisconnect}

0 commit comments

Comments
 (0)