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

Cannot change name of the created/existing template #62

Closed
piotrzarzycki21 opened this issue Nov 6, 2017 · 14 comments
Closed

Cannot change name of the created/existing template #62

piotrzarzycki21 opened this issue Nov 6, 2017 · 14 comments

Comments

@piotrzarzycki21
Copy link
Collaborator

This issue has been extracted from #27, where @JoelProminic created new template and couldn't change the name. Following comments describe the steps.

@rat-moonshine
Copy link
Collaborator

(Changes updated at https://github.com/prominic/Moonshine-IDE/tree/template_creation_changes_ref_62)

Following changes has been applied to the managing template section so far:

  • Template file/project rename
  • File/project name will have an incremental value (i.e. MyFile(2).as) if same named file already exists
  • Creating a new project template now can add file/folders directly to any level or folder (in general in a valid project class file creation only allows inside its source folder)
  • Deleting project template from Settings > Templating section now removes the project from workspace, too. However this immediately removes the entry from the Settings > Templating section which requires to handle

Few things which still needs to work on are:

  • "Modify" option shouldn't be available in case of custom project template entry
  • Removing a file template should also close the file if already open in the editor
  • Deleting an opened project template (on workspace) by its context menu, do not removes the entry from Settings > Templating - this needs to fix

@rat-moonshine
Copy link
Collaborator

  • Removing project template and file deletion now synchronized
  • "Reset" option now available in case of new project/file template creation

@rat-moonshine
Copy link
Collaborator

  • Removing file template from Settings > Templating now auto-close the file tab if already opened

[KNOWN ISSUE] If a file template is open at a time, and it's renamed from the Settings > Templating, deletion of file template do not close its tab effectively (due to renaming).

@JoelProminic
Copy link
Contributor

JoelProminic commented Nov 21, 2017

I noticed that new templates were not populated in the menus until Moonshine restarted:

  1. Start Mooonshine
  2. Open Moonshine > Settings > Templating
  3. Create a new file template
  4. Rename the file template
  5. Create a new project template
  6. Rename the project template.
  7. Save the settings
  8. Open File > New. BUG: Neither template appears in this list
  9. Open/Create a project
  10. Right click on the project and select New. BUG: the file template does not appear in this list. NOTE: this behaved a bit inconsistently for me
  11. Restart Moonshine
  12. Open File > New. Both templates are present
  13. Open/Create a project
  14. Right click on the project and select New. The file template is present.

Also, I noticed that I could not create a new project based on the template added above. When I clicked File > New > , nothing happened.

Mouse scrolling does not work properly in the Templating interface. @rat-moonshine pointed out that it does work if the cursor is over the scroll bar.

@JoelProminic
Copy link
Contributor

Sorry, I accidentally clicked "Close and comment" :(

@JoelProminic JoelProminic reopened this Nov 21, 2017
rat-moonshine added a commit that referenced this issue Nov 23, 2017
1. Rename its tab upon renaming from Settings/Templating
2. Removing the tab upon deletion from Settings/Templating
(reference #62)
rat-moonshine added a commit that referenced this issue Nov 24, 2017
Opening from the newly added File template menu also adds the new file
to an opened project. However, there are still some settlement needs to
do. Deleting from Settings/Templating also removes the menu items from
File/New. (reference #62)
rat-moonshine added a commit that referenced this issue Nov 27, 2017
- Renaming a template from Settings/Templating now renames the item in
File/New dialog (tested in Windows)

Trouble:
- Firing the template creation event after item renamed inside File/New

Known issue:
- Renaming label do not renaming item in right-click-project-File/New

(reference #62)
rat-moonshine added a commit that referenced this issue Nov 27, 2017
Settings/Templating (tested in Windows)

(reference #62)
@rat-moonshine
Copy link
Collaborator

Following things were covered until now:

  • Project creation with custom template from File/New is now working
  • Renaming a template while its opened in an editor, renames its tab title as well
  • Renaming a template also renames the label in File/New (tested in Windows only)
  • Custom template item is also now triggering from File/New after a rename event performs (tested in Windows only)
  • Removing a template from Settings/Templating while its opened in the an editor, closes the tab as well
  • File/project template creation now adds immediately to the File/New menu
  • Deletion of file/project template deletes the entry in File/New menu

Known issues:

  • Add/remove/rename template in project context menu File/New needs to work out properly

@JoelProminic
Copy link
Contributor

I noticed a couple unexpected behaviors with the file templates:

  1. Make sure that there is at least one custom file template
  2. Restart Moonshine
  3. Modify an old template
  4. Delete the old template. The tab closes properly
  5. Create a new File template
  6. Enter some text in the template and save
  7. While the template is still open, rename it - the tab name is updated as well
  8. Open a project
  9. Try to create a new file from the template under src - BUG: nothing happens
  10. Close and reopen the settings window
  11. BUG: The template uses the default name
  12. Click Modify. BUG: the template does not open
  13. Restart Moonshine
  14. Open the Settings
  15. The template name is correct, and it can be modified
  16. Try to create a new file from the template - this works

Sometimes I got this result instead - I don't know what made the difference:
9. Try to create a new File from the template under src - this works
10. Click File > New. BUG: the template no longer appears in this list. The deleted template does appear in this list
11. Restart Moonshine
12. File > New - This list looks correct

For project templates, I saw this behavior:

  1. Create a new project template
  2. Rename the template - BUG: the name does not update in the sidebar
  3. File > New > - BUG: the New Project window does not open
  4. Restart Moonshine
  5. File > New > - This works
  6. Rename the template again
  7. File > New > - BUG: the new project dialog does not open.

rat-moonshine added a commit that referenced this issue Nov 28, 2017
properly triggers in Mac, too
- Project's context menu generates properly with current file template
list each time
- Renaming project template changes name in sidebar in Mac, too
- File template now has new field for extension input

(reference #62)
@rat-moonshine
Copy link
Collaborator

rat-moonshine commented Nov 28, 2017

All of the said bugs above, now handled. Some of them were working partially in Windows, now they works in Mac, too.

Also, while working on the above fixes, I noticed that file created through a custom template (File/New) was saving without an extension. Now, the files saving with extension properly. To handle the situation better, file template creation now has a new field 'Extension' to input the extension type. Previously, one could able to omit the extension part and do a save.

I also noticed some random bug when File/New custom menu items were reverting back to old labels (Mac). This has resolved.

rat-moonshine added a commit that referenced this issue Nov 29, 2017
- [Bug] After renaming a project template - closing the project template
through its context menu was not removing the project from sidebar -
fixed

(reference #62)
@rat-moonshine
Copy link
Collaborator

  • Template file name+extension now validates through single input field

[BUG] While working on above changes, I noticed that renaming a project template, and therefore closing the opened project template through its context menu do not closed the project in sidebar. This has fixed now.

@rat-moonshine
Copy link
Collaborator

New file creation dialog now shows the extension value for the file to be created.

rat-moonshine added a commit that referenced this issue Nov 29, 2017
@rat-moonshine
Copy link
Collaborator

I couldn't able to reproduce this issue with my some time of tests. Please, report if you able to reproduce it and if possibly with some steps @JoelProminic :
image

Since the last remaining issue (file+extension validation handling through single field) is handled now, I'm closing this for the time being, until new problem come out.

@piotrzarzycki21 piotrzarzycki21 added this to the v1.7.0 milestone Nov 29, 2017
@piotrzarzycki21 piotrzarzycki21 moved this from In Progress to Done in Moonshine-IDE - Features Nov 29, 2017
rat-moonshine added a commit that referenced this issue Nov 29, 2017
- Expand/collapse branches now restricted to double-click (reference
#83)
@JoelProminic JoelProminic reopened this Nov 29, 2017
@JoelProminic
Copy link
Contributor

When I created a bunch of new file templates in a row, and then create some example files from the template, I noticed that the File > New menu started getting messed up. For example:

  1. Clear the Moonshine project data
  2. Open Moonshine and complete any setup steps
  3. Create a new project
  4. Create a new file template and rename it - this template appears properly in the File > New and Right-click menus
  5. Create a new file from the template using the right-click menu - This works
  6. Create a new file template and rename it - BUG: the new template appears below the separator with the project templates, and it was not renamed

Some other behavior I saw:

  • The new file template was missing entirely
  • The separator was missing

The right-click menu displayed properly in these tests.

@JoelProminic
Copy link
Contributor

Also, the extension logic looks good to me now, but please change

"Please enter a valid file name with extension."

To:

"Please enter a valid file name including an extension."

rat-moonshine added a commit that referenced this issue Nov 30, 2017
non-VE projects, and during template creation/renaming etc. (reference
#62)
@rat-moonshine
Copy link
Collaborator

Possibly the ordering, vanishing issues in File/New in MacOS now resolved, there were problems which have fixed now. Hopefully, the item messing issues inside File/New will not come again.

While working on the above, I noticed one problem scenario -

  • I had opened 2 projects at same time - a VE project and a non-VE project
  • When VE project is selected File/New items enable/disable state updated accordingly, so in the case of non-VE project
  • Being selected inside a VE project, if I right-click on any item in the non-VE project (not physically selecting it) and try to create a new file from its context menu - it opens the file creation dialog
  • When the dialog removes, File/New items enable/disable change according to the non-VE project [BUG]. Since the selection is still in the VE project, File/New enable/disable state was suppose to show according to the VE project

This problem is solved now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

3 participants