-
Notifications
You must be signed in to change notification settings - Fork 238
feat(compass-welcome): show connection progress on welcome COMPASS-9634 #7258
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
Conversation
| dispatch( | ||
| updateConnectionStep(connectionInfo.id, 'topology', 'completed') | ||
| ); | ||
| dispatch( | ||
| updateConnectionStep( | ||
| connectionInfo.id, | ||
| 'authentication', | ||
| 'in-progress' | ||
| ) | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dispatching actions (especially setter actions) in bulk is an antipattern that usually points to a wrongly selected abstraction for the action: actions should roughly map to actual events happening in the app, and then it's reducer job to define what exactly that means. As you are actually dealing with already existing events here, I think the best thing you can do is to actually model your actions around those and make reducer decide how to modify state based on that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this a web only feature? It doesn't rely on anything web specific
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mainly just layout, it is totally doable on desktop but I wasn't sure what to do with the "start a free cluster" and "add a connection" cards that are also on this page, I guess they can just be wholesale replaced. My hesitation comes from how the plug image replacing the cloud image is a bit of a jolt but it works because they're in the same position, when I was running this on desktop, the cloud image is to one side, and the jump to center for the plug seems like buggy almost? I may be overly sensitive and we should just keep it simple and make both work.
| const connectionName = connectionInfo.title; | ||
|
|
||
| // Create sub-items for connecting steps | ||
| const renderConnectingSteps = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A cleaner approach would be to define either this or even a single step outside of the render as a separate component ("Thinking in React" is an easy read to get a feeling for how to break down code like that)
|
|
||
| // Create a proper 'connected' state, which excludes connectingSteps | ||
| const newConnectionState: ConnectionState = { | ||
| info: existingConnection?.info || ({} as ConnectionInfo), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This action should not proceed if you don't have a corresponding connection in the state, assigning an empty info is a dangerous assumption that also doesn't really make sense in the context of the whole app
| updateConnectionStep: ( | ||
| connectionId: ConnectionId, | ||
| step: 'topology' | 'authentication' | 'listingDatabases', | ||
| status: 'pending' | 'in-progress' | 'completed' | 'failed' | ||
| ) => { | ||
| return dispatch(updateConnectionStep(connectionId, step, status)); | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we would want this to be exposed as part of the connections public interface, the logic for updating connection state should stay in the plugin
| // Get IDs of connections that are currently connecting | ||
| const connectingConnectionIds = useConnectionIds( | ||
| (connection) => connection.status === 'connecting' | ||
| ); | ||
|
|
||
| // Get IDs of connections that are connected | ||
| const connectedConnectionIds = useConnectionIds( | ||
| (connection) => connection.status === 'connected' | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably include errored connections also, otherwise they jump in and out of this view in a very weird way
| fontSize: '14px', | ||
| color: palette.gray.dark1, // Grayish color for connecting state |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| { | ||
| key: 'listingDatabases', | ||
| label: 'Listing Databases...', | ||
| status: connectingSteps.listingDatabases, | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This status will never meaningfully show up as finished (or would even stay in progress for long) because for compass to consider connection connected and to be functional it doesn't need to list databases
9b5c448 to
ff3385d
Compare
ff3385d to
2e29c53
Compare
|
@gribnoysup After wrestling with the "real" statuses for long enough I relent, this ticket was intended to give more a reactive UX for the longer wait times on Web while we worked on real improvements to latency. We actually have met our goal latency for GA, so I think some spinners that just react to the current connected/failed state are good enough. Figured we can do desktop too here :) but easily changed to just be web only. The problem with accurate spinners is they don't give you the satisfaction you're seeking 😅. I want a nice satisfying check, check, check. In practice the steps are happening too fast to capture in an animation. Screen.Recording.2025-09-08.at.12.47.34.AM.movScreen.Recording.2025-09-08.at.12.53.38.AM.movSo for posterity, international changes from the designs:
I put "no release notes" bc I figure we wouldn't right a note about the welcome page spinners, but maybe that's the wrong assumption 🤔 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds connection progress functionality to the Compass welcome page, allowing users to see real-time status updates when connecting to clusters.
- Displays connection progress status (connecting, connected, failed) with appropriate icons and animations
- Switches the welcome page visual from the default tab image to a "plug" image when connections are active
- Shows a dynamic list of active connections with their current status instead of static welcome content
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/compass-welcome/src/components/welcome-image.tsx | Adds new WelcomePlugImage SVG component for active connection state |
| packages/compass-welcome/src/components/web-welcome-tab.tsx | Integrates connection progress display and conditional image switching |
| packages/compass-welcome/src/components/desktop-welcome-tab.tsx | Integrates connection progress display and conditional image switching |
| packages/compass-welcome/src/components/connection-list.tsx | New component handling connection status display with animations and icons |
Comments suppressed due to low confidence (1)
packages/compass-welcome/src/components/desktop-welcome-tab.tsx:1
- The nested ternary operator using && and || operators creates confusing logic flow. Consider refactoring to use explicit if-else conditions or separate the logic into clearer conditional blocks for better readability.
import React from 'react';
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
packages/compass-welcome/src/components/desktop-welcome-tab.tsx
Outdated
Show resolved
Hide resolved
| export function WelcomePlugImage(props: SVGProps<SVGSVGElement>) { | ||
| return ( | ||
| <svg | ||
| className="darkreader-ignore-child-inline-style" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prevents cloud's way of doing dark mode from changing the fills in the svg. Looks exactly the same as compass dark mode now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like you capilalized some styles by accident, otherwise LGTM
| minHeight: `${spacing[200] * 3 + 72}px`, | ||
| }); | ||
|
|
||
| const fadeInFromAbove = keyframes({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I tried some experimentation but since it unmounts I'd have to track the state outside of the component I think. I think most users will navigate away almost immediately 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can do it by making it a style that applies only as effect after initial render of this view on the newly added items, keeping all the state inside the component, but it is still an overkill for the value we get here for sure 😅
| </clipPath> | ||
| <style> | ||
| { | ||
| '.g,.h{fill:none}.i{fill:#e3fcf7}.g,.h,.i,.j,.k,.l,.m,.o,.p{stroke:#000000;stroke-linecap:round;stroke-linejoin:round}.j{fill:#ffc010}.k,.o{fill:#ffffff}.l{fill:#ffc010}.m{fill:#00ed64}.h{stroke-dasharray:0 0 2 2}.o{stroke-width:.8px}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is css, not css in js, so shouldn't be capilatized
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
|
RE release notes: I think we're trying to keep the rules as simple as possible, so I'd suggest user facing -> goes into release notes, even if it's a small thing |


Description
The welcome page now responds to a connect click and shows the connect progress to each cluster.
Checklist
Motivation and Context
Open Questions
Dependents
Types of changes