-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
add code folding in logger #108 #111
Conversation
A new UI element 'foldable' has been added. It allows code folding for the console. It mirrors the behavior found in most browser consoles, which is to start collapsed and expand upon selection.
@arunoda what do you think? |
I noticed that we are identifying actions(i.e I want to update this PR with an extra commit, where actions |
Lot better than present but going forward we should add syntax highlighting and nested folding too. I think highlighting part can be done easily by using highlight.js and passing the string through it. |
@andela-bkagia the current version of highlighing doesn't work correctly. So, had to change a bit. Also we need to write some tests for this component. |
@arunoda thanks! |
@andela-bkagia I updated to original patch format, but earlier would also work. git apply highlight.patch |
@arunoda thanks for pointing that out, I have applied the patch and will push the tests later today. |
Awesome. |
I have encountered a problem with testing. I needed to test that the output of an uncollapsed foldable is a pretty printed document. The tests fail because the first newline encountered is always removed, from the output of calling I have raised an issue here. |
@andela-bkagia that might be the correct behaviour. Just try to avoid it or go around it. |
</span> | ||
</div> | ||
|
||
<div className="foldable-content" style={ folderContentStyle }> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you remove the className here. May be use a ref. I hope which can be used inside tests.
@arunoda I wanted to use refs but I saw that refs are not available with the shallow rendering api. |
Okay. Then I try to use JSDom mounting then. I will take this and release today. |
I picked this PR and merged to master. |
Thanks a lot for this. |
View your CI Pipeline Execution ↗ for commit 739f26c.
☁️ Nx Cloud last updated this comment at |
A new UI element 'foldable' has been added. It allows code folding
for the console. It mirrors the behavior found in most browser
consoles, which is to start collapsed and expand upon selection.