Compare commits

..
Author SHA1 Message Date
Connor Yoh 3535ffd187 undo 2025-11-24 15:57:05 +00:00
Connor Yoh 91db3fd72c Dev 2025-11-24 15:56:31 +00:00
Connor Yoh 51500da7b8 undo dev prototol detection override 2025-11-24 15:55:40 +00:00
Connor Yoh 9cd3e49f48 Missing translations 2025-11-24 15:32:19 +00:00
Connor Yoh 74d73442b0 Merge remote-tracking branch 'origin/V2' into feature/v2/subscription_seats 2025-11-24 15:23:31 +00:00
Connor Yoh adb93526d5 Never logged in activity marker 2025-11-24 15:20:35 +00:00
Connor Yoh c6a7f775d3 Type errors 2025-11-24 15:11:00 +00:00
Connor Yoh aad5b9dc54 Make sure prices aren't rounded down 2025-11-24 15:00:46 +00:00
Connor Yoh 601a17f1e6 remove premium config section 2025-11-24 14:59:39 +00:00
Connor Yoh 9a464e8cc8 Auto detect currency 2025-11-24 14:34:33 +00:00
Connor Yoh 2b16a55371 Reset logic 2025-11-24 14:31:54 +00:00
Connor Yoh 816077fca8 Success page wording 2025-11-24 14:31:25 +00:00
Connor Yoh c5a0e59d90 Auto detect currency 2025-11-24 13:58:42 +00:00
Connor Yoh 4138d4b5d7 Default to us dollars 2025-11-24 12:35:27 +00:00
Connor Yoh 88ebd03ba0 Manage button on cards 2025-11-24 11:58:02 +00:00
Connor Yoh ffdff7a03b reduce duplication and formatting 2025-11-24 11:34:38 +00:00
Connor Yoh 2848d4a5e6 Staged Checkout 2025-11-21 17:41:14 +00:00
Connor Yoh c3bd637672 fit text to button 2025-11-20 15:51:05 +00:00
Connor Yoh 6db9c1cb26 plan button flow tweaks 2025-11-20 15:48:05 +00:00
Connor Yoh 74ad90db5d Button for adding seats added to people tab. Should be able to use from anywhere 2025-11-20 15:33:25 +00:00
22 changed files with 62 additions and 253 deletions
+8 -7
View File
@@ -92,6 +92,8 @@ jobs:
toolchain: stable
targets: ${{ (matrix.platform == 'macos-15' || matrix.platform == 'macos-15-intel') && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
- name: Set up JDK 21
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
with:
@@ -178,7 +180,7 @@ jobs:
# DigiCert KeyLocker Setup (Cloud HSM)
- name: Setup DigiCert KeyLocker
id: digicert-setup
if: ${{ matrix.platform == 'windows-latest' && env.SM_API_KEY != '' && github.ref == 'refs/heads/main' }}
if: ${{ matrix.platform == 'windows-latest' && env.SM_API_KEY != '' }}
uses: digicert/ssm-code-signing@v1.1.0
env:
SM_API_KEY: ${{ secrets.SM_API_KEY }}
@@ -188,7 +190,7 @@ jobs:
SM_HOST: ${{ secrets.SM_HOST }}
- name: Setup DigiCert KeyLocker Certificate
if: ${{ matrix.platform == 'windows-latest' && env.SM_API_KEY != '' && github.ref == 'refs/heads/main' }}
if: ${{ matrix.platform == 'windows-latest' && env.SM_API_KEY != '' }}
shell: pwsh
run: |
Write-Host "Setting up DigiCert KeyLocker environment..."
@@ -223,7 +225,7 @@ jobs:
# Traditional PFX Certificate Import (fallback if KeyLocker not configured)
- name: Import Windows Code Signing Certificate
if: ${{ matrix.platform == 'windows-latest' && env.SM_API_KEY == '' && github.ref == 'refs/heads/main' }}
if: ${{ matrix.platform == 'windows-latest' && env.SM_API_KEY == '' }}
env:
WINDOWS_CERTIFICATE: ${{ secrets.WINDOWS_CERTIFICATE }}
WINDOWS_CERTIFICATE_PASSWORD: ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}
@@ -312,8 +314,7 @@ jobs:
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
VITE_SUPABASE_PUBLISHABLE_DEFAULT_KEY: ${{ secrets.VITE_SUPABASE_PUBLISHABLE_DEFAULT_KEY }}
VITE_SAAS_SERVER_URL: ${{ secrets.VITE_SAAS_SERVER_URL }}
# Only enable Windows signing in Tauri when on main
SIGN: ${{ github.ref == 'refs/heads/main' && (env.SM_API_KEY == '' && env.WINDOWS_CERTIFICATE != '') && '1' || '0' }}
SIGN: ${{ (env.SM_API_KEY == '' && env.WINDOWS_CERTIFICATE != '') && '1' || '0' }}
CI: true
with:
projectPath: ./frontend
@@ -322,7 +323,7 @@ jobs:
# Sign with DigiCert KeyLocker (post-build)
- name: Sign Windows binaries with DigiCert KeyLocker
if: ${{ matrix.platform == 'windows-latest' && env.SM_API_KEY != '' && github.ref == 'refs/heads/main' }}
if: ${{ matrix.platform == 'windows-latest' && env.SM_API_KEY != '' }}
shell: pwsh
run: |
Write-Host "=== DigiCert KeyLocker Signing ==="
@@ -513,7 +514,7 @@ jobs:
fi
- name: Verify Windows Code Signature
if: matrix.platform == 'windows-latest' && github.ref == 'refs/heads/main'
if: matrix.platform == 'windows-latest'
shell: pwsh
run: |
Write-Host "Verifying Windows code signatures..."
@@ -18,7 +18,7 @@ export function useFileEditorRightRailButtons({
onDeselectAll,
onCloseSelected,
}: FileEditorRightRailButtonsParams) {
const { t, i18n } = useTranslation();
const { t } = useTranslation();
const buttons = useMemo<RightRailButtonWithAction[]>(() => [
{
@@ -54,7 +54,7 @@ export function useFileEditorRightRailButtons({
visible: totalItems > 0,
onClick: onCloseSelected,
},
], [t, i18n.language, totalItems, selectedCount, onSelectAll, onDeselectAll, onCloseSelected]);
], [t, totalItems, selectedCount, onSelectAll, onDeselectAll, onCloseSelected]);
useRightRailButtons(buttons);
}
@@ -31,15 +31,3 @@
inset 0 0 30px rgba(59, 130, 246, 0.2);
}
}
/* RTL: mirror step indicator and controls in Reactour popovers */
:root[dir='rtl'] .reactour__popover {
direction: rtl;
}
/* Minimal overrides retained for glow only */
:root[dir='rtl'] .reactour__badge {
left: auto;
right: 16px;
}
@@ -7,7 +7,6 @@ import { useFilesModalContext } from '@app/contexts/FilesModalContext';
import { useTourOrchestration } from '@app/contexts/TourOrchestrationContext';
import { useAdminTourOrchestration } from '@app/contexts/AdminTourOrchestrationContext';
import ArrowForwardIcon from '@mui/icons-material/ArrowForward';
import ArrowBackIcon from '@mui/icons-material/ArrowBack';
import CheckIcon from '@mui/icons-material/Check';
import TourWelcomeModal from '@app/components/onboarding/TourWelcomeModal';
import '@app/components/onboarding/OnboardingTour.css';
@@ -71,7 +70,6 @@ export default function OnboardingTour() {
const { t } = useTranslation();
const { completeTour, showWelcomeModal, setShowWelcomeModal, startTour, tourType, isOpen } = useOnboarding();
const { openFilesModal, closeFilesModal } = useFilesModalContext();
const isRTL = typeof document !== 'undefined' ? document.documentElement.dir === 'rtl' : false;
// Helper to add glow to multiple elements
const addGlowToElements = (selectors: string[]) => {
@@ -440,7 +438,6 @@ export default function OnboardingTour() {
handleCloseTour(clickProps);
}
}}
rtl={isRTL}
styles={{
popover: (base) => ({
...base,
@@ -469,19 +466,21 @@ export default function OnboardingTour() {
showBadge={false}
showCloseButton={true}
disableInteraction={true}
disableDotsNavigation={false}
disableDotsNavigation={true}
prevButton={() => null}
nextButton={({ currentStep, stepsLength, setCurrentStep, setIsOpen }) => {
const isLast = currentStep === stepsLength - 1;
const ArrowIcon = isRTL ? ArrowBackIcon : ArrowForwardIcon;
return (
<ActionIcon
onClick={() => advanceTour({ setCurrentStep, currentStep, steps, setIsOpen })}
onClick={() => {
advanceTour({ setCurrentStep, currentStep, steps, setIsOpen });
}}
variant="subtle"
size="lg"
aria-label={isLast ? t('onboarding.finish', 'Finish') : t('onboarding.next', 'Next')}
>
{isLast ? <CheckIcon /> : <ArrowIcon />}
{isLast ? <CheckIcon /> : <ArrowForwardIcon />}
</ActionIcon>
);
}}
@@ -41,7 +41,7 @@ export function usePageEditorRightRailButtons(params: PageEditorRightRailButtons
closePdf,
} = params;
const { t, i18n } = useTranslation();
const { t } = useTranslation();
// Lift i18n labels out of memo for clarity
const selectAllLabel = t('rightRail.selectAll', 'Select All');
@@ -144,7 +144,6 @@ export function usePageEditorRightRailButtons(params: PageEditorRightRailButtons
];
}, [
t,
i18n.language,
selectAllLabel,
deselectAllLabel,
selectByNumberLabel,
@@ -10,14 +10,9 @@ import { handleUnlessSpecialClick } from '@app/utils/clickHandlers';
interface AllToolsNavButtonProps {
activeButton: string;
setActiveButton: (id: string) => void;
tooltipPosition?: 'left' | 'right' | 'top' | 'bottom';
}
const AllToolsNavButton: React.FC<AllToolsNavButtonProps> = ({
activeButton,
setActiveButton,
tooltipPosition = 'right'
}) => {
const AllToolsNavButton: React.FC<AllToolsNavButtonProps> = ({ activeButton, setActiveButton }) => {
const { t } = useTranslation();
const { handleReaderToggle, handleBackToTools, selectedToolKey, leftPanelView } = useToolWorkflow();
const { getHomeNavigation } = useSidebarNavigation();
@@ -45,13 +40,7 @@ const AllToolsNavButton: React.FC<AllToolsNavButtonProps> = ({
);
return (
<Tooltip
content={t("quickAccess.allTools", "Tools")}
position={tooltipPosition}
arrow
containerStyle={{ marginTop: "-1rem" }}
maxWidth={200}
>
<Tooltip content={t("quickAccess.allTools", "Tools")} position="right" arrow containerStyle={{ marginTop: "-1rem" }} maxWidth={200}>
<div className="flex flex-col items-center gap-1 mt-4 mb-2">
<ActionIcon
component="a"
@@ -81,3 +70,4 @@ const AllToolsNavButton: React.FC<AllToolsNavButtonProps> = ({
export default AllToolsNavButton;
@@ -185,11 +185,6 @@ const LanguageSelector: React.FC<LanguageSelectorProps> = ({ position = 'bottom-
// Clear ripple effect
setTimeout(() => setRippleEffect(null), 100);
// Force a full reload so RTL/LTR layout and tooltips re-evaluate correctly
if (typeof window !== 'undefined') {
window.location.reload();
}
}, 300);
}, 200);
};
@@ -39,8 +39,6 @@ const QuickAccessBar = forwardRef<HTMLDivElement>((_, ref) => {
const scrollableRef = useRef<HTMLDivElement>(null);
const isOverflow = useIsOverflowing(scrollableRef);
const isRTL = typeof document !== 'undefined' && document.documentElement.dir === 'rtl';
// Open modal if URL is at /settings/*
useEffect(() => {
const isSettings = location.pathname.startsWith('/settings');
@@ -191,6 +189,9 @@ const QuickAccessBar = forwardRef<HTMLDivElement>((_, ref) => {
ref={ref}
data-sidebar="quick-access"
className={`h-screen flex flex-col w-16 quick-access-bar-main ${isRainbowMode ? 'rainbow-mode' : ''}`}
style={{
borderRight: '1px solid var(--border-default)'
}}
>
{/* Fixed header outside scrollable area */}
<div className="quick-access-header">
@@ -277,7 +278,7 @@ const QuickAccessBar = forwardRef<HTMLDivElement>((_, ref) => {
// If admin, show menu with both options
return (
<div key={buttonConfig.id} data-tour="help-button">
<Menu position={isRTL ? 'left' : 'right'} offset={10} zIndex={Z_INDEX_OVER_FULLSCREEN_SURFACE}>
<Menu position="right" offset={10} zIndex={Z_INDEX_OVER_FULLSCREEN_SURFACE}>
<Menu.Target>
<div>{renderNavButton(buttonConfig, index)}</div>
</Menu.Target>
@@ -19,22 +19,19 @@ import LightModeIcon from '@mui/icons-material/LightMode';
import { useSidebarContext } from '@app/contexts/SidebarContext';
import { RightRailButtonConfig, RightRailRenderContext, RightRailSection } from '@app/types/rightRail';
import { useRightRailTooltipSide } from '@app/hooks/useRightRailTooltipSide';
const SECTION_ORDER: RightRailSection[] = ['top', 'middle', 'bottom'];
function renderWithTooltip(
node: React.ReactNode,
tooltip: React.ReactNode | undefined,
position: 'left' | 'right',
offset: number
tooltip: React.ReactNode | undefined
) {
if (!tooltip) return node;
const portalTarget = typeof document !== 'undefined' ? document.body : undefined;
return (
<Tooltip content={tooltip} position={position} offset={offset} arrow portalTarget={portalTarget}>
<Tooltip content={tooltip} position="left" offset={12} arrow portalTarget={portalTarget}>
<div className="right-rail-tooltip-wrapper">{node}</div>
</Tooltip>
);
@@ -42,7 +39,6 @@ function renderWithTooltip(
export default function RightRail() {
const { sidebarRefs } = useSidebarContext();
const { position: tooltipPosition, offset: tooltipOffset } = useRightRailTooltipSide(sidebarRefs);
const { t } = useTranslation();
const viewerContext = React.useContext(ViewerContext);
const { toggleTheme, themeMode } = useRainbowThemeContext();
@@ -121,9 +117,9 @@ export default function RightRail() {
</ActionIcon>
);
return renderWithTooltip(buttonNode, btn.tooltip, tooltipPosition, tooltipOffset);
return renderWithTooltip(buttonNode, btn.tooltip);
},
[actions, allButtonsDisabled, disableForFullscreen, tooltipPosition, tooltipOffset]
[actions, allButtonsDisabled, disableForFullscreen]
);
const handleExportAll = useCallback(async () => {
@@ -207,18 +203,14 @@ export default function RightRail() {
<DarkModeIcon sx={{ fontSize: '1.5rem' }} />
)}
</ActionIcon>,
t('rightRail.toggleTheme', 'Toggle Theme'),
tooltipPosition,
tooltipOffset
t('rightRail.toggleTheme', 'Toggle Theme')
)}
{renderWithTooltip(
<div style={{ display: 'inline-flex' }}>
<LanguageSelector position="left-start" offset={6} compact />
</div>,
t('rightRail.language', 'Language'),
tooltipPosition,
tooltipOffset
t('rightRail.language', 'Language')
)}
{renderWithTooltip(
@@ -234,9 +226,7 @@ export default function RightRail() {
>
<LocalIcon icon="download" width="1.5rem" height="1.5rem" />
</ActionIcon>,
downloadTooltip,
tooltipPosition,
tooltipOffset
downloadTooltip
)}
</div>
@@ -37,7 +37,7 @@ export interface TooltipProps {
export const Tooltip: React.FC<TooltipProps> = ({
sidebarTooltip = false,
position,
position = 'right',
content,
tips,
children,
@@ -81,16 +81,6 @@ export const Tooltip: React.FC<TooltipProps> = ({
const isControlled = controlledOpen !== undefined;
const open = (isControlled ? !!controlledOpen : internalOpen) && !disabled;
const resolvedPosition: NonNullable<TooltipProps['position']> = useMemo(() => {
const htmlDir = typeof document !== 'undefined' ? document.documentElement.dir : 'ltr';
const isRTL = htmlDir === 'rtl';
const base = position ?? 'right';
if (!isRTL) return base as NonNullable<TooltipProps['position']>;
if (base === 'left') return 'right';
if (base === 'right') return 'left';
return base as NonNullable<TooltipProps['position']>;
}, [position]);
const setOpen = useCallback(
(newOpen: boolean) => {
if (newOpen === open) return; // avoid churn
@@ -104,7 +94,7 @@ export const Tooltip: React.FC<TooltipProps> = ({
const { coords, positionReady } = useTooltipPosition({
open,
sidebarTooltip,
position: resolvedPosition,
position,
gap,
triggerRef,
tooltipRef,
@@ -155,8 +145,8 @@ export const Tooltip: React.FC<TooltipProps> = ({
left: 'tooltip-arrow-left',
right: 'tooltip-arrow-right',
};
return map[resolvedPosition] || map.right;
}, [resolvedPosition, sidebarTooltip]);
return map[position] || map.right;
}, [position, sidebarTooltip]);
const getArrowStyleClass = useCallback(
(key: string) =>
@@ -342,7 +332,7 @@ export const Tooltip: React.FC<TooltipProps> = ({
className={`${styles['tooltip-arrow']} ${getArrowStyleClass(arrowClass!)}`}
style={
coords.arrowOffset !== null
? { [resolvedPosition === 'top' || resolvedPosition === 'bottom' ? 'left' : 'top']: coords.arrowOffset }
? { [position === 'top' || position === 'bottom' ? 'left' : 'top']: coords.arrowOffset }
: undefined
}
/>
@@ -24,12 +24,11 @@ import { Tooltip } from '@app/components/shared/Tooltip';
interface ActiveToolButtonProps {
activeButton: string;
setActiveButton: (id: string) => void;
tooltipPosition?: 'left' | 'right' | 'top' | 'bottom';
}
const NAV_IDS = ['read', 'sign', 'automate'];
const ActiveToolButton: React.FC<ActiveToolButtonProps> = ({ setActiveButton, tooltipPosition = 'right' }) => {
const ActiveToolButton: React.FC<ActiveToolButtonProps> = ({ setActiveButton }) => {
const { selectedTool, selectedToolKey, leftPanelView, handleBackToTools } = useToolWorkflow();
const { getHomeNavigation } = useSidebarNavigation();
@@ -140,12 +139,7 @@ const ActiveToolButton: React.FC<ActiveToolButtonProps> = ({ setActiveButton, to
{indicatorTool && (
<div className="current-tool-content">
<div className="flex flex-col items-center gap-1">
<Tooltip
content={isBackHover ? 'Back to all tools' : indicatorTool.name}
position={tooltipPosition}
arrow
maxWidth={140}
>
<Tooltip content={isBackHover ? 'Back to all tools' : indicatorTool.name} position="right" arrow maxWidth={140}>
<ActionIcon
component="a"
href={getHomeNavigation().href}
@@ -195,3 +189,4 @@ const ActiveToolButton: React.FC<ActiveToolButtonProps> = ({ setActiveButton, to
export default ActiveToolButton;
@@ -43,10 +43,6 @@
max-width: 4rem;
position: relative;
z-index: 10;
border-right: 1px solid var(--border-default);
flex-shrink: 0;
box-sizing: border-box;
direction: ltr; /* keep layout stable when document is rtl */
}
/* Rainbow mode container */
@@ -57,17 +53,6 @@
max-width: 4rem;
position: relative;
z-index: 10;
border-right: 1px solid var(--border-default);
flex-shrink: 0;
box-sizing: border-box;
direction: ltr;
}
/* RTL adjustments keep the bar on-screen and separated from content */
:root[dir='rtl'] .quick-access-bar-main,
:root[dir='rtl'] .quick-access-bar-main.rainbow-mode {
border-right: none;
border-left: 1px solid var(--border-default);
}
/* Header padding */
@@ -291,4 +276,4 @@
margin-top: 0.5rem;
margin-bottom: 0.5rem;
}
}
}
@@ -11,8 +11,6 @@ import { generateThumbnailWithMetadata } from '@app/utils/thumbnailUtils';
import { createProcessedFile } from '@app/contexts/file/fileActions';
import { createStirlingFile, createNewStirlingFileStub } from '@app/types/fileContext';
import { useNavigationState } from '@app/contexts/NavigationContext';
import { useSidebarContext } from '@app/contexts/SidebarContext';
import { useRightRailTooltipSide } from '@app/hooks/useRightRailTooltipSide';
interface ViewerAnnotationControlsProps {
currentView: string;
@@ -21,8 +19,6 @@ interface ViewerAnnotationControlsProps {
export default function ViewerAnnotationControls({ currentView, disabled = false }: ViewerAnnotationControlsProps) {
const { t } = useTranslation();
const { sidebarRefs } = useSidebarContext();
const { position: tooltipPosition, offset: tooltipOffset } = useRightRailTooltipSide(sidebarRefs);
const [selectedColor, setSelectedColor] = useState('#000000');
const [isColorPickerOpen, setIsColorPickerOpen] = useState(false);
const [isHoverColorPickerOpen, setIsHoverColorPickerOpen] = useState(false);
@@ -57,7 +53,7 @@ export default function ViewerAnnotationControls({ currentView, disabled = false
return (
<>
{/* Annotation Visibility Toggle */}
<Tooltip content={t('rightRail.toggleAnnotations', 'Toggle Annotations Visibility')} position={tooltipPosition} offset={tooltipOffset} arrow portalTarget={document.body}>
<Tooltip content={t('rightRail.toggleAnnotations', 'Toggle Annotations Visibility')} position="left" offset={12} arrow portalTarget={document.body}>
<ActionIcon
variant="subtle"
radius="md"
@@ -134,7 +130,7 @@ export default function ViewerAnnotationControls({ currentView, disabled = false
</div>
) : (
// When inactive: Show "Draw" tooltip
<Tooltip content={t('rightRail.draw', 'Draw')} position={tooltipPosition} offset={tooltipOffset} arrow portalTarget={document.body}>
<Tooltip content={t('rightRail.draw', 'Draw')} position="left" offset={12} arrow portalTarget={document.body}>
<ActionIcon
variant="subtle"
radius="md"
@@ -160,7 +156,7 @@ export default function ViewerAnnotationControls({ currentView, disabled = false
)}
{/* Save PDF with Annotations */}
<Tooltip content={t('rightRail.save', 'Save')} position={tooltipPosition} offset={tooltipOffset} arrow portalTarget={document.body}>
<Tooltip content={t('rightRail.save', 'Save')} position="left" offset={12} arrow portalTarget={document.body}>
<ActionIcon
variant="subtle"
radius="md"
@@ -234,4 +230,4 @@ export default function ViewerAnnotationControls({ currentView, disabled = false
/>
</>
);
}
}
@@ -47,7 +47,6 @@ const FullscreenToolSurface = ({
const { colorScheme } = useMantineColorScheme();
const [isExiting, setIsExiting] = useState(false);
const surfaceRef = useRef<HTMLDivElement>(null);
const isRTL = typeof document !== 'undefined' && document.documentElement.dir === 'rtl';
// Enable focus trap when surface is active
useFocusTrap(surfaceRef, !isExiting);
@@ -115,10 +114,7 @@ const FullscreenToolSurface = ({
aria-label={toggleLabel}
style={{ color: 'var(--right-rail-icon)' }}
>
<DoubleArrowIcon
fontSize="small"
style={{ transform: isRTL ? undefined : 'rotate(180deg)' }}
/>
<DoubleArrowIcon fontSize="small" style={{ transform: 'rotate(180deg)' }} />
</ActionIcon>
</Tooltip>
</div>
@@ -160,3 +156,4 @@ const FullscreenToolSurface = ({
export default FullscreenToolSurface;
@@ -111,14 +111,6 @@
animation: tool-panel-fullscreen-slide-out var(--fullscreen-anim-out-duration) ease forwards;
}
:root[dir='rtl'] .tool-panel__fullscreen-surface-inner {
animation-name: tool-panel-fullscreen-slide-in-rtl;
}
:root[dir='rtl'] .tool-panel__fullscreen-surface-inner.tool-panel__fullscreen-surface-inner--exiting {
animation-name: tool-panel-fullscreen-slide-out-rtl;
}
.tool-panel__fullscreen-header {
display: flex;
justify-content: space-between;
@@ -510,28 +502,6 @@
}
}
@keyframes tool-panel-fullscreen-slide-in-rtl {
from {
transform: translateX(6%) scaleX(0.85);
opacity: 0;
}
to {
transform: translateX(0) scaleX(1);
opacity: 1;
}
}
@keyframes tool-panel-fullscreen-slide-out-rtl {
from {
transform: translateX(0) scaleX(1);
opacity: 1;
}
to {
transform: translateX(6%) scaleX(0.85);
opacity: 0;
}
}
@media (prefers-reduced-motion: reduce) {
.tool-panel__fullscreen-surface-inner {
animation: none !important;
@@ -573,3 +543,4 @@
}
@@ -50,7 +50,6 @@ export default function ToolPanel() {
const isFullscreenMode = toolPanelMode === 'fullscreen';
const toolPickerVisible = !readerMode;
const fullscreenExpanded = isFullscreenMode && leftPanelView === 'toolPicker' && !isMobile && toolPickerVisible;
const isRTL = typeof document !== 'undefined' && document.documentElement.dir === 'rtl';
// Disable right rail buttons when fullscreen mode is active
@@ -151,10 +150,7 @@ export default function ToolPanel() {
aria-label={toggleLabel}
className="tool-panel__mode-toggle"
>
<DoubleArrowIcon
fontSize="small"
style={{ transform: isRTL ? 'scaleX(-1)' : undefined }}
/>
<DoubleArrowIcon fontSize="small" />
</ActionIcon>
</Tooltip>
)}
@@ -50,7 +50,7 @@ export const useCompareRightRailButtons = ({
baseScrollRef,
comparisonScrollRef,
}: UseCompareRightRailButtonsOptions): RightRailButtonWithAction[] => {
const { t, i18n } = useTranslation();
const { t } = useTranslation();
const isMobile = useIsMobile();
return useMemo<RightRailButtonWithAction[]>(() => [
@@ -184,7 +184,6 @@ export const useCompareRightRailButtons = ({
setIsScrollLinked,
zoomLimits,
t,
i18n.language,
isMobile,
]);
};
@@ -7,15 +7,11 @@ import LocalIcon from '@app/components/shared/LocalIcon';
import { Tooltip } from '@app/components/shared/Tooltip';
import { SearchInterface } from '@app/components/viewer/SearchInterface';
import ViewerAnnotationControls from '@app/components/shared/rightRail/ViewerAnnotationControls';
import { useSidebarContext } from '@app/contexts/SidebarContext';
import { useRightRailTooltipSide } from '@app/hooks/useRightRailTooltipSide';
export function useViewerRightRailButtons() {
const { t, i18n } = useTranslation();
const { t } = useTranslation();
const viewer = useViewer();
const [isPanning, setIsPanning] = useState<boolean>(() => viewer.getPanState()?.isPanning ?? false);
const { sidebarRefs } = useSidebarContext();
const { position: tooltipPosition } = useRightRailTooltipSide(sidebarRefs, 12);
// Lift i18n labels out of memo for clarity
const searchLabel = t('rightRail.search', 'Search PDF');
@@ -34,8 +30,8 @@ export function useViewerRightRailButtons() {
section: 'top' as const,
order: 10,
render: ({ disabled }) => (
<Tooltip content={searchLabel} position={tooltipPosition} offset={12} arrow portalTarget={document.body}>
<Popover position={tooltipPosition} withArrow shadow="md" offset={8}>
<Tooltip content={searchLabel} position="left" offset={12} arrow portalTarget={document.body}>
<Popover position="left" withArrow shadow="md" offset={8}>
<Popover.Target>
<div style={{ display: 'inline-flex' }}>
<ActionIcon
@@ -65,7 +61,7 @@ export function useViewerRightRailButtons() {
section: 'top' as const,
order: 20,
render: ({ disabled }) => (
<Tooltip content={panLabel} position={tooltipPosition} offset={12} arrow portalTarget={document.body}>
<Tooltip content={panLabel} position="left" offset={12} arrow portalTarget={document.body}>
<ActionIcon
variant={isPanning ? 'default' : 'subtle'}
color={undefined}
@@ -136,7 +132,7 @@ export function useViewerRightRailButtons() {
)
}
];
}, [t, i18n.language, viewer, isPanning, searchLabel, panLabel, rotateLeftLabel, rotateRightLabel, sidebarLabel, bookmarkLabel, tooltipPosition]);
}, [t, viewer, isPanning, searchLabel, panLabel, rotateLeftLabel, rotateRightLabel, sidebarLabel, bookmarkLabel]);
useRightRailButtons(viewerButtons);
}
@@ -42,26 +42,11 @@ export function useToolPanelGeometry({
const computeAndSetGeometry = () => {
const rect = panelEl.getBoundingClientRect();
const rail = rightRailEl();
const isRTL = typeof document !== 'undefined' && document.documentElement.dir === 'rtl';
const railRect = rail?.getBoundingClientRect();
const railIsOnRight = railRect ? railRect.right > window.innerWidth / 2 : false;
const rightOffset = railRect && railIsOnRight ? Math.max(0, window.innerWidth - railRect.right) : 0;
let width: number;
let left: number;
if (isRTL) {
// In RTL, QuickAccessBar is on the right, so start after it (using rect.right as the right edge)
const quickAccessRect = quickAccessRef.current?.getBoundingClientRect();
const quickAccessWidth = quickAccessRect ? quickAccessRect.width : 0;
width = Math.max(360, window.innerWidth - quickAccessWidth - rightOffset);
left = quickAccessWidth;
} else {
width = Math.max(360, window.innerWidth - rect.left - rightOffset);
left = rect.left;
}
const rightOffset = rail ? Math.max(0, window.innerWidth - rail.getBoundingClientRect().left) : 0;
const width = Math.max(360, window.innerWidth - rect.left - rightOffset);
const height = Math.max(rect.height, window.innerHeight - rect.top);
setGeometry({
left,
left: rect.left,
top: rect.top,
width,
height,
@@ -1,33 +0,0 @@
import { useEffect, useState } from 'react';
import { SidebarRefs } from '@app/types/sidebar';
export function useRightRailTooltipSide(
sidebarRefs?: SidebarRefs,
defaultOffset: number = 16
): { position: 'left' | 'right'; offset: number } {
const [position, setPosition] = useState<'left' | 'right'>('left');
useEffect(() => {
const computePosition = () => {
const rail = sidebarRefs?.rightRailRef?.current;
const isRTL = typeof document !== 'undefined' && document.documentElement.dir === 'rtl';
// Fallback to left if we can't measure
if (!rail || typeof window === 'undefined') {
setPosition(isRTL ? 'left' : 'left');
return;
}
const rect = rail.getBoundingClientRect();
const center = rect.left + rect.width / 2;
const preferred = center > window.innerWidth / 2 ? 'left' : 'right';
setPosition(isRTL ? 'left' : preferred);
};
computePosition();
window.addEventListener('resize', computePosition);
return () => window.removeEventListener('resize', computePosition);
}, [sidebarRefs]);
return { position, offset: defaultOffset };
}
+5 -15
View File
@@ -74,7 +74,6 @@ export function useTooltipPosition({
// Fallback sidebar position (only used as last resort)
const sidebarLeft = 240;
const isRTL = typeof document !== 'undefined' && document.documentElement.dir === 'rtl';
const updatePosition = () => {
if (!triggerRef.current || !open) return;
@@ -94,11 +93,7 @@ export function useTooltipPosition({
}
const sidebarInfo = getSidebarInfo(sidebarRefs, sidebarState);
const rect = sidebarInfo.rect;
if (!rect) {
setPositionReady(false);
return;
}
const currentSidebarRight = sidebarInfo.rect ? sidebarInfo.rect.right : sidebarLeft;
// Only show tooltip if we have the tool panel active
if (!sidebarInfo.isToolPanelActive) {
@@ -107,18 +102,13 @@ export function useTooltipPosition({
return;
}
const tooltipRect = tooltipRef.current?.getBoundingClientRect() || null;
// Position adjacent to sidebar; mirror for RTL
if (isRTL) {
left = rect.left - (tooltipRect?.width || 0) - 20;
} else {
left = rect.right + 20;
}
// Position to the right of active sidebar with 20px gap
left = currentSidebarRight + 20;
top = triggerRect.top; // Align top of tooltip with trigger element
// Only clamp if we have tooltip dimensions
if (tooltipRect) {
if (tooltipRef.current) {
const tooltipRect = tooltipRef.current.getBoundingClientRect();
const maxTop = window.innerHeight - tooltipRect.height - 4;
const originalTop = top;
top = clamp(top, 4, maxTop);
-21
View File
@@ -9,9 +9,6 @@ import { useBaseUrl } from "@app/hooks/useBaseUrl";
import { useIsMobile } from "@app/hooks/useIsMobile";
import { useAppConfig } from "@app/contexts/AppConfigContext";
import { useLogoPath } from "@app/hooks/useLogoPath";
import { useFileContext } from "@app/contexts/file/fileHooks";
import { useNavigationActions } from "@app/contexts/NavigationContext";
import { useViewer } from "@app/contexts/ViewerContext";
import AppsIcon from '@mui/icons-material/AppsRounded';
import ToolPanel from "@app/components/tools/ToolPanel";
@@ -56,11 +53,6 @@ export default function HomePage() {
const [configModalOpen, setConfigModalOpen] = useState(false);
const [showAnalyticsModal, setShowAnalyticsModal] = useState(false);
const { activeFiles } = useFileContext();
const { actions } = useNavigationActions();
const { setActiveFileIndex } = useViewer();
const prevFileCountRef = useRef(activeFiles.length);
// Show admin analytics choice modal if analytics settings not configured
useEffect(() => {
if (config && config.enableAnalytics === null) {
@@ -68,19 +60,6 @@ export default function HomePage() {
}
}, [config]);
// Auto-switch to viewer when going from 0 to 1 file
useEffect(() => {
const prevCount = prevFileCountRef.current;
const currentCount = activeFiles.length;
if (prevCount === 0 && currentCount === 1) {
actions.setWorkbench('viewer');
setActiveFileIndex(0);
}
prevFileCountRef.current = currentCount;
}, [activeFiles.length, actions, setActiveFileIndex]);
const brandAltText = t("home.mobile.brandAlt", "Stirling PDF logo");
const brandIconSrc = useLogoPath();
const brandTextSrc = `${BASE_PATH}/branding/StirlingPDFLogo${