Skip to content
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

Comment count updates on admin.pl #293

Open
soytakyon opened this issue Aug 25, 2016 · 5 comments
Open

Comment count updates on admin.pl #293

soytakyon opened this issue Aug 25, 2016 · 5 comments

Comments

@soytakyon
Copy link

I'd like comment count change indicators on admin.pl

For the latest 40 or whatever are displayed per page amount of stories on admin.pl, store the current number of comments.

Then, when the editor loads admin.pl again, if a change has occurred, for example, 100 comments became 103 comments, the comments column displays 103 (+3). If admin.pl is reloaded again, this would change back to simply "103".

At a glance, this would allow you to see changes in activity.

There are 40 recent stories displayed on admin.pl. Only the comment counts for those 40 stories ought to be stored. I'm not sure how it would handle unexpected shifts in the indices, such as loading admin.pl, somebody else adding a new story to the top at the same a dupe story is nuked by storing it back on Jan 1, 1970, and then finally reloading admin.pl. I guess 40 storyids could be stored along with the number of comments.

To get more room, you could make the time column narrower and make it switch to local time onmouseover. This might not be a great solution since you would probably want the whole column to change, not just one table cell, and that might require some fancy or impossible CSS, or the use of JavaScript.

@soytakyon soytakyon changed the title Comment updates on admin.pl Comment count updates on admin.pl Aug 25, 2016
@NCommander
Copy link
Contributor

Best way to implement this would be once every 24 hours, and have a (+X or -X (if we've deleted comments, or we factor moderation into it)

@TheMightyBuzzard
Copy link
Contributor

@NCommander I think he's wanting near-realtime ajaxy updates. Which we could technically do pretty easily with calls to the API or to a new sub of admin.pl every minute or two. But someone besides me gets to write the javascript to do it. I'm allergic.

@marty-b
Copy link
Contributor

marty-b commented Oct 12, 2016

Given the desire to refresh the delta between the times the user clicks refresh (or whatever), does this require separate counts for each user viewing admin.pl? A simpler approach would we to display the number of comments made to each story over the past, admin_refresh_comment_delta seconds; which could be set as a site variable. A value of zero means no updates. A change from zero to a non-zero vale triggers the start of updates. At the next update time, the deltas are computed, and a new update time is computed based on current time and update time. Also needs to be checked at site startup/restart.

Please note that comments still continue to come in well after the first 40 comments have come and gone off the top of the admin.pl page. Maybe have another site var, admin_refresh_comment_count, which specifies how many of the n-most-recent comments are to have their deltas calculated? I regularly see stories with discussions occurring over several days, so a value of 160 would cover the last 10 or so days. An alternative is to just compute the delta for all stories for which comments are still enabled.

@TheMightyBuzzard
Copy link
Contributor

@marty-b Actually, that would be more difficult. We'd have to write all the display code, create/alter a table to hold the values, and write a slashd job to compute them every interval. We don't have enough editors that even refreshing twice a minute would put a significant load on the servers or db, so there's no reason to pre-compute the values.

As much as I despise javascript, this would be a good place for it.

@marty-b
Copy link
Contributor

marty-b commented Oct 13, 2016

Please accept my apologies. I completely misunderstood what was being proposed. I concur that client-side Javascript would be the way to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants