Commit Graph

4877 Commits

Author SHA1 Message Date
Dan Abramov e8ec306839 Handle different thumbnail aspects 2024-11-02 03:17:01 +00:00
Dan Abramov e01f69132b Prevent gestures during animation 2024-11-02 02:57:39 +00:00
Dan Abramov d8c1354e96 Make flying away nice 2024-11-02 02:52:35 +00:00
Dan Abramov 58e261676b Opacity for controls 2024-11-02 01:28:18 +00:00
Dan Abramov dcf72ae381 Fix type 2024-11-02 01:18:29 +00:00
Dan Abramov 0032aa1620 Half-broken dismiss animation 2024-11-02 01:12:37 +00:00
Dan Abramov f08e542995 Key lightbox by id 2024-11-02 00:49:53 +00:00
Dan Abramov 68ab910d5a Conslidate ImageView props 2024-11-02 00:46:28 +00:00
Dan Abramov de1a6fe14d Prevent OOB scroll on iOS when zoomed in 2024-11-02 00:35:56 +00:00
Dan Abramov aeda009b2f FIX DA CALCULATION!!!!!!
Holy shit this took me a while. Basically we should be treating the original image center as the scale origin rather than the scaled image center. Otherwise expanding feels unsteady.
2024-11-02 00:35:56 +00:00
Dan Abramov e1d1735f56 Combine two functions 2024-11-02 00:35:56 +00:00
Dan Abramov 03679c4e51 Extract a function 2024-11-02 00:35:56 +00:00
Dan Abramov 4fb92ab059 Animate transform 2024-11-02 00:35:56 +00:00
Dan Abramov d35fcca01e Animate opening 2024-11-02 00:35:56 +00:00
Dan Abramov 0be8c55780 Integrate dismissal with root lightbox view 2024-11-02 00:35:56 +00:00
Dan Abramov fe7d97b0bf Move swipe gesture handling upwards 2024-11-02 00:35:56 +00:00
Dan Abramov 9c28b3a491 Lift the swipe animated value upwards 2024-11-02 00:35:56 +00:00
Dan Abramov 6ee2b05ac0 Move LightboxFooter into the implementation file 2024-11-02 00:35:34 +00:00
Dan Abramov ab6877795f Refactor LightboxFooter props 2024-11-02 00:08:31 +00:00
Dan Abramov 00ff654134 Unindent 2024-11-01 23:50:20 +00:00
Dan Abramov fd27242ce8 Unify lightbox types 2024-11-01 23:49:12 +00:00
Dan Abramov 431c81981c Refactor lightbox footer to render prop 2024-11-01 23:42:42 +00:00
Dan Abramov 5e1a2fcf06 Use safe aspect for lightbox calculations 2024-11-01 22:53:14 +00:00
Dan Abramov c95f8e8659 Handle division by zero in the hook 2024-11-01 22:53:14 +00:00
Dan Abramov 79a61adef7 Wire up known dimensions to the lightbox 2024-11-01 22:53:14 +00:00
Dan Abramov 0ae5033147 Make lightbox use the same cache 2024-11-01 22:53:14 +00:00
Dan Abramov 6b478644e2 Move useImageDimensions into image-sizes 2024-11-01 22:53:14 +00:00
Dan Abramov fe33a21d3e Factor useImageDimensions out of useImageAspectRatio 2024-11-01 22:53:14 +00:00
Dan Abramov 412426bac3 Derive aspect on the fly 2024-11-01 22:53:14 +00:00
Dan Abramov 56740a3d26 Rm unused fields 2024-11-01 22:53:14 +00:00
Dan Abramov af11271ff7 Make image-sizes LRU
Code is copy paste from useImageDimensions.ts
2024-11-01 22:53:14 +00:00
Dan Abramov 33f4ab2697 Rewrite image-sizes.fetch to avoid mixing async styles 2024-11-01 22:53:14 +00:00
Dan Abramov 71c4add42e Handle src change 2024-11-01 22:53:14 +00:00
Dan Abramov fc0f7bbf9c Check cache early 2024-11-01 22:53:14 +00:00
Dan Abramov 9b076032cc Use explicit values when useImageAspectRatio doesn't know
It's not very good that you can't distingiush when we haven't loaded vs when we're certain. This shifts the burden of dealing with missing values to the caller.
2024-11-01 22:53:14 +00:00
Dan Abramov c4c01955cc Remove useless memo 2024-11-01 22:53:14 +00:00
dan 7111e38cd4 Revert "React compiler beta and reenable rule (#5898)" (#6071)
This reverts commit 1fc684aaef.
2024-11-01 22:17:05 +00:00
dan 3eb531b000 Composer UI fixes (#6065)
* Fix close button overlap

* Make footer actually sticky on web

* Special toast for thread

* Only stick to bottom for last post
2024-11-01 22:02:39 +00:00
dan 46004fb2d0 Fix duplicates in thread composer (#6068) 2024-11-01 21:55:37 +00:00
Samuel Newman d33ce1dea1 change language for autoplay setting (#6069) 2024-11-01 21:10:25 +00:00
dan ff01ffe35f Fix some images getting squished on Android due to EXIF tags (#6058) 2024-11-01 19:25:31 +00:00
Ben Harris 5c5fc3230b fix text clipping around external embed's domain (#6012) 2024-11-01 12:15:44 -07:00
dan 2398b84d17 Change post Follow button color on toggle (#6059) 2024-11-01 19:09:28 +00:00
Hailey fb4210b36c Add dids for discover debug (#6063)
* add dids

* keep is_internal
2024-11-01 19:09:13 +00:00
dan 8d5b551ed6 Hook debugTopics to override X-Bsky-Topics (#6060) 2024-11-01 18:28:54 +00:00
dan 125ac5049a [Statsig] Track threads (#6057)
* [Statsig] Send thread length

* Split events
2024-11-01 16:21:18 +00:00
dan 1c2186bc03 Fix character count with intent (#6056) 2024-11-01 16:21:10 +00:00
dan 21b82fa19c Fixes for thread composer on Android (#6045)
* Extract function to read contentHeight later

* Remove autoscroll to bottom

We're going to implement this in the UI layer instead.

* Remove worklet from non-worklets to avoid confusion

* Rename and invert hasScrolled* variables

Their naming was too ambiguous (they used to represent "has scrolled _away_ from X"). I inverted them and clarified the naming. No functional changes.

* This should not be necessary

It's already called not just from UI thread. And it only sets shared values, which can be done from either thread.

* Make hasScrolledTo* derived values

It wasn't always correct to derive them manually because reading from .value is stale on JS thread. We could fix that by using the local variables but it makes more conceptualy sense to treat these as derived anyway.

* Reimplement autoscroll-to-bottom in UI layer

Doing it here ensures we also do it when you add an image at the end of the thread. Otherwise it's very confusing where it went.

* Use fancy ScrollView

This seems to fix ScrollView getting stuck after inserting images at the thread end on Android.

* More aggressive scroll-to-bottom

* "Fix" cursor getting stuck on Android

* Revert "Use fancy ScrollView"

This reverts commit 04e34a54e3b75f8a77de5062bff5fe6e76420bbb.
2024-11-01 03:47:53 +00:00
dan 7a08d61d88 Thread composer UI (#6050)
* Basic adding of posts

* Switch active post on focus

* Conditionally show plus button

* Insert posts midthread

* Track active/inactive post

* Delete posts in a thread

* Focus after deletion

* Tweak empty post detection

* Mix height for active only

* Move toolbar with post on web

* Fix footer positioning

* Post All button

* Fix reply to positioning

* Improve memoization

* Improve memoization for clearVideo

* Remove unnecessary argument

* Add some manual memoization to fix re-renders

* Scroll to bottom on add new

* Fix opacity on Android

* Add backdrop

* Fix videos

* Check alt for video too

* Clear pending publish on error

* Fork alt message by type

* Separate placeholder for next posts

* Limit hitslop to avoid clashes
2024-11-01 03:45:55 +00:00
dan 01c9ac0e13 Implement posting threads (#6049)
* Implement posting a thread

Co-authored-by: Dan Abramov <dan.abramov@gmail.com>

* Fix native build

* Remove dependency on web crypto API

* Fix unrelated TS error (wtf)

---------

Co-authored-by: Mary <148872143+mary-ext@users.noreply.github.com>
2024-11-01 03:42:38 +00:00