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

Web editor #3460

Closed
6 tasks done
unknwon opened this issue Aug 15, 2016 · 22 comments
Closed
6 tasks done

Web editor #3460

unknwon opened this issue Aug 15, 2016 · 22 comments
Assignees
Labels
🎯 feature Categorizes as related to a new feature
Milestone

Comments

@unknwon
Copy link
Member

unknwon commented Aug 15, 2016

Web editor for repository files are now in public beta in master branch and demo site (https://try.gogs.io), but not yet fully done.

Todos/issues:

I'll maintain this list based on feedback in comments.

Besides, to keep this thread clean and focus on implementation, there are some rules of comment in this thread; violate to those rules will result in deletion of your comment without warning:

  1. Do not comment unless you have a bug report with reproduce steps on demo site (https://try.gogs.io)
  2. Do not post duplicated or irrelavent problems
  3. Use reactions
@unknwon unknwon added the 🎯 feature Categorizes as related to a new feature label Aug 15, 2016
@unknwon unknwon added this to the 0.10.0 milestone Aug 15, 2016
@unknwon unknwon self-assigned this Aug 15, 2016
@richmahn
Copy link
Contributor

@unknwon I don't understand the mirror repositories should not allow edit item. Like Github, even a repo that you can't edit still has an edit icon and has you fork it if you can't edit. Or are you saying if someone mirrors my repo, currently I can edit their repo but shouldn't be able to? How to reproduce what you saw?

@unknwon
Copy link
Member Author

unknwon commented Aug 15, 2016

@richmahn You simply can't push changes to a mirror repository in Gogs, this is by Gogs's definition. You can also fork but can't send pull request.

@joubertredrat
Copy link

joubertredrat commented Aug 16, 2016

This is results from my first test, was tested on Firefox, Chrome, Opera and Vivaldi. Fortunately, IE doesn't work on Linux :)

  • If I edit js, json, css, php files, tabulation doesn't work fine, tab work fine, but shift + tab not.
  • If I edit txt files, tab add more tabulation normally, but shift + tab remove all tabulation one time, and the correct was to remove the tabulation one by one.
  • On md files, both tab and shift + tab works fine.
  • I think that is good to ? tooltip explain too that if you change name on input when you edit, Gogs will rename file.
  • Toggle side by side is amazing, nice option.
  • Gogs doesn't allow me edit photo files, this is correct.

I will continue testing to see if I have more impressions.

@joubertredrat
Copy link

@joubertredrat tested on demo site with Chrome and shift + tab works as expected.

@unknwon You edited md files, text files or another language files? I tested here again with Chrome on both Linux and Windows

I will view here If I can provide a small video with this issue.

@unknwon
Copy link
Member Author

unknwon commented Aug 16, 2016

@joubertredrat yes, all works, but indeed for code file shift + tab sometimes delete more than it should. But I don't see any code handles tab in Gogs codebase, so I guess it is upstream bug of CodeMirror maybe.

@joubertredrat
Copy link

@unknwon Ok, I will test here to see if I can reproduce this issue directly on CodeMirror

@fontenele
Copy link

fontenele commented Aug 16, 2016

Testing in firefox/linux/debian:

  • Creating txt files: OK
  • Editing txt files: OK
  • Creating php files: OK but indentation is using 2 spaces, normally we use 4 spaces in PHP
  • Previewing php files: indentation is confused on preview, but when editing this is OK
  • Editing php files: when i go to preview changes without make any changes, it shows me i changed all the file on the diff preview.
  • Creating js files: OK
  • Editing js files: OK
  • Previewing js files: OK
  • Creating json files: OK
  • Editing json files: OK
  • Previewing json files: OK
  • ALL FILES EXTENCIONS I edit, without have any change i click in preview then show me as i have changed all the file.

Continue testing...

@unknwon
Copy link
Member Author

unknwon commented Aug 16, 2016

Line endings can be different which cause unnecessary diff.

(please continue edit same comment, otherwise will be deleted)

@joubertredrat
Copy link

joubertredrat commented Aug 18, 2016

codemirror/codemirror5#4177
[edit]
codemirror/codemirror5#4177 (comment)

@joubertredrat
Copy link

joubertredrat commented Aug 26, 2016

@unknwon for shift + tab, is possible to remap keys, on link below have more about this.

https://github.com/codemirror/CodeMirror/blob/master/keymap/sublime.js#L95
You can test this on https://codemirror.net/demo/sublime.html

About indent, have one param on configuration called indentUnit and default is 2, I think that change to 4 solve problem and change indentWithTabs to false for indent with spaces, not tabulations.

@andreynering
Copy link
Contributor

@joubertredrat I played a little with these configs on #3512

@unknwon
Copy link
Member Author

unknwon commented Aug 26, 2016

@andreynering does these configs take effect if no .editorconfig?

Aside from PR, I think we need to fix these configs in default settings as well?

@andreynering
Copy link
Contributor

@unknwon

@richmahn have set some defaults (indentation size). My PR override these defaults if a .editorconfig is present.

@joubertredrat's issue of using shift + tab to unindent is a separated issue, so yeah that is still to be fixed.

@richmahn
Copy link
Contributor

richmahn commented Aug 27, 2016

Sorry guys, been away from doing any Gogs development, instead been working with AWS Lambda and API Gateway for a whole new system, so had no time, but do need to get back to Gogs in the changes I make for my organization. Anyway, I am not even sure where this Web Editing feature is at, changes people have wanted, and if anything is depending on me or if this is more or less out of my hands. If editing should work different than with Github (haven't tried to wrap my mind around @unknwon's response about forking and PRs to understand the differences if any), and my code doesn't handle this right, has anyone made changes? Let me know if anything is waiting on me.

After writing the above, I realize now all the editor stuff had been pushed to master. Awesome! I guess recent talk about PRs are other changes to the editor. If there is anything I need to help with, let me know, @unknwon.

@unknwon
Copy link
Member Author

unknwon commented Aug 27, 2016

@richmahn Thanks. I made some quick changes to merge the branch so people can start testing. But many detailed works are still going on. (listed in my original comment of this thread)

@richmahn
Copy link
Contributor

richmahn commented Aug 27, 2016

@unknwon Ok, so this is still an open issue. I saw that the re-enable upload is there, and now saw that you commented out the link for uploading files. Did you make a comment elsewhere on what was wrong with how I did uploading files? It does use a new table in the database, so not sure if maybe I didn't hook that up right to auto-create the table? It's been a while since I worked on that piece so don't remember much. Let me know the issue there and how we can get uploading turned back on.

Again, I'm in the dark about what was wrong with uploading, but I did this differently than attachment to issues since an uploaded file to an repo doesn't need to remain in the database, but does need to be stored there when a file is added to the page/uploaded through ajax it can be remembered until the whole form is submitted, similar to attachments, but gets deleted once the file is saved to the repo. Maybe saying all this is pointless, but thought I would discuss how this part works just to get feedback so this can more forward to being fixed.

@unknwon
Copy link
Member Author

unknwon commented Aug 27, 2016

@richmahn no, just because I don't have enough time t quick review uploads. (we can chat on gitter.im to keep this thread clean)

@atomi
Copy link

atomi commented Aug 29, 2016

unable to create new files in subdirectories
editor.failed_to_update_file%!(EXTRA *errors.errorString=git mv foo foo/test.md: exit status 128 - fatal: can not move directory into itself, source=foo, destination=foo/test.md )

I created a test repo https://try.gogs.io/atomi/test/src/master/foo if you try to use 'new file' in a subdirectory you get the above errror.

@unknwon
Copy link
Member Author

unknwon commented Aug 29, 2016

@atomi things should be good now!

@unknwon
Copy link
Member Author

unknwon commented Aug 30, 2016

The feature set is now complete.

@unknwon unknwon closed this as completed Aug 30, 2016
@joubertredrat
Copy link

@andreynering then you or me open issue about indentation?

@andreynering
Copy link
Contributor

@joubertredrat You can open

Martchus pushed a commit to Martchus/gogs that referenced this issue Aug 27, 2018
* Changed style of checklist in issuelist.

* Adjusted padding for progressbar, updated index.css.

* Fixed another wrong tab to spaces.

Signed-off-by: modmew8 <modmew8@gmail.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🎯 feature Categorizes as related to a new feature
Projects
None yet
Development

No branches or pull requests

6 participants