dev.to Repo Recap from the Past Week
Andy Zhao (he/him)
Posted on February 22, 2019
Welcome back to another Repo Recap, where we cover last week's contributions to dev.to's repository and the iOS repo. This edition is covering February 10 to February 16.
Features
-
@philnash added his very own
<web-share-wrapper>
web component. It gives a much wider range of options to share posts on Chrome Android. Thanks, Phil!
Use <web-share-wrapper> for article sharing #1524
philnash posted on- [ ] Refactor
- [x] Feature
- [ ] Bug Fix
- [ ] Documentation Update
This is an initial attempt at replacing share links with the web share API on supported platforms. It uses
<web-share-wrapper>
, a custom element that only takes over if the web share API is available (currently Chrome on Android, but it's in preview in Safari too).One question: I'm not sure this is the best way to include the module. Ideally it would just sit in the vendor bundle, but I couldn't work out how to get it in there. Any help on that would be appreciated.
#399
- [ ] docs.dev.to
- [ ] readme
- [x] no documentation needed
@seanmfox made a PR to show the tag moderators on the tag page. Thanks, Sean!
Display tag moderators on tag page #1739
What type of PR is this? (check all applicable)
- [ ] Refactor
- [x] Feature
- [ ] Bug Fix
- [ ] Documentation Update
Description
Each tag page shows a list of the tag moderators in the left sidebar. The formatting matches that used for the 'meet the team' sidebar on the organization page.
Related Tickets & Documents
#1677
Mobile & Desktop Screenshots/Recordings (if there are UI changes)
Added to documentation?
- [ ] docs.dev.to
- [ ] readme
- [x] no documentation needed
-
@nikoheikkila added
'me'
value to'rel'
tag to the Mastodon URL. More details in the PR. Thanks, @nikoheikkila!
Add 'me' value to 'rel' tag on Mastodon URL on profile #1792
Hi there!
What type of PR is this? (check all applicable)
- [ ] Refactor
- [x] Feature
- [ ] Bug Fix
- [ ] Documentation Update
Description
Attempting my first contribution here. I noticed that when you set a Mastodon URL on your profile the link does not contain a rel=me
attribute. This is required for Mastodon instances to recognize the link between instance and dev.to to be real. This should fix it.
Related Tickets & Documents
None.
Mobile & Desktop Screenshots/Recordings (if there are UI changes)
No UI changes. Verify this feature by investigating the generated Mastodon URL from source.
Added to documentation?
- [ ] docs.dev.to
- [ ] readme
- [x] no documentation needed (probably?)
[optional] What gif best describes this PR or how it makes you feel?
- @glennmen added GitHub PR liquid tag support, which is why you see these new GitHub PR embeds! Thanks, @glennmen!
Added GitHub PR liquid tag support #1784
What type of PR is this? (check all applicable)
- [ ] Refactor
- [x] Feature
- [ ] Bug Fix
- [ ] Documentation Update
Description
Add support for Github pull request via liquid tags in markdown.
{% github https://github.com/thepracticaldev/dev.to/pull/1633 %}
My first time setting up a Ruby environment and actually developing in Ruby, so let me know if I should have done things differently.
I also fixed a couple of pre-commit errors, strange that the thrown errors where from parts that I didn't edit. So I assume that a lot of people skip the pre-commit check with --no-verify
.
Anyways the only error I couldn't fix was this section because it would parse the html instead of showing it in the codeblock:
https://github.com/thepracticaldev/dev.to/blob/7c369facf183fb236f47333e0fe913e565b12d2a/app/views/pages/_editor_guide_text.html.erb#L192-L194
Related Tickets & Documents
Closes #1760
Mobile & Desktop Screenshots/Recordings (if there are UI changes)
Added to documentation?
- [x] help tab in the markdown editor
- [ ] docs.dev.to
- [ ] readme
- [ ] no documentation needed
[optional] What gif best describes this PR or how it makes you feel?
- We've removed the restriction of video uploads to beta users. Visit your dashboard for to upload a post. PR by @ben:
Remove harsh video restriction and add video duration #1811
What type of PR is this? (check all applicable)
- [ ] Refactor
- [x] Feature
- [ ] Bug Fix
- [ ] Documentation Update
Description
Removes the video permission role and replaces it with check on account age. Also adds a video duration attribute to articles and the code to fetch video duration from the s3 file.
Bug Fixes / Other Contributions
-
@aspittel fixed a few bugs with the v1 editor. Thanks, Ali! To summarize:
- an issue where clicking the submit post multiple times would send multiple requests,
- a bug to allow the v1 editor to prefill tags if you visit, for example:
https://dev.to/new/githunt
, - and bug that prevented front matter errors from rendering.
Bug/multiple articles on save v1 editor #1791
aspittel posted on- [ ] Refactor
- [ ] Feature
- [x] Bug Fix
- [ ] Documentation Update
Exits out of submit function early if the submit button has already been pressed.
https://github.com/thepracticaldev/dev.to/issues/1770
- [ ] docs.dev.to
- [ ] readme
- [x] no documentation needed
</div> <div class="gh-btn-container"><a class="gh-btn" href="https://github.com/thepracticaldev/dev.to/pull/1791">View on GitHub</a></div>
Bug/v1 editor tags #1793
aspittel posted on- [ ] Refactor
- [ ] Feature
- [x] Bug Fix
- [ ] Documentation Update
Add condition so V1 editor can have prefilled template tags
https://github.com/thepracticaldev/dev.to/issues/1769
- [ ] docs.dev.to
- [ ] readme
- [x] no documentation needed
still render editor with frontmatter errors on edit view #1797
aspittel posted on- [ ] Refactor
- [ ] Feature
- [x] Bug Fix
- [ ] Documentation Update
If you had an error in the frontmatter of the edit view on the v1 editor, it would throw a 500 instead of rendering the editor with the errors. This fixes that. If an error is thrown, then we are in the v1 editor and so we render that. This
has_frontmatter?
method is only called in the template:<% unless @article.has_frontmatter? %>
https://github.com/thepracticaldev/dev.to/issues/625
- [ ] docs.dev.to
- [ ] readme
- [x] no documentation needed
-
@lightalloy refactored a few pieces of code. Thanks, Anna! The PR titles say it all:
Remove unused Organization#resave_articles method #1802
lightalloy posted on- [x] Refactor
This method was kept in the codebase so that the existing jobs wouldn't fail. Now all old jobs should have run already, so we can remove the method.
Remove useless removing algolia indexing on article destroy #1807
lightalloy posted on- [x] Refactor
When an article is destroyed,
trigger_delayed_index
was useless, causetrigger_delayed_index
runsafter_destroy
, so this checkrecord.&persisted?
was always false andrecord.delay.remove_from_index!
wasn't executed. An article is actually removed from the index inbefore_destroy_actions
(remove_algolia_index
). This pr removes the useless code to make the logic easier to understand.Related to the #1641, thought this pr doesn't provide any fixes.
Reduce the number of sql queries for articles comments #1606 #1766
lightalloy posted on- [x] Refactor
Eliminate N+1 while loading articles comments.
#1606
- [x] no documentation needed
- @maestromac fixed an issue where the horizontal scrollbar of a codeblock wasn't clickable. Thanks, Mac!
[UI] Fix scrollbar overlapse bug #1540
maestromac posted on- [x] Bug Fix
Removed two CSS line to fix a UI bug. Will need another pair of eyes to verify I didn't break anything somewhere else though.
Resolves #1332
- [x] no documentation needed
New Issues and Discussions
- @sarthology rqeuested a feature where you could save your posts with ctrl + s. Thanks, @sarthology!
Save post when user press cntrl + s #1772
sarthology posted onIs your feature request related to a problem? Please describe. Sometimes accidentally while writing the post I press control + save. It opens the browser default save command to wonder if we can change that.
Describe the solution you'd like By using this simple snippet that can be fixed
document.addEventListener("keydown", function(e) { if (e.keyCode == 83 && (navigator.platform.match("Mac") ? e.metaKey : e.ctrlKey)) { e.preventDefault(); // Save post instead... } }, false);
Using this the default event can be stopped. Maybe you guys can trigger the save the post function here.
Not sure if it's a bug
🤔 - @_bigblind requested a feature that gives contrast guidance when selecting your profile background and text colors. Thanks, @bigblind!
Give contrast guidance on user profile background/text color #1774
bigblind posted onIs your feature request related to a problem? Please describe.
Looking at [this profile], the contrast for the text on the follow button is quite low. These colors come from the text color and background color settings. Could we give some guidance to users to pick contrasting colors?
Describe the solution you'd like
When the user enters two colors, we measure their contrast ratio and give feedback to the user.
Describe alternatives you've considered
We could even disallow combinations under a certain contrast ratio. It might also be useful to just give a preview. While we're at it, why not make these fields
input type=color
?- @aligoren opened a discussion regarding the editor version field in your settings page: "Should dropdown be used for editor version selection?" Thanks, @aligoren!
Should dropdown be used for editor version selection? #1775
aligoren posted onIs your feature request related to a problem? Please describe.
In my opinion, It's annoying always writing editor version. I'm not sure but if there is a version number 99, the user will have to write v99.
Instead of this, the
select
tag can be useful.Describe the solution you'd like
I think we can change the input element with a select element like below:
<label for="user_editor_version">Editor version: v1 or v2</label> <select name="user[editor_version]" id="user_editor_version"> <option value="v1">v1</option> <option value="v2">v2</option> </select>
And css will be like that
width: 650px; max-width: calc(100% - 30px); padding: 12px; font-size: 19px; border: 1px solid #dee6e9; border-radius: 3px;
Describe alternatives you've considered
The other alternative is Radio Button if there are two versions.
Additional context
I changed input with the select tag using Chrome's Developer Tool.
It looks like below;
In this example, I changed my editor version using the select tag.
-
@itsasine reported a bug where posts are
SAVE
instead ofSAVED
if you filter the reading list. Thanks, @itsasine!
Posts are SAVE instead of SAVED if you filter the Reading List #1785
ItsASine posted onDescribe the bug I know there are other issues around SAVE/SAVED but this one seems unique enough for its own post. When filtering the Reading List, the buttons on posts are not in the SAVED state.
To reproduce:
- Navigate to the Reading List
- Select one of the tags on the sidebar
Expected:
- Articles are marked as Saved as they are in the list of saved stuff
Actual:
- Article button is Save as if they are not in the Reading List
Desktop (please complete the following information):
- OS: Chrome OS
- Browser: Chrome
- Version: 71.0.3578.127
- @lightalloy reported a bug where the page does not show your comment immediately when you submit the comment on a podcast.
The page is not updated after submitting a podcast comment #1788
lightalloy posted onDescribe the bug
To Reproduce Steps to reproduce the behavior:
- Go to a podcast episode page
- Fill the comment form
- Click submit or press
Ctrl+Enter
- The "submit" button changes color and the form becomes blurred (as the comment is being submitted).
- The form remains the same, the comment doesn't appear on the page.
- After refresh, the comment appears on the page.
Expected behavior After submitting, the comment appears on the page, the comment form returns to its "fresh" state (the submit button changes color back, the textarea is cleared)
Desktop (please complete the following information): I've checked in Firefox and Chrome, but suppose that the browser doesn't matter, cause the reason specified below:
Additional context I've noticed this error in dev environment.
NoMethodError - undefined method `receive_notifications' for #<PodcastEpisode:0x00007fdc223ae340>: app/models/notification.rb:50:in `send_new_comment_notifications' app/controllers/comments_controller.rb:69:in `create'
So the code needs to be updated to be suitable for the
PodcastEpisode
comments.- @12vanblart reported a bug where the footer visually overlaps the left hand sidebar in your reading list. Thanks, @12vanblart!
Footer visually overlaps Left Hand Nav Card #1794
12vanblart posted onDescribe the bug In a Chrome window sized 1305x842, I scrolled to the bottom of the "My Reading List" and the Footer overlapped the Left Hand Card.
To Reproduce Steps to reproduce the behavior: 0. (Resize window to ~ 1305 x 842)
- Go to "My Reading List"
- Scroll down to the bottom of the page (As far down as possible)
- See overlap
Expected behavior I'm not sure what the bet way to handle this is, but possibly by shrinking the width of the footer card to match the width of the center column.
Desktop (please complete the following information):
- OS: Windows
- Browser Chrome
- Version 72.0.3626.96
- I reported a bug where posts on front page do not load until scrolled down. This seems to happen on Chrome with Windows 10. Feel free to add a comment if you have seen this bug, too. Thanks, me!
Posts on front page do not load until scrolled down #1805
Zhao-Andy posted onWhen going to the home page, sometimes posts under the first post do not load until you scroll down. The page simply hangs and looks like this:
This seems to happen on Windows 10, Chrome. Possibly related extension is uBlock Origin.
I think that we load the posts with Algolia, so there might be some JS that is triggered by scrolling. Not 100% sure though.
- @jf1 requested a feature where you can view your reaction history. Thanks, @j-f1!
Allow viewing your hearts (❤️) and unicorns (🦄) history #1806
j-f1 posted onIs your feature request related to a problem? Please describe. I’d like to be able to mark posts with
🦄 to save them for later without having to have them in my reading list.Describe the solution you'd like It would be great to have a list of posts I’ve
❤️ ed or🦄 ed so I can refer back to them laterDescribe alternatives you've considered Maybe a separate list I can save things to once I’ve read them?
Additional context N/A
- @stereobooster reported an issue where they were constantly seeing offline screen. Let us know if you are experiencing this, too. Thanks, @stereobooster!
Constantly seeing offline screen #1810
stereobooster posted onDescribe the bug
Opened direct link to dev.to article and saw offline screen.
Cmd
+R
didn't help. I was online all the time. The only thing which is helped is to remove ServiceWorker completely and reload page.To Reproduce Steps to reproduce the behavior:
- Open any link to dev.to post
Expected behavior No offline screen if browser is online
Screenshots N/A
Desktop (please complete the following information):
- OS: Mac OS X
- Browser Chrome
- Version Version 71.0.3578.98 (Official Build) (64-bit)
Additional context N/A
DEV-iOS
We haven't had any new issues or PRs merged lately. Feel free to check out the iOS repo, or download our iOS app on the App Store.
Thanks for reading! Let me know what you think of the new format for PRs. See you next week!
Posted on February 22, 2019
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.