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

Refactor CodeFile component #134

Merged
merged 35 commits into from
Jan 19, 2019
Merged

Conversation

onemen
Copy link
Contributor

@onemen onemen commented Jan 5, 2019

Key changes for this pr:

  • codeFile renders much faster
  • new question/reply are visible immediately after submitting the form
  • remove prism-react-renderer - use prism directly
  • add each line of highlighted code with dangerouslySetInnerHTML see RenderLine component
  • Import prism from prismjs/components/prism-core fix the missing highlight see #972 #1020
  • add CodeCard as ui component

TODO

  • add button/checkbox to show/hide: next/previous question, all question, ...
  • apply new form design
  • reuse same question/reply form for QuestionSection and CodeFile

@benawad
Copy link
Owner

benawad commented Jan 5, 2019

Nice work! I'll review this in a little bit

@benawad
Copy link
Owner

benawad commented Jan 7, 2019

Looks good, I'll wait till your done to merge

@onemen
Copy link
Contributor Author

onemen commented Jan 12, 2019

New form design, new badge button to show/hide discussion

New form design with these new features:

  • Added title to question form, currently just to the form, you need to update the mutation.
  • Added option to select start line by clicking with the mouse. The last line determined by the line that opened the form.

New badge button to show/hide discussion (question + replies) added to last line for each question.

  • Added header at the top of each discussion. The header contains the discussion title and identifier, (currently just a placeholder), and the line numbers associate to it.
    Regarding the identifier I this you can apply running number like in Github

Todo: (future pull request)

  • Add sticky navbar above the code to show/hide all discussions, go to next/previous discussion.
  • Reuse the form for QuestionSection.
  • Add avatar and date to each comment in the discussion.

Notice:

  • Large files may take long time to render. See how github address this issue.
  • Fix how you open image files. Github show the image.

@benawad
Copy link
Owner

benawad commented Jan 12, 2019

Awesome, I'm going to wait for you to finish the pr before continuing on more stuff.

@onemen
Copy link
Contributor Author

onemen commented Jan 12, 2019

Currently QuestionSection is only used from post.tsx.
When user is in this page no file where selected, do you want to add option to ask question that are not related to a file?
We need some drop down list to let the user choose a file.

@benawad
Copy link
Owner

benawad commented Jan 13, 2019

No drop-down is necessary, if they are not on a file then the question is a generic one

@onemen
Copy link
Contributor Author

onemen commented Jan 18, 2019

I'v done with this PR.
i hope to be able contribute Code-ponder more in the future.

i'v accidentally push none squashed branch, but i'm sure you can handle it . :)

@benawad
Copy link
Owner

benawad commented Jan 18, 2019

Wow, this is fantastic. I'll check this out soon

@benawad benawad merged commit 0381c90 into benawad:master Jan 19, 2019
onemen added a commit to onemen/codeponder that referenced this pull request Jan 27, 2019
@onemen onemen deleted the refactor/CodeFile-component branch February 6, 2019 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants