Run IDE with Project Manager endpoint instead of Language Server endpoints, when on local backend (#6810)

This is a fix for a couple of recent regressions:
- Fixes #6756: Projects couldn't be renamed anymore from within the project view.
- Fixes #6804: One could no longer switch between projects from within the project view.
- It also unblocks the issue with the spinner (that got reverted), but that probably needs some extra attention.

It might be the long-term goal to have different UX solutions to these cases, but this should fix those regressions in the short term at least.

Thanks to @somebody1234 for the in-depth conversation (and the actual code!).
This commit is contained in:
Stijn ("stain") Seghers 2023-05-30 14:42:22 +02:00 committed by GitHub
parent 4fdcea3635
commit ab159238dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View File

@ -299,6 +299,7 @@ function Dashboard(props: DashboardProps) {
const switchToDashboardTab = react.useCallback(() => {
setTab(Tab.dashboard)
doRefresh()
const ideElement = document.getElementById(IDE_ELEMENT_ID)
if (ideElement) {
ideElement.style.top = '-100vh'

View File

@ -4,6 +4,8 @@ import * as react from 'react'
import * as backendModule from '../backend'
import * as backendProvider from '../../providers/backend'
import GLOBAL_CONFIG from '../../../../../../../../gui/config.yaml' assert { type: 'yaml' }
// =================
// === Constants ===
// =================
@ -67,6 +69,15 @@ function Ide(props: IdeProps) {
}
})()
const runNewProject = async () => {
const engineConfig =
backend.type === backendModule.BackendType.remote
? {
rpcUrl: jsonAddress,
dataUrl: binaryAddress,
}
: {
projectManagerUrl: GLOBAL_CONFIG.projectManagerEndpoint,
}
await appRunner.runApp({
loader: {
assetsUrl: `${assetsRoot}dynamic-assets`,
@ -74,8 +85,7 @@ function Ide(props: IdeProps) {
jsUrl: `${assetsRoot}pkg${JS_EXTENSION[backend.type]}`,
},
engine: {
rpcUrl: jsonAddress,
dataUrl: binaryAddress,
...engineConfig,
preferredVersion: engineVersion,
},
startup: {