Closed outoftime closed 6 years ago
@ajgreenb and I are looking into this!
In a recent Popcode meeting, we discussed that the first revision of the editable instructions will be open to any user. There is a potential case where a student can intentionally edit and tamper with the instructions to render them useless, but we considered this scenario very unlikely.
As for the workflow on what happens when the "Edit Instructions" link is clicked, we are still brainstorming possibilities... 1, Render the instructions panel to be editable and add a WYSWIG editor tool on top.
@jwang1919 @ajgreenb looking forward to seeing what you guys come up with! FWIW I would be inclined to do the simplest thing first which would probably be option 1 with no editor tool (either a plain-text Markdown editor or something like react-mde
). You can always follow up with more bells and whistles!
I say we start with a plain-text Markdown editor and see how far that gets us before adding a dependency on react-mde
. How does this sound, UX-wise?
All projects start with a basic instructions
boilerplate (stored in project
state.) Maybe something like
# Project Title
You can add **bold text**, _italic text_, or `code`.
1. Ordered lists
2. are also
3. available.
## Sub-heading
* Same
* with
* unordered lists!
If you load Popcode normally and instructions
is unmodified, the panel will be hidden from the UI. If it's been changed from the default, it will be visible and expanded (similar to current behavior for instructions from Gists.)
If you load Popcode with the ?admin
query parameter, the instructions panel will be visible, expanded, and in editing mode. The top toolbar will have an icon button that toggles between
📝 Edit
and
💾 Save
"Save" saves the instructions to state
and renders the Markdown. "Edit" switches back to editing mode.
Thoughts? Does that cover all the possible states?
I say we start with a plain-text Markdown editor and see how far that gets us before adding a dependency on react-mde. How does this sound, UX-wise?
I agree, I would like to first start with a basic editor then go for the nice looking UX.
All projects start with a basic instructions boilerplate (stored in project state.) Maybe something like
Haven't thought of this before but makes sense!
If you load Popcode normally and instructions is unmodified, the panel will be hidden from the UI. If it's been changed from the default, it will be visible and expanded (similar to current behavior for instructions from Gists.)
I was looking into this yesterday (and relearning React 😢).
If you load Popcode with the ?admin query parameter, the instructions panel will be visible, expanded, and in editing mode.
I thought we decided against this approach and opted for adding an extra link in the Hamburger Menu. This way is more intuitive for non-coders and works better when instructors need to edit Popcode projects that don't have existing instructions. The obvious downside is that a student can edit the instructions, but I don't think we really need to worry about that.
The top toolbar will have an icon button that toggles between
📝 Edit
and
💾 Save
"Save" saves the instructions to state and renders the Markdown. "Edit" switches back to editing mode.
If we add the "Edit Instructions/Add Instructions" link on the Hamburger menu we can avoid adding an Edit button. There does need to be a Cancel button ❌, where clicking on it reverts the instructions to the previous instructions or no instructions they were not present before.
Loving this thoughtful discussion! A couple of thoughts:
placeholder
property, although I’d also be fine with borrowing GitHub’s approach of just putting a Styling with Markdown is supported message below the editor that links to a good Markdown guide.That all sounds 💯 to me! Glad I dropped a comment on the issue before writing a bunch of code 😄
If there's only a Add/Edit Instructions button in the hamburger menu and a Cancel button in the Instructions panel (that just reverts the instructions to the previous instructions or no instructions if they were not present before), at what point do we get the rendered Markdown view vs the plain text "editing" view?
As an example, say I open a fresh project and click Add/Edit Instructions. The Instructions panel appears, expanded, in editing mode. I type some text. Now I want to stop editing, but I want to keep the instructions I've added (i.e., I don't want to Cancel.) With just those two buttons, there's no way to switch to the rendered Markdown view without refreshing the page (or, like, clicking outside the editor?)
I can think of two alternatives:
Of those two, I think I prefer (1), since it's more discoverable. Either of you have any other solutions that I'm missing? I might be tunnel-visioning.
@ajgreenb definitely agree that (1) is the better UI!
All right, gotta WIP PR up. The functionality isn't all there yet, but I wanted to get feedback/work in the open as much as possible. Please take a look at your convenience!
@jwang1919 Let me know if you'd like me to save any of those specific tasks for you.
Make it possible to add/edit project instructions from within Popcode. This would probably be via an option in the hamburger menu (maybe in an “Instructor” submenu?)
https://github.com/andrerpena/react-mde might be useful.