-
Notifications
You must be signed in to change notification settings - Fork 79
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
Move connections pane into core positron #4967
Conversation
71b55c3
to
383330a
Compare
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.
Some nits. A couple of thoughts and a few questions.
src/vs/workbench/contrib/positronConnections/browser/positronConnections.tsx
Outdated
Show resolved
Hide resolved
src/vs/workbench/contrib/positronConnections/browser/positronConnections.tsx
Outdated
Show resolved
Hide resolved
src/vs/workbench/contrib/positronConnections/browser/positronConnections.tsx
Outdated
Show resolved
Hide resolved
src/vs/workbench/contrib/positronConnections/browser/components/actionBar.tsx
Outdated
Show resolved
Hide resolved
src/vs/workbench/contrib/positronConnections/browser/components/actionBar.tsx
Outdated
Show resolved
Hide resolved
src/vs/workbench/contrib/positronConnections/browser/components/actionBar.tsx
Show resolved
Hide resolved
setItems(entries); | ||
})); | ||
// First entries refresh - on component mount. | ||
props.connectionsService.refreshConnectionEntries(); |
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.
refreshConnectionEntries
is not awaited? Makes me wonder if that's actually OK.
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 starts an event that will eventually execute setItems
because of the observer:
positron/src/vs/workbench/contrib/positronConnections/browser/positronConnections.tsx
Lines 78 to 80 in 09d74f5
disposableStore.add(props.connectionsService.onDidChangeEntries((entries) => { | |
setItems(entries); | |
})); |
It seems fine to not wait for it here in the useEffect()
call. But maybe there's a better pattern for this, like useCallback()
?
In 3c29b1b I added some error handling to make sure that the user is notified if something goes wrong before this event is called. Although there's already error handling at the RPC boundaries so we shoould display the entries marked with a special error icons if something goes wrong.
const itemProps = items[props.index]; | ||
|
||
return ( | ||
<PositronConnectionsItem |
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.
Perhaps:
return (
<PositronConnectionsItem
{...itemProps}
selected={itemProps.id === selectedId}
onSelectedHandler={() => setSelectedId(itemProps.id)}
style={props.style}>
</PositronConnectionsItem>
);
Just a thought.
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 tried this and it doesn't work. I have no idea why :S
I just changed to c34d6c7 which looks slightly better, I think!
19bed62
to
c21446c
Compare
Addresses #4874
Needs codicons from: https://github.com/posit-dev/positron-codicons/pull/6
Needs ark side: posit-dev/ark#589
This PR is an initial implementation of the connections pane into Positron core. It's still missing a lot of functionality, but will eventually be equivalent to the current positron-connections extension.
TODO:
Table
orView
Demo:
Screen.Recording.2024-10-15.at.14.30.50.mov
Must be enabled with: