Compare commits

...

3 Commits

Author SHA1 Message Date
Eric Bailey cd630b0c32 Merge remote-tracking branch 'origin/main' into app-2098
* origin/main: (26 commits)
  [Android] Fix horizontal swipes being cancelled when leaving bounds (#10712)
  Enable ESLint errors and suppress existing violations (#10490)
  Hide accept button for locked chats (#10696)
  Mount message dialogs once at the list level (#10435)
  Fix alt text selection in lightbox on Android (and iOS) (#10698)
  Mention default `<Text>` style in CLAUDE.md (#10705)
  Use square icons for labellers in Automation Label preview card (#10701)
  [ALF] Set text to `leading_snug` by default (#10627)
  Nightly source-language update
  Transpile `@atproto/api` package for older browser support (#10700)
  Add iOS peek long-press context menu for image embeds (#10300)
  Revert "[ALG-96] Don't fall back to search for onboarding user suggestions (#10680)" (#10699)
  fix blur on image alt text background (#10658)
  Create screen for managing chat requests (#10635)
  Don't show Suggested heading if there are no suggestions (#10695)
  Prefer opengraph image, fall back to Standard Site coverImage (#10694)
  Create logged-out view for group chat invites (#10598)
  Bump actions/create-github-app-token from 1 to 3 (#10691)
  Bump marocchino/sticky-pull-request-comment from 2 to 3 (#10692)
  Bump slackapi/slack-github-action from 2.1.1 to 3.0.3 (#10693)
  ...

# Conflicts:
#	src/components/Post/Embed/ImageEmbed.tsx
2026-06-03 15:17:10 -05:00
vineyardbovines 410f3cbba1 Apply quote-context fix to single-image branch too 2026-06-02 12:33:13 -04:00
vineyardbovines fbf8fc2e7f Fix image peek in carousels for quote posts
Plumbs `isWithinQuote` from `ImageEmbed` through to `Gallery` and uses
it to render the carousel with a smaller per-breakpoint height + square
crop. Drops the `FeedEmbedRecordWithMedia` derivation, which has been
dead since the chat-message squashing change removed every site that
set that enum.

Closes APP-2098
2026-06-02 12:26:38 -04:00
2 changed files with 17 additions and 13 deletions
+3 -6
View File
@@ -87,8 +87,7 @@ export function ImageEmbed({
crop={
rest.viewContext === PostEmbedViewContext.ThreadHighlighted
? 'none'
: rest.viewContext ===
PostEmbedViewContext.FeedEmbedRecordWithMedia
: rest.isWithinQuote
? 'square'
: 'constrained'
}
@@ -103,10 +102,7 @@ export function ImageEmbed({
onPress(0, [containerRef], [dims])
}
onPressIn={() => onPressIn(0)}
hideBadge={
rest.viewContext ===
PostEmbedViewContext.FeedEmbedRecordWithMedia
}
hideBadge={rest.isWithinQuote}
/>
</ImageContextMenu>
</View>
@@ -121,6 +117,7 @@ export function ImageEmbed({
onPress={onPress}
onPressIn={onPressIn}
viewContext={rest.viewContext}
isWithinQuote={rest.isWithinQuote}
/>
</View>
)
+14 -7
View File
@@ -54,6 +54,7 @@ interface GalleryProps {
) => void
onPressIn?: (index: number) => void
viewContext?: PostEmbedViewContext
isWithinQuote?: boolean
}
const Context = createContext<{
@@ -97,6 +98,7 @@ export function Gallery({
onPress,
onPressIn,
viewContext,
isWithinQuote,
}: GalleryProps) {
const {t: l} = useLingui()
const ax = useAnalytics()
@@ -104,14 +106,21 @@ export function Gallery({
const largeAltBadge = useLargeAltBadgeEnabled()
const bps = useBreakpoints()
const window = useWindowDimensions()
const isWithinQuote =
viewContext === PostEmbedViewContext.FeedEmbedRecordWithMedia
const isWithinChat = viewContext === PostEmbedViewContext.ChatMessage
const hideBadges = isWithinQuote
const contentHeight = useMemo(() => {
if (isWithinChat) {
return 120
}
if (isWithinQuote) {
if (bps.gtMobile) {
return 220
} else if (bps.gtPhone) {
return 190
} else {
return 150
}
}
if (bps.gtMobile) {
return 300
} else if (bps.gtPhone) {
@@ -119,7 +128,7 @@ export function Gallery({
} else {
return 200
}
}, [bps, isWithinChat])
}, [bps, isWithinChat, isWithinQuote])
/*
* Container overflow styles
@@ -220,7 +229,7 @@ export function Gallery({
crop={
viewContext === PostEmbedViewContext.ThreadHighlighted
? 'none'
: viewContext === PostEmbedViewContext.FeedEmbedRecordWithMedia
: isWithinQuote
? 'square'
: 'constrained'
}
@@ -229,9 +238,7 @@ export function Gallery({
onPress?.(index, [containerRef], [dims])
}
onPressIn={() => onPressIn?.(index)}
hideBadge={
viewContext === PostEmbedViewContext.FeedEmbedRecordWithMedia
}
hideBadge={isWithinQuote}
/>
))}
</View>