-
Notifications
You must be signed in to change notification settings - Fork 874
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
Conversation
✅ Deploy Preview for remixproject ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
fcd7bc8
to
80e6f6c
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.
The helloWorld.sol file should be put into the contracts folder.
ce5e847
to
7eba4ca
Compare
}) | ||
|
||
const [, dispatch] = useReducer(loadingReducer, loadingInitialState) | ||
|
||
const inputValue = useRef(null) | ||
|
||
useEffect(() => { | ||
console.log("useEffHomeFile") |
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.
Remove log
console.log("useEffHomeFile") | ||
plugin.on('filePanel', 'setWorkspace', async () => { | ||
let recents = JSON.parse(localStorage.getItem('recentWorkspaces')) | ||
console.log("useEffHomeFilerecents ", recents) |
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.
same here
const handleSwichToRecentWorkspace = async (e, workspaceName) => { | ||
e.preventDefault(); | ||
await plugin.call('filePanel', 'switchToWorkspace', { name: workspaceName, isLocalhost: false }) | ||
console.log('The link was clicked.'); |
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 log
|
@@ -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) |
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 surely shouln't be here.
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?
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 are you in the file manager itself, this isn't a place where you can on the fly update a file name.
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.
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": ""')) |
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 it's not just an array.... ?
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 know. it feels like manipulation would be easier like that
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) |
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.
should be removed
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 log should be removed
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.
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 { |
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.
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 |
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.
Do we really need it?
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.
yes I'm afraid
good catch. thanks. |
fix #3357