enso-org / enso

Hybrid visual and textual functional programming.
https://enso.org
Apache License 2.0
7.31k stars 318 forks source link

Renaming project in GUI #10243

Closed farmaazon closed 2 weeks ago

farmaazon commented 3 weeks ago

Pull Request Description

Fixes #10073

Screencast from 2024-06-11 13-01-10.webm

Important Notes

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

farmaazon commented 3 weeks ago

@somebody1234 @MrFlashAccount Please, review my changes in dashboard. Also, I don't know how to properly update the name in project list after changing it in project view. Any hints?

somebody1234 commented 3 weeks ago

as for changing the project name - there is a setProjectAsset function in the projectStartupInfo - you can use it something like this

projectStartupInfo.setProjectAsset(asset => ({ ...asset, title: newName })))

or this, with the appropriate import (auto-import + change {} import to * import should work, or copy-paste from somewhere else with object.merger as a last resort)

projectStartupInfo.setProjectAsset(object.merger({ title: newName }))
farmaazon commented 2 weeks ago

@somebody1234 I came back to this one; applied your review with the suggestion: it works, but only when I open the project in given session; if the project is automatically opened, setProjectAsset is undefined.

farmaazon commented 2 weeks ago

We decided to merge this PR with the above issue. Still requires review, though.