Monorepo for Tangled tangled.org
854
fork

Configure Feed

Select the types of activity you want to include in your feed.

appview/timeline: collapse identical events #294

open opened by kevinyap.ca targeting master from kevinyap.ca/core: collapse-timeline

Group consecutive timeline events (defined as being the same action and operating on the same target) together so that the same target is not seen multiple times in a row. This notably does not completely aggregate all events together, so the timeline may still appear as "A B A" if several instances of event A were broken up by event B.

For collapsed groups, we render "and N other user(s)" in the description of the event, with a popover that shows the collapsed users if "N other user(s)" is hovered. The number of events fetched was increased so that limit refers to the number of items in the timeline post-grouping.

Future follow-up work for this PR could include doing some less naive aggregation of events so that only a single instance of each event would appear on the timeline to further improve the diversity of what gets shown; this PR was intentionally kept minimal.

Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:kewhcp362af66czceva4dhrl/sh.tangled.repo.pull/3mksxbzup4i22
+1 -1
Interdiff #2 #3
+1 -1
appview/db/timeline.go
··· 30 30 // Fetch more events than we need to so that when we collapse each individual 31 31 // event into groups, we can still be relatively confident that we will have 32 32 // `limit` groups to fill the timeline with. Adjust multiplier as necessary. 33 - const fetchLimit = limit * 2 33 + fetchLimit := limit * 2 34 34 35 35 repos, err := getTimelineRepos(e, fetchLimit, loggedInUserDid, userIsFollowing) 36 36 if err != nil {
appview/models/timeline.go

This file has not been changed.

appview/pages/pages.go

This file has not been changed.

appview/pages/templates/timeline/fragments/timeline.html

This file has not been changed.

History

4 rounds 0 comments
sign up or login to add to the discussion
1 commit
expand
appview/timeline: collapse identical events
merge conflicts detected
expand
  • appview/db/timeline.go:11
  • appview/models/timeline.go:21
  • appview/pages/pages.go:403
  • appview/pages/templates/timeline/fragments/timeline.html:6
expand 0 comments
1 commit
expand
appview/timeline: collapse identical events
expand 0 comments
1 commit
expand
appview/timeline: collapse identical events
expand 0 comments
1 commit
expand
appview/timeline: collapse identical events
expand 0 comments