Commit Graph

94 Commits

Author SHA1 Message Date
Samuel Newman b1d891385e fix older android versions 2026-03-09 14:21:02 +02:00
Samuel Newman b7ba2d3f0f set isClosing before cancel() to prevent content observer fighting dismiss
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-06 23:38:10 +02:00
Samuel Newman 88354a69d3 fix chat report dialog adjusting to wrong height 2026-03-06 23:38:10 +02:00
Samuel Newman a7c8b1bdce fix cancelling dialogs with preventDismiss 2026-03-06 23:38:10 +02:00
Samuel Newman 537c3cb0ca rm extraneous comment 2026-03-06 23:38:10 +02:00
Samuel Newman 1e8ce36184 add fullHeight prop, fix Android bottom sheet behavior, keyboard handling
Native module:
- Add `fullHeight` prop to BottomSheetView on Android and iOS
- iOS: fullHeight sets detent to .large, skips content observation
- Android: fullHeight uses isFitToContents=false with expandedOffset=statusBarHeight

Android bottom sheet behavior overhaul:
- Switch normal sheets to isFitToContents=false with expandedOffset, enabling
  proper 3-state snapping (half-expanded ↔ expanded ↔ hidden). Previously
  isFitToContents=true prevented settling at half-expanded during gestures,
  making it impossible to swipe back down from expanded.
- preventExpansion sheets keep isFitToContents=true with maxHeight cap, plus
  a state callback safety net that bounces EXPANDED→HALF_EXPANDED. This
  catches an edge case where rapid content resizes during opening can invert
  the expanded/half-expanded offsets, causing the sheet to dismiss.
- Add requestLayout() after maxHeight changes in updateLayout() so the
  FrameLayout actually re-measures (fixes keyboard padding not resizing sheet)
- Set backgroundTint=transparent in the theme to remove Material3 surface
  tint that was visible in gaps between sheet and screen edge

Keyboard handling:
- Remove native keyboard expansion logic (insets listener, isKeyboardVisible
  tracking, manual STATE_EXPANDED on keyboard show)
- Replace with JS-side keyboard padding: ScrollableInner listens for RN
  Keyboard events and adds bottom padding equal to keyboard height
- Generalize useOnKeyboardDidShow → useOnKeyboard(eventName, cb)

Callers:
- Replace minHeight: screenHeight hack with fullHeight: true in EditProfile,
  ChangeHandle, AddAppPassword, ImageAltText, GifAltText, LanguageSelect,
  FollowDialog, GifSelect, StarterPack, Select, NewChat, ShareViaChat,
  DraftsList, WizardEditList, ListAddRemoveUsers, CreateOrEditList
- Remove unused useWindowDimensions imports
- ServerInput: simplify to just preventExpansion (was platform-specific)
- ImageAltTextDialog: remove old {height: 300} keyboard spacer hack

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-06 23:38:10 +02:00
Samuel Newman e46977ddca fix android bottom sheet height observation and content clipping
- getContentHeight: use max of children heights instead of DFS index 1
  (old approach measured the drag handle, not the content)
- observe height via OnLayoutChangeListener on each direct child instead
  of OnGlobalLayoutListener (RN bypasses requestLayout, so global listener
  never fires for RN-driven layout changes)
- defer state changes during DRAGGING/SETTLING to avoid interrupting
  dismiss swipes, apply when gesture settles
- subtract insets.top from NativeView height on android (matching iOS)
  to prevent scroll content clipping at bottom of full-height sheets

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-06 23:38:10 +02:00
Claude 132c46817f Fix Android sheets opening at ~10px height
OnLayoutChangeListener only fires on future layout changes, but
dialog.show() triggers the initial content layout synchronously
before the listener is registered. The sheet was stuck at the tiny
halfExpandedRatio computed from the pre-layout content height (0).

After registering the listener, do an immediate updateLayout() if
the content view already has a nonzero height, so we pick up the
real dimensions.

https://claude.ai/code/session_01Rp7ef1h3fKh6fhStcjqLJ5
2026-03-06 23:38:10 +02:00
Claude 5a122230a7 Fix OnLayoutChangeListener lambda parameter count
The lambda had 10 destructured parameters but OnLayoutChangeListener
only passes 9 (view, left, top, right, bottom, oldLeft, oldTop,
oldRight, oldBottom). Remove the extra placeholder.

https://claude.ai/code/session_01Rp7ef1h3fKh6fhStcjqLJ5
2026-03-06 23:38:10 +02:00
Claude affa0cf810 Remove dead updateLayout JS→native bridge path
Now that both platforms observe content height natively (iOS via KVO,
Android via OnLayoutChangeListener), the JS-callable updateLayout()
is unused. Remove:

- updateLayout() and prevLayoutDetentIdentifier from iOS SheetView
- AsyncFunction("updateLayout") from both platform module definitions
- updateLayout method from the JS BottomSheetNativeComponent

Android's updateLayout() is kept as a private implementation detail
since the keyboard insets listener and native layout observer both
call it internally.

https://claude.ai/code/session_01Rp7ef1h3fKh6fhStcjqLJ5
2026-03-06 23:38:10 +02:00
Claude 421c4abd02 Fix sheet getting set to previous height on rapid content changes
The KVO callback was calling updateLayout(), which has two problems for
content-driven updates:

1. The prevLayoutDetentIdentifier guard can block updates. When
   updateDetents triggers animateChanges, the delegate callback
   sheetPresentationControllerDidChangeSelectedDetentIdentifier fires
   and updates selectedDetentIdentifier to the system-assigned custom
   detent identifier. On the next KVO callback, prevLayoutDetentIdentifier
   (.medium) no longer matches selectedDetentIdentifier, so the update
   is silently dropped.

2. Re-reading frame.size.height from the view hierarchy instead of using
   the observed bounds can return a stale value during rapid layout passes.

Fix: have the KVO callback call updateDetents directly with the observed
height, bypassing both the guard and the frame re-read. The guard in
updateLayout() is preserved for the manual/fallback code path.

https://claude.ai/code/session_01Rp7ef1h3fKh6fhStcjqLJ5
2026-03-06 23:38:10 +02:00
Claude eab139d51f Revert "Add compiled JS build artifacts for bottom-sheet module"
This reverts commit 76dc194bcdfbac4a37e1023c848f936d0913da7a.
2026-03-06 23:38:10 +02:00
Claude cd41cbd8d6 Add compiled JS build artifacts for bottom-sheet module
https://claude.ai/code/session_01Rp7ef1h3fKh6fhStcjqLJ5
2026-03-06 23:38:10 +02:00
Claude 00e990b276 Observe content view layout natively on Android too
Same approach as the iOS KVO change: use View.OnLayoutChangeListener on
the content view to detect height changes purely on the native side.
This eliminates the setTimeout → updateLayout() JS bridge hack that was
a known workaround for async timing issues on Android.

The onLayout callback in JS is now only used for the iOS 15 fallback
height measurement. All other height observation is native.

https://claude.ai/code/session_01Rp7ef1h3fKh6fhStcjqLJ5
2026-03-06 23:38:10 +02:00
Claude f83662275d Observe content view bounds natively to update sheet height on iOS
Replace the async JS bridge round-trip (onLayout → updateLayout()) with
native KVO observation on the content view's bounds. When React Native's
Yoga layout engine sets the frame, the KVO callback fires synchronously
on the same run loop iteration and calls updateLayout() directly. This
eliminates the timing issues that surfaced after enabling iOS 26 design.

https://claude.ai/code/session_01Rp7ef1h3fKh6fhStcjqLJ5
2026-03-06 23:38:10 +02:00
Samuel Newman ae2dd8432b fix bottom sheet keyboard expansion with preventExpansion on android
When preventExpansion is true, the maxHeight cap prevented the sheet
from expanding when the keyboard opened. Lift the cap temporarily when
the keyboard appears (updateLayout restores it on dismiss). Also
broadened the state check to handle SETTLING state during rapid
keyboard open/close.

Fixes #9943

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-06 23:38:10 +02:00
Samuel Newman 1782a65174 Add iOS 26 fluid zoom transition to alt text dialog (#9970)
Co-authored-by: Claude <noreply@anthropic.com>
2026-03-04 20:32:08 -06:00
Samuel Newman 73b096e443 iOS 26 (#9047)
Co-authored-by: Eric Bailey <git@esb.lol>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 22:34:52 -08:00
Samuel Newman f3ddc074a6 Fork MCEmojiPicker (#9763) 2026-02-20 10:39:48 -06:00
Samuel Newman 512ce3d5d0 ALF content language dialog (#9471)
Co-authored-by: Eric Bailey <git@esb.lol>
2026-02-18 08:57:32 -08:00
Samuel Newman 338016ed5c Android sheets edge to edge (#8342) 2026-02-10 21:01:58 +00:00
Eric Bailey 0589bd7d9e Move /platform/detection vars into /env (#9707)
* Add platform vars to env

* Replace /platform/detection with /env
2026-01-16 16:28:17 -06:00
tomsqrd 9136be68b3 Reading the optional String extras from attachment share intents (#9396)
and adding them to the compose intents for images and videos if they exist.

Co-authored-by: Tom Quinders <tom.quinders@check24.de>
2025-11-22 03:03:30 -08:00
Samuel Newman f5a5eee32c handle share intents when app first launches (#9410) 2025-11-20 17:52:33 +02:00
Samuel Newman b422765aed [Threadgate] Tweak threadgate buttons (#9173)
* tweak in-post threadgate button

* tweak composer threadgate button

* reduce date length slightly

* pressed styles

* make date length depend on breakpoint

* add chevron to label btn

* add tiny chevron, special-case button icon width

* [Threadgate] Add hint (#9350)

* get tooltip working on web

* add compatibility layer for working in iOS sheets

* add timeout to profile tooltip now that it appears instantly

* rm debug code

* Update ThreadgateBtn.tsx

Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com>

* remeasure when keyboard changes

---------

Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com>

* fix types

* [Threadgate] Refresh dialog (#9342)

* wip new ui

* update threadgate dialog with new designs

* restore nobody option

* relayout android sheet when ratio changes

* fix ratio changing case in bottom sheet

* timebox reached, use setTimeout

* update panel styles

* missing imports

* extract out Panel

* tweak layout animation

* fix icon color

* use same color mechamism for icon as text

* restore the header

* refreshed toggle styles (#9343)

* [Threadgate] Persist settings (#9341)

* add persist toggle to threadgate dialog

* move state back down

* sort out spacing

* wire up query

* @surfdude29 tweaks

* use tiny chevron in WhoCanReply

* wait for prefetch before opening

* move Panel into the Toggle namespace

* default -> pref

* use medium date length

* rm hover state from web selects, fix border radius

* fix key issue in Selects

---------

Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com>
2025-11-14 06:21:37 -08:00
Samuel Newman 5211b26903 Expo 54 (#8931)
* update deps

* update patches

* fix new arch optout

* build from source, disable new arch

* update to preview.14

* upgrade off of preview to release

* fix lockfile lint

* update patches

* add back expo-location

* downgrade reanimated

* downgrade pagerview

* use expo-file-system/legacy

* try and upgrade types/react-dom

* fix type of uint8array

* rm @types/react resolution from bad rebase

* more type errors

* fix mock

* bump rn-compressor

* add patch of https://github.com/bluesky-social/react-native-paste-input/pull/5

* delete NativeDropdown & remove Zeego

* `import React` in expo modules

* bump cocoapods

* rm unused picker lib

* add speculative react-native-mmkv patch

* revert patch, add temp debug info to error

* bring back speculative patch, patch built JS code instead of source

* revert patch, just do debugging part

* dep update

* update resolutions, dynamic-app-icon

* bump node version in eas.json

* update build instructions

* rm atob from docs

* Delete react-native-mmkv+2.12.2.patch

* bump expo which might include fix

* update expo patch version

* bump expo patch version

* wrong version oops

* update expo to latest

* update react-native-compressor, rm patch
2025-09-22 08:52:07 -07:00
Samuel Newman b2c56cbd6d Add displayName to contexts (#8814) 2025-08-14 01:12:31 +03:00
Samuel Newman d5cc19f282 run lint-native:fix (#8836) 2025-08-13 22:15:08 +03:00
Samuel Newman 1ed019bd72 specify mcemojipicker version (#8600) 2025-07-03 10:17:36 -07:00
Samuel Newman bc072570d2 Activity notification settings (#8485)
Co-authored-by: Eric Bailey <git@esb.lol>
Co-authored-by: Samuel Newman <mozzius@protonmail.com>
Co-authored-by: hailey <me@haileyok.com>
2025-07-01 14:36:04 -07:00
Samuel Newman c634cd9071 Upgrade prettier to 3.6 (#8558)
* upgrade prettier

* run prettier

* more files
2025-06-23 07:44:40 -07:00
Samuel Newman 4c75b568df Android notification channels (#8539) 2025-06-20 11:01:55 +03:00
hailey a6455b3de3 fix crash (#8348) 2025-05-08 08:49:43 -07:00
Samuel Newman 973538d246 New Select component (#8323)
* radix select component on web

* native implementation (wip)

* fix sheet height/padding

* tone down web styles

* react 19 cleanup

* replace primary language select

* change style on native

* get auto placeholder working

* more style tweaks

* replace app language dropdown

* replace rnpickerselect with native select

* rm react-native-picker-select dependency

* rm placeholder, since a value is always selected

* docblock for renderItem

* add more docblocks

* add style prop to item

* pass selectedValue through renderItem

* fix context

* Style overflow buttons

---------

Co-authored-by: Eric Bailey <git@esb.lol>
2025-05-06 10:27:05 -07:00
hailey e7fe9ab553 revert changes to scroll forwarder (#8328) 2025-05-05 00:20:34 -07:00
hailey 544f7befe0 bump it bop it upgrade it (rn 79/expo 53) (#8281)
* basic bumps

* more tweaking

* fix rn patch

* fix crop picker patch

* fix media library patch

* rm unnecessary patch

* fix notifications patch

* update bottomsheet

* Update withAppDelegateReferrer.js

* Delete withNoBundleCompression.js

* rm withNoBundleCompression plugin

* rm findLast shim

* metro package exports is enabled by default

* update react/react-dom/react-compiler

* fix reanimated issue

* vendor expo-ized emoji popup

* fix types

* hackfix view full thread

* Update EmojiPickerModule.podspec

* more upgrades

* fix multiformats package version

* add baseurl

* bump mmkv

* bumps

* update react-keyed-flatten-children

* bump locale packages

* fix emoji picker dark mode

* rn upgrades

* Revert "bump locale packages"

This reverts commit fc82f0f173.

* upgrade testing-library

* rm test renderer

* update patch name minors

* rm findNodeHandle from tabbar

* only do scrollview tag thing on ios

* disable package exports

* update expo notifications handler

* memoize emoji picker styles

* fix tests, mock multiformats

* bump some dev deps with RC versions

* completely rearchitect toasts

* rm logs

* layout animation config for composer footer

* disable autolinking for patched libs

* undo lingui changes

* version bump from release candidate to 0.1

* update atproto deps

* rm @did-plc/server

* fix key issue (maybe)

* move URL polyfill to the polyfill file

* fix yarn lock

* upgrade to 53.0.3

* reanimated layout anim bug patch

* workletize a function that wasn't getting autoworkletized anymore (#8309)

* bump to expo 53.0.4

* bump RN to 0.79.2

* fix yarn lock ci

* Revert "completely rearchitect toasts"

This reverts commit 2e2fcaeeed.

* final upgrades

* chore: cleanup yarn lock

* prettier

---------

Co-authored-by: Samuel Newman <mozzius@protonmail.com>
2025-05-02 13:23:39 -07:00
Samuel Newman b1550f9c02 fix first sheet height change not registering (#8267) 2025-04-22 11:49:20 -07:00
Samuel Newman 5d30111b78 Get sheet padding working consistently (#7798)
* tweak height/padding of iOS

* tweak android ratio calculation

* add a bit of extra padding to full height iOS to account for the bit below the safe area
2025-02-21 10:59:08 -08:00
Hailey 1f6acc11ab clean rn 0.76 upgrade (#6887)
* package upgrades

* upgrade system ui

* update patches

* rename patch

* rm

* use .set/.set

* resolve yarnlock

* fix accidentally removed package

* fix use permissions hook

* fix some type errors

* type fixes

* more tweaking

* clean

* Discard changes to src/screens/Onboarding/StepProfile/index.tsx

* oops

* fix splash

* use ios/android in config

* Fix tests

* add back patch

* add to rn patch

* fullscreen?

* Revert "add to rn patch"

This reverts commit 4716d2c643.

* try this

* test with revert

* test

* maybe this

* fix config

* Bump @react-native-picker/picker

* Bump some packages

* Rm unused

* Update lockfile

* Rename expo-notifications+0.29.8.patch.md to expo-notifications+0.29.10.patch.md

* Update react-native+0.76.3.patch.md

* Update react-native+0.76.3.patch.md

* Inline splash configs

Jumping around the file is annoying and makes it harder to understand how this is structured.

* Start fixing Android splash

* Downgrade compressor

This version isn't building for me due to https://github.com/numandev1/react-native-compressor/issues/322.

* Make Android splash empty for now

* Work around a bug

* Bump the compressor

* Bump again

* Include splash fixes

* Try updating

* No custom Android splash

* Revert to using icons

* welp

* Fix sizes

* Make sizing work

* Bump size

---------

Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
2024-12-06 17:52:08 +00:00
dan 9247407c70 Don't render unnecessary <Portal> instances (#6217) 2024-11-10 23:03:55 +00:00
Hazem Ali 9a10af7117 Fix Retain Cycles in SheetViewController (#6202)
* Fix retain cycle in SheetViewController.swift

* Fix retain cycles
2024-11-10 22:10:09 +00:00
Samuel Newman c3d0cc55d9 Edit profile dialog ALF refresh (#5633) 2024-10-15 21:57:28 +03:00
Hailey 88f326b37f Fix sheets to work nicely on ios 15 (#5685) 2024-10-10 18:16:25 -07:00
Hailey 34a0007679 Move setup for Android sheet (#5684) 2024-10-10 17:52:19 -07:00
Hailey e1a696bcbb More clip stuff for Apple (#5672) 2024-10-10 15:11:43 -07:00
Hailey 2841944789 Ensure app clip works even with starter-pack (#5664) 2024-10-09 15:29:25 -07:00
Hailey 86b0d3b498 Add missing web component (for native view manager) (#5662) 2024-10-09 12:09:16 -07:00
Samuel Newman cca344a3d1 Allow nested sheets without boilerplate (#5660)
Co-authored-by: Hailey <me@haileyok.com>
2024-10-09 11:30:42 -07:00
Hailey 80e25b3d9f [Video] Add dimension info to share intent pt.2 (#5640) 2024-10-07 15:32:26 -07:00
Hailey ee25b89801 [Video] Add dimension info to share intent (#5639) 2024-10-07 14:09:47 -07:00