dev.to Repo Recap from the Past Week

andy

Andy Zhao (he/him)

Posted on February 22, 2019

dev.to Repo Recap from the Past Week

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

    What type of PR is this? (check all applicable)

    • [ ] Refactor
    • [x] Feature
    • [ ] Bug Fix
    • [ ] Documentation Update

    Description

    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.

    Related Tickets & Documents

    #399

    Mobile & Desktop Screenshots/Recordings (if there are UI changes)

    screenshot_20190112-143333 screenshot_20190112-143505

    Added to documentation?

    • [ ] docs.dev.to
    • [ ] readme
    • [x] no documentation needed

    [optional] What gif best describes this PR or how it makes you feel?

    alt_text

  • @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)

image

image

Added to documentation?

  • [ ] docs.dev.to
  • [ ] readme
  • [x] no documentation needed

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?

TOOT

  • @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)

Desktop

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?

THUMBS UP

  • 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

      What type of PR is this? (check all applicable)

      • [ ] Refactor
      • [ ] Feature
      • [x] Bug Fix
      • [ ] Documentation Update

      Description

      Exits out of submit function early if the submit button has already been pressed.

      Related Tickets & Documents

      https://github.com/thepracticaldev/dev.to/issues/1770

      Mobile & Desktop Screenshots/Recordings (if there are UI changes)

      Added to documentation?

      • [ ] docs.dev.to
      • [ ] readme
      • [x] no documentation needed

      [optional] What gif best describes this PR or how it makes you feel?

      alt_text

      </div>
      <div class="gh-btn-container"><a class="gh-btn" href="https://github.com/thepracticaldev/dev.to/pull/1791">View on GitHub</a></div>
      
      Enter fullscreen mode Exit fullscreen mode





      Bug/v1 editor tags #1793

      What type of PR is this? (check all applicable)

      • [ ] Refactor
      • [ ] Feature
      • [x] Bug Fix
      • [ ] Documentation Update

      Description

      Add condition so V1 editor can have prefilled template tags

      Related Tickets & Documents

      https://github.com/thepracticaldev/dev.to/issues/1769

      Mobile & Desktop Screenshots/Recordings (if there are UI changes)

      Added to documentation?

      • [ ] docs.dev.to
      • [ ] readme
      • [x] no documentation needed

      [optional] What gif best describes this PR or how it makes you feel?

      alt_text

      still render editor with frontmatter errors on edit view #1797

      What type of PR is this? (check all applicable)

      • [ ] Refactor
      • [ ] Feature
      • [x] Bug Fix
      • [ ] Documentation Update

      Description

      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? %>
      Enter fullscreen mode Exit fullscreen mode

      Related Tickets & Documents

      https://github.com/thepracticaldev/dev.to/issues/625

      Mobile & Desktop Screenshots/Recordings (if there are UI changes)

      Added to documentation?

      • [ ] docs.dev.to
      • [ ] readme
      • [x] no documentation needed

      [optional] What gif best describes this PR or how it makes you feel?

      alt_text

      Remove useless removing algolia indexing on article destroy #1807

      What type of PR is this? (check all applicable)

      • [x] Refactor

      Description

      When an article is destroyed,trigger_delayed_index was useless, cause trigger_delayed_index runs after_destroy, so this check record.&persisted? was always false and record.delay.remove_from_index! wasn't executed. An article is actually removed from the index in before_destroy_actions (remove_algolia_index). This pr removes the useless code to make the logic easier to understand.

      Related Tickets & Documents

      Related to the #1641, thought this pr doesn't provide any fixes.

      Reduce the number of sql queries for articles comments #1606 #1766

      What type of PR is this? (check all applicable)

      • [x] Refactor

      Description

      Eliminate N+1 while loading articles comments.

      Related Tickets & Documents

      #1606

      Added to documentation?

      • [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

      What type of PR is this? (check all applicable)

      • [x] Bug Fix

      Description

      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.

      Related Tickets & Documents

      Resolves #1332

      Mobile & Desktop Screenshots/Recordings (if there are UI changes)

      before After screen shot 2019-01-14 at 4 24 10 pm

      Added to documentation?

      • [x] no documentation needed

      [optional] What gif best describes this PR or how it makes you feel?

      alt_text

      New Issues and Discussions

      Save post when user press cntrl + s #1772

      Is 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);
      Enter fullscreen mode Exit fullscreen mode

      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

      Is 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

      Is 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>
      Enter fullscreen mode Exit fullscreen mode

      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;
      Enter fullscreen mode Exit fullscreen mode

      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;

      image

      In this example, I changed my editor version using the select tag.

      • @itsasine reported a bug where posts are SAVE instead of SAVED if you filter the reading list. Thanks, @itsasine!

      Posts are SAVE instead of SAVED if you filter the Reading List #1785

      Describe 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

      Screenshots image

      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

      Describe the bug

      To Reproduce Steps to reproduce the behavior:

      1. Go to a podcast episode page
      2. Fill the comment form
      3. Click submit or press Ctrl+Enter
      4. The "submit" button changes color and the form becomes blurred (as the comment is being submitted).
      5. The form remains the same, the comment doesn't appear on the page.
      6. 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)

      Screenshots podcast_comment

      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

      Describe 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. visual overlap showing

      To Reproduce Steps to reproduce the behavior: 0. (Resize window to ~ 1305 x 842)

      1. Go to "My Reading List"
      2. Scroll down to the bottom of the page (As far down as possible)
      3. 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

      When 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: image 1

      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 avatar
      j-f1 posted on

      Is 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 later

      Describe 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

      Describe 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:

      1. 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!

💖 💪 🙅 🚩
andy
Andy Zhao (he/him)

Posted on February 22, 2019

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related