News for hackers. Stuff that matters.
Re:Why is collapsing a Hacker News comment so slow? by pg_bot on Tuesday July 02, 2019 @01:27PM (#20337322)
I would use the <details> tag to solve this problem. Most people don't know this exists and I have no idea why. You would probably have to rewrite the html so it no longer uses tables but I don't really consider that to be a negative.

I would also question why we are saving collapsed comments. I feel like this is something that doesn't need to be persisted forever. If you want this behavior why not use local storage instead?

Re:Why is collapsing a Hacker News comment so slow? by zeugmasyllepsis on Tuesday July 02, 2019 @01:53PM (#20337614)
Persisting it on the server allows users to browse on multiple devices and keep their collapse settings in sync. This is useful in particular for long threads of comments, where collapsing can be used as a tool to keep track of progress through the thread by collapsing comments along the way.
Re:Why is collapsing a Hacker News comment so slow? by mintplant on Tuesday July 02, 2019 @02:09PM (#20337776)
FWIW, you can still do this with the `<details>` tag, though. Have the page background-sync collapsed statuses back to the server and have the server remove the appropriate `open` attribute from collapsed `<details>` on subsequent page loads.
Re:Why is collapsing a Hacker News comment so slow? by pg_bot on Tuesday July 02, 2019 @02:51PM (#20338206)
Sure I get that this is possible given that you know this is what the code does but the bigger questions are who knows that you can do this, and who actually uses this feature?

Is this the expected behavior when you collapse or show a thread? I would suggest that it is not, as most minor interactions on a page are only stored locally.

How many people actually use this feature? In order get a benefit from this feature you have to be logged into hacker news on multiple devices, collapse a thread on one device, come back to that thread later on the second device and then continue reading from where you left off. Alternatively you can just scroll past the stuff you've already read, which has a minimal cost to the user.

The benefits seem negligible for the amount of developer time that likely went into making this feature.

Re:Why is collapsing a Hacker News comment so slow? by Yoofie on Tuesday July 02, 2019 @04:10PM (#20338975)
> Sure I get that this is possible given that you know this is what the code does but the bigger questions are who knows that you can do this, and who actually uses this feature?

I do.

> In order get a benefit from this feature you have to be logged into hacker news on multiple devices, collapse a thread on one device, come back to that thread later on the second device and then continue reading from where you left off.

I actually do exactly this. I read on my phone/laptop and later come back to the same thread (when more people have commented) on my home computer, usually at the end of the day. Having threads of conversation that you are not interested in already collapsed on multiple devices is very useful.

> Alternatively you can just scroll past the stuff you've already read, which has a minimal cost to the user.

Scrolling and quickly scanning over multiple threads is more time consuming and becomes actually annoying if you just want to passively follow a thread. If you want to follow multiple threads under the same topic, you either have to remember unique words/usernames/dates of that thread or resort to scroll & scan method mentioned above. One is annoying, the other is simply non viable for N amount of threads.

Until there is a way to subscribe to a thread, this feature is super helpful. Its actually just as good or better than a subscribe mechanism because atleast you can avoid getting multiple notifications for every single comment that get posted in the interesting thread. In the current scheme, all the irrelevant ones are already out of your way.

Re:Why is collapsing a Hacker News comment so slow? by yorwba on Tuesday July 02, 2019 @03:36PM (#20338648)
> you can just scroll past the stuff you've already read, which has a minimal cost to the user.

Both vote count and age influence the order of comments, which means that the stuff you've already read may appear below stuff you haven't read yet.

If you use the feature at all, I'm not sure why you wouldn't want collapsed comments to be in sync across devices.

Re:Why is collapsing a Hacker News comment so slow? by doomjunky on Friday July 05, 2019 @06:20AM (#20361334)
Actually i use the collapse feature for totally diffentent use case: Navigation.

I don't want to scroll over all the replies just to find the next post or i want to see all replies to one post. Therefore collapsing is convenient, but the slowth is annoying.

Re:Why is collapsing a Hacker News comment so slow? by anigbrowl on Tuesday July 02, 2019 @02:49PM (#20338194)
That sounds like a solution in search of a problem tbh
Re:Why is collapsing a Hacker News comment so slow? by giancarlostoro on Tuesday July 02, 2019 @01:46PM (#20337542)
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/de...

This is awesome! I had no idea! You're right, I don't think most people even realize. There's often times I get upset when using Bootstrap or just doing CSS and look up ways to do specific things and don't find out of the box solutions, this is one time I'm glad I found a decent alternative. One case that comes to mind is collapsible trees and dropdown boxes where you can type / search on them, and anything with dropdown boxes like checkmarks gets a wee bit hacky.

Re:Why is collapsing a Hacker News comment so slow? by jhomedall on Tuesday July 02, 2019 @01:50PM (#20337582)
Note that it's not yet supported by Edge: https://developer.microsoft.com/en-us/microsoft-edge/platfor...
Re:Why is collapsing a Hacker News comment so slow? by mintplant on Tuesday July 02, 2019 @02:10PM (#20337790)
There's a handy polyfill for that.

https://github.com/rstacruz/details-polyfill

Re:Why is collapsing a Hacker News comment so slow? by giancarlostoro on Tuesday July 02, 2019 @02:21PM (#20337890)
Yeah I was going to say, I'm sure the polyfill shouldn't be entirely horrible...
Re:Why is collapsing a Hacker News comment so slow? by Ajedi32 on Tuesday July 02, 2019 @01:56PM (#20337644)
Edge is turning into Chromium soon, so that shouldn't be a problem for much longer.
Re:Why is collapsing a Hacker News comment so slow? by reaperducer on Tuesday July 02, 2019 @02:03PM (#20337707)
Considering there are millions of people still using IE11, I'd say it will continue being a problem for a long time.

18% of my users are on IE11. Some industries (healthcare, for example) don't change if they don't perceive something to be broken.

Re:Why is collapsing a Hacker News comment so slow? by lol768 on Tuesday July 02, 2019 @02:30PM (#20337999)
Doesn't Edge auto-update though? How easy would it be, as someone in enterprise IT, to keep users on an old version of Edge?
Re:Why is collapsing a Hacker News comment so slow? by fuzz4lyfe on Tuesday July 02, 2019 @02:52PM (#20338218)
The reason is active-x, somebody wrote a way to scan with active-x and now virtually every healthcare web app works that way.
Re:Why is collapsing a Hacker News comment so slow? by mschuster91 on Tuesday July 02, 2019 @03:35PM (#20338638)
This was before webcam support was mainstream in browsers. Capturing stills from ultrasound is in many legacy systems still done with a TV capture card and the really old legacy cards don't even use any standard API but carry their own driver so you can't use them as a webcam but need the vendor app.

source: did support for a doctor some years ago

Re:Why is collapsing a Hacker News comment so slow? by notriddle on Tuesday July 02, 2019 @02:53PM (#20338224)
Edge isn't IE11. They are both installed, side-by-side, on Windows 10, and IE11 is the only one that ships on Windows 7.
Re:Why is collapsing a Hacker News comment so slow? by CognitiveLens on Tuesday July 02, 2019 @03:20PM (#20338479)
To be fair, if we're staying in the parameters of the thought experiment, we're targeting the HN user base, which I suspect isn't using IE11 at nearly that rate...
Re:Why is collapsing a Hacker News comment so slow? by stephenboyd on Tuesday July 02, 2019 @03:03PM (#20338315)
In healthcare, the most common EMR systems (Epic, Cerner, Allscripts, etc) use IE11 in iframes as the platform environment for 3rd party applications embedded in their UIs. So convincing a few large vendors to upgrade would make a huge difference, but the hospitals themselves don't have the option of upgrading some of those browser environments. (My company makes apps that run in the EMR platforms)
Re:Why is collapsing a Hacker News comment so slow? by krferriter on Tuesday July 02, 2019 @01:57PM (#20337653)
Hmm, that's cool, I don't know how I've never heard of this before. Probably much better than some more-expensive CSS or Javascript.
Re:Why is collapsing a Hacker News comment so slow? by skrause on Tuesday July 02, 2019 @03:16PM (#20338446)
> You would probably have to rewrite the html so it no longer uses tables

This reminds me: What happened to the markup rewrite that was announced almost 5 years ago together with the Firebase API? https://blog.ycombinator.com/hacker-news-api/

As far as I can see the markup never changed after all.

Re:Why is collapsing a Hacker News comment so slow? by Deimorz on Tuesday July 02, 2019 @02:33PM (#20338041)
I looked into using <details> to handle collapsing comment threads on Tildes, and ended up deciding it wouldn't work well and just went with JS.

It was a long time ago now so I can't remember much specifically any more, but I think that the styling and behavior for <details> were both too limited and too inconsistent across browsers.

I do use it in some other places though, like collapsing/expanding the text of text topics from the listing pages, and it works really well for that (other than the current lack of support in Edge).

Re:Why is collapsing a Hacker News comment so slow? by aitchnyu on Wednesday July 03, 2019 @05:48AM (#20342934)
I tried ctrl+f on text inside collapsed details and it didnt show up. I would have expected that with correct semantics, the browser would have figured out that it should expand the details and highlight that text.

Its also missing a group name, so I can expand only one details of a group.

Why is it useful?

Re:Why is collapsing a Hacker News comment so slow? by kingosticks on Wednesday July 03, 2019 @07:08AM (#20343225)
This is a really good point. The lack of searchability of the collapsed text makes this pretty useless for comments. Please consider this when thinking of using it anywhere.
Re:Why is collapsing a Hacker News comment so slow? by smacktoward on Tuesday July 02, 2019 @02:20PM (#20337881)
> If you want this behavior why not use local storage instead?

My guess would be that the decision was made before a standardized, widely available cross-browser implementation of localstorage was a thing.

Re:Why is collapsing a Hacker News comment so slow? by Jaruzel on Tuesday July 02, 2019 @05:38PM (#20339632)
> I would also question why we are saving collapsed comments.

I can't be the only one who had no idea it did this? And if so, I'd could argue that there isn't really a need for it.

Re:Why is collapsing a Hacker News comment so slow? by thekyle on Tuesday July 02, 2019 @04:39PM (#20339222)
Didn't know about <details>. I was actually working on a site that uses threaded comments recently, so I might consider using it.
Re:Why is collapsing a Hacker News comment so slow? by reustle on Tuesday July 02, 2019 @07:12PM (#20340208)
I would absolutely vote to do comment state saving in local storage. The need to have synced collapsed comments across devices is pretty minimal, compared to the performance increase that everybody will experience.
Re:Why is collapsing a Hacker News comment so slow? by wolco on Tuesday July 02, 2019 @07:58PM (#20340466)
Removing a feature few know about for a small increase in performance for some?

Now that everyone knows about it people will start using it and people will start noticing the slowdown.

Somethings are best not mentioned

Re:Why is collapsing a Hacker News comment so slow? by OrgNet on Tuesday July 02, 2019 @03:10PM (#20338384)
I like the saving collapsed comments feature but past 7 days, I would not care if the server forgot about them because I usually never go back to posts 7 days or older
Re:Why is collapsing a Hacker News comment so slow? by pgcj_poster on Tuesday July 02, 2019 @08:16PM (#20340571)
Holy heck. I always wondered why there wasn't a tag like that. Thanks!