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

WIP: Replace easymde with textarea #15394

Closed
wants to merge 1 commit into from

Conversation

silverwind
Copy link
Member

@silverwind silverwind commented Apr 10, 2021

WIP on the easymde replacement. Basically it rips out EasyMDE without much second thought. Issue commenting works but other things may be broken.

TODOs:

  • Fix up loose ends, quote reply, image paste, etc
  • Replace Tribute with something better, remove RequireTribute
  • Finish style removal, remove _editor.less
  • Add toolbar when editing markdown files in the repo
  • Fix review textarea
  • Re-Implement fullscreen side-by-side (maybe for another PR)

Fixes #10729 and a probably 30 other issues.

image

@silverwind silverwind added topic/ui Change the appearance of the Gitea UI pr/wip This PR is not ready for review labels Apr 10, 2021
@silverwind silverwind added this to the 1.15.0 milestone Apr 10, 2021
@silverwind silverwind force-pushed the textarea branch 2 times, most recently from 0bd6549 to 26bf6e2 Compare April 10, 2021 20:39
@zeripath
Copy link
Contributor

Our users really really like the WYSIWYG editor.

I think this has to be an option to switch between editors. In fact we need to have the option to use easymde as the main editor too.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 10, 2021
@silverwind
Copy link
Member Author

silverwind commented Apr 10, 2021

WYSIWYG

You can't really call it that. It's more like a strange mixup between HTML and Markdown inside a buggy editor that is not accessible. Markdown was not designed for this and neither GitHub or GitLab offer such a mode. If anything, it should be opt-in.

I still think a majority of users would prefer a plaintext editor, it's only natural for developers.

@silverwind silverwind changed the title Replace easymde with textarea WIP: Replace easymde with textarea Apr 12, 2021
WIP on the easymde replacement. Basically it rips out EasyMDE without
much second thought. Issue commenting works but other things may be broken.
@silverwind
Copy link
Member Author

Rebased and kept the CodeMirror files in the repo for now make the diff more manageable.

Any more feedback on whether we can go ahead with this?

To me it's still a clear case. I curse at EasyMDE almost daily when it decides to delete entered text because of its atrocious handling of backtick characters.

@richmahn
Copy link
Contributor

richmahn commented Apr 28, 2021

I still think a majority of users would prefer a plaintext editor, it's only natural for developers.

While I understand what is going on here, as I implemented the original File editing feature for Gogs back in 2016 with CodeMirror and have made a few fixes once we all switched over to Gitea, just want to say we have thousands of users and not a single one is a developer. We use this for content, in various forms (Markdown, HTML, TSV, USFM, RST). We would have to figure out how we can properly have some sort of preview and WYSIWYG.

@igalic
Copy link

igalic commented Apr 28, 2021

how many of those thousands of users have to, occasionally, use gitea from a mobile device?

@richmahn
Copy link
Contributor

@igalic at least a hundred use our site directly, https://git.door43.org, but good point, as mobile apps have nothing to do with this feature. :)

@igalic
Copy link

igalic commented Apr 28, 2021

unless the mobile app is Firefox, in which case, good luck, mozilla-mobile/fenix#4208

@silverwind
Copy link
Member Author

silverwind commented May 22, 2021

We would have to figure out how we can properly have some sort of preview and WYSIWYG.

There's a "Preview" Tab right above the editor, is that really so hard to discover?

I think I would implement some form of side-by-side editor, but the rendering has to be done by the server to match the actual output so there will be a slight delay to update the preview. Currently what EasyMDE shows may totally not match what the final result will be.

@fnetX
Copy link
Contributor

fnetX commented May 29, 2021

Just adding my thoughts:

  • I only write markdown and don't want to rely on any special markup in the editor
  • preview: works fine!
  • side-by-side should be optional IMHO and sounds more like a plan for the future, unless you're really fond of working on it

Oh and thank you very much for working on it! 💯
I'm really looking forward no longer to see weird editor bugs or hear users complaining about Gitea being inaccessible to mobile devices

@silverwind
Copy link
Member Author

silverwind commented May 31, 2021

I plan to pick this up again given the positive feedback. I think it outweights the negative ones :)

Maybe I will skip side-by-side mode reimplementation and defer it to another PR. I think it's not an essential feature to have and would require additional backend changes that might over-complicate this PR.

@techknowlogick techknowlogick modified the milestones: 1.15.0, 1.16.0 Jun 23, 2021
web_src/js/index.js Show resolved Hide resolved
web_src/js/index.js Show resolved Hide resolved
web_src/js/index.js Show resolved Hide resolved
web_src/js/index.js Show resolved Hide resolved
web_src/js/index.js Show resolved Hide resolved
web_src/js/index.js Show resolved Hide resolved
web_src/js/index.js Show resolved Hide resolved
web_src/js/features/markdowneditor.js Show resolved Hide resolved
@wxiaoguang

This comment was marked as outdated.

@silverwind
Copy link
Member Author

silverwind commented Mar 2, 2023

This is now too far out of date to be of any use, but we should still pursue it.

@silverwind silverwind closed this Mar 2, 2023
@silverwind silverwind deleted the textarea branch March 2, 2023 12:02
lunny pushed a commit that referenced this pull request Apr 3, 2023
The first step of the plan

* #23290

Thanks to @silverwind for the first try in #15394 . Close #10729 and a
lot of related issues.

The EasyMDE is not removed, now it works as a fallback, users can switch
between these two editors.

Editor list:

* Issue / PR comment
* Issue / PR comment edit
* Issue / PR comment quote reply
* PR diff view, inline comment
* PR diff view, inline comment edit
* PR diff view, inline comment quote reply
* Release editor
* Wiki editor

Some editors have attached dropzone

Screenshots:

<details>


![image](https://user-images.githubusercontent.com/2114189/229363558-7e44dcd4-fb6d-48a0-92f8-bd12f57bb0a0.png)


![image](https://user-images.githubusercontent.com/2114189/229363566-781489c8-5306-4347-9714-d71af5d5b0b1.png)


![image](https://user-images.githubusercontent.com/2114189/229363771-1717bf5c-0f2a-4fc2-ba84-4f5b2a343a11.png)


![image](https://user-images.githubusercontent.com/2114189/229363793-ad362d0f-a045-47bd-8f9d-05a9a842bb39.png)

</details>

---------

Co-authored-by: silverwind <me@silverwind.io>
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. pr/wip This PR is not ready for review topic/ui Change the appearance of the Gitea UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace EasyMDE with textarea
10 participants