about summary refs log tree commit diff
path: root/src/state/queries/post-thread.ts
Commit message (Collapse)AuthorAgeFilesLines
* [Explore] Add shadow cache (#8119)Samuel Newman2025-04-041-7/+23
| | | | | | | * enable shadowcache for feed previews * extract keyextractor * dedupe feeds
* Remove `moderatePost_wrapped` (#7188)Samuel Newman2025-02-251-1/+1
| | | | | | | | | * rm `moderatePost_wrapped` * Handle display in app --------- Co-authored-by: Eric Bailey <git@esb.lol>
* `@atproto/api@next` integration (#7344)Eric Bailey2025-02-181-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Bump SDK * Use consistent type in profile query * Omit from constraint for profile shadow * Replace isRecord with isValidRecord in QuoteEmbed * Omit type from constraint for old ProfileCard * Omit type from constraint in profile queries where appropriate * Use correct type for update profile mutation * Conslidate and fix check for isValidRecord in Post.tsx * Replace isRecord with isValidRecord in PostThreadItem * Remove redundant cast in PostThreadFollowBtn * Ignore errors in DebugMod screen * Use matching type in ProfileFollows screen * Use matching type in ProfileFollowers screen * Migrate to isValidRecord in PostFeedItem * Use matching type if PostRepostedBy * Omit type from constraint in avatar props * Use matching types in NotificationFeedItem * Todo * Use isValidRecord in NotfyFeedItem * Improve MediaPreview types * Migrate another isValidRecord in NotificationFeedItem * Migrate to isValidView in queries/util * Migrate to isValidRecord in threadgate/util * Fix types in threadgates * Fix up types in starter-packs queries * Todo * Specify exact types in search-posts * Use internal type util to align types * Ditto last * Migrate postgate/index * Specify exact types in post-thread * Use correct type in post-quotes * FIX potential bug in post-thread * Use correct type in post-feed * Add correct type guards to notifications/feed * Migrate a guard in notifications/util * Migrate guard in Wizard/State * [@next] Profile handling, migrate `ProfileCard` (#7347) * Introduce new utils for profiles, migrate old ProfileCard * Rename, reorg * Add parseEmbed utils * Expand AnyProfileView to include chat profile view, update post shadow to reflect this * Cast for perf reasons * Tighten up types now that we have AnyProfileView * Add fastIsType util * Use `assertDid` Co-authored-by: Matthieu Sieben <matthieusieben@users.noreply.github.com> * Use util types * Comment * Use fastIsType where no validation was happening before * suggestions (#7382) * suggestions * Revert unneeded changes --------- Co-authored-by: Eric Bailey <git@esb.lol> * Use new util * Rename to dangerousIsType * Convert object shape * Use dangerous util * Use dangerous util * Use dangerous util, we can trust post records * Use dangerous util * Use AnyProfileVIew * Convert object shape * Clean up handling * Patch moderateProfile to accept known profile views, to discuss * Add AnyStarterPackView and related, implement in first usage * Remove validation, fix type, fix ref * Migrate over list-conversations * Clarify intent behind precacheProfile and its unstable query cache * Clean up unstable profile cache * Fix types during label creation in PwiOptOut (#7346) * Tighten types in queries/list * Chat: use correct profile views * Chat: fix log type check * Chat: construct lexically correct shape, even though it's only internal usage * Chat: use correct profile types * Chat: fix type check in logs * Starter: use correct profile types * Starter: use correct profile types * Starter: tighten types to match lex * Any profile type will work in blocked-and-muted * Use dangerous util * Use dangerousIsType * Update new ProfileCard to use AnyProfileView * Use dangerousIsType * Remove outdated todo * Use correct profile type * Use correct profile types * Tighten up types * Use dangerousIsType * Chat: more type fixes * Remove unused file * Add a few utils * Remove unused file * Ignore feedPost.__source * Clean up types, leave validation in critical path * Use dangerousIstype * Use ANyProfileView * Use isValidRecord * Use dangerousIsType * Fix types in ListCard * Fix FeedInterstitials types * Fix types in FeedCard * Fix types in dms ReportDialog * Fix types in SearchablePeopleList * Fix bad type in composer opts * Starter: ok these need to be loose too * Clarify docs Co-authored-by: Matthieu Sieben <matthieusieben@users.noreply.github.com> * Less code Co-authored-by: Matthieu Sieben <matthieusieben@users.noreply.github.com> * Use package exports Co-authored-by: Matthieu Sieben <matthieusieben@users.noreply.github.com> * Use package exports * Bump sdk, update $Typed imports * Format * Format * Fix weird TS error * Remove patch * Beter name * It's memo, can validate * Tighten up parseEmbed, dogfood * Bump sdk * Use asPredicate * Loosen types a bit * use asPredicate * Fix types * Use asPredicate * Use asPredicate * Use asPredicate * Clean up upsertProfile types * Use asPredicate * Use Un util * Fix types * Use new AnyProfileView * Use dangerousIsType * Use asPredicate * Use asPredicate * Add fallback content-type to pass typecheck * Clean up upsertProfile types * Align types * Use dangerousIsType * Use dangerousIsType * Use asPredicate * Align types * Convert findLast * Align types * Just ignore type errors and use findLast * Rename atproto -> bsky * Add validate util * Fix type error * Loosen types * Export post * rename atp bsky * Remove unused code * minor changes * Bump deps * Fix types * Tighten back up loose check * Tighten back up loose check * Fix small bug * Update comment * Revert change --------- Co-authored-by: Matthieu Sieben <matthieusieben@users.noreply.github.com> Co-authored-by: Matthieu Sieben <matthieu.sieben@gmail.com>
* Tweak adjustment in the formula (#7547)dan2025-01-221-3/+2
| | | | | * Remove ts-ignore * Tweak OP like adjustment
* Adjust decay formula (#7535)dan2025-01-221-6/+14
|
* Don't re-sort already fetched post thread items (#6698)dan2024-11-241-9/+43
| | | | | | | | | | | | | | | * Don't reorder already seen posts in PostThread * Add sorting by generation * Rip out stable order cache It doesn't make sense because sort() doesn't call the callback for all A/B pairs, and the server returning a different ordering will cause cache misses which means there'll be no stability anyway. * Make hotness deterministic per fetched at * Cache random scores while in thread * Reorder for clarity
* Add a hotness thread sort (#6649)dan2024-11-231-1/+20
| | | | | * Add a hotness thread sort * Bump @atproto/api
* Sort pins last in thread view (#6426)dan2024-11-161-0/+11
|
* Sort imports (#6009)dan2024-10-291-3/+3
| | | | | * Mark import sort/order/style rules as error * npm run lint -- --fix
* Fix notification->post jump for real (#5314)dan2024-09-131-2/+6
| | | | | | | * Revert "Fix notification scroll jump (#5297)" This reverts commit e0d9e75407b053dd3b7a3472f925d8cd4bd92d45. * Query notifications first
* fix `findAll*` type in `post-thread` (#4986)Hailey2024-08-231-8/+12
|
* Optimistic hidden replies (#4977)Eric Bailey2024-08-231-4/+12
|
* update `usePostThreadQuery` to check quote query data (#4975)Hailey2024-08-221-0/+4
| | | | | | | * update `usePostThreadQuery` to check quote query data * search notifs before quotes * oops
* Detached QPs and hidden replies (#4878)Eric Bailey2024-08-211-1/+17
| | | | Co-authored-by: Hailey <me@haileyok.com>
* Show just-posted replies above OP replies (#4901)dan2024-08-081-1/+18
| | | | | | | | | * Unify onPostReply handler * Show just-posted replies above OP replies * Only do this for the highlighted post or thread mode It's confusing to have your post displace OP thread or other people's leaf posts.
* Show own replies before follows' replies in threads (#4882)dan2024-08-061-1/+12
|
* Implement thread locking (#4545)Paul Frazee2024-06-181-1/+1
| | | | | | | * Add the ability to edit threadgates * Fix bottom border on mobile * Refresh thread after threadgate edit
* Fix: only apply self-thread load-more behavior on the outer edge of the ↵Paul Frazee2024-06-181-2/+11
| | | | reply tree (#4559)
* Fix to thread load-more bug (#4488)Paul Frazee2024-06-111-3/+2
|
* Improve thread loading (#4402)Paul Frazee2024-06-111-2/+51
| | | | | | | * Increase the number of posts loaded when a self-thread is present * Increase depth to 10, detect cutoffs on self-threads and show continue link * Stacky the avis
* remove resolution from post thread (#4297)Hailey2024-06-031-11/+14
| | | | | | | | | | | | | | | | | | | | | * remove resolution from post thread nit completely remove did cache lookup move cache check for did to `usePostThreadQuery` remove resolution from post thread * helper function * simplify * simplify search too * fix missing check for root or parent quoted post 🤯 * fix thread traversal
* Shadows (#4265)Eric Bailey2024-05-311-3/+46
|
* Replace getAgent() with reading agent (#4243)dan2024-05-281-2/+2
| | | | | * Replace getAgent() with agent * Replace {agent} with agent
* Improve moderation behaviors: show alert/inform sources and improve UX ↵Paul Frazee2024-05-241-15/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | around threads (#3677) * Dont show account or profile alerts and informs on posts * Sort threads to put blurred items at bottom * Group blurred replies under a single 'show hidden replies' control * Distinguish between muted and hidden replies in the thread view * Fix types * Modify the label alerts with some minor aesthetic updates and to show the source of a label * Tune when an account-level alert is shown on a post * Revert: show account-level alerts on posts again * Rm unused import * Fix to showing hidden replies when viewing a blurred item * Go ahead and uncover replies when 'show hidden posts' is clicked --------- Co-authored-by: dan <dan.abramov@gmail.com>
* remove precacheThreadPostProfiles (#3729)Hailey2024-04-271-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * remove `precacheThreadPostProfiles` * add `displayName` to `PreviewableUserAvatar` * memo * use `precacheProfile` * pass `profile` directly to `PreviewableUserAvatar` * update the `UserAvatar`'s props * remove feed cache * one more spot * rm unused queryClient * Don't call fn unnecessarily * Preload for display name too * try notification item * add to feeditem * and finally, precache for post threads * timestamp * Fix * onBeforePress --------- Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
* [Session] Add `useAgent` hook and replace (#3706)Eric Bailey2024-04-251-1/+2
| | | | | | | | | | | * Hook it up * Memoize getAgent method * Use one shared reference --------- Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
* cache fix for search post results (#3520)Hailey2024-04-121-0/+4
|
* QT Jump Pt. 2 - Remove code duplication (#3506)Hailey2024-04-121-9/+2
| | | | | * remove code duplication * now it's safe to remove shimmer
* Extract query key roots to constants (#3404)dan2024-04-041-7/+8
| | | | | | | * Extract query key roots to constants * Dedupe labelers-detailed-info * Align naming
* Fix flash when pressing into just-created post (#2945)dan2024-02-201-1/+8
|
* Prefer full posts for post thread placeholder (#2943)dan2024-02-201-25/+32
| | | | | | | | | * Revert "Prefer post over quote when finding cached post (#2935)" This reverts commit da62a77f05258ce2b0609248cb5677c2406a4e63. * Prefer full posts for post thread placeholder * Clarify with a comment
* Precache basic profile from posts for instant future navigations (#2795)Hailey2024-02-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * skeleton for caching * modify some existing logic * refactor uri resolution query * add precache feed posts * adjustments * remove prefetch on hover (maybe revert, just example) * fix * change arg name to match what we want * optional infinite stale time * use `ProfileViewDetailed` * Revert "remove prefetch on hover (maybe revert, just example)" This reverts commit 08609deb0defa7cea040438bc37dd3488ddc56f4. * add warning comment back for stale time * remove comment * store profile with both the handle and did for query key * remove extra block from revert * clarify argument name * remove QT cache * structure queries the same (put `enabled` at bottom) * use both `ProfileViewDetailed` and `ProfileView` for the query return type * placeholder profile header * remove logs * remove a few other things we don't need * add placeholder * refactor * refactor * we don't need this height adjustment now * use gray banner while loading * set background color of image to the loading placeholder color * reorg imports * add border to header on loading * Fix style * Rm radius * oops * Undo edit * Back out type changes * Tighten some types and moderate shadow * Move precaching fns to profile where the cache is * Rename functions to match what they do now * Remove anys --------- Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
* Completely disable the RQ cache in post-thread (#2133)Paul Frazee2023-12-071-0/+1
|
* Add PWI opt-out toggle (#2122)Paul Frazee2023-12-071-5/+0
| | | | | | | | | | | | | | | | | * Add PWI opt-out toggle * Bump @atproto/api@0.7.0 * Tweak copy * Bump lockfile * Fix layout on ios * Tweak copy more * Fix types * Tweak copy some more
* Fix some typesPaul Frazee2023-12-051-1/+2
|
* Perf: Include quote posts in the post-thread placeholder (#2104)Paul Frazee2023-12-051-1/+38
|
* Rewrite the shadow logic to look inside the cache (#2045)dan2023-11-301-27/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Reset * Associate shadows with the cache * Use colocated helpers * Fix types * Reorder for clarity * More types * Copy paste logic for profile * Hook up profile query * Hook up suggested follows * Hook up other profile things * Fix shape * Pass setShadow into the effect deps * Include reply posts in the shadow cache search --------- Co-authored-by: Paul Frazee <pfrazee@gmail.com>
* Adjust stale-caches and dont group read&unread notifs together (#2041)Paul Frazee2023-11-291-2/+0
| | | | | | | | | * Dont group read & unread notifications together * Remove and reduce some stale cache times * Keep the staleTime on the post-feed * Bring back the load-bearing staletime on profile
* Apply feed preferences (react-query refactor) (#2040)Paul Frazee2023-11-291-9/+8
| | | | | * Actually implement the feed tuners hook * Move feed-tuner pass into select() to have it apply immediately on change
* Restore post-thread caching behaviors (react-query refactor) (#2010)Paul Frazee2023-11-271-2/+144
| | | | | | | | | | | | | | | | | | | | | * Rework resolve-did and resolve-uri queries to be smarter about cache reuse * Precache handle resolutions * Remove old unused code * Load placeholder threads from the post-feed and notifications-feed queries * Remove logs * Fix bad ref * Add loading spinners to the cache-loading thread view * Scroll replies into view when loading threads * Add caching within a thread * Fix: dont show bottom border when the child spinner is active
* Filter out blocked posts from thread view (#2006)Eric Bailey2023-11-271-3/+4
|
* Move the current agent to a global and reset RQ queries on agent change (#1946)Paul Frazee2023-11-161-3/+2
|
* Caching heuristics (#1938)Eric Bailey2023-11-161-0/+3
| | | | | * Tempfix profile load * First pass at staleTime
* Remove post thread (#1920)Eric Bailey2023-11-151-3/+3
| | | | | | | * Delete post-thread model * Remove post-thread-item * Remove unused types
* Refactor feeds to use react-query (#1862)Paul Frazee2023-11-101-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Update to react-query v5 * Introduce post-feed react query * Add feed refresh behaviors * Only fetch feeds of visible pages * Implement polling for latest on feeds * Add moderation filtering to slices * Handle block errors * Update feed error messages * Remove old models * Replace simple-feed option with disable-tuner option * Add missing useMemo * Implement the mergefeed and fixes to polling * Correctly handle failed load more state * Improve error and empty state behaviors * Clearer naming
* Refactor post threads to use react query (#1851)Paul Frazee2023-11-091-0/+177
* Add post and post-thread queries * Update PostThread components to use new queries * Move from normalized cache to shadow cache model * Merge post shadow into the post automatically * Remove dead code * Remove old temporary session * Fix: set agent on session creation * Temporarily double-login * Handle post-thread uri resolution errors