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

Convert Editor to functional, splits off CodeMirror code into its own file #3352

Merged
merged 14 commits into from
Mar 28, 2025

Conversation

khanniie
Copy link
Collaborator

@khanniie khanniie commented Feb 28, 2025

Part of larger CodeMirror v5 -> v6 conversion. This converts the Editor component from class-based to functional style.

Changes:

I have verified that this pull request:

  • has no linting errors (npm run lint)
  • has no test errors (npm run test)
  • is from a uniquely-named feature branch and is up to date with the develop branch.
  • is descriptively named and links to an issue number, i.e. Fixes #123

@khanniie khanniie changed the base branch from develop to connie-develop February 28, 2025 17:11
Copy link

release-com bot commented Feb 28, 2025

Release Environments

This Environment is provided by Release, learn more!
To see the status of the Environment click on Environment Status below.

🔧Environment Status : https://app.release.com/public/Processing%20Foundation/env-4246ac625c

@raclim
Copy link
Collaborator

raclim commented Mar 4, 2025

Thanks so much for your work on this! After doing some manual testing, I think this mostly felt good besides an issue with unsaved changes—I attached some videos below to help visualize it!

In the current setup, if I have unsaved changes, the changes would remain.

editor_ver.mov

Here, I think I'm seeing that the unsaved changes disappear on Autosave.

PR_ver.mov

Besides this, I feel like everything else seems to work well for me!

@raclim raclim added the Area:Editor For CodeMirror-related features label Mar 6, 2025
@khanniie khanniie force-pushed the connie-editor-conversion-splitoff-codemirror branch from 5b7cc8c to 76a8c97 Compare March 7, 2025 16:57
@khanniie khanniie force-pushed the connie-editor-conversion-splitoff-codemirror branch from 1e8e8ce to 6d7ef6d Compare March 28, 2025 02:59
I'm fairly certain that we can remove ```
      if (!prevProps?.unsavedChanges) {
        setTimeout(() => setUnsavedChanges(false), 400);
      }
```

I looked at the git blame and it looks like the intention was to stop setting unsavedchanges to false when the files switched, but i think the solve that was implemented 9 years ago did something like "if c == false, c = false" and we should be able to safely remove it instead.

reference commit: 77e2f5b
@khanniie khanniie changed the title Connie editor conversion splitoff codemirror Convert Editor to functional, splits off CodeMirror code into its own file Mar 28, 2025
Copy link
Collaborator

@raclim raclim left a comment

Choose a reason for hiding this comment

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

Thanks so much for your work on this!!! This overall looks good to me! :)

I feel like any further issues that come up from this will probably be on the minor end, and can be addressed down the line!

@raclim raclim merged commit 9fd608d into connie-develop Mar 28, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area:Editor For CodeMirror-related features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants