Open noi5e opened 3 years ago
I copied the contents of my old planning issue over here... I thought it would be nice for the late-stage of the internship to have things be more readable here.
If you need to look at the old issue for any reason, it's here: #8775.
TY for the ordered list of merges!!!!!
(Last updated Monday April 18th)
This issue summarizes my internship with Outreachy and Public Lab!
Also see the following GitHub Milestone.
Overtime!
Synopsis
The internship is technically wrapped up! I am popping in whenever reasonable finish a React revision to the commenting system.
🥝
Open PRs (merge from top-to-bottom)
🦁Rewrite Comment Editor with React
I wrote a basic React version of the comment system in #9175.
Currently working on improvements to the React system in issue #9365, including:
Write Issues
comment.add_comment
tocomment_from_email
Stretch Goals
h2
rich-text button provides drop-down options forh1
,h3
,h4
, etc.Late-Stage Internship Tasks:
editor.js
's ecosystemnode.add_comment
where necessary to reduce redundant fixturesdrop_in_dropzone
helper method for efficiencyWhat I've Done
Rewrite Comment Editor with React
?react=true
(merged in #9176)react_create
,react_update
, etc. (merged in #9176)useReducer
for comment state management (merged in #9801)useReducer
forcommentFormsVisibility
(merged in #9862)useReducer
fortextAreaValues
(merged in #9862)Refactor Comment Editor with Object-Oriented Programming
$E.setState()
method using ES6 default parameters (merged in #9035)$E.setState()
calls (merged in #9035)handleClick()
function and call when opening reply forms. (merged in #9107)$D.selected
! (merged in #9108)$E.refresh
! (merged in #9108)$E.method();
tothis.method();
(merged in #9110)$E.initialize({ default main editor form ID })
- allows for different default form IDs (merged in #9110)$E.textarea
,$E.textAreaValue
, and$E.preview
(merged in #9110)Bugfixes for Improved User Experience
comments/_edit.html.erb
indiv.comment-form-wrapper
, reassign$D.selected
(merged in #8897)click
anddrop
event handlers to set$D.selected
(merged in #8987)$E.textarea
ase.target
when clicking rich-text buttons. (merged in #9011).dropzone
to upload image (merged in #9118)$E.setState
when clicking onsave
,recover
, or atextarea
(merged in #9132)create.js.erb
(merged in #9195)<textarea>
when toggling preview in legacy editor (merged in #9234)Code Reorganization & Deletion for Maintainability
comment.js
anddragdrop.js
so they're not loaded once per comment (merged in #9037)dragdrop.js
toeditorToolbar.js
(merged in #9044)_edit.html.erb
in-template JavaScript; integrate witheditor.js
(merged in #9067)<script>
in_edit.html.erb
and point it towardeditor.js
instead (merged in #9067)setInit
call on#edit-btn
click (merged in #9067)$E.initialize
to higher-level views (merged in #9067)toggle_preview
on#comment-form-body
instead of#dropzone-large
(merged in #9123)comments/_edit.html.erb
andcomments/_form.html.erb
into one partial (merged in #9183)Standardized and Made Unique HTML Element IDs
<form>
andpreview
IDs in reply and main comment forms (merged in #9062)<form>
IDs are:#comment-form-main
,#comment-form-reply-123
, and#comment-form-edit-123
(merged in #9062)#preview-main
and#preview123
are now:#comment-preview-main
and#comment-preview-reply-123
(merged in #9062)#comment-preview-edit-123
and#text-input-edit-123
(merged in #9067)Researched & Wrote Issues
Style Fixes
Reply to comment
link un-selectable (merged in #9079)cursor: pointer;
for toolbar buttons (merged in #9195)Wrote System Tests
drop_in_dropzone
test helper to be reused for multiple drops (merged in #8897).dropzone
(merged in #8987).dropzone
(merged in #8987)/wiki/new
(merged in #9234)Project Description from Public Lab
We have a collection of improvements, bugfixes, and refinements to our aging Comment editor subcomponent on the PublicLab.org website. The comment editor is used in various “variants” with shared code, complicating debugging (i.e. fixing the bug in one place can introduce a bug in another). This is a great case for system tests, where we can ensure behaviors are preserved, and for writing these tests before making any major code changes - as well as for identifying bugs by writing tests to demonstrate them, followed by submitting a fix within the same pull request, which gets the test to pass -- Test Driven Development. We have prioritized a list of bugs and refinements we’d like to fix first, and have then outlined a set of changes that could make the code more compact, readable, and maintainable to reduce future workload.