Skip to content
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

recent workspaces & Start Coding #3654

Merged
merged 32 commits into from
Oct 31, 2023
Merged

recent workspaces & Start Coding #3654

merged 32 commits into from
Oct 31, 2023

Conversation

LianaHus
Copy link
Collaborator

@LianaHus LianaHus commented Apr 26, 2023

fix #3357

@netlify
Copy link

netlify bot commented Apr 26, 2023

Deploy Preview for remixproject ready!

Name Link
🔨 Latest commit 7f9b0f9
🔍 Latest deploy log https://app.netlify.com/sites/remixproject/deploys/65413f7999853c0008396db6
😎 Deploy Preview https://deploy-preview-3654--remixproject.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@LianaHus LianaHus changed the title recent workspaces WIP recent workspaces Apr 26, 2023
@LianaHus LianaHus changed the title recent workspaces recent workspaces & Start Coding Apr 26, 2023
@LianaHus LianaHus added this to In progress in v0.33.0 - Feature Freeze 26/04 - Release 11/05 via automation Apr 26, 2023
@LianaHus LianaHus moved this from In progress to Review in progress in v0.33.0 - Feature Freeze 26/04 - Release 11/05 Apr 26, 2023
@Aniket-Engg Aniket-Engg force-pushed the startCoding branch 2 times, most recently from fcd7bc8 to 80e6f6c Compare April 28, 2023 08:44
Copy link
Collaborator

@ryestew ryestew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The helloWorld.sol file should be put into the contracts folder.

@Aniket-Engg Aniket-Engg force-pushed the startCoding branch 2 times, most recently from ce5e847 to 7eba4ca Compare May 3, 2023 06:50
})

const [, dispatch] = useReducer(loadingReducer, loadingInitialState)

const inputValue = useRef(null)

useEffect(() => {
console.log("useEffHomeFile")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove log

console.log("useEffHomeFile")
plugin.on('filePanel', 'setWorkspace', async () => {
let recents = JSON.parse(localStorage.getItem('recentWorkspaces'))
console.log("useEffHomeFilerecents ", recents)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

const handleSwichToRecentWorkspace = async (e, workspaceName) => {
e.preventDefault();
await plugin.call('filePanel', 'switchToWorkspace', { name: workspaceName, isLocalhost: false })
console.log('The link was clicked.');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this log

@Aniket-Engg
Copy link
Collaborator

  • When Remix is loaded first time or in a private window, It should show none or No workspaces for Recent workspaces. For now, it is just blank

Screenshot 2023-05-03 at 12 51 08 PM

  • When One workspace is created, it shows one recent workspace and other two as undefined

Screenshot 2023-05-03 at 12 51 38 PM

  • Fix indentation for helloWorld.sol file.

Screenshot 2023-05-03 at 12 53 23 PM

  • helloWorld.sol should go in contracts folder.
  • For the content of HelloWorld contract, I propose to add also a method like this:
function print() public pure returns (string memory){
        return "Hello World!";
    }

@@ -205,11 +205,11 @@ class FileManager extends Plugin {
path = this.normalize(path)
path = this.limitPluginScope(path)
if (await this.exists(path)) {
await this._handleIsFile(path, `Cannot write file ${path}`)
return await this.setFileContent(path, data)
const newPath = await helper.createNonClashingNameAsync(path, this)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this surely shouln't be here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are you in the file manager itself, this isn't a place where you can on the fly update a file name.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well I think it can be the job of FM to manage name conflicts. Who else should do it? It' s a proper service that should be done by default IMHO

@@ -154,16 +154,35 @@ module.exports = class Filepanel extends ViewPlugin {
})
}

saveRecent (workspace) {
if (!localStorage.getItem('recentWorkspaces')) {
localStorage.setItem('recentWorkspaces', JSON.stringify('"first": "", "second": "", "third": ""'))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why it's not just an array.... ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't know. it feels like manipulation would be easier like that

@LianaHus
Copy link
Collaborator Author

The helloWorld.sol file should be put into the contracts folder.

a contract folder does not always exist

if (await this.exists(path)) {
const newPath = await helper.createNonClashingNameAsync(path, this)
const content = await this.setFileContent(newPath, data)
console.log("newp in write ", newPath)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be removed

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This log should be removed

Copy link
Collaborator

@Aniket-Engg Aniket-Engg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a workspace is deleted, it is still shown in recent workspaces

Also, for me, when I open a workspace from recent workspaces, folder icon is open but files inside it are not shown

const content = `// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.9.0;

contract helloWorld {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

contract name should start with Capital letter by solidity design

await plugin.call('filePanel', 'createWorkspace', wName, 'remixDefault')
}
await plugin.call('filePanel', 'switchToWorkspace', { name: wName, isLocalHost: false })
await plugin.call('filePanel', 'switchToWorkspace', { name: wName, isLocalHost: false }) // don't ask why
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes I'm afraid

@LianaHus
Copy link
Collaborator Author

LianaHus commented Jun 7, 2023

If a workspace is deleted, it is still shown in recent workspaces

Also, for me, when I open a workspace from recent workspaces, folder icon is open but files inside it are not shown

good catch. thanks.

@yann300 yann300 self-requested a review October 31, 2023 17:55
@yann300 yann300 dismissed ryestew’s stale review October 31, 2023 19:24

after discussing it

0.37.0 - Feature Freeze 31/10 - Release 07/11 automation moved this from In progress to Reviewer approved Oct 31, 2023
@yann300 yann300 merged commit c57e2f6 into master Oct 31, 2023
32 checks passed
0.37.0 - Feature Freeze 31/10 - Release 07/11 automation moved this from Reviewer approved to Done Oct 31, 2023
@yann300 yann300 deleted the startCoding branch October 31, 2023 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-review PR ready to review
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Home tab Start Coding
5 participants