Skip to content

A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.

TypeScript fluxerfluxerapp

fix(app): zoom-proof the titlebar, media viewer and reactions

Hampus50df71145543
diff --git a/fluxer_app/src/app/globals.css b/fluxer_app/src/app/globals.css
index 2349fb251..eed72a10c 100644
--- a/fluxer_app/src/app/globals.css
+++ b/fluxer_app/src/app/globals.css
@@ -85,7 +85,7 @@ var {
--z-index-tooltip: 45000;
--z-index-toast: 50000;
--z-index-titlebar: 100000;
- --native-titlebar-height: 2rem;
+ --native-titlebar-height: 32px;
--macos-traffic-light-inset: 78px;
--radius-sm: 0.25rem;
@@ -383,13 +383,13 @@ html.allow-transparency body {
.fluxer-native-titlebar {
position: fixed;
top: 0;
- left: 0;
- right: 0;
+ inset-inline-start: 0;
+ inset-inline-end: 0;
height: var(--native-titlebar-height);
display: flex;
align-items: center;
- gap: var(--spacing-2);
- padding: 0 0 0 calc(var(--spacing-3) + env(safe-area-inset-left));
+ gap: 8px;
+ padding: 0 0 0 calc(12px + env(safe-area-inset-left));
background: var(--background-secondary);
-webkit-app-region: drag;
z-index: var(--z-index-titlebar);
@@ -397,7 +397,7 @@ html.allow-transparency body {
.fluxer-native-titlebar[data-platform='macos'] {
padding-left: calc(var(--macos-traffic-light-inset) + env(safe-area-inset-left));
- padding-right: calc(var(--spacing-3) + env(safe-area-inset-right));
+ padding-right: calc(12px + env(safe-area-inset-right));
}
html.platform-native:not(.window-focused) .fluxer-native-titlebar,
@@ -408,14 +408,15 @@ html.platform-native.window-focus-activation-guard .fluxer-native-titlebar {
.fluxer-native-titlebar__left {
display: flex;
align-items: center;
- gap: var(--spacing-2);
+ gap: 8px;
color: var(--text-primary-muted);
opacity: 0.8;
}
.fluxer-native-titlebar__wordmark {
display: block;
- height: 0.8125rem;
+ height: 13px;
+ font-size: 16px;
width: auto;
color: var(--text-primary-muted);
overflow: visible;
@@ -440,7 +441,7 @@ html.platform-native.window-focus-activation-guard .fluxer-native-titlebar {
border: 0;
background: transparent;
color: var(--text-secondary);
- width: 3rem;
+ width: 48px;
height: 100%;
padding: 0;
border-radius: 0;
@@ -454,8 +455,8 @@ html.platform-native.window-focus-activation-guard .fluxer-native-titlebar {
}
.fluxer-native-titlebar__control svg {
- width: 1.0625rem;
- height: 1.0625rem;
+ width: 17px;
+ height: 17px;
}
.fluxer-native-titlebar__control:hover {
@@ -588,7 +589,7 @@ table {
}
table th {
- text-align: left;
+ text-align: start;
font-weight: bold;
}
diff --git a/fluxer_app/src/features/channel/components/MessageReactions.tsx b/fluxer_app/src/features/channel/components/MessageReactions.tsx
index f978e69d9..094e547d2 100644
--- a/fluxer_app/src/features/channel/components/MessageReactions.tsx
+++ b/fluxer_app/src/features/channel/components/MessageReactions.tsx
@@ -22,6 +22,7 @@ import {ReactionImage} from '@app/features/messaging/components/ReactionImage';
import {useMessageReactions as useMessageReactionsSnapshot} from '@app/features/messaging/hooks/useMessageReactionStore';
import type {Message} from '@app/features/messaging/models/MessagingMessage';
import {getEmojiName, getReactionKey, useEmojiURL} from '@app/features/messaging/utils/ReactionUtils';
+import {remFromPx} from '@app/features/theme/layout/RemFromPx';
import {EmojiContextMenuItems} from '@app/features/ui/action_menu/items/EmojiContextMenuItems';
import * as ContextMenuCommands from '@app/features/ui/commands/ContextMenuCommands';
import FocusRing from '@app/features/ui/focus_ring/FocusRing';
@@ -330,7 +331,7 @@ export const MessageReactions = observer(
onClick={handleEmojiPickerOpen}
data-flx="channel.message-reactions.add-reaction-button.emoji-picker-open"
>
- <SmileyIcon size={20} weight="fill" data-flx="channel.message-reactions.smiley-icon" />
+ <SmileyIcon size={remFromPx(20)} weight="fill" data-flx="channel.message-reactions.smiley-icon" />
</button>
</FocusRing>
<ExpressionPickerSheet
@@ -371,7 +372,7 @@ export const MessageReactions = observer(
data-action="message-add-reaction-button"
data-flx="channel.message-reactions.add-reaction-button"
>
- <SmileyIcon size={20} weight="fill" data-flx="channel.message-reactions.smiley-icon--2" />
+ <SmileyIcon size={remFromPx(20)} weight="fill" data-flx="channel.message-reactions.smiley-icon--2" />
</button>
</FocusRing>
</Popout>
diff --git a/fluxer_app/src/features/messaging/components/modals/MediaModal.module.css b/fluxer_app/src/features/messaging/components/modals/MediaModal.module.css
index b4274e20a..a8ef7c3b1 100644
--- a/fluxer_app/src/features/messaging/components/modals/MediaModal.module.css
+++ b/fluxer_app/src/features/messaging/components/modals/MediaModal.module.css
@@ -136,7 +136,7 @@
.modalOverlay {
position: fixed;
- inset: 0;
+ inset: var(--native-titlebar-height, 0px) 0 0;
z-index: var(--z-index-modal);
display: flex;
align-items: center;
@@ -172,8 +172,6 @@
.modalContentInner {
--media-hud-button-size: 2.375rem;
--media-hud-button-radius: 0.75rem;
- --media-hud-surface-padding: 0.375rem;
- --media-hud-surface-radius: calc(var(--media-hud-button-radius) + var(--media-hud-surface-padding) + 0.125rem);
--media-hud-surface-bg: rgb(0 0 0 / 0.58);
--media-hud-surface-border: rgb(255 255 255 / 0.11);
--media-hud-shadow: 0 0.625rem 1.75rem rgb(0 0 0 / 0.42);
@@ -191,7 +189,10 @@
);
--media-fit-safe-inset-inline: max(var(--media-content-padding, 1rem), var(--media-side-overlay-width, 0px));
--media-fit-max-width: max(0px, calc(100dvw - (2 * var(--media-fit-safe-inset-inline))));
- --media-fit-max-height: max(0px, calc(100dvh - (2 * var(--media-fit-safe-inset-block))));
+ --media-fit-max-height: max(
+ 0px,
+ calc(100dvh - var(--native-titlebar-height, 0px) - (2 * var(--media-fit-safe-inset-block)))
+ );
--media-content-inner-gap: 0.75rem;
--media-content-inner-padding: 0px;
position: relative;
@@ -395,7 +396,7 @@
font-size: 0.8125rem;
font-weight: 400;
line-height: 1.25rem;
- text-align: right;
+ text-align: end;
text-shadow: 0 0.0625rem 0.75rem rgb(0 0 0 / 0.68);
pointer-events: none;
contain: layout paint;
@@ -511,13 +512,13 @@
}
.thumbnailImageWrapperFirst {
- border-top-left-radius: 0.375rem;
- border-bottom-left-radius: 0.375rem;
+ border-start-start-radius: 0.375rem;
+ border-end-start-radius: 0.375rem;
}
.thumbnailImageWrapperLast {
- border-top-right-radius: 0.375rem;
- border-bottom-right-radius: 0.375rem;
+ border-start-end-radius: 0.375rem;
+ border-end-end-radius: 0.375rem;
}
.thumbnailButtonSelected .thumbnailImageWrapper {
diff --git a/fluxer_app/src/features/messaging/components/modals/MediaModal.tsx b/fluxer_app/src/features/messaging/components/modals/MediaModal.tsx
index f7fabc53f..9f7fcb8e5 100644
--- a/fluxer_app/src/features/messaging/components/modals/MediaModal.tsx
+++ b/fluxer_app/src/features/messaging/components/modals/MediaModal.tsx
@@ -24,7 +24,6 @@ import {
ATTACHMENT_DESCRIPTOR,
ATTACHMENT_THUMBNAILS_DESCRIPTOR,
CLOSE_MEDIA_VIEWER_DESCRIPTOR,
- getNativeTitlebarHeight,
getViewportPadding,
type MediaModalProps,
type MediaThumbnail,
@@ -38,6 +37,7 @@ import * as MediaViewerCommands from '@app/features/ui/commands/MediaViewerComma
import {Scroller} from '@app/features/ui/components/Scroller';
import {clamp} from '@app/features/ui/components/slider/SliderMath';
import FocusRing from '@app/features/ui/focus_ring/FocusRing';
+import {CaretLeftIcon, CaretRightIcon} from '@app/features/ui/icons/DirectionalIcons';
import LayerManager from '@app/features/ui/state/LayerManager';
import MobileLayout from '@app/features/ui/state/MobileLayout';
import OverlayStack from '@app/features/ui/state/OverlayStack';
@@ -45,11 +45,10 @@ import {Tooltip} from '@app/features/ui/tooltip/Tooltip';
import {formatRoundedPercentage} from '@app/features/ui/utils/PercentageFormatting';
import {MobileVideoViewer} from '@app/features/voice/components/modals/MobileVideoViewer';
import {useLingui} from '@lingui/react/macro';
-import {CaretLeftIcon, CaretRightIcon} from '@phosphor-icons/react';
import {clsx} from 'clsx';
import {AnimatePresence, motion} from 'framer-motion';
import {observer} from 'mobx-react-lite';
-import type {CSSProperties, FC, KeyboardEvent as ReactKeyboardEvent} from 'react';
+import type {CSSProperties, FC, KeyboardEvent as ReactKeyboardEvent, ReactNode} from 'react';
import {createElement, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState} from 'react';
interface PanZoomInfo {
@@ -120,7 +119,6 @@ export const MediaModal: FC<MediaModalProps> = observer(
const [panZoomInfo, setPanZoomInfo] = useState<PanZoomInfo>(FITTED_PAN_ZOOM_INFO);
const [isHudHovered, setIsHudHovered] = useState(false);
const [viewportPadding, setViewportPadding] = useState(getViewportPadding);
- const [nativeTitlebarHeight, setNativeTitlebarHeight] = useState(getNativeTitlebarHeight);
const panZoomHandleRef = useRef<PanZoomSurfaceHandle>(null);
const topActionBarRef = useRef<HTMLDivElement>(null);
const bottomActionBarRef = useRef<HTMLDivElement>(null);
@@ -205,7 +203,6 @@ export const MediaModal: FC<MediaModalProps> = observer(
useEffect(() => {
const updateViewportInsets = () => {
setViewportPadding(getViewportPadding());
- setNativeTitlebarHeight(getNativeTitlebarHeight());
};
updateViewportInsets();
window.addEventListener('resize', updateViewportInsets);
@@ -216,7 +213,9 @@ export const MediaModal: FC<MediaModalProps> = observer(
const [rovingThumbnailIndex, setRovingThumbnailIndex] = useState<number>(() => currentIndex ?? 0);
useEffect(() => {
const handleKeyDown = (e: KeyboardEvent) => {
- if (e.defaultPrevented) return;
+ if (e.defaultPrevented) {
+ return;
+ }
if (e.key === 'Escape') {
handleClose();
return;
@@ -257,14 +256,19 @@ export const MediaModal: FC<MediaModalProps> = observer(
thumbnails && thumbnails.length > 1 && currentIndex !== undefined && onSelectThumbnail !== undefined;
const isMobileVideo = Boolean(isMobile && mediaType === 'video' && videoSrc);
const contentSizingStyle = useMemo(() => {
- const minimumTopOverlayHeight = isMobile && !isMobileVideo ? 46 : hasThumbnailCarousel ? 54 : 0;
+ let minimumTopOverlayHeight = 0;
+ if (isMobile && !isMobileVideo) {
+ minimumTopOverlayHeight = 46;
+ } else if (hasThumbnailCarousel) {
+ minimumTopOverlayHeight = 54;
+ }
const minimumBottomOverlayHeight = isMobile ? 0 : 44;
const hasSideNavButtons =
currentIndex !== undefined && totalAttachments !== undefined && totalAttachments > 1 && !isMobile;
const navButtonInset = 8 + 48 + 8;
const sideOverlayWidth = hasSideNavButtons ? Math.max(0, navButtonInset - viewportPadding) : 0;
const hudInlineOffset = isMobile ? 12 : Math.round(clamp(viewportPadding * 0.24, 10, 16));
- const hudTopOffset = isMobile ? 12 : Math.round(clamp(viewportPadding * 0.22, 10, 16)) + nativeTitlebarHeight;
+ const hudTopOffset = isMobile ? 12 : Math.round(clamp(viewportPadding * 0.22, 10, 16));
const hudBottomOffset = isMobile ? 12 : Math.round(clamp(viewportPadding * 0.28, 12, 22));
return {
'--media-content-padding': `${viewportPadding}px`,
@@ -278,7 +282,6 @@ export const MediaModal: FC<MediaModalProps> = observer(
} as CSSProperties;
}, [
viewportPadding,
- nativeTitlebarHeight,
topOverlayHeight,
bottomOverlayHeight,
isMobile,
@@ -292,10 +295,18 @@ export const MediaModal: FC<MediaModalProps> = observer(
const observer = new ResizeObserver(() => {
measureOverlayHeights();
});
- if (topActionBarRef.current) observer.observe(topActionBarRef.current);
- if (thumbnailCarouselRef.current) observer.observe(thumbnailCarouselRef.current);
- if (bottomActionBarRef.current) observer.observe(bottomActionBarRef.current);
- if (bottomInfoBarRef.current) observer.observe(bottomInfoBarRef.current);
+ if (topActionBarRef.current) {
+ observer.observe(topActionBarRef.current);
+ }
+ if (thumbnailCarouselRef.current) {
+ observer.observe(thumbnailCarouselRef.current);
+ }
+ if (bottomActionBarRef.current) {
+ observer.observe(bottomActionBarRef.current);
+ }
+ if (bottomInfoBarRef.current) {
+ observer.observe(bottomInfoBarRef.current);
+ }
return () => observer.disconnect();
}, [measureOverlayHeights, hasThumbnailCarousel, currentIndex, totalAttachments, isMobile, isMobileVideo]);
const shouldHideHud = enablePanZoom && !panZoomInfo.isDefault && !isHudHovered;
@@ -318,7 +329,9 @@ export const MediaModal: FC<MediaModalProps> = observer(
}, [currentIndex, rovingThumbnailIndex]);
const handleThumbnailSelect = useCallback(
(index: number) => {
- if (!onSelectThumbnail || currentIndex === undefined) return;
+ if (!onSelectThumbnail || currentIndex === undefined) {
+ return;
+ }
setZoomState('fit');
setRovingThumbnailIndex(index);
onSelectThumbnail(index);
@@ -331,7 +344,9 @@ export const MediaModal: FC<MediaModalProps> = observer(
}, []);
const handleThumbnailKeyDown = useCallback(
(e: ReactKeyboardEvent<HTMLElement>) => {
- if (!thumbnailCount) return;
+ if (!thumbnailCount) {
+ return;
+ }
let nextIndex = rovingThumbnailIndex;
if (e.key === 'ArrowRight' || e.key === 'ArrowDown') {
nextIndex = (rovingThumbnailIndex + 1) % thumbnailCount;
@@ -344,7 +359,9 @@ export const MediaModal: FC<MediaModalProps> = observer(
} else {
return;
}
- if (nextIndex === rovingThumbnailIndex) return;
+ if (nextIndex === rovingThumbnailIndex) {
+ return;
+ }
e.preventDefault();
e.stopPropagation();
handleThumbnailSelect(nextIndex);
@@ -369,55 +386,75 @@ export const MediaModal: FC<MediaModalProps> = observer(
),
[children, rotation, isRotationSwapped],
);
- const mediaContent = isMobileVideo
- ? createElement(MobileVideoViewer, {
- src: videoSrc ?? '',
- initialTime,
- loop: true,
- onClose: handleClose,
- onMenuOpen,
- })
- : enablePanZoom
- ? isMobile
- ? createElement(MobileMediaViewer, {
- ref: panZoomHandleRef,
- zoomState,
- onZoomStateChange: handleZoomStateChange,
- onTransformChange: handleTransformChange,
- resetKey: currentIndex,
- children: wrappedChildren,
- })
- : createElement(DesktopMediaViewer, {
- ref: panZoomHandleRef,
- onClose: handleClose,
- onZoomStateChange: handleZoomStateChange,
- onTransformChange: handleTransformChange,
- resetKey: currentIndex,
- zoomState,
- children: wrappedChildren,
- })
- : createElement(
- 'div',
- {className: styles.nonZoomMediaContainer},
- createElement('div', {
- className: styles.nonZoomBackdrop,
- role: 'button',
- tabIndex: 0,
- onClick: handleClose,
- onKeyDown: (e: ReactKeyboardEvent<HTMLDivElement>) => {
- if (isKeyboardActivationKey(e.key)) {
- e.preventDefault();
- handleClose();
- }
- },
- 'aria-label': i18n._(CLOSE_MEDIA_VIEWER_DESCRIPTOR),
- }),
- createElement(
- 'div',
- {className: styles.nonZoomContent},
- createElement('div', {className: styles.nonZoomContentInner}, wrappedChildren),
- ),
- );
+ let mediaContent: ReactNode;
+ if (isMobileVideo) {
+ mediaContent = createElement(MobileVideoViewer, {
+ src: videoSrc ?? '',
+ initialTime,
+ loop: true,
+ onClose: handleClose,
+ onMenuOpen,
+ });
+ } else if (!enablePanZoom) {
+ mediaContent = createElement(
+ 'div',
+ {className: styles.nonZoomMediaContainer},
+ createElement('div', {
+ className: styles.nonZoomBackdrop,
+ role: 'button',
+ tabIndex: 0,
+ onClick: handleClose,
+ onKeyDown: (e: ReactKeyboardEvent<HTMLDivElement>) => {
+ if (isKeyboardActivationKey(e.key)) {
+ e.preventDefault();
+ handleClose();
+ }
+ },
+ 'aria-label': i18n._(CLOSE_MEDIA_VIEWER_DESCRIPTOR),
+ }),
+ createElement(
+ 'div',
+ {className: styles.nonZoomContent},
+ createElement('div', {className: styles.nonZoomContentInner}, wrappedChildren),
+ ),
+ );
+ } else if (isMobile) {
+ mediaContent = createElement(MobileMediaViewer, {
+ ref: panZoomHandleRef,
+ zoomState,
+ onZoomStateChange: handleZoomStateChange,
+ onTransformChange: handleTransformChange,
+ resetKey: currentIndex,
+ children: wrappedChildren,
+ });
+ } else {
+ mediaContent = createElement(DesktopMediaViewer, {
+ ref: panZoomHandleRef,
+ onClose: handleClose,
+ onZoomStateChange: handleZoomStateChange,
+ onTransformChange: handleTransformChange,
+ resetKey: currentIndex,
+ zoomState,
+ children: wrappedChildren,
+ });
+ }
+ let mediaActions: ReactNode = null;
+ if (isMobile && !isMobileVideo) {
+ mediaActions = (
+ <MobileMediaActions
+ rootRef={topActionBarRef}
+ data-flx="messaging.media-modal.mobile-media-actions"
+ />
+ );
+ } else if (!isMobile) {
+ mediaActions = (
+ <MediaOverlayActions
+ rootRef={bottomActionBarRef}
+ onDeleteAttachment={onDeleteAttachment}
+ data-flx="messaging.media-modal.media-overlay-actions"
+ />
+ );
+ }
const modalContent = (
<AnimatePresence data-flx="messaging.media-modal.animate-presence">
<div className={styles.modalOverlay} data-flx="messaging.media-modal.modal-overlay">
@@ -541,6 +578,49 @@ export const MediaModal: FC<MediaModalProps> = observer(
const isRovingTarget = rovingThumbnailIndex === index;
const isFirstThumbnail = index === 0;
const isLastThumbnail = index === thumbnailCount - 1;
+ const thumbnailLabel = thumb.alt ?? i18n._(ATTACHMENT_DESCRIPTOR, {index1: index + 1});
+ const thumbnailButtonClassName = clsx(
+ styles.thumbnailButton,
+ isSelected && styles.thumbnailButtonSelected,
+ );
+ const thumbnailWrapperClassName = clsx(
+ styles.thumbnailImageWrapper,
+ isFirstThumbnail && styles.thumbnailImageWrapperFirst,
+ isLastThumbnail && styles.thumbnailImageWrapperLast,
+ );
+ let thumbnailContent: ReactNode;
+ if (thumb.type === 'video' || thumb.type === 'gifv') {
+ thumbnailContent = (
+ <video
+ className={styles.thumbnailVideo}
+ src={thumb.src}
+ muted
+ playsInline
+ preload="metadata"
+ aria-label={thumb.alt ?? i18n._(VIDEO_PREVIEW_DESCRIPTOR)}
+ data-flx="messaging.media-modal.thumbnail-video"
+ />
+ );
+ } else if (thumb.type === 'audio') {
+ thumbnailContent = (
+ <div
+ className={styles.thumbnailPlaceholder}
+ data-flx="messaging.media-modal.thumbnail-placeholder"
+ >
+ {i18n._(AUDIO_DESCRIPTOR)}
+ </div>
+ );
+ } else {
+ thumbnailContent = (
+ <img
+ src={thumb.src}
+ alt={thumb.alt ?? ''}
+ className={styles.thumbnailImage}
+ draggable={false}
+ data-flx="messaging.media-modal.thumbnail-image"
+ />
+ );
+ }
return (
<FocusRing
key={`${thumb.src}-${index}`}
@@ -554,47 +634,18 @@ export const MediaModal: FC<MediaModalProps> = observer(
type="button"
role="option"
aria-selected={isSelected}
- aria-label={thumb.alt ?? i18n._(ATTACHMENT_DESCRIPTOR, {index1: index + 1})}
- className={clsx(styles.thumbnailButton, isSelected && styles.thumbnailButtonSelected)}
+ aria-label={thumbnailLabel}
+ className={thumbnailButtonClassName}
tabIndex={isRovingTarget ? 0 : -1}
onClick={() => handleThumbnailSelect(index)}
onKeyDown={handleThumbnailKeyDown}
data-flx="messaging.media-modal.thumbnail-button.thumbnail-select"
>
<div
- className={clsx(
- styles.thumbnailImageWrapper,
- isFirstThumbnail && styles.thumbnailImageWrapperFirst,
- isLastThumbnail && styles.thumbnailImageWrapperLast,
- )}
+ className={thumbnailWrapperClassName}
data-flx="messaging.media-modal.thumbnail-image-wrapper"
>
- {thumb.type === 'video' || thumb.type === 'gifv' ? (
- <video
- className={styles.thumbnailVideo}
- src={thumb.src}
- muted
- playsInline
- preload="metadata"
- aria-label={thumb.alt ?? i18n._(VIDEO_PREVIEW_DESCRIPTOR)}
- data-flx="messaging.media-modal.thumbnail-video"
- />
- ) : thumb.type === 'audio' ? (
- <div
- className={styles.thumbnailPlaceholder}
- data-flx="messaging.media-modal.thumbnail-placeholder"
- >
- {i18n._(AUDIO_DESCRIPTOR)}
- </div>
- ) : (
- <img
- src={thumb.src}
- alt={thumb.alt ?? ''}
- className={styles.thumbnailImage}
- draggable={false}
- data-flx="messaging.media-modal.thumbnail-image"
- />
- )}
+ {thumbnailContent}
</div>
</button>
</FocusRing>
@@ -604,58 +655,7 @@ export const MediaModal: FC<MediaModalProps> = observer(
</Scroller>
</div>
)}
- {isMobile && !isMobileVideo ? (
- <MobileMediaActions
- rootRef={topActionBarRef}
- isFavorited={isFavorited}
- onFavorite={onFavorite}
- onDownload={onDownload}
- onOpenInBrowser={onOpenInBrowser}
- onCopyLink={onCopyLink}
- onCopyMedia={onCopyMedia}
- onReset={handleResetMedia}
- onZoomIn={handleZoomIn}
- onZoomOut={handleZoomOut}
- onRotateCW={handleRotateCW}
- onRotateCCW={handleRotateCCW}
- onReply={onReply}
- onForward={onForward}
- onClose={handleClose}
- canReset={!panZoomInfo.isDefault || hasCustomRotation}
- canZoomIn={panZoomInfo.canZoomIn}
- canZoomOut={panZoomInfo.canZoomOut}
- enableZoomControls={enablePanZoom}
- onPointerEnter={handleHudPointerEnter}
- onPointerLeave={handleHudPointerLeave}
- data-flx="messaging.media-modal.mobile-media-actions"
- />
- ) : !isMobile ? (
- <MediaOverlayActions
- rootRef={bottomActionBarRef}
- isFavorited={isFavorited}
- onFavorite={onFavorite}
- onDownload={onDownload}
- onOpenInBrowser={onOpenInBrowser}
- onCopyLink={onCopyLink}
- onCopyMedia={onCopyMedia}
- onDeleteAttachment={onDeleteAttachment}
- onReset={handleResetMedia}
- onZoomIn={handleZoomIn}
- onZoomOut={handleZoomOut}
- onRotateCW={handleRotateCW}
- onRotateCCW={handleRotateCCW}
- onReply={onReply}
- onForward={onForward}
- onClose={handleClose}
- canReset={!panZoomInfo.isDefault || hasCustomRotation}
- canZoomIn={panZoomInfo.canZoomIn}
- canZoomOut={panZoomInfo.canZoomOut}
- enableZoomControls={enablePanZoom}
- onPointerEnter={handleHudPointerEnter}
- onPointerLeave={handleHudPointerLeave}
- data-flx="messaging.media-modal.media-overlay-actions"
- />
- ) : null}
+ {mediaActions}
{!isMobile && (
<div
ref={bottomInfoBarRef}
diff --git a/fluxer_app/src/features/messaging/components/modals/media_modal/shared.ts b/fluxer_app/src/features/messaging/components/modals/media_modal/shared.ts
index c4ed06c04..52d913b0e 100644
--- a/fluxer_app/src/features/messaging/components/modals/media_modal/shared.ts
+++ b/fluxer_app/src/features/messaging/components/modals/media_modal/shared.ts
@@ -47,12 +47,6 @@ export const getViewportPadding = () => {
const minSide = Math.min(window.innerWidth, window.innerHeight);
return Math.round(clamp(minSide * 0.05, 16, 64));
};
-export const getNativeTitlebarHeight = () => {
- if (typeof document === 'undefined') return 0;
- const raw = getComputedStyle(document.documentElement).getPropertyValue('--native-titlebar-height').trim();
- const parsed = Number.parseFloat(raw);
- return Number.isFinite(parsed) ? parsed : 0;
-};
export const MEDIA_CONTROLS_DESCRIPTOR = msg({
message: 'Media controls',
comment: 'Accessible label for the floating media controls toolbar in the media viewer modal.',