-
Notifications
You must be signed in to change notification settings - Fork 3
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
Basic Text Editor #65
Comments
This looks good: https://github.com/mweiss/elm-rte-toolkit |
If the goal is this:
I don't think we'd need a rich-text editor. RTEs in the browser are extremely complex (I've been reworking the home-grown RTE for https://zenkit.com).
So, I guess there are two separate goals here:
What is the main goal in this issue? |
Of course, "anything more basic" should actually be "anything more complex". Yes, basic text editor should not be an RTE -- "plain text" editing of text files is the goal for this. This basic capability added to Drive means that a user can edit a CSS file, YAML file, Markdown doc and any plain text format. I shared the Elm thing as I was doing research. Picking an existing editor and integrating it / loading the scripts only for editing is likely what we want to do. CodeMirror https://codemirror.net is interesting because it has a companion ProseMirror RTE that could go in a full app. I don't have any opinion on CM itself in terms of suitability. Small code base, well maintained, easy to integrate, works on mobile, open source are key criteria I can think of. |
Ha. Actually didn't notice :D I auto-corrected that somehow. The RTE
Nice! That's useful.
And maybe a non-goal:
The plain-text editorPossible criteria:
I've heard good things about codemirror. It's codebase also seems fairly small. |
I think only syntax highlighting from the plain text list feels attractive — and even there it’s a nice to have. Shall we try CodeMirror for now or do you want to do research some others? Small code base: thinking about this some more — as long as it is well maintained and can easily be plugged in, this matters less. We can package / version this and host it once on IPFS / Fission’s infrastructure. |
I'm happy to go with codemirror. I'd like to create some designs first, so I can better think through the UI flows/UX. That's what I'll focus on now. This elm codebase seems quite approachable to me (that's a huge bonus of elm :) ) |
Great. Yes, getting you into this codebase is another goal ;) |
I've started some design: https://www.figma.com/proto/wqJjBsfSAIWzwPsLdMkl1t/Fission-Drive?node-id=7%3A83&scaling=min-zoom Also cc @icidasset, as you've been the creative director so far, I think? EDIT: Implementation is not really blocked on your review, so no need to hurry. I just like having any design before working on code. Changing the design in response to feedback should be fine. |
@matheus23 Not sure I'd give myself that title, but yes 😅 I like the concept, putting the editor there seems like a good idea 👍 I would like to see:
Regarding libraries, there's https://package.elm-lang.org/packages/jxxcarlson/elm-editor/latest/ as well. Don't have a huge preference for either Elm or JS for this, but since we would need to interact quite a bit with the editor, Elm might be easier? What do you think? PS. There's also this article on my reading list regarding editors: https://medium.com/content-uneditable/contenteditable-the-good-the-bad-and-the-ugly-261a38555e9c Still need to read this 👀 |
Do we want to use this as a viewer as well as an editor for plain text? So, in a directory, loading text files in the right hand pane? And a switch to edit? Future feature, but may impact design - a clear “Editing” mode. When editing, may want to show a “dirty” indicator, that the file hasn’t been saved. |
Yes. Otherwise we'd need to implement a viewer as well.
I'd think so. Easy enough to add a edit action with the current content-viewing setup. |
Forgot to remove that one. It was just for testing how adding some info add the footer would look like. It's not a feature planned for the first iteration, though. (Basically, there was not tangible plan for that :) )
Agree. I wanted to increase the contrast, but I think I'll just go with the grey-purple-ish background.
Agree.
Hm. What would it do? There's already a 'Close' button on the top-right.
Hm. That's interesting. I'll have a look at how editors would/could support that.
This is an important issue to gain clarity of: What interaction are we planning to have with the editor? I think there's potential for a super-simple interface between the editor and the rest. String values down and string callbacks up from the editor. This has given me plenty enough ideas and improvements. I'll get going on a little more design and start implementation soon. |
My reasoning here is that the functionality of the close button doesn't change depending on the contents of the "sidebar". So it always hides/closes the entire side. Cancel on the other hand, would go back to the default "non-editor view" without saving changes. Does that make sense? 🤔
Yeah, thinking more about this, let's just pick whatever works best. |
Agree with @icidasset on close / cancel. Slowly coming up with a UI pattern for the preview pane! And context for "Basic" is that we're not going to do previews or any other interactions other than open/close/edit/save. Maybe we'll implement creating new text files too. That's it ;) |
I'm not entirely sold on the idea of having two modes, Editing and viewing. I wanted to compare both approaches, so I created two prototypes: The instructional text in the lower left is obviously not meant to be part of the app. I find the combined mode preferable, as it's simpler. The two-mode editor also doesn't have much visual indication for which mode you're in. That problem can be solved, but it's just more work to implement and additional hoops for the user, potentially. There's a little fine-tuning left: What does 'Close' do when there's unsaved changes. Should it save? At the moment I'm leaning towards 'no'. Anyway, I've definitely designed enough to start coding the viewer (for real this time! 😄 ). |
Nice job on the prototypes @matheus23 👏 Yeah sorry, should've been more clear, the non-editor view I had in mind was this: We would change the primary action for text files to "EDIT" and move download to secondary-actions menu next to it. But I guess seeing the text directly is more useful, so I would opt for the combined view as well @matheus23 👍 How I see it working:
|
Yeah, we definitely want to see the text in Preview And yes, "CANCEL" goes back to view mode is better than "CANCEL" closing the pane. @icidasset a future feature might just be auto-saving like Discourse does, with like |
Can we close this now that #65 is merged? I'll go ahead for now. |
Include basic text editing functionality in Drive.
Edit Plaintext, Markdown, YAML, HTML, JSON, etc.
Anything more basic should be an external "app".
Goal of including this is to enable various scenarios which already have permission. For instance -- you now have live editing of HTML files in a public folder.
The text was updated successfully, but these errors were encountered: