Giter Site home page Giter Site logo

insin / comments-owl-for-hacker-news Goto Github PK

View Code? Open in Web Editor NEW
22.0 3.0 2.0 2.42 MB

Browser extension which makes it easer to follow comment threads on Hacker News across multiple visits, allows you to annotate and mute users, and other UI tweaks and mobile UX improvements

JavaScript 70.48% HTML 7.50% CSS 15.29% Swift 6.73%
hacker-news-comments comment-highlighting user-blocking user-notes

comments-owl-for-hacker-news's Issues

Comment management / quality filtering

  • Ignore comments from selected users
  • Highlight comments from selected users
  • Toggle display of comments by recently-created users (often used as throwaway accounts)
  • Custom user tagging

Add custom CSS options (desktop and mobile)

Add options to provide custom CSS via a <textarea> in extension options and on your profile page

e.g. for more comfortable comment reading on desktop

#hnmain { max-width: 72ch; }
.comment{ line-height: 1.5rem; font-size: .875rem; padding-right: 1rem; }
.default p { margin-top: 1rem; }

Add extra checks for local storage support

I'm using the UserScript version of the extension in a browser without local storage support.

Although some parts of the code do check for the presence of local storage support in the browser, many parts do not.

This results in the script breaking in browsers with no local storage.

Please consider adding extra checks to handle such situations.

Example Fix

I modified v47 of the user script to include a few more checks for local storage. This makes the comment controls work, at least, which is all I use the extension for.

Here is a comparison before/after the fixes:
https://editor.mergely.com/UTLOX9CM

User hover cards

  • Add hover cards when you mouse over user names, which pull profile info and display notes
  • Make notes editable via hover cards
  • Update notes in the current page when changed in a hover card
  • Add a toggle option for notes being displayed in comments

"Read later" functionality

Add something which lets you keep the previous visit details if you're reading new comments and have to go do something else so you can come back to the current page with the same new comments highlighted.

Say you had a "Read later" button - clicking it would store lastVisit in localStorage for this item again:

firefox_7bsKoaVyXC

Mobile styling

Using the same breakpoints as HN:

Navigation:

  • Better mobile navigation which displays below the header row instead, hiding the default header nav links

Comments:

  • Hide root/parent/next/prev nav as we're probably breaking it by having our own comment collapsing implementation, plus the idea is we don't need it as we're going to auto-collapse read threads and highlight new comments, plus they tend to overflow the meta bar as soon as comments start nesting
  • Make the collapse/expand control a slightly larger target on mobile
  • Allow comments to go right to the edge - HN has some weird breakpoints based on specific device widths
  • Improve styling of the highlight/collapse controls at the top

Sync comment pages up with changes to mutes and notes

If you change a user's mute status or note, we could update any comment pages open in other tabs accordingly

We don't currently handle unmuting on those pages as it hasn't been possible before - would need to figure out the logic for that (e.g. we stopped adding controls to muted comments and their children on initial load, so we'd need to handle that if a comment is about to be displayed for the first time due to unmuting)

  • Mute a user when they're muted in another tab
  • Implement updating comment screens when a user is unmuted and do it when a user is unmuted in another tab
  • Fix next/prev nav links on comments when siblings are muted/unmuted and show them again

Add Safari version

Might as well add a Safari version since we now have an Apple Developer account and all the macOS/iOS styling from Control Panel for Twitter

Seems to have stopped working

As of today this plugin seems to have stopped working.

Looking at console output, I'm wondering if HN changed their Content-Security-Policy header and that's what broke it. (That's purely speculation, it could be something else entirely.)

Sync user notes and block list

Hello, thank you for working on this addon.

Do you plan adding synchronisation support?

I read HN on two computers and two phones, Firefox (with sync always on) everywhere and it would be great if user notes and block list would be synchronized between them.

Improve notes

Get rid of the Add/Edit/Save buttons - always have notes displayed as a <textarea>

Notes should be saved when focus is lost

This will also make notes easier to use in hover cards #16

Handling "more comments..." pages

HN comment threads kind of fall apart once they have more than a few hundred comments and they get split into separate pages - this also breaks our highlighting of new comments as we count viewing the first page as your most recent "visit" to the entire item thread.

What should we do about this?

  • Reset to the last "visit" if you click the "more comments..." link so new comments get highlighted appropriately?
  • Auto-load the complete thread then apply highlighting?
  • Provide a link to react-hn with last visit details, which will let you read the entire thread in one place?

FIx handling of comments which are collapsed by default

For comments which are collapsed by default by Hacker News' own JavaScript (those with a .coll class), we're currently trying to access the comment's children before we've created a HNComment object for every comment on the page, which is breaking the ability to show the pre-collapsed comments.

Set new comment highlight colour and style

  • Choose highlight background colour
  • Choose highlight style (background colour or vertical bar)
  • Choose colour for vertical bar highlight (separate from background colour setting) - default to using the top bar colour

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.