Increase chat bubble max width to 85% (was 80%) (#10930)
Co-authored-by: Samuel Newman <mozzius@protonmail.com>
This commit is contained in:
@@ -15,7 +15,11 @@ import {EmojiSmile_Stroke2_Corner0_Rounded as EmojiSmileIcon} from '#/components
|
|||||||
import * as Toast from '#/components/Toast'
|
import * as Toast from '#/components/Toast'
|
||||||
import type * as bsky from '#/types/bsky'
|
import type * as bsky from '#/types/bsky'
|
||||||
import {EmojiReactionPicker} from './EmojiReactionPicker'
|
import {EmojiReactionPicker} from './EmojiReactionPicker'
|
||||||
import {canReact, hasReachedReactionLimit} from './util'
|
import {
|
||||||
|
canReact,
|
||||||
|
hasReachedReactionLimit,
|
||||||
|
MESSAGE_BUBBLE_MAX_WIDTH,
|
||||||
|
} from './util'
|
||||||
|
|
||||||
export function ActionsWrapper({
|
export function ActionsWrapper({
|
||||||
message,
|
message,
|
||||||
@@ -163,7 +167,10 @@ export function ActionsWrapper({
|
|||||||
</MessageContextMenu>
|
</MessageContextMenu>
|
||||||
</View>
|
</View>
|
||||||
<View
|
<View
|
||||||
style={[{maxWidth: '80%'}, isFromSelf ? a.align_end : a.align_start]}>
|
style={[
|
||||||
|
{maxWidth: MESSAGE_BUBBLE_MAX_WIDTH},
|
||||||
|
isFromSelf ? a.align_end : a.align_start,
|
||||||
|
]}>
|
||||||
{children}
|
{children}
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ import {groupReactions} from './ReactionsDialog'
|
|||||||
import {
|
import {
|
||||||
CLUSTERED_MESSAGE_THRESHOLD_MS,
|
CLUSTERED_MESSAGE_THRESHOLD_MS,
|
||||||
filterBlockedReactions,
|
filterBlockedReactions,
|
||||||
|
MESSAGE_BUBBLE_MAX_WIDTH,
|
||||||
MESSAGE_GAP_THRESHOLD_MS,
|
MESSAGE_GAP_THRESHOLD_MS,
|
||||||
} from './util'
|
} from './util'
|
||||||
|
|
||||||
@@ -661,7 +662,7 @@ function BlockedPlaceholder({
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Button
|
<Button
|
||||||
style={[{maxWidth: '80%'}, a.self_start]}
|
style={[{maxWidth: MESSAGE_BUBBLE_MAX_WIDTH}, a.self_start]}
|
||||||
label={
|
label={
|
||||||
profile.viewer?.blocking
|
profile.viewer?.blocking
|
||||||
? l`This message is hidden because you are blocking this user.`
|
? l`This message is hidden because you are blocking this user.`
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import Animated, {
|
|||||||
import {useHaptics} from '#/lib/haptics'
|
import {useHaptics} from '#/lib/haptics'
|
||||||
import {atoms as a, tokens, useTheme} from '#/alf'
|
import {atoms as a, tokens, useTheme} from '#/alf'
|
||||||
import {ArrowCornerDownRight_Stroke2_Corner3_Rounded as ReplyIcon} from '#/components/icons/ArrowCornerDownRight'
|
import {ArrowCornerDownRight_Stroke2_Corner3_Rounded as ReplyIcon} from '#/components/icons/ArrowCornerDownRight'
|
||||||
|
import {MESSAGE_BUBBLE_MAX_WIDTH} from './util'
|
||||||
|
|
||||||
// Distance the bubble must travel before releasing fires a reply.
|
// Distance the bubble must travel before releasing fires a reply.
|
||||||
const ACTIVATION_THRESHOLD = 56
|
const ACTIVATION_THRESHOLD = 56
|
||||||
@@ -184,7 +185,7 @@ export function SwipeToReply({
|
|||||||
leaving the gutter free for the back/scroll gestures. */}
|
leaving the gutter free for the back/scroll gestures. */}
|
||||||
<Animated.View
|
<Animated.View
|
||||||
style={[
|
style={[
|
||||||
{maxWidth: '80%'},
|
{maxWidth: MESSAGE_BUBBLE_MAX_WIDTH},
|
||||||
isFromSelf ? a.self_end : a.self_start,
|
isFromSelf ? a.self_end : a.self_start,
|
||||||
contentStyle,
|
contentStyle,
|
||||||
]}>
|
]}>
|
||||||
|
|||||||
@@ -11,12 +11,18 @@ import {isBlockedOrBlocking} from '#/lib/moderation/blocked-and-muted'
|
|||||||
import {logger} from '#/logger'
|
import {logger} from '#/logger'
|
||||||
import {type Shadow} from '#/state/cache/profile-shadow'
|
import {type Shadow} from '#/state/cache/profile-shadow'
|
||||||
import {type ConvoState, ConvoStatus} from '#/state/messages/convo/types'
|
import {type ConvoState, ConvoStatus} from '#/state/messages/convo/types'
|
||||||
|
import {platform} from '#/alf'
|
||||||
import {type ReportSubject} from '#/components/moderation/ReportDialog/types'
|
import {type ReportSubject} from '#/components/moderation/ReportDialog/types'
|
||||||
import * as bsky from '#/types/bsky'
|
import * as bsky from '#/types/bsky'
|
||||||
|
|
||||||
export const MESSAGE_GAP_THRESHOLD_MS = 60 * 60 * 1000
|
export const MESSAGE_GAP_THRESHOLD_MS = 60 * 60 * 1000
|
||||||
export const CLUSTERED_MESSAGE_THRESHOLD_MS = 5 * 60 * 1000
|
export const CLUSTERED_MESSAGE_THRESHOLD_MS = 5 * 60 * 1000
|
||||||
|
|
||||||
|
export const MESSAGE_BUBBLE_MAX_WIDTH = platform({
|
||||||
|
web: '80%' as const,
|
||||||
|
default: '85%' as const,
|
||||||
|
})
|
||||||
|
|
||||||
export function canBeMessaged(profile: bsky.profile.AnyProfileView) {
|
export function canBeMessaged(profile: bsky.profile.AnyProfileView) {
|
||||||
switch (profile.associated?.chat?.allowIncoming) {
|
switch (profile.associated?.chat?.allowIncoming) {
|
||||||
case 'none':
|
case 'none':
|
||||||
|
|||||||
Reference in New Issue
Block a user