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

Refactor feed slices #4834

Merged
merged 16 commits into from
Jul 25, 2024
Merged

Refactor feed slices #4834

merged 16 commits into from
Jul 25, 2024

Conversation

gaearon
Copy link
Collaborator

@gaearon gaearon commented Jul 25, 2024

I'm refactoring feed slicing. This refactor should fully preserve the existing behavior but it makes strategic code changes that will prepare us for the next PR #4835, which solves longstanding problems with how replies show up in the feed.

The best way to follow along, unfortunately, is to read commit-by-commit. Each change is meant to be atomic and safe (mostly manipulation). The main theme of this refactor is to decouple the shape of a "slice item" from FeedPostView so that #4835 can construct it on-the-fly from parent and root with correct information. I'm tucking away low-level access of slices[i].items.reply and similar fields into the slice API itself so that I can later change the type of individual items.

I guess you could also just read the entire diff.

By the end of this refactor, the only code that reaches out into "internals" of a slice is the slice item manipulation logic which the next PR will get rid of.

Test Plan

This is going to require some non-trivial testing. Things you'll want to look at:

  • Mergefeed on/off
  • Reposts of replies
  • Self-threads
  • Other people's threads
  • Replies on/off
  • Like threshold on replies
  • Follow setting on replies
  • Deduplication
  • Reposts on/off
  • Quotes on/off
  • Replies to blocked/deleted posts

The goal in this PR is to stay aligned with the behavior on main.

Copy link

render bot commented Jul 25, 2024

Copy link

github-actions bot commented Jul 25, 2024

Old size New size Diff
7.01 MB 7.01 MB -246 B (-0.00%)

Copy link
Contributor

@haileyok haileyok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did some testing, toggled the various settings and things seem to line up localhost vs. bsky.app.

@gaearon gaearon merged commit ac1538b into main Jul 25, 2024
12 checks passed
@gaearon gaearon deleted the feedsliceitem-1 branch July 25, 2024 22:02
estrattonbailey added a commit that referenced this pull request Jul 31, 2024
* origin/main: (30 commits)
  Only show "followed you back" when appropriate (#4849)
  [Web] Retrigger onEndReached if needed when content height changes (#4859)
  Remove unused NoopFeedTuner (#4856)
  useDedupe callback (#4855)
  [Video] Uploads (#4754)
  Make label required in link components (#4844)
  Boolean filter improvement alternative: TS upgrade (#4840)
  Add label to profile card (#4843)
  Improve a11y on noty feed (#4842)
  Add labels in feed card (#4836)
  Add labels to mod details dialog (#4839)
  Add labels to a few missing places (#4838)
  Add labels in list card (#4837)
  Refactor feed slices (#4834)
  `true` (#4833)
  Replace `import hairlineWidth =` with const (#4831)
  [Videos] Video player - PR #1 - basic player (#4731)
  Bump 1.90 (#4832)
  Fix sloppy filter(Boolean) types (#4830)
  Fuggedaboudit (#4829)
  ...
estrattonbailey added a commit that referenced this pull request Jul 31, 2024
* origin/main: (37 commits)
  Only show "followed you back" when appropriate (#4849)
  [Web] Retrigger onEndReached if needed when content height changes (#4859)
  Remove unused NoopFeedTuner (#4856)
  useDedupe callback (#4855)
  [Video] Uploads (#4754)
  Make label required in link components (#4844)
  Boolean filter improvement alternative: TS upgrade (#4840)
  Add label to profile card (#4843)
  Improve a11y on noty feed (#4842)
  Add labels in feed card (#4836)
  Add labels to mod details dialog (#4839)
  Add labels to a few missing places (#4838)
  Add labels in list card (#4837)
  Refactor feed slices (#4834)
  `true` (#4833)
  Replace `import hairlineWidth =` with const (#4831)
  [Videos] Video player - PR #1 - basic player (#4731)
  Bump 1.90 (#4832)
  Fix sloppy filter(Boolean) types (#4830)
  Fuggedaboudit (#4829)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants