about summary refs log tree commit diff
path: root/src/view/com/composer/Composer.tsx
Commit message (Collapse)AuthorAgeFilesLines
* Add gif support to web (#6433)Samuel Newman2024-11-221-15/+20
| | | | | | | | | | | | | * add gif support to web * rm set dimensions * rm effect from preview * rm log * rm use of {cause: error} * fix lint
* Use compiler-safe Reanimated get/set APIs (#6391)dan2024-11-171-19/+27
| | | | | | | | | | | | | | | | | | | | | * Convert lightbox to get/set * Work around software-mansion/react-native-reanimated#6613 * Use get/set in more places * Port MainScrollProvider to get/set * Port more to get/set * Port composer to get/set * Remove unnecessary thread hops in composer * Port more things to get/set * Convert more to get/set, remove redundant runOnJS * Convert remaining cases to get/set
* fix video thumb cleanup (#6431)Samuel Newman2024-11-171-1/+3
|
* Add email verification prompts throughout the app (#6174)Hailey2024-11-121-0/+21
|
* Composer UI fixes (#6065)dan2024-11-011-5/+20
| | | | | | | | | * Fix close button overlap * Make footer actually sticky on web * Special toast for thread * Only stick to bottom for last post
* Fix duplicates in thread composer (#6068)dan2024-11-011-0/+1
|
* [Statsig] Track threads (#6057)dan2024-11-011-0/+7
| | | | | * [Statsig] Send thread length * Split events
* Fixes for thread composer on Android (#6045)dan2024-11-011-33/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Thread composer UI (#6050)dan2024-11-011-199/+341
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Implement posting threads (#6049)dan2024-11-011-1/+1
| | | | | | | | | | | | | | | * 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>
* Check video state for the entire thread (#5957)dan2024-11-011-69/+143
| | | | | | | | | | | | | * Switch to using post ID for post actions * Pass post-bound dispatch to ComposerPost * Check video state for entire thread * Always bind post actions to an ID * Rename variable for consistency * Fix clashing keys
* Extend composer checks to all posts in a thread (#5955)dan2024-10-291-50/+65
| | | | | * Check all posts in a thread * Use thread for more checks
* Remove indirection when rendering composer state (#5954)dan2024-10-291-66/+36
| | | | | | | * Simplify onPressCancel dismiss condition * Remove alias variables * Move grapheme length calculation to reducer
* Refactor composer state for threads (#5945)dan2024-10-291-20/+41
| | | | | | | * Refactor composer state for threads * Remove unnecessary default case TS can see it's exhaustive.
* Disable Post button when empty (#5953)dan2024-10-291-32/+19
| | | | | | | * Disable Post button when empty * Use regular disabled button * Disable post on video error until cleared
* Make composer min height conditional and align attachments (#5976)dan2024-10-281-2/+6
| | | | | | | * Make web composer min height condiitonal * Fix alignment * Fix alignment on mobile
* Don't render `ComposerPills` when unnecessary (#5975)Hailey2024-10-281-0/+6
|
* Fix missing style (#5944)dan2024-10-251-1/+1
|
* Conditionally render labels button when media exists in post (#5942)Hailey2024-10-251-7/+8
| | | | | | | * conditionally render button * update labels on remove * tweak
* Split composer into smaller components (#5941)dan2024-10-251-351/+515
| | | | | | | | | | | | | | | * Extract ComposerTopBar * Rename state variables to align with props * Extract ComposerEmbeds * Extract ComposerPills * Extract ComposerFooter * Tweak condition to be simpler * Extract ComposerPost
* Display non-post embeds in composer preview (#5647)dan2024-10-241-0/+1
| | | | | | | | | | | | | * Display non-post embeds in composer preview * Remove starter pack special case from ExternalLinkEmbed This should not be needed because starter pack composer preview now goes through the record preview codepath, just like in the feed/post view. * Hide record ext links if quote is present * Align remove buttons Remove the implicit top padding in record embeds and make it conditional, which is similar to how we treat external link embeds. This makes the X button appear in the same place for record embeds as with links.
* Refactor post meta to return PostView (#5645)dan2024-10-241-4/+2
|
* Move self-label button (#5780)Hailey2024-10-171-58/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * move self label button? * rm * make sure its usable on large font sizes * tweak wording * update icon * tweaks * change button label and change opacity when no media (#5794) * Tweak it moar (#5807) * Tweak it moar * Pluralize * Labels --------- Co-authored-by: Samuel Newman <mozzius@protonmail.com> Co-authored-by: Eric Bailey <git@esb.lol>
* Composer - Self label dialog ALF rewrite (#4354)Samuel Newman2024-10-161-9/+1
|
* translate video state strings (#5762)surfdude292024-10-151-5/+5
|
* ext gif check (#5725)Hailey2024-10-111-0/+2
|
* Allow nested sheets without boilerplate (#5660)Samuel Newman2024-10-091-16/+4
| | | | Co-authored-by: Hailey <me@haileyok.com>
* Move Dialogs to Radix (#5648)Samuel Newman2024-10-081-18/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Use Redix FocusTrap (#5638) * Use Redix FocusTrap * force resolutions on radix libs * add focus guards * use @radix-ui/dismissable-layer for escape handling * fix banner menu keypress by using `Pressable` * add menu in dialog example to storybook --------- Co-authored-by: Samuel Newman <mozzius@protonmail.com> * use DismissableLayer/FocusScope for composer * fix storybook dialog * thread Portal through Prompt and avatar/banner * fix dialog style regression * remove tamagui --------- Co-authored-by: Eric Bailey <git@esb.lol>
* Nicer error message for disabled quotes (#5644)dan2024-10-081-0/+3
|
* Move remaining composer state into reducer (#5623)dan2024-10-071-73/+48
| | | | | | Co-authored-by: Mary <git@mary.my.id> Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com> Co-authored-by: Hailey <me@haileyok.com>
* Fetch link previews from RQ (#5608)dan2024-10-071-107/+69
| | | | | Co-authored-by: Mary <git@mary.my.id> Co-authored-by: Hailey <me@haileyok.com>
* Use composer state as source of truth for embeds/links on publish (#5606)dan2024-10-071-2/+0
| | | | | Co-authored-by: Mary <git@mary.my.id> Co-authored-by: Hailey <me@haileyok.com>
* [Video] Add dimension info to share intent (#5639)Hailey2024-10-071-1/+1
|
* Fix composer char progress layout (#5620)Hailey2024-10-061-48/+50
| | | | | * fix composer * more fixes
* [Sheets] [Pt. 1] Root PR (#5557)Hailey2024-10-041-275/+295
| | | | | | | Co-authored-by: Samuel Newman <mozzius@protonmail.com> Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dan <dan.abramov@gmail.com> Co-authored-by: Hailey <me@haileyok.com>
* Make composer reducer source of truth for images/video when publishing (#5595)dan2024-10-051-24/+23
| | | | | * Move caption and altText state into video reducer * Make composer state source of truth for images and video publish
* Track links and embeds in the composer reducer (#5593)dan2024-10-051-2/+15
| | | | | | | | | * Scaffold embed draft types These don't map 1:1 to the record structure. Rather, we select data from the draft on posting. * Prefill initial quote * Implement the reducer
* Rename some files and variables (#5587)dan2024-10-031-66/+54
| | | | | | | * Move composer reducers together * videoUploadState -> videoState * Inline videoDispatch
* Manage video reducer from composer reducer (#5573)dan2024-10-031-20/+29
| | | | | | | | | | | | | | | * Move video state into composer state * Represent video as embed This is slightly broken. In particular, we can't remove video yet because there's no action that results in video embed being removed. * Properly represent video as embed This aligns the video state lifetime with the embed lifetime. Video can now be properly added and removed. * Disable Add Video when we have images * Ignore empty image pick
* Refactor video uploads (#5570)dan2024-10-031-46/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove unused video field * Stop exposing video dispatch * Move cancellation out of the reducer * Make useUploadStatusQuery controlled by jobId * Rename SetStatus to SetProcessing This action only has one callsite and it's always passing "processing". * Move jobId into video reducer state * Make cancellation scoped * Inline useCompressVideoMutation * Move processVideo down the file * Extract getErrorMessage * useServiceAuthToken -> getServiceAuthToken * useVideoAgent -> createVideoAgent * useVideoUploadLimits -> getVideoUploadLimits * useUploadVideoMutation -> uploadVideo * Use async/await in processVideo * Inline onVideoCompressed into processVideo * Use async/await for uploadVideo * Factor out error messages * Guard dispatch with signal This lets us remove the scattered signal checks around dispatch. * Move job polling out of RQ * Handle poll failures * Remove unnecessary guards * Slightly more accurate condition * Move initVideoUri handling out of the hook * Remove dead argument It wasn't being used before either. * Remove unused detailed status This isn't being used because we're only respecting that state variable when isProcessing=true, but isProcessing is always false during video upload. If we want to re-add this later, it should really just be derived from the reducer state. * Harden the video reducer * Tie all spawned work to a signal * Preserve asset/media for nicer error state * Rename actions to match states * Inline useUploadVideo This abstraction is getting in the way of some future work. * Move MIME check to the only place that handles it
* Introduce a composer reducer and move image state there (#5547)dan2024-10-021-6/+23
| | | | | | | | | | | | | | | | | | | * Add composer reducer * Support adding images Co-authored-by: Mary <git@mary.my.id> * Support updating and deleting images Co-authored-by: Mary <git@mary.my.id> * Derive images state from composer state Co-authored-by: Mary <git@mary.my.id> --------- Co-authored-by: Mary <git@mary.my.id>
* Remove Segment (#5518)Hailey2024-09-271-9/+1
|
* [Share Extension] Move away from deprecated API, implement JS side of things ↵Hailey2024-09-261-0/+2
| | | | (#5509)
* MobX removal take 2 (#5381)Mary2024-09-251-28/+39
| | | | | | | | | * mobx removal take 2 * Actually rm mobx --------- Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
* Enable video_upload gate (#5311)dan2024-09-121-9/+6
|
* [Video] Allow drag-and-drop & pasting video (#5252)Samuel Newman2024-09-101-2/+6
| | | | | * allow DnD/pasting video * rm await
* [Video] Upload tweaks (#5228)Samuel Newman2024-09-081-2/+4
| | | | | * use correct mime type * fix wheel progress
* [Video] Tweak order of elements in composer (#5213)Hailey2024-09-071-32/+32
|
* Add emoji picker to chat composer (#5196)Eric Bailey2024-09-061-3/+3
| | | | | Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com> Co-authored-by: Adrov Igor <nucleartux@gmail.com>
* [Video] Fix alt text dialog on iOS and Android (#5177)Hailey2024-09-061-2/+2
| | | | Co-authored-by: Samuel Newman <mozzius@protonmail.com>