Compare commits

..
Author SHA1 Message Date
EthanHealy01 e2e37695cd fix: use ?? instead of || so empty thumbnail string skips generation 2026-05-05 17:50:09 +01:00
EthanHealy01 fa3e9f5db6 fix: remove unreachable size check inside image branch of generateThumbnailForFile 2026-05-05 17:49:18 +01:00
EthanHealy01 2c7efe1e83 refactor: consolidate thumbnail rendering onto UIRedesignStaging base
Apply useFileThumbnail + DocumentThumbnail to FileEditorThumbnail, rebased
onto UIRedesignStaging. Also carry forward the FileEditorFileName truncation
fix from main (#6310).
2026-05-05 17:31:04 +01:00
EthanHealy01 18fd86f5bf These adress the change requests along with some other issues I found with our UI 2026-05-05 17:25:31 +01:00
107 changed files with 2229 additions and 3436 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
# Maintainer: Stirling PDF Inc <contact@stirlingpdf.com>
pkgname=stirling-pdf-desktop
pkgver=2.10.1
pkgver=2.10.0
pkgrel=1
pkgdesc="Locally hosted, web-based PDF manipulation tool (Tauri desktop app, official Stirling PDF Inc build)"
arch=('x86_64')
+1 -1
View File
@@ -1,6 +1,6 @@
# Maintainer: Stirling PDF Inc <contact@stirlingpdf.com>
pkgname=stirling-pdf-server-bin
pkgver=2.10.1
pkgver=2.10.0
pkgrel=1
pkgdesc="Locally hosted, web-based PDF manipulation tool (server JAR, prebuilt)"
arch=('any')
+7 -31
View File
@@ -93,18 +93,18 @@ jobs:
echo 'matrix={"include":[{"platform":"windows-latest","args":"--target x86_64-pc-windows-msvc","name":"windows-x86_64"}]}' >> $GITHUB_OUTPUT
;;
"macos")
echo 'matrix={"include":[{"platform":"macos-15","args":"--target universal-apple-darwin","name":"macos-universal"}]}' >> $GITHUB_OUTPUT
echo 'matrix={"include":[{"platform":"macos-15","args":"--target aarch64-apple-darwin","name":"macos-aarch64"},{"platform":"macos-15-intel","args":"--target x86_64-apple-darwin","name":"macos-x86_64"}]}' >> $GITHUB_OUTPUT
;;
"linux")
echo 'matrix={"include":[{"platform":"ubuntu-22.04","args":"","name":"linux-x86_64"}]}' >> $GITHUB_OUTPUT
;;
*)
echo 'matrix={"include":[{"platform":"windows-latest","args":"--target x86_64-pc-windows-msvc","name":"windows-x86_64"},{"platform":"macos-15","args":"--target universal-apple-darwin","name":"macos-universal"},{"platform":"ubuntu-22.04","args":"","name":"linux-x86_64"}]}' >> $GITHUB_OUTPUT
echo 'matrix={"include":[{"platform":"windows-latest","args":"--target x86_64-pc-windows-msvc","name":"windows-x86_64"},{"platform":"macos-15","args":"--target aarch64-apple-darwin","name":"macos-aarch64"},{"platform":"macos-15-intel","args":"--target x86_64-apple-darwin","name":"macos-x86_64"},{"platform":"ubuntu-22.04","args":"","name":"linux-x86_64"}]}' >> $GITHUB_OUTPUT
;;
esac
else
# For push/release events, build all platforms
echo 'matrix={"include":[{"platform":"windows-latest","args":"--target x86_64-pc-windows-msvc","name":"windows-x86_64"},{"platform":"macos-15","args":"--target universal-apple-darwin","name":"macos-universal"},{"platform":"ubuntu-22.04","args":"","name":"linux-x86_64"}]}' >> $GITHUB_OUTPUT
echo 'matrix={"include":[{"platform":"windows-latest","args":"--target x86_64-pc-windows-msvc","name":"windows-x86_64"},{"platform":"macos-15","args":"--target aarch64-apple-darwin","name":"macos-aarch64"},{"platform":"macos-15-intel","args":"--target x86_64-apple-darwin","name":"macos-x86_64"},{"platform":"ubuntu-22.04","args":"","name":"linux-x86_64"}]}' >> $GITHUB_OUTPUT
fi
build-jars:
@@ -218,23 +218,7 @@ jobs:
uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 # stable
with:
toolchain: stable
targets: ${{ matrix.platform == 'macos-15' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
# x86_64 JDK is set up first so the aarch64 step below can leave its
# JAVA_HOME as the active one. The macOS universal JRE build needs
# jmods from both arches; the x64 path is captured into the env
# before the second setup-java overwrites JAVA_HOME.
- name: Set up x86_64 JDK 25 (macOS universal JRE)
if: matrix.platform == 'macos-15'
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
java-version: "25"
distribution: "temurin"
architecture: "x64"
- name: Capture x86_64 JAVA_HOME
if: matrix.platform == 'macos-15'
run: echo "X64_JAVA_HOME=$JAVA_HOME" >> "$GITHUB_ENV"
targets: ${{ (matrix.platform == 'macos-15' || matrix.platform == 'macos-15-intel') && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
- name: Set up JDK 25
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
@@ -250,14 +234,6 @@ jobs:
- name: Install Task
uses: go-task/setup-task@3be4020d41929789a01026e0e427a4321ce0ad44 # v2.0.0
# Build the universal JRE before desktop:prepare so the jlink:runtime
# task short-circuits on its `test -d runtime/jre` status check.
- name: Build universal macOS JRE
if: matrix.platform == 'macos-15'
env:
AARCH64_JAVA_HOME: ${{ env.JAVA_HOME }}
run: task desktop:jlink:universal-mac
- name: Prepare desktop build
run: task desktop:prepare
env:
@@ -345,7 +321,7 @@ jobs:
}
- name: Import Apple Developer Certificate
if: matrix.platform == 'macos-15' && (github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.sign != 'false') || github.ref == 'refs/heads/V2-master')
if: (matrix.platform == 'macos-15' || matrix.platform == 'macos-15-intel') && (github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.sign != 'false') || github.ref == 'refs/heads/V2-master')
env:
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
@@ -366,7 +342,7 @@ jobs:
rm certificate.p12
- name: Verify Certificate
if: matrix.platform == 'macos-15' && (github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.sign != 'false') || github.ref == 'refs/heads/V2-master')
if: (matrix.platform == 'macos-15' || matrix.platform == 'macos-15-intel') && (github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.sign != 'false') || github.ref == 'refs/heads/V2-master')
run: |
echo "Verifying Apple Developer Certificate..."
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
@@ -581,7 +557,7 @@ jobs:
# Only ship the MSI installer on Windows. The loose exe and WiX toolset exes
# are not the user-facing installer - the MSI contains the signed inner exe.
find . -name "*.msi" -exec cp {} "../../../dist/Stirling-PDF-${{ matrix.name }}.msi" \;
elif [ "${{ matrix.platform }}" = "macos-15" ]; then
elif [ "${{ matrix.platform }}" = "macos-15" ] || [ "${{ matrix.platform }}" = "macos-15-intel" ]; then
find . -name "*.dmg" -exec cp {} "../../../dist/Stirling-PDF-${{ matrix.name }}.dmg" \;
find . -name "*.app" -exec cp -r {} "../../../dist/Stirling-PDF-${{ matrix.name }}.app" \;
else
+22 -18
View File
@@ -22,7 +22,8 @@ jobs:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.info.outputs.version }}
dmg_sha256: ${{ steps.hashes.outputs.dmg_sha256 }}
dmg_arm64_sha256: ${{ steps.hashes.outputs.dmg_arm64_sha256 }}
dmg_x86_64_sha256: ${{ steps.hashes.outputs.dmg_x86_64_sha256 }}
msi_sha256: ${{ steps.hashes.outputs.msi_sha256 }}
deb_sha256: ${{ steps.hashes.outputs.deb_sha256 }}
jar_sha256: ${{ steps.hashes.outputs.jar_sha256 }}
@@ -62,15 +63,17 @@ jobs:
sha256sum "$file" | awk '{print $1}'
}
DMG_SHA=$(download_sha256 "${BASE}/Stirling-PDF-macos-universal.dmg")
DMG_ARM64_SHA=$(download_sha256 "${BASE}/Stirling-PDF-macos-aarch64.dmg")
DMG_X64_SHA=$(download_sha256 "${BASE}/Stirling-PDF-macos-x86_64.dmg")
MSI_SHA=$(download_sha256 "${BASE}/Stirling-PDF-windows-x86_64.msi")
DEB_SHA=$(download_sha256 "${BASE}/Stirling-PDF-linux-x86_64.deb")
JAR_SHA=$(download_sha256 "${BASE}/Stirling-PDF-with-login.jar")
echo "dmg_sha256=$DMG_SHA" >> "$GITHUB_OUTPUT"
echo "msi_sha256=$MSI_SHA" >> "$GITHUB_OUTPUT"
echo "deb_sha256=$DEB_SHA" >> "$GITHUB_OUTPUT"
echo "jar_sha256=$JAR_SHA" >> "$GITHUB_OUTPUT"
echo "dmg_arm64_sha256=$DMG_ARM64_SHA" >> "$GITHUB_OUTPUT"
echo "dmg_x86_64_sha256=$DMG_X64_SHA" >> "$GITHUB_OUTPUT"
echo "msi_sha256=$MSI_SHA" >> "$GITHUB_OUTPUT"
echo "deb_sha256=$DEB_SHA" >> "$GITHUB_OUTPUT"
echo "jar_sha256=$JAR_SHA" >> "$GITHUB_OUTPUT"
update-homebrew-and-scoop:
needs: get-release-info
@@ -90,21 +93,22 @@ jobs:
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
path: tap
# Stirling-PDF now ships a single universal DMG, so the Cask should
# have one sha256 line rather than separate on_arm/on_intel blocks.
# We rewrite every `sha256 "..."` in the Cask to the same value so
# the workflow keeps working through the Cask migration: pre-migration
# both arch blocks get the universal SHA (still correct, since both
# would resolve to the same DMG), post-migration the lone sha256 line
# is updated.
- name: Update Homebrew cask (Casks/stirling-pdf.rb)
env:
VERSION: ${{ needs.get-release-info.outputs.version }}
DMG_SHA: ${{ needs.get-release-info.outputs.dmg_sha256 }}
ARM64_SHA: ${{ needs.get-release-info.outputs.dmg_arm64_sha256 }}
X64_SHA: ${{ needs.get-release-info.outputs.dmg_x86_64_sha256 }}
run: |
CASK="tap/Casks/stirling-pdf.rb"
sed -i "s/version \"[^\"]*\"/version \"${VERSION}\"/" "$CASK"
sed -i "s/sha256 \"[^\"]*\"/sha256 \"${DMG_SHA}\"/g" "$CASK"
sed -i "s/version \".*\"/version \"${VERSION}\"/" "$CASK"
awk -v arm="$ARM64_SHA" -v x64="$X64_SHA" '
/on_arm/ { in_arm=1 }
/on_intel/ { in_arm=0; in_intel=1 }
/end/ { in_arm=0; in_intel=0 }
in_arm && /sha256/ { sub(/sha256 ".*"/, "sha256 \"" arm "\"") }
in_intel && /sha256/ { sub(/sha256 ".*"/, "sha256 \"" x64 "\"") }
{ print }
' "$CASK" > tmp && mv tmp "$CASK"
- name: Update Homebrew formula (Formula/stirling-pdf-server.rb)
env:
@@ -112,8 +116,8 @@ jobs:
JAR_SHA: ${{ needs.get-release-info.outputs.jar_sha256 }}
run: |
FORMULA="tap/Formula/stirling-pdf-server.rb"
sed -i "s/version \"[^\"]*\"/version \"${VERSION}\"/" "$FORMULA"
sed -i "s/sha256 \"[^\"]*\"/sha256 \"${JAR_SHA}\"/" "$FORMULA"
sed -i "s/version \".*\"/version \"${VERSION}\"/" "$FORMULA"
sed -i "s/sha256 \".*\"/sha256 \"${JAR_SHA}\"/" "$FORMULA"
- name: Update Scoop stirling-pdf.json
env:
+14 -37
View File
@@ -1,6 +1,6 @@
name: Build Tauri Applications
# Multi-OS Tauri desktop bundle build matrix (Windows / macOS universal /
# Multi-OS Tauri desktop bundle build matrix (Windows / macOS arm+intel /
# Linux). Called from build.yml on PRs that touch desktop sources (gated
# via the `tauri` filter in .github/config/.files.yaml). Also runnable
# on demand via workflow_dispatch with a per-platform selector.
@@ -48,16 +48,17 @@ jobs:
PLATFORM: ${{ inputs.platform }}
run: |
WINDOWS='{"platform":"windows-latest","args":"--target x86_64-pc-windows-msvc","name":"windows-x86_64"}'
MACOS='{"platform":"macos-15","args":"--target universal-apple-darwin","name":"macos-universal"}'
MACOS_ARM='{"platform":"macos-15","args":"--target aarch64-apple-darwin","name":"macos-aarch64"}'
MACOS_INTEL='{"platform":"macos-15-intel","args":"--target x86_64-apple-darwin","name":"macos-x86_64"}'
LINUX='{"platform":"ubuntu-22.04","args":"","name":"linux-x86_64"}'
# Resolve requested platform — populated by either workflow_dispatch
# or workflow_call inputs; both paths default to "all".
case "$PLATFORM" in
windows) ENTRIES=("$WINDOWS") ;;
macos) ENTRIES=("$MACOS") ;;
macos) ENTRIES=("$MACOS_ARM" "$MACOS_INTEL") ;;
linux) ENTRIES=("$LINUX") ;;
*) ENTRIES=("$WINDOWS" "$MACOS" "$LINUX") ;;
*) ENTRIES=("$WINDOWS" "$MACOS_ARM" "$MACOS_INTEL" "$LINUX") ;;
esac
# Drop macOS entries when Apple certificate secret is unavailable
@@ -110,23 +111,7 @@ jobs:
uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 # stable
with:
toolchain: stable
targets: ${{ matrix.platform == 'macos-15' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
# x86_64 JDK is set up first so the aarch64 step below can leave its
# JAVA_HOME as the active one. The macOS universal JRE build needs
# jmods from both arches; the x64 path is captured into the env
# before the second setup-java overwrites JAVA_HOME.
- name: Set up x86_64 JDK 25 (macOS universal JRE)
if: matrix.platform == 'macos-15'
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
java-version: "25"
distribution: "temurin"
architecture: "x64"
- name: Capture x86_64 JAVA_HOME
if: matrix.platform == 'macos-15'
run: echo "X64_JAVA_HOME=$JAVA_HOME" >> "$GITHUB_ENV"
targets: ${{ (matrix.platform == 'macos-15' || matrix.platform == 'macos-15-intel') && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
- name: Set up JDK 25
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
@@ -141,15 +126,6 @@ jobs:
- name: Setup Task
uses: go-task/setup-task@3be4020d41929789a01026e0e427a4321ce0ad44 # v2.0.0
# Build the universal JRE before desktop:prepare so the jlink:runtime
# task short-circuits on its `test -d runtime/jre` status check.
- name: Build universal macOS JRE
if: matrix.platform == 'macos-15'
env:
AARCH64_JAVA_HOME: ${{ env.JAVA_HOME }}
run: task desktop:jlink:universal-mac
- name: Prepare desktop build
run: task desktop:prepare
env:
@@ -237,7 +213,7 @@ jobs:
}
- name: Import Apple Developer Certificate
if: matrix.platform == 'macos-15' && env.APPLE_CERTIFICATE != ''
if: (matrix.platform == 'macos-15' || matrix.platform == 'macos-15-intel') && env.APPLE_CERTIFICATE != ''
env:
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
@@ -258,7 +234,7 @@ jobs:
rm certificate.p12
- name: Verify Certificate
if: matrix.platform == 'macos-15' && env.APPLE_CERTIFICATE != ''
if: (matrix.platform == 'macos-15' || matrix.platform == 'macos-15-intel') && env.APPLE_CERTIFICATE != ''
run: |
echo "Verifying Apple Developer Certificate..."
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
@@ -270,7 +246,7 @@ jobs:
echo "Certificate imported successfully."
- name: Check DMG creation dependencies (macOS only)
if: matrix.platform == 'macos-15'
if: matrix.platform == 'macos-15' || matrix.platform == 'macos-15-intel'
run: |
echo "🔍 Checking DMG creation dependencies on ${{ matrix.platform }}..."
echo "hdiutil version: $(hdiutil --version || echo 'NOT FOUND')"
@@ -397,7 +373,7 @@ jobs:
fi
- name: Verify notarization (macOS only)
if: matrix.platform == 'macos-15'
if: matrix.platform == 'macos-15' || matrix.platform == 'macos-15-intel'
run: |
echo "🔍 Verifying notarization status..."
cd ./frontend/src-tauri/target
@@ -422,7 +398,7 @@ jobs:
# Only ship the MSI installer. The loose exe and WiX toolset exes
# are not the user-facing installer - the MSI contains the signed inner exe.
find . -name "*.msi" -exec cp {} "../../../dist/Stirling-PDF-${{ matrix.name }}.msi" \;
elif [ "${{ matrix.platform }}" = "macos-15" ]; then
elif [ "${{ matrix.platform }}" = "macos-15" ] || [ "${{ matrix.platform }}" = "macos-15-intel" ]; then
find . -name "*.dmg" -exec cp {} "../../../dist/Stirling-PDF-${{ matrix.name }}.dmg" \;
else
find . -name "*.deb" -exec cp {} "../../../dist/Stirling-PDF-${{ matrix.name }}.deb" \;
@@ -515,7 +491,7 @@ jobs:
echo "❌ No Windows executable found"
exit 1
fi
elif [ "${{ matrix.platform }}" = "macos-15" ]; then
elif [ "${{ matrix.platform }}" = "macos-15" ] || [ "${{ matrix.platform }}" = "macos-15-intel" ]; then
echo "Checking for macOS artifacts..."
find . -name "*.dmg" | head -5
if [ $(find . -name "*.dmg" | wc -l) -eq 0 ]; then
@@ -580,7 +556,8 @@ jobs:
// Map of expected artifact names to display info
const artifactMap = {
'Stirling-PDF-windows-x86_64': { icon: '🪟', platform: 'Windows x64', files: '.exe, .msi' },
'Stirling-PDF-macos-universal': { icon: '🍎', platform: 'macOS Universal', files: '.dmg' },
'Stirling-PDF-macos-aarch64': { icon: '🍎', platform: 'macOS ARM64', files: '.dmg' },
'Stirling-PDF-macos-x86_64': { icon: '🍎', platform: 'macOS Intel', files: '.dmg' },
'Stirling-PDF-linux-x86_64': { icon: '🐧', platform: 'Linux x64', files: '.deb, .rpm, .AppImage' }
};
-4
View File
@@ -266,7 +266,3 @@ docs/type3/signatures/
# Claude
.claude/
# Playwright MCP screenshots / traces
.playwright-mcp/
*.playwright-mcp.png
+1 -16
View File
@@ -96,7 +96,7 @@ tasks:
jlink
--add-modules {{.JLINK_MODULES}}
--strip-debug
--compress=zip-6
--compress=2
--no-header-files
--no-man-pages
--output src-tauri/runtime/jre
@@ -107,18 +107,3 @@ tasks:
desc: "Remove JLink runtime and bundled JARs"
cmds:
- rm -rf src-tauri/libs src-tauri/runtime
# macOS-only. Replaces jlink:runtime's single-arch JRE with a universal
# (arm64 + x86_64) one for the universal Tauri shell. Runs the x86_64
# jlink under Rosetta on Apple Silicon, so it is opt-in and not part of
# the default desktop:build flow. Requires AARCH64_JAVA_HOME and
# X64_JAVA_HOME to point at matching JDK installations with jmods/.
jlink:universal-mac:
desc: "Create universal (arm64+x86_64) JRE for the macOS Tauri build"
deps: [jlink:jar]
platforms: [darwin]
env:
JLINK_MODULES: "{{.JLINK_MODULES}}"
OUTPUT_DIR: src-tauri/runtime/jre
cmds:
- scripts/build-universal-mac-jre.sh
+10 -10
View File
@@ -183,26 +183,26 @@ Use this pattern for desktop-specific or proprietary-specific features WITHOUT r
**Example - Desktop-specific footer:**
```typescript
// core/components/workbenchBar/WorkbenchBarFooterExtensions.tsx (stub)
interface WorkbenchBarFooterExtensionsProps {
// core/components/rightRail/RightRailFooterExtensions.tsx (stub)
interface RightRailFooterExtensionsProps {
className?: string;
}
export function WorkbenchBarFooterExtensions(_props: WorkbenchBarFooterExtensionsProps) {
export function RightRailFooterExtensions(_props: RightRailFooterExtensionsProps) {
return null; // Stub - does nothing in web builds
}
```
```tsx
// desktop/components/workbenchBar/WorkbenchBarFooterExtensions.tsx (real implementation)
// desktop/components/rightRail/RightRailFooterExtensions.tsx (real implementation)
import { Box } from '@mantine/core';
import { BackendHealthIndicator } from '@app/components/BackendHealthIndicator';
interface WorkbenchBarFooterExtensionsProps {
interface RightRailFooterExtensionsProps {
className?: string;
}
export function WorkbenchBarFooterExtensions({ className }: WorkbenchBarFooterExtensionsProps) {
export function RightRailFooterExtensions({ className }: RightRailFooterExtensionsProps) {
return (
<Box className={className}>
<BackendHealthIndicator />
@@ -212,15 +212,15 @@ export function WorkbenchBarFooterExtensions({ className }: WorkbenchBarFooterEx
```
```tsx
// core/components/shared/WorkbenchBar.tsx (usage - works in ALL builds)
import { WorkbenchBarFooterExtensions } from '@app/components/workbenchBar/WorkbenchBarFooterExtensions';
// core/components/shared/RightRail.tsx (usage - works in ALL builds)
import { RightRailFooterExtensions } from '@app/components/rightRail/RightRailFooterExtensions';
export function WorkbenchBar() {
export function RightRail() {
return (
<div>
{/* In web builds: renders nothing (stub returns null) */}
{/* In desktop builds: renders BackendHealthIndicator */}
<WorkbenchBarFooterExtensions className="workbench-bar-footer" />
<RightRailFooterExtensions className="right-rail-footer" />
</div>
);
}
+2 -2
View File
@@ -25,7 +25,7 @@ ext {
imageioVersion = "3.13.1"
lombokVersion = "1.18.44"
bouncycastleVersion = "1.83"
springSecuritySamlVersion = "7.0.5"
springSecuritySamlVersion = "7.0.4"
openSamlVersion = "5.2.1"
commonmarkVersion = "0.28.0"
googleJavaFormatVersion = "1.28.0"
@@ -78,7 +78,7 @@ springBoot {
allprojects {
group = 'stirling.software'
version = '2.10.1'
version = '2.10.0'
configurations.configureEach {
exclude group: "org.springframework.boot", module: "spring-boot-starter-tomcat"
+170 -171
View File
@@ -12,29 +12,29 @@
"@atlaskit/pragmatic-drag-and-drop": "^1.7.7",
"@cantoo/pdf-lib": "^2.5.3",
"@dnd-kit/core": "^6.3.1",
"@embedpdf/core": "^2.14.1",
"@embedpdf/core": "^2.8.0",
"@embedpdf/engines": "^2.8.0",
"@embedpdf/models": "^2.14.1",
"@embedpdf/plugin-annotation": "^2.14.1",
"@embedpdf/plugin-attachment": "^2.14.1",
"@embedpdf/plugin-bookmark": "^2.14.1",
"@embedpdf/plugin-document-manager": "^2.14.1",
"@embedpdf/plugin-export": "^2.14.1",
"@embedpdf/plugin-history": "^2.14.1",
"@embedpdf/plugin-interaction-manager": "^2.14.1",
"@embedpdf/plugin-pan": "^2.14.1",
"@embedpdf/plugin-print": "^2.14.1",
"@embedpdf/plugin-redaction": "^2.14.1",
"@embedpdf/plugin-render": "^2.14.1",
"@embedpdf/plugin-rotate": "^2.14.1",
"@embedpdf/plugin-scroll": "^2.14.1",
"@embedpdf/plugin-search": "^2.14.1",
"@embedpdf/models": "^2.8.0",
"@embedpdf/plugin-annotation": "^2.8.0",
"@embedpdf/plugin-attachment": "^2.8.0",
"@embedpdf/plugin-bookmark": "^2.8.0",
"@embedpdf/plugin-document-manager": "^2.8.0",
"@embedpdf/plugin-export": "^2.8.0",
"@embedpdf/plugin-history": "^2.8.0",
"@embedpdf/plugin-interaction-manager": "^2.8.0",
"@embedpdf/plugin-pan": "^2.8.0",
"@embedpdf/plugin-print": "^2.8.0",
"@embedpdf/plugin-redaction": "^2.8.0",
"@embedpdf/plugin-render": "^2.8.0",
"@embedpdf/plugin-rotate": "^2.8.0",
"@embedpdf/plugin-scroll": "^2.8.0",
"@embedpdf/plugin-search": "^2.8.0",
"@embedpdf/plugin-selection": "^2.8.0",
"@embedpdf/plugin-spread": "^2.14.1",
"@embedpdf/plugin-thumbnail": "^2.14.1",
"@embedpdf/plugin-tiling": "^2.14.1",
"@embedpdf/plugin-viewport": "^2.14.1",
"@embedpdf/plugin-zoom": "^2.14.1",
"@embedpdf/plugin-spread": "^2.8.0",
"@embedpdf/plugin-thumbnail": "^2.8.0",
"@embedpdf/plugin-tiling": "^2.8.0",
"@embedpdf/plugin-viewport": "^2.8.0",
"@embedpdf/plugin-zoom": "^2.8.0",
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.1",
"@iconify/react": "^6.0.2",
@@ -52,8 +52,8 @@
"@tailwindcss/postcss": "^4.1.13",
"@tanstack/react-virtual": "^3.13.12",
"@tauri-apps/api": "^2.10.1",
"@tauri-apps/plugin-dialog": "2.7.0",
"@tauri-apps/plugin-fs": "2.5.0",
"@tauri-apps/plugin-dialog": "^2.6.0",
"@tauri-apps/plugin-fs": "^2.4.5",
"@tauri-apps/plugin-http": "^2.5.7",
"@tauri-apps/plugin-notification": "^2.3.3",
"@tauri-apps/plugin-shell": "^2.3.5",
@@ -585,13 +585,13 @@
}
},
"node_modules/@embedpdf/core": {
"version": "2.14.1",
"resolved": "https://registry.npmjs.org/@embedpdf/core/-/core-2.14.1.tgz",
"integrity": "sha512-L0lNn5WGnGDPaI1q2wnavVF6C6haRtvPGbMfqhZrjr7V+e0GExeoTO0VjK1DwH4IIBHOuD6nsQFYI89+nY/sJA==",
"version": "2.9.1",
"resolved": "https://registry.npmjs.org/@embedpdf/core/-/core-2.9.1.tgz",
"integrity": "sha512-DlFV2o+tv9S+j4TeBVkRaIjjE9o3Tq3+hvJNoIOFtl87cR77UVQqEIRqOf61yk85Y+T2LfmnVPWjNcMuiKUh8w==",
"license": "MIT",
"dependencies": {
"@embedpdf/engines": "2.14.1",
"@embedpdf/models": "2.14.1"
"@embedpdf/engines": "2.9.1",
"@embedpdf/models": "2.9.1"
},
"peerDependencies": {
"preact": "^10.26.4",
@@ -602,9 +602,9 @@
}
},
"node_modules/@embedpdf/engines": {
"version": "2.14.1",
"resolved": "https://registry.npmjs.org/@embedpdf/engines/-/engines-2.14.1.tgz",
"integrity": "sha512-k+HHuhj7dPKZC+8wUvMbpEUbNfi6F5r96Ky2XbNhBxiMQSWlVljBQVfZWcq9Jy3TLslwn5m2BbrvvHw+UVqe3w==",
"version": "2.9.1",
"resolved": "https://registry.npmjs.org/@embedpdf/engines/-/engines-2.9.1.tgz",
"integrity": "sha512-zyUdKgM2BZVzkqkbIMiTPAKIdH4M3bRV91P1nXUJUU94AmL9DrDrMkf2Nv6+S0bxGt19OpqDlclGSRZ8txhbGw==",
"license": "MIT",
"dependencies": {
"@embedpdf/fonts-arabic": "1.0.0",
@@ -614,8 +614,8 @@
"@embedpdf/fonts-latin": "1.0.0",
"@embedpdf/fonts-sc": "1.0.0",
"@embedpdf/fonts-tc": "1.0.0",
"@embedpdf/models": "2.14.1",
"@embedpdf/pdfium": "2.14.1"
"@embedpdf/models": "2.9.1",
"@embedpdf/pdfium": "2.9.1"
},
"peerDependencies": {
"preact": "^10.26.4",
@@ -668,32 +668,31 @@
"license": "OFL-1.1"
},
"node_modules/@embedpdf/models": {
"version": "2.14.1",
"resolved": "https://registry.npmjs.org/@embedpdf/models/-/models-2.14.1.tgz",
"integrity": "sha512-jbuoXKv4jW8F1o8EzCmPIB5U/yVC5DWlWhxL9ZfvBiBgW2HIy68ydcu+AykqOG75eAvCfxqcvF2HzSDsV3+K0A==",
"version": "2.9.1",
"resolved": "https://registry.npmjs.org/@embedpdf/models/-/models-2.9.1.tgz",
"integrity": "sha512-hUKj30D+a9dDOQlbqbrpjaECDPIcw/526Vo/s+eqJBY8zDNUkZ6meX+aVUrKg8+ApBm2dcEdVo3ff7KgNRhUGw==",
"license": "MIT"
},
"node_modules/@embedpdf/pdfium": {
"version": "2.14.1",
"resolved": "https://registry.npmjs.org/@embedpdf/pdfium/-/pdfium-2.14.1.tgz",
"integrity": "sha512-4FKhpeb7CYfkZ1k0WyDTq8i2FlIO5MaR0ywIDJ0goxOjenKkYOgHQ4747B5evxRzNEC2H5V3Rk6Dunf7TlIYBQ==",
"version": "2.9.1",
"resolved": "https://registry.npmjs.org/@embedpdf/pdfium/-/pdfium-2.9.1.tgz",
"integrity": "sha512-GUu1rDF3XP8X7UpQNnOCvc/jAX/Tw0NoUpOF0aEksVZ6CoujBxtu84P3kWAxcJl6cicyIJq1GAp9szHBSYrTrQ==",
"license": "MIT"
},
"node_modules/@embedpdf/plugin-annotation": {
"version": "2.14.1",
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-annotation/-/plugin-annotation-2.14.1.tgz",
"integrity": "sha512-YGe/DLL5r9HsF54QYgNnsc82W4E2jXRaX6D4WzR38argBhiSLf3IhTJmFXVR2WlPK4VwW6DA0p7WqKcEYUOyDg==",
"version": "2.9.1",
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-annotation/-/plugin-annotation-2.9.1.tgz",
"integrity": "sha512-aNtXjI3NUwz7kdmWsQIWzuS1QdZmuHXGCc+Kwl9u5O0PAgoj74OLsgoNEcFzz9m1rljyq3WPVnLczO6ByiifpQ==",
"license": "MIT",
"dependencies": {
"@embedpdf/models": "2.14.1",
"@embedpdf/utils": "2.14.1"
"@embedpdf/models": "2.9.1",
"@embedpdf/utils": "2.9.1"
},
"peerDependencies": {
"@embedpdf/core": "2.14.1",
"@embedpdf/plugin-history": "2.14.1",
"@embedpdf/plugin-interaction-manager": "2.14.1",
"@embedpdf/plugin-scroll": "2.14.1",
"@embedpdf/plugin-selection": "2.14.1",
"@embedpdf/core": "2.9.1",
"@embedpdf/plugin-history": "2.9.1",
"@embedpdf/plugin-interaction-manager": "2.9.1",
"@embedpdf/plugin-selection": "2.9.1",
"preact": "^10.26.4",
"react": ">=16.8.0",
"react-dom": ">=16.8.0",
@@ -702,15 +701,15 @@
}
},
"node_modules/@embedpdf/plugin-attachment": {
"version": "2.14.1",
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-attachment/-/plugin-attachment-2.14.1.tgz",
"integrity": "sha512-RdR43Kp/t15/KcvAiN8VEMxhqJcTfK2ZeU95PbPHr8zZ1rDatRltVGmKQ4fcaBXQMv15VLTEPZNbGFbfRgdF8g==",
"version": "2.9.1",
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-attachment/-/plugin-attachment-2.9.1.tgz",
"integrity": "sha512-7fPPHLWHZE9SXZRPnibo6o/AkuiknJQckdNgO16g9EdbPbO6IDNg/8e8pyjK4Knc+ckyyF4gnJ1lemWswSELUw==",
"license": "MIT",
"dependencies": {
"@embedpdf/models": "2.14.1"
"@embedpdf/models": "2.9.1"
},
"peerDependencies": {
"@embedpdf/core": "2.14.1",
"@embedpdf/core": "2.9.1",
"preact": "^10.26.4",
"react": ">=16.8.0",
"react-dom": ">=16.8.0",
@@ -719,15 +718,15 @@
}
},
"node_modules/@embedpdf/plugin-bookmark": {
"version": "2.14.1",
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-bookmark/-/plugin-bookmark-2.14.1.tgz",
"integrity": "sha512-ur5tEu4OaVec8T6qF9c18W9hfMNqg0g6dkVqcuh+qaLUYznJpyxMSsNTMJmw/h607bsVLfA1QCwk4l2vORwNmQ==",
"version": "2.9.1",
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-bookmark/-/plugin-bookmark-2.9.1.tgz",
"integrity": "sha512-5qgz4yBFEi6h1cogvn9q9CBObGdNLVfkX809kVNPHuRIYsghEieqYkdoh1BNwdP/bm9+D7a6pcXZrVvbXs5e5w==",
"license": "MIT",
"dependencies": {
"@embedpdf/models": "2.14.1"
"@embedpdf/models": "2.9.1"
},
"peerDependencies": {
"@embedpdf/core": "2.14.1",
"@embedpdf/core": "2.9.1",
"preact": "^10.26.4",
"react": ">=16.8.0",
"react-dom": ">=16.8.0",
@@ -736,15 +735,15 @@
}
},
"node_modules/@embedpdf/plugin-document-manager": {
"version": "2.14.1",
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-document-manager/-/plugin-document-manager-2.14.1.tgz",
"integrity": "sha512-Qdj6Xkmpyt0aLHCkqZbOsOK5xzwI4IjaV8C2ihPiggB/iPDhoyXPklJb3wXmJfxjTIl+aw+FZmmPkmr4IpYn7w==",
"version": "2.9.1",
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-document-manager/-/plugin-document-manager-2.9.1.tgz",
"integrity": "sha512-TrqkZvPIQxcWikL9Fmm8/qAJvI+uG7ahPXuyGyyF0JxkrrHCkUMCL8SPJN/fntcPnLJRIi3/K/xR5Qnt/L0aAg==",
"license": "MIT",
"dependencies": {
"@embedpdf/models": "2.14.1"
"@embedpdf/models": "2.9.1"
},
"peerDependencies": {
"@embedpdf/core": "2.14.1",
"@embedpdf/core": "2.9.1",
"preact": "^10.26.4",
"react": ">=16.8.0",
"react-dom": ">=16.8.0",
@@ -753,15 +752,15 @@
}
},
"node_modules/@embedpdf/plugin-export": {
"version": "2.14.1",
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-export/-/plugin-export-2.14.1.tgz",
"integrity": "sha512-O52WPexZD7dbUJQnjp3ikhNg7D3PmGZJowJmXVcmJ2YlTkBabN799LBppC+FYP7nXrtbwy7UmG6vdGWha1b/NQ==",
"version": "2.9.1",
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-export/-/plugin-export-2.9.1.tgz",
"integrity": "sha512-oYl8H0km1m75SYz17mVwxm9ljZvW0yBV8sTcyCa7YhnqE7yxtczu7jw3BrU3KW4Sua9mr9izhs3AixvWkTASQg==",
"license": "MIT",
"dependencies": {
"@embedpdf/models": "2.14.1"
"@embedpdf/models": "2.9.1"
},
"peerDependencies": {
"@embedpdf/core": "2.14.1",
"@embedpdf/core": "2.9.1",
"preact": "^10.26.4",
"react": ">=16.8.0",
"react-dom": ">=16.8.0",
@@ -770,15 +769,15 @@
}
},
"node_modules/@embedpdf/plugin-history": {
"version": "2.14.1",
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-history/-/plugin-history-2.14.1.tgz",
"integrity": "sha512-mJUKNO69b8Cf0zpE3zJRM5in/AsVRLZq4bRbuAfK9c5+YG2Z59fYEjfRNSwDefxatzFTgy3mlZ5/fSfZsAZz0w==",
"version": "2.9.1",
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-history/-/plugin-history-2.9.1.tgz",
"integrity": "sha512-3AcvSTT7fmqe1ve/FvR3lJ5q7t5JYmnnAg8LKc9ATsDjS9J5b0WE03Omz9a8/sL19iKq8xeR1+W28phgvlcKNw==",
"license": "MIT",
"dependencies": {
"@embedpdf/models": "2.14.1"
"@embedpdf/models": "2.9.1"
},
"peerDependencies": {
"@embedpdf/core": "2.14.1",
"@embedpdf/core": "2.9.1",
"preact": "^10.26.4",
"react": ">=16.8.0",
"react-dom": ">=16.8.0",
@@ -787,15 +786,15 @@
}
},
"node_modules/@embedpdf/plugin-interaction-manager": {
"version": "2.14.1",
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-interaction-manager/-/plugin-interaction-manager-2.14.1.tgz",
"integrity": "sha512-eyH45cF3vHeZ5BlcgIjH212EtUhi20FvKSRZeLWZW72noOn6saXRDScLy/XGbtfGFjJoTrzkNA553hvrRpqVKA==",
"version": "2.9.1",
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-interaction-manager/-/plugin-interaction-manager-2.9.1.tgz",
"integrity": "sha512-/wpdStr1NeyMCvAEMVSCPC0a3zaMd+TSK4u8INsIo3b1RoFfb9iTlBB+qW/aaxvZJ/C7MChQ7cLX6VSKXK/6JQ==",
"license": "MIT",
"dependencies": {
"@embedpdf/models": "2.14.1"
"@embedpdf/models": "2.9.1"
},
"peerDependencies": {
"@embedpdf/core": "2.14.1",
"@embedpdf/core": "2.9.1",
"preact": "^10.26.4",
"react": ">=16.8.0",
"react-dom": ">=16.8.0",
@@ -804,17 +803,17 @@
}
},
"node_modules/@embedpdf/plugin-pan": {
"version": "2.14.1",
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-pan/-/plugin-pan-2.14.1.tgz",
"integrity": "sha512-sHc9gjfoWQhfMcJ2JULsTzH9Sg9z6wX76Qvr5cujSPoOVV5bZ4QCB0kF1vgLFFzA1ia7vIBveGtDHIGkQQjsxA==",
"version": "2.9.1",
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-pan/-/plugin-pan-2.9.1.tgz",
"integrity": "sha512-LH5fp/2xKWuEYb5cc5jNWdXkhgOL+8TEf4oLcgao6hK33aV1xry+HAg5ATy+OPpIJItCwjU/Lk7Mc7uibYcFlA==",
"license": "MIT",
"dependencies": {
"@embedpdf/models": "2.14.1"
"@embedpdf/models": "2.9.1"
},
"peerDependencies": {
"@embedpdf/core": "2.14.1",
"@embedpdf/plugin-interaction-manager": "2.14.1",
"@embedpdf/plugin-viewport": "2.14.1",
"@embedpdf/core": "2.9.1",
"@embedpdf/plugin-interaction-manager": "2.9.1",
"@embedpdf/plugin-viewport": "2.9.1",
"preact": "^10.26.4",
"react": ">=16.8.0",
"react-dom": ">=16.8.0",
@@ -823,15 +822,15 @@
}
},
"node_modules/@embedpdf/plugin-print": {
"version": "2.14.1",
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-print/-/plugin-print-2.14.1.tgz",
"integrity": "sha512-wYuGuxuBhau7l2BfTlD5oohboRdseOn9/v0uVNGwKDuLHUTrv2WnkpzibBYIjv73gttyMBxTXdB3PZfnWOo8VA==",
"version": "2.9.1",
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-print/-/plugin-print-2.9.1.tgz",
"integrity": "sha512-brTn0R8AVyAfpm0SYxz/8bg0e373n4KaeIgw5E51DSrczVr3zIgqYGSvXFbfbv57ZUp63Hb93sVorP1et2AeUw==",
"license": "MIT",
"dependencies": {
"@embedpdf/models": "2.14.1"
"@embedpdf/models": "2.9.1"
},
"peerDependencies": {
"@embedpdf/core": "2.14.1",
"@embedpdf/core": "2.9.1",
"preact": "^10.26.4",
"react": ">=18.0.0",
"react-dom": ">=18.0.0",
@@ -840,20 +839,20 @@
}
},
"node_modules/@embedpdf/plugin-redaction": {
"version": "2.14.1",
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-redaction/-/plugin-redaction-2.14.1.tgz",
"integrity": "sha512-xlcOgYDNqIKp9u7exT95RtfDGCkW1b+knGikpTNZEA5OJgtYO9RxquTkEZ4rdVZbgIWxs0xiMg6b0mhr33z4JQ==",
"version": "2.9.1",
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-redaction/-/plugin-redaction-2.9.1.tgz",
"integrity": "sha512-2R81U4ex/JU4IAJ0+G3eIMOwpq80HnAIZ2sI5yMhkDbz+ZZE/sdAP4JKTOFIbhTkwk7DmC222yW34dQJoX4tRQ==",
"license": "MIT",
"dependencies": {
"@embedpdf/models": "2.14.1",
"@embedpdf/utils": "2.14.1"
"@embedpdf/models": "2.9.1",
"@embedpdf/utils": "2.9.1"
},
"peerDependencies": {
"@embedpdf/core": "2.14.1",
"@embedpdf/plugin-annotation": "2.14.1",
"@embedpdf/plugin-history": "2.14.1",
"@embedpdf/plugin-interaction-manager": "2.14.1",
"@embedpdf/plugin-selection": "2.14.1",
"@embedpdf/core": "2.9.1",
"@embedpdf/plugin-annotation": "2.9.1",
"@embedpdf/plugin-history": "2.9.1",
"@embedpdf/plugin-interaction-manager": "2.9.1",
"@embedpdf/plugin-selection": "2.9.1",
"preact": "^10.26.4",
"react": ">=16.8.0",
"react-dom": ">=16.8.0",
@@ -862,15 +861,15 @@
}
},
"node_modules/@embedpdf/plugin-render": {
"version": "2.14.1",
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-render/-/plugin-render-2.14.1.tgz",
"integrity": "sha512-KRjeSZeQRrg6fuyUgSU43yE6bOrRredpEiAfPI/FUCGgniO9nokTHjnFYg5G3UtVteJdnzdnKwzBl5sY++NQkg==",
"version": "2.9.1",
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-render/-/plugin-render-2.9.1.tgz",
"integrity": "sha512-mtfu6uDxlz3+j0xPXfKyvuu8iCFjapPkbnx8vGQ0z2PBNAMm+05hsNIzxJSGMP2VCFo09SOz2zCs7ch9J6NeNg==",
"license": "MIT",
"dependencies": {
"@embedpdf/models": "2.14.1"
"@embedpdf/models": "2.9.1"
},
"peerDependencies": {
"@embedpdf/core": "2.14.1",
"@embedpdf/core": "2.9.1",
"preact": "^10.26.4",
"react": ">=16.8.0",
"react-dom": ">=16.8.0",
@@ -879,15 +878,15 @@
}
},
"node_modules/@embedpdf/plugin-rotate": {
"version": "2.14.1",
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-rotate/-/plugin-rotate-2.14.1.tgz",
"integrity": "sha512-ILu0Y6bXzLQg63cj9pAJ0ime5m5HVDOSBOyTT/Nb47hBfDLSbTWQuvAHZXwxPhGOjM5Pn6gHssKWZjW2WiXkBQ==",
"version": "2.9.1",
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-rotate/-/plugin-rotate-2.9.1.tgz",
"integrity": "sha512-OgfMI2IsSPHKs4A0DGpmHpxuhoBcZjvw+tz+CXGBi6ILL6oS7z5wXhoMZfRgCgkvjII8RnmjBvmLeahoSaepAA==",
"license": "MIT",
"dependencies": {
"@embedpdf/models": "2.14.1"
"@embedpdf/models": "2.9.1"
},
"peerDependencies": {
"@embedpdf/core": "2.14.1",
"@embedpdf/core": "2.9.1",
"preact": "^10.26.4",
"react": ">=16.8.0",
"react-dom": ">=16.8.0",
@@ -896,16 +895,16 @@
}
},
"node_modules/@embedpdf/plugin-scroll": {
"version": "2.14.1",
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-scroll/-/plugin-scroll-2.14.1.tgz",
"integrity": "sha512-ppnP4t43EVNiXr2coEwybQ7BYucbUEpdTGlcEBm38DhLywgseVVySrcIMx7rHdM7ZylsW7uwS84hCFndTpPezg==",
"version": "2.9.1",
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-scroll/-/plugin-scroll-2.9.1.tgz",
"integrity": "sha512-+U3PSIUuNlIOTXzRhnPBP+Rx20sFOd3OPiowyI2EP/Kx/j5R/amgL/t2rjrpw9gjXEMEGsli9Fn4UqnVgMrPaQ==",
"license": "MIT",
"dependencies": {
"@embedpdf/models": "2.14.1"
"@embedpdf/models": "2.9.1"
},
"peerDependencies": {
"@embedpdf/core": "2.14.1",
"@embedpdf/plugin-viewport": "2.14.1",
"@embedpdf/core": "2.9.1",
"@embedpdf/plugin-viewport": "2.9.1",
"preact": "^10.26.4",
"react": ">=16.8.0",
"react-dom": ">=16.8.0",
@@ -914,15 +913,15 @@
}
},
"node_modules/@embedpdf/plugin-search": {
"version": "2.14.1",
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-search/-/plugin-search-2.14.1.tgz",
"integrity": "sha512-dAX4aIc4WeO+bUImbcHVm4c32UADYelpTeJA0It2eq6agZVND20B25kyDYpJiWKTl9NaVcJbNic+wreudl6vsQ==",
"version": "2.9.1",
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-search/-/plugin-search-2.9.1.tgz",
"integrity": "sha512-NefZgXPfj1MW8i5bYEfuphpXXAODutJTtwCHpLff1YwPw6liuBug9G1lDKSpNddvp+7aSkTcXV5LYNhcPxb1vg==",
"license": "MIT",
"dependencies": {
"@embedpdf/models": "2.14.1"
"@embedpdf/models": "2.9.1"
},
"peerDependencies": {
"@embedpdf/core": "2.14.1",
"@embedpdf/core": "2.9.1",
"preact": "^10.26.4",
"react": ">=16.8.0",
"react-dom": ">=16.8.0",
@@ -931,17 +930,17 @@
}
},
"node_modules/@embedpdf/plugin-selection": {
"version": "2.14.1",
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-selection/-/plugin-selection-2.14.1.tgz",
"integrity": "sha512-M+omnIDqgME+QgYX3nW3ypjzRvvz2IrSWpx7vP7vUhfd12R4ZJnTkS9AkKbXgHBVwWrxnbibKlZduiiehRLeKg==",
"version": "2.9.1",
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-selection/-/plugin-selection-2.9.1.tgz",
"integrity": "sha512-dVLjiLGnZDo0xO7lZulLGl3cJ/mO7BcA3PGO2uMdhqSWK4tAF/DrakvwXdD581VBwXD/C25EJhxiNa2L7mU4wg==",
"license": "MIT",
"dependencies": {
"@embedpdf/models": "2.14.1",
"@embedpdf/utils": "2.14.1"
"@embedpdf/models": "2.9.1",
"@embedpdf/utils": "2.9.1"
},
"peerDependencies": {
"@embedpdf/core": "2.14.1",
"@embedpdf/plugin-interaction-manager": "2.14.1",
"@embedpdf/core": "2.9.1",
"@embedpdf/plugin-interaction-manager": "2.9.1",
"preact": "^10.26.4",
"react": ">=16.8.0",
"react-dom": ">=16.8.0",
@@ -950,15 +949,15 @@
}
},
"node_modules/@embedpdf/plugin-spread": {
"version": "2.14.1",
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-spread/-/plugin-spread-2.14.1.tgz",
"integrity": "sha512-MychoG54eYqjB+8/1/ArKYF+4eonULtBuGPqU72MO9t/Nadl8nNThaPrOW/eKQr3zQu1Af3KO7ng6tm6Umz4rA==",
"version": "2.9.1",
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-spread/-/plugin-spread-2.9.1.tgz",
"integrity": "sha512-s9J4tvoucNac8pUAHVhv3PWDWMZJyK0ikaG78VdGwh4G2iMo5HW1LKDJkJ29l1TjAuxhIoKihpfQbLgUgi7JHA==",
"license": "MIT",
"dependencies": {
"@embedpdf/models": "2.14.1"
"@embedpdf/models": "2.9.1"
},
"peerDependencies": {
"@embedpdf/core": "2.14.1",
"@embedpdf/core": "2.9.1",
"preact": "^10.26.4",
"react": ">=16.8.0",
"react-dom": ">=16.8.0",
@@ -967,16 +966,16 @@
}
},
"node_modules/@embedpdf/plugin-thumbnail": {
"version": "2.14.1",
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-thumbnail/-/plugin-thumbnail-2.14.1.tgz",
"integrity": "sha512-NOaFve83gbD6BUiANSSbiREjUJ1qpNyQrHl2RdMDNLyDaSUARweUu5zC5vfFRd9I+jUf3XGsCa3GNFlzQt+C9A==",
"version": "2.9.1",
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-thumbnail/-/plugin-thumbnail-2.9.1.tgz",
"integrity": "sha512-TAEUkVxvvB5kh2VVGf9RMuJFq++CQgWpKJ62ed2GhB9WvVKP5gBYj7G5ff90TLCrAV8iXZL9ENKcHgGKxrZrYw==",
"license": "MIT",
"dependencies": {
"@embedpdf/models": "2.14.1"
"@embedpdf/models": "2.9.1"
},
"peerDependencies": {
"@embedpdf/core": "2.14.1",
"@embedpdf/plugin-render": "2.14.1",
"@embedpdf/core": "2.9.1",
"@embedpdf/plugin-render": "2.9.1",
"preact": "^10.26.4",
"react": ">=16.8.0",
"react-dom": ">=16.8.0",
@@ -985,18 +984,18 @@
}
},
"node_modules/@embedpdf/plugin-tiling": {
"version": "2.14.1",
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-tiling/-/plugin-tiling-2.14.1.tgz",
"integrity": "sha512-tvs3pPT6wVh0MjMN7Dp8R1XeoTjguH30j/ToWz9ziTKkwXADfJXdyjqYGhagiamMMTwQeUF9py+yDTMP23QV7Q==",
"version": "2.9.1",
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-tiling/-/plugin-tiling-2.9.1.tgz",
"integrity": "sha512-UQ/gr/Rdzj7sMsgvtuClw6Jq25fMr+OEdW4tQmg2bV/MqpKptpOEUZ5Aiay4M03X3cgoxhS8UvobRMnjlpYljA==",
"license": "MIT",
"dependencies": {
"@embedpdf/models": "2.14.1"
"@embedpdf/models": "2.9.1"
},
"peerDependencies": {
"@embedpdf/core": "2.14.1",
"@embedpdf/plugin-render": "2.14.1",
"@embedpdf/plugin-scroll": "2.14.1",
"@embedpdf/plugin-viewport": "2.14.1",
"@embedpdf/core": "2.9.1",
"@embedpdf/plugin-render": "2.9.1",
"@embedpdf/plugin-scroll": "2.9.1",
"@embedpdf/plugin-viewport": "2.9.1",
"preact": "^10.26.4",
"react": ">=16.8.0",
"react-dom": ">=16.8.0",
@@ -1005,15 +1004,15 @@
}
},
"node_modules/@embedpdf/plugin-viewport": {
"version": "2.14.1",
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-viewport/-/plugin-viewport-2.14.1.tgz",
"integrity": "sha512-U45B46XoaAFxC3yKnVhBO8Z5Wa+ca17UW7esJC/yWneJ2dNfSnvRAR7309KKP/RpZfDmn/lfJDVOFGCDbR3hvw==",
"version": "2.9.1",
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-viewport/-/plugin-viewport-2.9.1.tgz",
"integrity": "sha512-bVhBuZHTppKV+OB5lBLqXQv+5oW1A7kAIc5UzsImBwl6NpwH+2PdVkelfrF37yEqnEF/mdxobriWSP0aOVl93w==",
"license": "MIT",
"dependencies": {
"@embedpdf/models": "2.14.1"
"@embedpdf/models": "2.9.1"
},
"peerDependencies": {
"@embedpdf/core": "2.14.1",
"@embedpdf/core": "2.9.1",
"preact": "^10.26.4",
"react": ">=16.8.0",
"react-dom": ">=16.8.0",
@@ -1022,17 +1021,17 @@
}
},
"node_modules/@embedpdf/plugin-zoom": {
"version": "2.14.1",
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-zoom/-/plugin-zoom-2.14.1.tgz",
"integrity": "sha512-rVah7XgrWiNe9kT7VGRhNp5mCImf3eMk4cGO9kXIidQWka+yFqBANJw6Rj+FJdtWqz6pamZNWXTDZ1jvQkMKZg==",
"version": "2.9.1",
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-zoom/-/plugin-zoom-2.9.1.tgz",
"integrity": "sha512-FVOYj+AKTc2aCPrZHOrgbiYNTfBmiwVpFCedmqeGLYOIYTIeGzwJlyIHLU0PmIC/nuHcu1ZFwh0tH23fWAfVCQ==",
"license": "MIT",
"dependencies": {
"@embedpdf/models": "2.14.1"
"@embedpdf/models": "2.9.1"
},
"peerDependencies": {
"@embedpdf/core": "2.14.1",
"@embedpdf/plugin-scroll": "2.14.1",
"@embedpdf/plugin-viewport": "2.14.1",
"@embedpdf/core": "2.9.1",
"@embedpdf/plugin-scroll": "2.9.1",
"@embedpdf/plugin-viewport": "2.9.1",
"preact": "^10.26.4",
"react": ">=16.8.0",
"react-dom": ">=16.8.0",
@@ -1041,9 +1040,9 @@
}
},
"node_modules/@embedpdf/utils": {
"version": "2.14.1",
"resolved": "https://registry.npmjs.org/@embedpdf/utils/-/utils-2.14.1.tgz",
"integrity": "sha512-TlJBT+SgRgcSMKH2EX3WBXIm/a/LEtgG2IiZ7hXPhT3t2e1HOeXjkvreJi6wcnvkMt4eYtJh3nocetto5gNclw==",
"version": "2.9.1",
"resolved": "https://registry.npmjs.org/@embedpdf/utils/-/utils-2.9.1.tgz",
"integrity": "sha512-IKe/k5DruzpuyGJBIoLEL9AKJ9rEBDLgi1eSCWQPyYkuLWTJg4rBzyGh57eS4S4K4dzQrlJ3Z9zGAW1mgbY2Jw==",
"license": "MIT",
"peerDependencies": {
"preact": "^10.26.4",
@@ -4431,21 +4430,21 @@
}
},
"node_modules/@tauri-apps/plugin-dialog": {
"version": "2.7.0",
"resolved": "https://registry.npmjs.org/@tauri-apps/plugin-dialog/-/plugin-dialog-2.7.0.tgz",
"integrity": "sha512-4nS/hfGMGCXiAS3LtVjH9AgsSAPJeG/7R+q8agTFqytjnMa4Zq95Bq8WzVDkckpanX+yyRHXnRtrKXkANKDHvw==",
"version": "2.6.0",
"resolved": "https://registry.npmjs.org/@tauri-apps/plugin-dialog/-/plugin-dialog-2.6.0.tgz",
"integrity": "sha512-q4Uq3eY87TdcYzXACiYSPhmpBA76shgmQswGkSVio4C82Sz2W4iehe9TnKYwbq7weHiL88Yw19XZm7v28+Micg==",
"license": "MIT OR Apache-2.0",
"dependencies": {
"@tauri-apps/api": "^2.10.1"
"@tauri-apps/api": "^2.8.0"
}
},
"node_modules/@tauri-apps/plugin-fs": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/@tauri-apps/plugin-fs/-/plugin-fs-2.5.0.tgz",
"integrity": "sha512-c83kbz61AK+rKjhS+je9+stIO27nXj7p9cqeg36TwkIUtxpCFTttlHHtqon6h6FN54cXjyAjlMPOJcW3mwE5XQ==",
"version": "2.4.5",
"resolved": "https://registry.npmjs.org/@tauri-apps/plugin-fs/-/plugin-fs-2.4.5.tgz",
"integrity": "sha512-dVxWWGE6VrOxC7/jlhyE+ON/Cc2REJlM35R3PJX3UvFw2XwYhLGQVAIyrehenDdKjotipjYEVc4YjOl3qq90fA==",
"license": "MIT OR Apache-2.0",
"dependencies": {
"@tauri-apps/api": "^2.10.1"
"@tauri-apps/api": "^2.8.0"
}
},
"node_modules/@tauri-apps/plugin-http": {
+23 -23
View File
@@ -8,29 +8,29 @@
"@atlaskit/pragmatic-drag-and-drop": "^1.7.7",
"@cantoo/pdf-lib": "^2.5.3",
"@dnd-kit/core": "^6.3.1",
"@embedpdf/core": "^2.14.1",
"@embedpdf/core": "^2.8.0",
"@embedpdf/engines": "^2.8.0",
"@embedpdf/models": "^2.14.1",
"@embedpdf/plugin-annotation": "^2.14.1",
"@embedpdf/plugin-attachment": "^2.14.1",
"@embedpdf/plugin-bookmark": "^2.14.1",
"@embedpdf/plugin-document-manager": "^2.14.1",
"@embedpdf/plugin-export": "^2.14.1",
"@embedpdf/plugin-history": "^2.14.1",
"@embedpdf/plugin-interaction-manager": "^2.14.1",
"@embedpdf/plugin-pan": "^2.14.1",
"@embedpdf/plugin-print": "^2.14.1",
"@embedpdf/plugin-redaction": "^2.14.1",
"@embedpdf/plugin-render": "^2.14.1",
"@embedpdf/plugin-rotate": "^2.14.1",
"@embedpdf/plugin-scroll": "^2.14.1",
"@embedpdf/plugin-search": "^2.14.1",
"@embedpdf/models": "^2.8.0",
"@embedpdf/plugin-annotation": "^2.8.0",
"@embedpdf/plugin-attachment": "^2.8.0",
"@embedpdf/plugin-bookmark": "^2.8.0",
"@embedpdf/plugin-document-manager": "^2.8.0",
"@embedpdf/plugin-export": "^2.8.0",
"@embedpdf/plugin-history": "^2.8.0",
"@embedpdf/plugin-interaction-manager": "^2.8.0",
"@embedpdf/plugin-pan": "^2.8.0",
"@embedpdf/plugin-print": "^2.8.0",
"@embedpdf/plugin-redaction": "^2.8.0",
"@embedpdf/plugin-render": "^2.8.0",
"@embedpdf/plugin-rotate": "^2.8.0",
"@embedpdf/plugin-scroll": "^2.8.0",
"@embedpdf/plugin-search": "^2.8.0",
"@embedpdf/plugin-selection": "^2.8.0",
"@embedpdf/plugin-spread": "^2.14.1",
"@embedpdf/plugin-thumbnail": "^2.14.1",
"@embedpdf/plugin-tiling": "^2.14.1",
"@embedpdf/plugin-viewport": "^2.14.1",
"@embedpdf/plugin-zoom": "^2.14.1",
"@embedpdf/plugin-spread": "^2.8.0",
"@embedpdf/plugin-thumbnail": "^2.8.0",
"@embedpdf/plugin-tiling": "^2.8.0",
"@embedpdf/plugin-viewport": "^2.8.0",
"@embedpdf/plugin-zoom": "^2.8.0",
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.1",
"@iconify/react": "^6.0.2",
@@ -48,8 +48,8 @@
"@tailwindcss/postcss": "^4.1.13",
"@tanstack/react-virtual": "^3.13.12",
"@tauri-apps/api": "^2.10.1",
"@tauri-apps/plugin-dialog": "2.7.0",
"@tauri-apps/plugin-fs": "2.5.0",
"@tauri-apps/plugin-dialog": "^2.6.0",
"@tauri-apps/plugin-fs": "^2.4.5",
"@tauri-apps/plugin-http": "^2.5.7",
"@tauri-apps/plugin-notification": "^2.3.3",
"@tauri-apps/plugin-shell": "^2.3.5",
+32 -69
View File
@@ -1460,14 +1460,14 @@ inactive = "Inactive"
[adminOnboarding]
adminTools = "Finally, we have advanced administration tools like <strong>Auditing</strong> to track system activity and <strong>Usage Analytics</strong> to monitor how your users interact with the platform."
configButton = "Open <strong>Settings</strong> to access all system configuration and administrative controls."
configButton = "Click the <strong>Config</strong> button to access all system settings and administrative controls."
connectionsSection = "The <strong>Connections</strong> section supports various login methods including custom SSO and SAML providers like Google and GitHub, plus email integrations for notifications and communications."
databaseSection = "For advanced production environments, we have settings to allow <strong>external database hookups</strong> so you can integrate with your existing infrastructure."
settingsOverview = "This is the <strong>Settings Panel</strong>. Admin settings are organised by category for easy navigation."
systemCustomization = "We have extensive ways to customise the UI: <strong>System Settings</strong> let you change the app name and languages, <strong>Features</strong> allows server certificate management, and <strong>Endpoints</strong> lets you enable or disable specific tools for your users."
teamsAndUsers = "Manage <strong>Teams</strong> and individual users here. You can invite new users via email, shareable links, or create custom accounts for them yourself."
welcome = "Welcome to the <strong>Admin Tour</strong>! Let's explore the powerful enterprise features and settings available to system administrators."
wrapUp = "That's the admin tour! You've seen the enterprise features that make Stirling PDF a powerful, customisable solution for organisations. You can replay it anytime — just open <strong>Settings</strong> and find it here in the <strong>Tours</strong> section under Help."
wrapUp = "That's the admin tour! You've seen the enterprise features that make Stirling PDF a powerful, customisable solution for organisations. Access this tour anytime from the <strong>Help</strong> menu."
[adminUserSettings]
actions = "Actions"
@@ -1791,14 +1791,26 @@ bullet3 = "Keeps the original name if no suitable title is found"
text = "Automatically finds the title from your PDF content and uses it as the filename."
title = "Smart Renaming"
[pdfCommentAgent]
submit = "Generate comments"
prompt.label = "What should the AI comment on?"
prompt.placeholder = "e.g. Flag any ambiguous dates and suggest clarifications"
[pdfCommentAgent.settings]
title = "Comment instructions"
[pdfCommentAgent.results]
title = "Commented PDF"
[pdfCommentAgent.error]
failed = "Failed to generate comments"
emptyPrompt = "Please describe what the AI should comment on"
tooLong = "Prompt is too long (maximum {{max}} characters)"
[automate]
copyToSaved = "Copy to Saved"
desc = "Build multi-step workflows by chaining together PDF actions. Ideal for recurring tasks."
export = "Export"
exportForFolderScanning = "Export for Folder Scanning"
import = "Import"
importPartialSuccess = "Imported with {{count}} unmapped operation(s): {{ops}}"
importSuccess = "Imported automation: {{name}}"
invalidStep = "Invalid step"
reviewTitle = "Automation Results"
title = "Automate"
@@ -1814,7 +1826,6 @@ title = "Configure {{toolName}}"
[automate.creation]
createTitle = "Create Automation"
editTitle = "Edit Automation"
export = "Export"
exportForFolderScanning = "Export for Folder Scanning"
intro = "Automations run tools sequentially. To get started, add tools in the order you want them to run."
save = "Save Automation"
@@ -1845,28 +1856,9 @@ confirm = "Go Back"
message = "You have unsaved changes. Are you sure you want to go back? All changes will be lost."
title = "Unsaved Changes"
[automate.entryMenu]
label = "Open menu for {{title}}"
[automate.files]
placeholder = "Select files to process with this automation"
[automate.importModal]
cancel = "Cancel"
confirm = "Import"
detectedAutomation = "Automate JSON"
detectedFolderScan = "Folder Scanning JSON"
dropHint = "Drop JSON here or click to choose a file"
dropSubhint = "Both Automate and Folder Scanning configs are accepted"
dropzoneAriaLabel = "Drop an automation JSON file here"
intro = "Drop a JSON file or paste its contents below. The format (Automate or Folder Scanning) is detected automatically."
opCount = "{{count}} operation(s)"
parseError = "Could not parse: {{message}}"
pasteLabel = "Or paste JSON"
pastePlaceholder = "Paste your automation JSON here…"
title = "Import automation"
unresolved = "Unmapped: {{ops}}"
[automate.run]
title = "Run Automation"
@@ -4121,6 +4113,11 @@ desc = "Auto renames a PDF file based on its detected header"
tags = "auto-detect,header-based,organize,relabel,auto rename,automatic rename,smart rename,rename by content,filename,file naming,detect title"
title = "Auto Rename PDF File"
[home.pdfCommentAgent]
desc = "Ask AI to annotate a PDF with sticky-note comments based on your prompt"
tags = "AI,agent,comment,annotate,sticky note,review,feedback,notes"
title = "Add AI comments"
[home.autoSizeSplitPDF]
desc = "Automatically split PDFs by file size or page count"
tags = "auto,split,size"
@@ -4260,11 +4257,6 @@ desc = "Merge multiple pages of a PDF document into a single page"
tags = "layout,arrange,combine,N-up,2-up,4-up,multiple per page,pages per sheet,layout pages,tile,grid layout,multi-page layout,combine on page,handout"
title = "Multi-Page Layout"
[home.pdfCommentAgent]
desc = "Ask AI to annotate a PDF with sticky-note comments based on your prompt"
tags = "AI,agent,comment,annotate,sticky note,review,feedback,notes"
title = "Add AI comments"
[home.pdfOrganiser]
desc = "Remove/Rearrange pages in any order"
tags = "organize,rearrange,reorder,organise,arrange pages,sort,move pages,delete pages,remove pages,page management,page organizer,page organiser,resequence"
@@ -4900,7 +4892,7 @@ toolInterface = "This is the <strong>Crop</strong> tool interface. As you can se
viewer = "The <strong>Viewer</strong> lets you read and annotate your PDFs."
viewSwitcher = "Use these controls to select how you want to view your PDFs."
workbench = "This is the <strong>Workbench</strong> - the main area where you view and edit your PDFs."
wrapUp = "You're all set! You can replay this tour anytime — just open <strong>Settings</strong> and find it here in the <strong>Tours</strong> section under Help."
wrapUp = "You're all set! You've learnt about the main areas of the app and how to use them. Click the <strong>Help</strong> button whenever you like to see this tour again."
[onboarding.buttons]
back = "Back"
@@ -4965,6 +4957,7 @@ fileUpload = "Use the <strong>Files</strong> button to upload or pick a recent P
leftPanel = "The left <strong>Tools</strong> panel lists everything you can do. Browse categories or search to find a tool quickly."
pageEditorView = "Switch to the Page Editor to reorder, rotate, or delete pages."
quickAccess = "Start at the <strong>Quick Access</strong> rail to jump between Reader, Automate, your files, and all the tours."
rightRail = "The <strong>Right Rail</strong> holds quick actions to select files, change theme or language, and download results."
topBar = "The top bar lets you swap between <strong>Viewer</strong>, <strong>Page Editor</strong>, and <strong>Active Files</strong>."
wrapUp = "That is what is new in V2. Open the <strong>Tours</strong> menu anytime to replay this, the Tools tour, or the Admin tour."
@@ -5340,24 +5333,6 @@ selectYearly = "Select Yearly"
title = "Choose Your Billing Period"
totalForSeats = "Total ({{count}} seats)"
[pdfCommentAgent]
submit = "Generate comments"
[pdfCommentAgent.error]
emptyPrompt = "Please describe what the AI should comment on"
failed = "Failed to generate comments"
tooLong = "Prompt is too long (maximum {{max}} characters)"
[pdfCommentAgent.prompt]
label = "What should the AI comment on?"
placeholder = "e.g. Flag any ambiguous dates and suggest clarifications"
[pdfCommentAgent.results]
title = "Commented PDF"
[pdfCommentAgent.settings]
title = "Comment instructions"
[pdfOrganiser]
header = "PDF Page Organiser"
placeholder = "(e.g. 1,3,2 or 4-8,2,10-12 or 2n-1)"
@@ -6565,7 +6540,7 @@ title = "High Contrast"
text = "Completely invert all colours in the PDF, creating a negative-like effect. Useful for creating dark mode versions of documents or reducing eye strain in low-light conditions."
title = "Invert All Colours"
[workbenchBar]
[rightRail]
annotations = "Annotations"
applyRedactionsFirst = "Apply redactions first"
closeAll = "Close All Files"
@@ -6606,9 +6581,6 @@ toggleComments = "Comments"
toggleLayers = "Toggle Layers"
toggleSidebar = "Toggle Sidebar"
toggleTheme = "Toggle Theme"
activeFiles = "Active Files"
multiTool = "Multi-Tool"
viewer = "Viewer"
[rotate]
rotateLeft = "Rotate Anticlockwise"
@@ -7034,20 +7006,6 @@ title = "Team"
enableLoginFirst = "Enable login mode first"
requiresEnterprise = "Requires Enterprise license"
[settings.help]
label = "Tours"
title = "Help"
[settings.help.adminTour]
description = "Explore team management, system settings, and enterprise features."
start = "Start"
title = "Admin Tour"
[settings.help.toolsTour]
description = "Walk through uploading files, picking a tool, and reviewing results."
start = "Start"
title = "Tools Tour"
[settings.workspace]
people = "People"
teams = "Teams"
@@ -7899,7 +7857,7 @@ viewerMode = "Switch to the file editor to add multiple files."
[toolPanel]
allTools = "All tools"
alpha = "Alpha"
backToTools = "Back to tools"
backToTools = "Back to all tools"
collapse = "Collapse panel"
comingSoon = "Coming soon:"
expand = "Expand panel"
@@ -8457,6 +8415,11 @@ description = "Upload a pre-created signature image. Ideal if you have a scanned
title = "Upload Signature Image"
[workbenchBar]
activeFiles = "Active Files"
multiTool = "Multi-Tool"
viewer = "Viewer"
[workspace]
title = "Workspace"
-108
View File
@@ -1,108 +0,0 @@
#!/usr/bin/env bash
# Build a universal (arm64 + x86_64) JRE bundle for the macOS Tauri app.
#
# jlink can only emit a single-architecture runtime, but the Tauri shell is
# universal-apple-darwin. Without this merge the bundled JRE would only run
# on whichever arch the runner used. We jlink twice (once per target JDK's
# jmods) and lipo-fatten every Mach-O file in the result.
#
# Inputs (env):
# AARCH64_JAVA_HOME path to an aarch64 JDK with jmods/
# X64_JAVA_HOME path to an x86_64 JDK with jmods/
# JLINK_MODULES comma-separated module list (matches desktop.yml)
# OUTPUT_DIR target directory (will be wiped); defaults to
# frontend/src-tauri/runtime/jre
set -euo pipefail
: "${AARCH64_JAVA_HOME:?AARCH64_JAVA_HOME must be set}"
: "${X64_JAVA_HOME:?X64_JAVA_HOME must be set}"
: "${JLINK_MODULES:?JLINK_MODULES must be set}"
OUTPUT_DIR="${OUTPUT_DIR:-frontend/src-tauri/runtime/jre}"
if [[ "$(uname -s)" != "Darwin" ]]; then
echo "build-universal-mac-jre.sh only runs on macOS" >&2
exit 1
fi
# x86_64 jlink runs under Rosetta on Apple Silicon. If Rosetta isn't
# installed the failure mode is a cryptic "Bad CPU type" from exec, so
# fail loudly up front when running on arm64 without it.
if [[ "$(uname -m)" == "arm64" ]] && ! arch -x86_64 /usr/bin/true >/dev/null 2>&1; then
echo "Rosetta 2 is required to run x86_64 jlink on Apple Silicon. Install with: softwareupdate --install-rosetta --agree-to-license" >&2
exit 1
fi
WORK_DIR="$(mktemp -d -t universal-jre)"
trap 'rm -rf "$WORK_DIR"' EXIT INT TERM
ARM_JRE="$WORK_DIR/jre-aarch64"
X64_JRE="$WORK_DIR/jre-x86_64"
# Each jlink invocation must run on the native arch of its JDK: jlink
# stamps out launcher executables (bin/java, bin/rmiregistry, etc.)
# matching the host binary, regardless of --module-path. So we run the
# arm64 jlink for the arm64 JRE and the x86_64 jlink for the x86_64
# JRE.
run_jlink() {
local java_home="$1"
local out="$2"
"$java_home/bin/jlink" \
--module-path "$java_home/jmods" \
--add-modules "$JLINK_MODULES" \
--strip-debug \
--compress=zip-6 \
--no-header-files \
--no-man-pages \
--output "$out"
}
echo "Building aarch64 JRE from $AARCH64_JAVA_HOME"
run_jlink "$AARCH64_JAVA_HOME" "$ARM_JRE"
echo "Building x86_64 JRE from $X64_JAVA_HOME (runs under Rosetta on Apple Silicon)"
run_jlink "$X64_JAVA_HOME" "$X64_JRE"
rm -rf "$OUTPUT_DIR"
mkdir -p "$(dirname "$OUTPUT_DIR")"
cp -R "$ARM_JRE" "$OUTPUT_DIR"
# Replace every Mach-O file in the copied tree with a fat binary.
# Files that aren't Mach-O (text, modules archive, etc.) are left as-is.
merged=0
skipped=0
while IFS= read -r -d '' arm_file; do
rel="${arm_file#"$ARM_JRE"/}"
x64_file="$X64_JRE/$rel"
out_file="$OUTPUT_DIR/$rel"
if [[ ! -f "$x64_file" ]]; then
skipped=$((skipped + 1))
continue
fi
if ! file "$arm_file" | grep -q "Mach-O"; then
continue
fi
lipo -create "$arm_file" "$x64_file" -output "$out_file"
merged=$((merged + 1))
done < <(find "$ARM_JRE" -type f -print0)
echo "Universal JRE written to $OUTPUT_DIR (merged $merged Mach-O files, skipped $skipped arm-only files)"
if [[ "$merged" -eq 0 ]]; then
echo "Refusing to ship a JRE with zero merged Mach-O binaries" >&2
exit 1
fi
# Sanity-check: the launcher must be a fat binary or the app crashes on the
# arch we didn't lipo for. `lipo -archs` prints just the arch names space-
# separated (avoiding fragile grep alternation across BSD/GNU grep).
java_archs="$(lipo -archs "$OUTPUT_DIR/bin/java" 2>/dev/null || true)"
if [[ "$java_archs" != *arm64* || "$java_archs" != *x86_64* ]]; then
echo "bin/java is not a universal binary (archs: ${java_archs:-unknown})" >&2
lipo -info "$OUTPUT_DIR/bin/java" >&2
exit 1
fi
+129 -301
View File
@@ -265,21 +265,6 @@ version = "0.22.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
[[package]]
name = "bit-set"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3"
dependencies = [
"bit-vec",
]
[[package]]
name = "bit-vec"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7"
[[package]]
name = "bitflags"
version = "1.3.2"
@@ -648,6 +633,24 @@ dependencies = [
"version_check",
]
[[package]]
name = "cookie_store"
version = "0.21.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2eac901828f88a5241ee0600950ab981148a18f2f756900ffba1b125ca6a3ef9"
dependencies = [
"cookie",
"document-features",
"idna",
"log",
"publicsuffix",
"serde",
"serde_derive",
"serde_json",
"time",
"url",
]
[[package]]
name = "cookie_store"
version = "0.22.1"
@@ -694,9 +697,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
[[package]]
name = "core-graphics"
version = "0.25.0"
version = "0.24.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "064badf302c3194842cf2c5d61f56cc88e54a759313879cdf03abdd27d0c3b97"
checksum = "fa95a34622365fa5bbf40b20b75dba8dfa8c94c734aea8ac9a5ca38af14316f1"
dependencies = [
"bitflags 2.11.0",
"core-foundation 0.10.1",
@@ -809,19 +812,6 @@ dependencies = [
"syn 1.0.109",
]
[[package]]
name = "cssparser"
version = "0.36.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dae61cf9c0abb83bd659dab65b7e4e38d8236824c85f0f804f173567bda257d2"
dependencies = [
"cssparser-macros",
"dtoa-short",
"itoa",
"phf 0.13.1",
"smallvec",
]
[[package]]
name = "cssparser-macros"
version = "0.6.1"
@@ -834,20 +824,14 @@ dependencies = [
[[package]]
name = "ctor"
version = "0.8.0"
version = "0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "352d39c2f7bef1d6ad73db6f5160efcaed66d94ef8c6c573a8410c00bf909a98"
checksum = "32a2785755761f3ddc1492979ce1e48d2c00d09311c39e4466429188f3dd6501"
dependencies = [
"ctor-proc-macro",
"dtor",
"quote",
"syn 2.0.117",
]
[[package]]
name = "ctor-proc-macro"
version = "0.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52560adf09603e58c9a7ee1fe1dcb95a16927b17c127f0ac02d6e768a0e25bc1"
[[package]]
name = "darling"
version = "0.21.3"
@@ -912,27 +896,6 @@ dependencies = [
"syn 2.0.117",
]
[[package]]
name = "derive_more"
version = "2.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134"
dependencies = [
"derive_more-impl",
]
[[package]]
name = "derive_more-impl"
version = "2.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb"
dependencies = [
"proc-macro2",
"quote",
"rustc_version",
"syn 2.0.117",
]
[[package]]
name = "digest"
version = "0.10.7"
@@ -972,9 +935,15 @@ dependencies = [
"libc",
"option-ext",
"redox_users",
"windows-sys 0.59.0",
"windows-sys 0.61.2",
]
[[package]]
name = "dispatch"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b"
[[package]]
name = "dispatch2"
version = "0.3.1"
@@ -1039,21 +1008,6 @@ dependencies = [
"litrs",
]
[[package]]
name = "dom_query"
version = "0.27.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "521e380c0c8afb8d9a1e83a1822ee03556fc3e3e7dbc1fd30be14e37f9cb3f89"
dependencies = [
"bit-set",
"cssparser 0.36.0",
"foldhash 0.2.0",
"html5ever 0.38.0",
"precomputed-hash",
"selectors 0.36.1",
"tendril 0.5.0",
]
[[package]]
name = "dpi"
version = "0.1.2"
@@ -1078,21 +1032,6 @@ dependencies = [
"dtoa",
]
[[package]]
name = "dtor"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1057d6c64987086ff8ed0fd3fbf377a6b7d205cc7715868cd401705f715cbe4"
dependencies = [
"dtor-proc-macro",
]
[[package]]
name = "dtor-proc-macro"
version = "0.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f678cf4a922c215c63e0de95eb1ff08a958a81d47e485cf9da1e27bf6305cfa5"
[[package]]
name = "dunce"
version = "1.0.5"
@@ -1195,7 +1134,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
dependencies = [
"libc",
"windows-sys 0.59.0",
"windows-sys 0.61.2",
]
[[package]]
@@ -1281,12 +1220,6 @@ version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2"
[[package]]
name = "foldhash"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb"
[[package]]
name = "foreign-types"
version = "0.5.0"
@@ -1780,7 +1713,7 @@ version = "0.15.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1"
dependencies = [
"foldhash 0.1.5",
"foldhash",
]
[[package]]
@@ -1821,20 +1754,10 @@ checksum = "3b7410cae13cbc75623c98ac4cbfd1f0bedddf3227afc24f370cf0f50a44a11c"
dependencies = [
"log",
"mac",
"markup5ever 0.14.1",
"markup5ever",
"match_token",
]
[[package]]
name = "html5ever"
version = "0.38.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1054432bae2f14e0061e33d23402fbaa67a921d319d56adc6bcf887ddad1cbc2"
dependencies = [
"log",
"markup5ever 0.38.0",
]
[[package]]
name = "http"
version = "1.4.0"
@@ -1966,7 +1889,7 @@ dependencies = [
"js-sys",
"log",
"wasm-bindgen",
"windows-core 0.61.2",
"windows-core 0.62.2",
]
[[package]]
@@ -2283,12 +2206,18 @@ version = "0.8.8-speedreader"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "02cb977175687f33fa4afa0c95c112b987ea1443e5a51c8f8ff27dc618270cc2"
dependencies = [
"cssparser 0.29.6",
"html5ever 0.29.1",
"cssparser",
"html5ever",
"indexmap 2.13.0",
"selectors 0.24.0",
"selectors",
]
[[package]]
name = "lazy_static"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
[[package]]
name = "leb128fmt"
version = "0.1.0"
@@ -2413,20 +2342,9 @@ dependencies = [
"log",
"phf 0.11.3",
"phf_codegen 0.11.3",
"string_cache 0.8.9",
"string_cache_codegen 0.5.4",
"tendril 0.4.3",
]
[[package]]
name = "markup5ever"
version = "0.38.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8983d30f2915feeaaab2d6babdd6bc7e9ed1a00b66b5e6d74df19aa9c0e91862"
dependencies = [
"log",
"tendril 0.5.0",
"web_atoms",
"string_cache",
"string_cache_codegen",
"tendril",
]
[[package]]
@@ -2762,6 +2680,16 @@ dependencies = [
"objc2-core-foundation",
]
[[package]]
name = "objc2-javascript-core"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a1e6550c4caed348956ce3370c9ffeca70bb1dbed4fa96112e7c6170e074586"
dependencies = [
"objc2",
"objc2-core-foundation",
]
[[package]]
name = "objc2-pdf-kit"
version = "0.3.2"
@@ -2788,6 +2716,17 @@ dependencies = [
"objc2-foundation",
]
[[package]]
name = "objc2-security"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "709fe137109bd1e8b5a99390f77a7d8b2961dafc1a1c5db8f2e60329ad6d895a"
dependencies = [
"bitflags 2.11.0",
"objc2",
"objc2-core-foundation",
]
[[package]]
name = "objc2-ui-kit"
version = "0.3.2"
@@ -2812,6 +2751,8 @@ dependencies = [
"objc2-app-kit",
"objc2-core-foundation",
"objc2-foundation",
"objc2-javascript-core",
"objc2-security",
]
[[package]]
@@ -2871,7 +2812,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7d8fae84b431384b68627d0f9b3b1245fcf9f46f6c0e3dc902e9dce64edd1967"
dependencies = [
"libc",
"windows-sys 0.59.0",
"windows-sys 0.61.2",
]
[[package]]
@@ -2970,17 +2911,6 @@ dependencies = [
"phf_shared 0.11.3",
]
[[package]]
name = "phf"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf"
dependencies = [
"phf_macros 0.13.1",
"phf_shared 0.13.1",
"serde",
]
[[package]]
name = "phf_codegen"
version = "0.8.0"
@@ -3001,16 +2931,6 @@ dependencies = [
"phf_shared 0.11.3",
]
[[package]]
name = "phf_codegen"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49aa7f9d80421bca176ca8dbfebe668cc7a2684708594ec9f3c0db0805d5d6e1"
dependencies = [
"phf_generator 0.13.1",
"phf_shared 0.13.1",
]
[[package]]
name = "phf_generator"
version = "0.8.0"
@@ -3041,16 +2961,6 @@ dependencies = [
"rand 0.8.5",
]
[[package]]
name = "phf_generator"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737"
dependencies = [
"fastrand",
"phf_shared 0.13.1",
]
[[package]]
name = "phf_macros"
version = "0.10.0"
@@ -3078,19 +2988,6 @@ dependencies = [
"syn 2.0.117",
]
[[package]]
name = "phf_macros"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "812f032b54b1e759ccd5f8b6677695d5268c588701effba24601f6932f8269ef"
dependencies = [
"phf_generator 0.13.1",
"phf_shared 0.13.1",
"proc-macro2",
"quote",
"syn 2.0.117",
]
[[package]]
name = "phf_shared"
version = "0.8.0"
@@ -3118,15 +3015,6 @@ dependencies = [
"siphasher 1.0.2",
]
[[package]]
name = "phf_shared"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266"
dependencies = [
"siphasher 1.0.2",
]
[[package]]
name = "pin-project-lite"
version = "0.2.17"
@@ -3637,7 +3525,7 @@ dependencies = [
"base64 0.22.1",
"bytes",
"cookie",
"cookie_store",
"cookie_store 0.22.1",
"encoding_rs",
"futures-core",
"h2",
@@ -3824,7 +3712,7 @@ dependencies = [
"errno",
"libc",
"linux-raw-sys",
"windows-sys 0.59.0",
"windows-sys 0.61.2",
]
[[package]]
@@ -4010,33 +3898,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c37578180969d00692904465fb7f6b3d50b9a2b952b87c23d0e2e5cb5013416"
dependencies = [
"bitflags 1.3.2",
"cssparser 0.29.6",
"derive_more 0.99.20",
"cssparser",
"derive_more",
"fxhash",
"log",
"phf 0.8.0",
"phf_codegen 0.8.0",
"precomputed-hash",
"servo_arc 0.2.0",
"smallvec",
]
[[package]]
name = "selectors"
version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c5d9c0c92a92d33f08817311cf3f2c29a3538a8240e94a6a3c622ce652d7e00c"
dependencies = [
"bitflags 2.11.0",
"cssparser 0.36.0",
"derive_more 2.1.1",
"log",
"new_debug_unreachable",
"phf 0.13.1",
"phf_codegen 0.13.1",
"precomputed-hash",
"rustc-hash",
"servo_arc 0.4.3",
"servo_arc",
"smallvec",
]
@@ -4220,15 +4089,6 @@ dependencies = [
"stable_deref_trait",
]
[[package]]
name = "servo_arc"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "170fb83ab34de17dc69aa7c67482b22218ddb85da56546f9bd6b929e32a05930"
dependencies = [
"stable_deref_trait",
]
[[package]]
name = "sha2"
version = "0.10.9"
@@ -4450,18 +4310,6 @@ dependencies = [
"serde",
]
[[package]]
name = "string_cache"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a18596f8c785a729f2819c0f6a7eae6ebeebdfffbfe4214ae6b087f690e31901"
dependencies = [
"new_debug_unreachable",
"parking_lot",
"phf_shared 0.13.1",
"precomputed-hash",
]
[[package]]
name = "string_cache_codegen"
version = "0.5.4"
@@ -4474,18 +4322,6 @@ dependencies = [
"quote",
]
[[package]]
name = "string_cache_codegen"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "585635e46db231059f76c5849798146164652513eb9e8ab2685939dd90f29b69"
dependencies = [
"phf_generator 0.13.1",
"phf_shared 0.13.1",
"proc-macro2",
"quote",
]
[[package]]
name = "strsim"
version = "0.11.1"
@@ -4587,22 +4423,23 @@ dependencies = [
[[package]]
name = "tao"
version = "0.34.8"
version = "0.34.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9103edf55f2da3c82aea4c7fab7c4241032bfeea0e71fa557d98e00e7ce7cc20"
checksum = "f3a753bdc39c07b192151523a3f77cd0394aa75413802c883a0f6f6a0e5ee2e7"
dependencies = [
"bitflags 2.11.0",
"block2",
"core-foundation 0.10.1",
"core-graphics",
"crossbeam-channel",
"dispatch2",
"dispatch",
"dlopen2",
"dpi",
"gdkwayland-sys",
"gdkx11-sys",
"gtk",
"jni",
"lazy_static",
"libc",
"log",
"ndk",
@@ -4614,6 +4451,7 @@ dependencies = [
"once_cell",
"parking_lot",
"raw-window-handle",
"scopeguard",
"tao-macros",
"unicode-segmentation",
"url",
@@ -4648,9 +4486,9 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
[[package]]
name = "tauri"
version = "2.10.3"
version = "2.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da77cc00fb9028caf5b5d4650f75e31f1ef3693459dfca7f7e506d1ecef0ba2d"
checksum = "463ae8677aa6d0f063a900b9c41ecd4ac2b7ca82f0b058cc4491540e55b20129"
dependencies = [
"anyhow",
"bytes",
@@ -4699,9 +4537,9 @@ dependencies = [
[[package]]
name = "tauri-build"
version = "2.6.0"
version = "2.5.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "be9aa8c59a894f76c29a002501c589de5eb4987a5913d62a6e0a47f320901988"
checksum = "ca7bd893329425df750813e95bd2b643d5369d929438da96d5bbb7cc2c918f74"
dependencies = [
"anyhow",
"cargo_toml",
@@ -4715,14 +4553,15 @@ dependencies = [
"serde_json",
"tauri-utils",
"tauri-winres",
"toml 0.9.12+spec-1.1.0",
"walkdir",
]
[[package]]
name = "tauri-codegen"
version = "2.6.0"
version = "2.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3e4e8230d565106aa19dfbaa01a7ed01abf78047fe0577a83377224bd1bf20e"
checksum = "aac423e5859d9f9ccdd32e3cf6a5866a15bedbf25aa6630bcb2acde9468f6ae3"
dependencies = [
"base64 0.22.1",
"brotli",
@@ -4747,9 +4586,9 @@ dependencies = [
[[package]]
name = "tauri-macros"
version = "2.6.0"
version = "2.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc8de2cddbbc33dbdf4c84f170121886595efdbcc9cb4b3d76342b79d082cedc"
checksum = "1b6a1bd2861ff0c8766b1d38b32a6a410f6dc6532d4ef534c47cfb2236092f59"
dependencies = [
"heck 0.5.0",
"proc-macro2",
@@ -4778,9 +4617,9 @@ dependencies = [
[[package]]
name = "tauri-plugin-deep-link"
version = "2.4.9"
version = "2.4.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "70ee75bc5627f77bfdf40c913255ebc258117b10ebe2b2239a1a1cf40b0b58aa"
checksum = "94deb2e2e4641514ac496db2cddcfc850d6fc9d51ea17b82292a0490bd20ba5b"
dependencies = [
"dunce",
"plist",
@@ -4799,9 +4638,9 @@ dependencies = [
[[package]]
name = "tauri-plugin-dialog"
version = "2.7.0"
version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1fa4150c95ae391946cc8b8f905ab14797427caba3a8a2f79628e956da91809"
checksum = "9204b425d9be8d12aa60c2a83a289cf7d1caae40f57f336ed1155b3a5c0e359b"
dependencies = [
"log",
"raw-window-handle",
@@ -4817,15 +4656,13 @@ dependencies = [
[[package]]
name = "tauri-plugin-fs"
version = "2.5.0"
version = "2.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "36e1ec28b79f3d0683f4507e1615c36292c0ea6716668770d4396b9b39871ed8"
checksum = "ed390cc669f937afeb8b28032ce837bac8ea023d975a2e207375ec05afaf1804"
dependencies = [
"anyhow",
"dunce",
"glob",
"log",
"objc2-foundation",
"percent-encoding",
"schemars 0.8.22",
"serde",
@@ -4841,12 +4678,12 @@ dependencies = [
[[package]]
name = "tauri-plugin-http"
version = "2.5.8"
version = "2.5.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cfba7d4ec72763f9d1fdf73c217747f01e2c84b08b87a8cacd2f94f35853f84d"
checksum = "d8f069451c4e87e7e2636b7f065a4c52866c4ce5e60e2d53fa1038edb6d184dc"
dependencies = [
"bytes",
"cookie_store",
"cookie_store 0.21.1",
"data-url",
"http",
"regex",
@@ -4949,9 +4786,9 @@ dependencies = [
[[package]]
name = "tauri-plugin-single-instance"
version = "2.4.1"
version = "2.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a33a5b7d78f0dec4406b003ea87c40bf928d801b6fd9323a556172c91d8712c1"
checksum = "dc61e4822b8f74d68278e09161d3e3fdd1b14b9eb781e24edccaabf10c420e8c"
dependencies = [
"serde",
"serde_json",
@@ -4996,9 +4833,9 @@ dependencies = [
[[package]]
name = "tauri-runtime"
version = "2.10.1"
version = "2.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2826d79a3297ed08cd6ea7f412644ef58e32969504bc4fbd8d7dbeabc4445ea2"
checksum = "b885ffeac82b00f1f6fd292b6e5aabfa7435d537cef57d11e38a489956535651"
dependencies = [
"cookie",
"dpi",
@@ -5021,9 +4858,9 @@ dependencies = [
[[package]]
name = "tauri-runtime-wry"
version = "2.10.1"
version = "2.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e11ea2e6f801d275fdd890d6c9603736012742a1c33b96d0db788c9cdebf7f9e"
checksum = "5204682391625e867d16584fedc83fc292fb998814c9f7918605c789cd876314"
dependencies = [
"gtk",
"http",
@@ -5031,6 +4868,7 @@ dependencies = [
"log",
"objc2",
"objc2-app-kit",
"objc2-foundation",
"once_cell",
"percent-encoding",
"raw-window-handle",
@@ -5047,18 +4885,17 @@ dependencies = [
[[package]]
name = "tauri-utils"
version = "2.9.0"
version = "2.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "55f61d2bf7188fbcf2b0ed095b67a6bc498f713c939314bb19eb700118a573b7"
checksum = "fcd169fccdff05eff2c1033210b9b94acd07a47e6fa9a3431cf09cfd4f01c87e"
dependencies = [
"anyhow",
"brotli",
"cargo_metadata",
"ctor",
"dom_query",
"dunce",
"glob",
"html5ever 0.29.1",
"html5ever",
"http",
"infer",
"json-patch",
@@ -5066,7 +4903,6 @@ dependencies = [
"log",
"memchr",
"phf 0.11.3",
"plist",
"proc-macro2",
"quote",
"regex",
@@ -5115,10 +4951,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "82a72c767771b47409d2345987fda8628641887d5466101319899796367354a0"
dependencies = [
"fastrand",
"getrandom 0.3.4",
"getrandom 0.4.1",
"once_cell",
"rustix",
"windows-sys 0.59.0",
"windows-sys 0.61.2",
]
[[package]]
@@ -5132,16 +4968,6 @@ dependencies = [
"utf-8",
]
[[package]]
name = "tendril"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c4790fc369d5a530f4b544b094e31388b9b3a37c0f4652ade4505945f5660d24"
dependencies = [
"new_debug_unreachable",
"utf-8",
]
[[package]]
name = "thiserror"
version = "1.0.69"
@@ -5872,18 +5698,6 @@ dependencies = [
"wasm-bindgen",
]
[[package]]
name = "web_atoms"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d7cff6eef815df1834fd250e3a2ff436044d82a9f1bc1980ca1dbdf07effc538"
dependencies = [
"phf 0.13.1",
"phf_codegen 0.13.1",
"string_cache 0.9.0",
"string_cache_codegen 0.6.1",
]
[[package]]
name = "webkit2gtk"
version = "2.0.2"
@@ -5995,7 +5809,7 @@ version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
dependencies = [
"windows-sys 0.59.0",
"windows-sys 0.61.2",
]
[[package]]
@@ -6041,6 +5855,19 @@ dependencies = [
"windows-core 0.61.2",
]
[[package]]
name = "windows-core"
version = "0.61.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3"
dependencies = [
"windows-implement",
"windows-interface",
"windows-link 0.1.3",
"windows-result 0.3.4",
"windows-strings 0.4.2",
]
[[package]]
name = "windows-core"
version = "0.62.2"
@@ -6540,23 +6367,24 @@ checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9"
[[package]]
name = "wry"
version = "0.54.4"
version = "0.54.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5a8135d8676225e5744de000d4dff5a082501bf7db6a1c1495034f8c314edbc"
checksum = "bb26159b420aa77684589a744ae9a9461a95395b848764ad12290a14d960a11a"
dependencies = [
"base64 0.22.1",
"block2",
"cookie",
"crossbeam-channel",
"dirs",
"dom_query",
"dpi",
"dunce",
"gdkx11",
"gtk",
"html5ever",
"http",
"javascriptcore-rs",
"jni",
"kuchikiki",
"libc",
"ndk",
"objc2",
+5 -5
View File
@@ -24,13 +24,13 @@ tauri-build = { version = "2.5.3", features = [] }
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
log = "0.4"
tauri = { version = "2.10.3", features = [ "devtools"] }
tauri = { version = "2.10.1", features = [ "devtools"] }
tauri-plugin-log = "2.8.0"
tauri-plugin-shell = "2.3.4"
tauri-plugin-fs = "2.5.0"
tauri-plugin-dialog = "2.7.0"
tauri-plugin-http = { version = "2.5.8", features = ["dangerous-settings"] }
tauri-plugin-single-instance = { version = "2.4.1", features = ["deep-link"] }
tauri-plugin-fs = "2.4.5"
tauri-plugin-dialog = "2.4.2"
tauri-plugin-http = { version = "2.5.6", features = ["dangerous-settings"] }
tauri-plugin-single-instance = { version = "2.3.7", features = ["deep-link"] }
tauri-plugin-store = "2.4.2"
tauri-plugin-opener = "2.5.3"
tauri-plugin-deep-link = "2.4.6"
+40 -102
View File
@@ -13,7 +13,6 @@ const STORE_FILE: &str = "connection.json";
const USER_INFO_KEY: &str = "user_info";
const TOKENS_STORE_FILE: &str = "tokens.json";
const REFRESH_TOKEN_STORE_KEY: &str = "refresh_token";
const AUTH_TOKEN_STORE_KEY: &str = "auth_token";
const KEYRING_SERVICE: &str = "stirling-pdf";
const KEYRING_TOKEN_KEY: &str = "auth-token";
const KEYRING_REFRESH_TOKEN_KEY: &str = "refresh-token";
@@ -41,134 +40,73 @@ fn get_refresh_token_keyring_entry() -> Result<Entry, String> {
}
#[tauri::command]
pub async fn save_auth_token(app_handle: AppHandle, token: String) -> Result<(), String> {
pub async fn save_auth_token(_app_handle: AppHandle, token: String) -> Result<(), String> {
let trimmed = token.trim();
if trimmed.is_empty() {
log::warn!("Attempted to save empty auth token");
return Err("Token cannot be empty".to_string());
}
let entry = get_keyring_entry()?;
if trimmed.len() != token.len() {
log::debug!("Auth token had surrounding whitespace; storing trimmed token");
}
// Try keyring first (works in environments where Credential Manager persists writes).
// Any failure - including entry creation - falls through to the Tauri Store fallback
// below, never an early return, so restricted environments still persist the token.
match get_keyring_entry() {
Ok(entry) => match entry.set_password(trimmed) {
Ok(_) => {
// Verify it persists. On managed Win10 Pro environments (GPO restricting
// Credential Manager, AV/EDR rules, roaming-profile DPAPI quirks) the
// read-back can return the wrong value or NoEntry even when set succeeded.
match entry.get_password() {
Ok(saved) if saved == trimmed => {
// Clear any stale fallback copy so the keyring stays authoritative.
if let Ok(store) = app_handle.store(TOKENS_STORE_FILE) {
if store.get(AUTH_TOKEN_STORE_KEY).is_some() {
store.delete(AUTH_TOKEN_STORE_KEY);
let _ = store.save();
}
}
log::info!("Auth token saved to keyring");
return Ok(());
}
_ => {
log::info!("Keyring did not persist auth token - using Tauri Store fallback");
}
}
entry
.set_password(trimmed)
.map_err(|e| {
log::error!("Failed to set password in keyring: {}", e);
format!("Failed to save token to keyring: {}", e)
})?;
// Verify the save worked
match entry.get_password() {
Ok(retrieved_token) => {
if retrieved_token != trimmed {
log::error!("Token verification failed: Retrieved token doesn't match");
return Err("Token verification failed after save".to_string());
}
Err(e) => {
log::info!("Keyring set failed for auth token: {} - using Tauri Store fallback", e);
}
},
}
Err(e) => {
log::info!("Keyring entry unavailable for auth token: {} - using Tauri Store fallback", e);
log::error!("Token verification failed: {}", e);
return Err(format!("Token verification failed: {}", e));
}
}
// Fallback to Tauri Store (same pattern as save_refresh_token)
let store = app_handle
.store(TOKENS_STORE_FILE)
.map_err(|e| format!("Failed to access tokens store: {}", e))?;
store.set(
AUTH_TOKEN_STORE_KEY,
serde_json::to_value(trimmed)
.map_err(|e| format!("Failed to serialize token: {}", e))?,
);
store
.save()
.map_err(|e| format!("Failed to save tokens store: {}", e))?;
log::info!("Auth token saved to Tauri Store (fallback)");
Ok(())
}
#[tauri::command]
pub async fn get_auth_token(app_handle: AppHandle) -> Result<Option<String>, String> {
// Try keyring first (production / unrestricted environments). Any failure -
// including entry creation - falls through to the Tauri Store fallback below.
match get_keyring_entry() {
Ok(entry) => match entry.get_password() {
Ok(token) => return Ok(Some(token)),
Err(keyring::Error::NoEntry) => {
log::debug!("No auth token in keyring, trying Tauri Store");
}
Err(e) => {
log::warn!("Keyring error reading auth token: {} - trying Tauri Store", e);
}
},
pub async fn get_auth_token(_app_handle: AppHandle) -> Result<Option<String>, String> {
let entry = get_keyring_entry()?;
match entry.get_password() {
Ok(token) => Ok(Some(token)),
Err(keyring::Error::NoEntry) => Ok(None),
Err(e) => {
log::warn!("Keyring entry unavailable for auth token: {} - trying Tauri Store", e);
}
log::error!("Failed to retrieve token from keyring: {}", e);
Err(format!("Failed to retrieve token: {}", e))
},
}
// Fallback to Tauri Store
let store = app_handle
.store(TOKENS_STORE_FILE)
.map_err(|e| format!("Failed to access tokens store: {}", e))?;
let token: Option<String> = store
.get(AUTH_TOKEN_STORE_KEY)
.and_then(|v| serde_json::from_value(v.clone()).ok());
Ok(token)
}
#[tauri::command]
pub async fn clear_auth_token(app_handle: AppHandle) -> Result<(), String> {
// Clear from keyring (best-effort). Entry creation failure must not block clearing
// the disk fallback, otherwise a stale fallback token could survive sign-out.
match get_keyring_entry() {
Ok(entry) => match entry.delete_credential() {
Ok(_) | Err(keyring::Error::NoEntry) => {}
Err(e) => {
log::warn!("Failed to delete keyring credential: {}. Attempting overwrite with empty token.", e);
// Overwrite with an empty token so a stale value cannot be reused
if let Err(e2) = entry.set_password("") {
log::warn!("Failed to overwrite keyring auth token: {}", e2);
}
pub async fn clear_auth_token(_app_handle: AppHandle) -> Result<(), String> {
let entry = get_keyring_entry()?;
// Delete the token - ignore error if it doesn't exist
match entry.delete_credential() {
Ok(_) | Err(keyring::Error::NoEntry) => Ok(()),
Err(e) => {
log::warn!("Failed to delete keyring credential: {}. Attempting overwrite with empty token.", e);
// As a fallback, overwrite with an empty token so a stale value cannot be reused
match entry.set_password("") {
Ok(_) => Ok(()),
Err(e2) => Err(format!("Failed to clear token (delete + overwrite failed): {}", e2)),
}
},
Err(e) => {
log::warn!("Keyring entry unavailable while clearing auth token: {} - clearing Tauri Store fallback only", e);
}
}
// Clear from Tauri Store fallback
let store = app_handle
.store(TOKENS_STORE_FILE)
.map_err(|e| format!("Failed to access tokens store: {}", e))?;
store.delete(AUTH_TOKEN_STORE_KEY);
store
.save()
.map_err(|e| format!("Failed to save tokens store: {}", e))?;
Ok(())
}
#[tauri::command]
+1 -1
View File
@@ -1,7 +1,7 @@
{
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
"productName": "Stirling-PDF",
"version": "2.10.1",
"version": "2.10.0",
"identifier": "stirling.pdf.dev",
"build": {
"frontendDist": "../dist",
+2 -1
View File
@@ -16,7 +16,8 @@ export function AppLayout({ children }: AppLayoutProps) {
return (
<>
<style>{`
.h-screen {
.h-screen,
.right-rail {
height: 100% !important;
}
`}</style>
@@ -17,7 +17,7 @@ import {
AppConfigRetryOptions,
useAppConfig,
} from "@app/contexts/AppConfigContext";
import { WorkbenchBarProvider } from "@app/contexts/WorkbenchBarContext";
import { RightRailProvider } from "@app/contexts/RightRailContext";
import { ViewerProvider } from "@app/contexts/ViewerContext";
import { SignatureProvider } from "@app/contexts/SignatureContext";
import { AnnotationProvider } from "@app/contexts/AnnotationContext";
@@ -139,13 +139,13 @@ export function AppProviders({
<RedactionProvider>
<FormFillProvider>
<AnnotationProvider>
<WorkbenchBarProvider>
<RightRailProvider>
<TourOrchestrationProvider>
<AdminTourOrchestrationProvider>
{children}
</AdminTourOrchestrationProvider>
</TourOrchestrationProvider>
</WorkbenchBarProvider>
</RightRailProvider>
</AnnotationProvider>
</FormFillProvider>
</RedactionProvider>
@@ -1,9 +0,0 @@
import { StirlingFileStub } from "@app/types/fileContext";
interface FileEditorStatusDotProps {
file: StirlingFileStub;
}
export function FileEditorStatusDot(_props: FileEditorStatusDotProps) {
return null;
}
@@ -196,26 +196,6 @@
pointer-events: none;
}
.thumbBadgesRight {
position: absolute;
top: 6px;
right: 6px;
display: flex;
gap: 4px;
align-items: center;
z-index: 3;
pointer-events: auto;
}
.statusDot {
display: inline-block;
width: 8px;
height: 8px;
border-radius: 50%;
flex-shrink: 0;
box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.15);
}
.ownershipBadge {
background: var(--mantine-color-blue-6);
color: white;
@@ -41,10 +41,9 @@ import { PrivateContent } from "@app/components/shared/PrivateContent";
import UploadToServerModal from "@app/components/shared/UploadToServerModal";
import ShareFileModal from "@app/components/shared/ShareFileModal";
import { useAppConfig } from "@app/contexts/AppConfigContext";
import { truncateCenter } from "@app/utils/textUtils";
import { useFileThumbnail } from "@app/hooks/useFileThumbnail";
import DocumentThumbnail from "@app/components/shared/filePreview/DocumentThumbnail";
import { truncateCenter } from "@app/utils/textUtils";
import { FileEditorStatusDot } from "@app/components/fileEditor/FileEditorStatusDot";
interface FileEditorThumbnailProps {
file: StirlingFileStub;
@@ -304,7 +303,6 @@ const FileEditorThumbnail = ({
label: isPinned
? t("unpin", "Unpin File (replace after tool run)")
: t("pin", "Pin File (keep active after tool run)"),
dataTour: "file-card-pin",
onClick: (e) => {
e.stopPropagation();
if (actualFile) {
@@ -506,7 +504,7 @@ const FileEditorThumbnail = ({
}}
/>
{/* Badges — top-left: version, pin, ownership, encrypted */}
{/* Badges — visible on hover via CSS */}
<div className={styles.thumbBadges}>
<span className={styles.versionBadgeThumb}>
v{file.versionNumber}
@@ -543,8 +541,6 @@ const FileEditorThumbnail = ({
</Tooltip>
)}
</div>
<FileEditorStatusDot file={file} />
</div>
</div>
{/* end thumbUnit */}
@@ -0,0 +1,89 @@
import { useMemo } from "react";
import { useTranslation } from "react-i18next";
import {
useRightRailButtons,
RightRailButtonWithAction,
} from "@app/hooks/useRightRailButtons";
import LocalIcon from "@app/components/shared/LocalIcon";
interface FileEditorRightRailButtonsParams {
totalItems: number;
selectedCount: number;
onSelectAll: () => void;
onDeselectAll: () => void;
onCloseSelected: () => void;
}
export function useFileEditorRightRailButtons({
totalItems,
selectedCount,
onSelectAll,
onDeselectAll,
onCloseSelected,
}: FileEditorRightRailButtonsParams) {
const { t, i18n } = useTranslation();
const buttons = useMemo<RightRailButtonWithAction[]>(
() => [
{
id: "file-select-all",
icon: <LocalIcon icon="select-all" width="1.5rem" height="1.5rem" />,
tooltip: t("rightRail.selectAll", "Select All"),
ariaLabel:
typeof t === "function"
? t("rightRail.selectAll", "Select All")
: "Select All",
section: "top" as const,
order: 10,
disabled: totalItems === 0 || selectedCount === totalItems,
visible: totalItems > 0,
onClick: onSelectAll,
},
{
id: "file-deselect-all",
icon: (
<LocalIcon
icon="crop-square-outline"
width="1.5rem"
height="1.5rem"
/>
),
tooltip: t("rightRail.deselectAll", "Deselect All"),
ariaLabel:
typeof t === "function"
? t("rightRail.deselectAll", "Deselect All")
: "Deselect All",
section: "top" as const,
order: 20,
disabled: selectedCount === 0,
visible: totalItems > 0,
onClick: onDeselectAll,
},
{
id: "file-close-selected",
icon: <LocalIcon icon="close-rounded" width="1.5rem" height="1.5rem" />,
tooltip: t("rightRail.closeSelected", "Close Selected Files"),
ariaLabel:
typeof t === "function"
? t("rightRail.closeSelected", "Close Selected Files")
: "Close Selected Files",
section: "top" as const,
order: 30,
disabled: selectedCount === 0,
visible: totalItems > 0,
onClick: onCloseSelected,
},
],
[
t,
i18n.language,
totalItems,
selectedCount,
onSelectAll,
onDeselectAll,
onCloseSelected,
],
);
useRightRailButtons(buttons);
}
@@ -232,15 +232,12 @@ export default function Onboarding() {
loadSampleFile: tourOrch.loadSampleFile,
switchToActiveFiles: tourOrch.switchToActiveFiles,
pinFile: tourOrch.pinFile,
revealFileCardHoverMenu: tourOrch.revealFileCardHoverMenu,
modifyCropSettings: tourOrch.modifyCropSettings,
executeTool: tourOrch.executeTool,
openFilesModal,
openSettingsHelpSection: () =>
adminTourOrch.navigateToSection("help"),
},
}),
[t, tourOrch, adminTourOrch, closeFilesModal, openFilesModal],
[t, tourOrch, closeFilesModal, openFilesModal],
);
const whatsNewStepsConfig = useMemo(
@@ -256,6 +253,7 @@ export default function Onboarding() {
switchToViewer: tourOrch.switchToViewer,
switchToPageEditor: tourOrch.switchToPageEditor,
switchToActiveFiles: tourOrch.switchToActiveFiles,
selectFirstFile: tourOrch.selectFirstFile,
},
}),
[t, tourOrch, closeFilesModal, openFilesModal],
@@ -4,10 +4,6 @@ import {
addGlowToElements,
removeAllGlows,
} from "@app/components/onboarding/tourGlow";
import {
waitForElement,
waitForHighlightable,
} from "@app/components/onboarding/tourUtils";
export enum AdminTourStep {
WELCOME,
@@ -61,7 +57,7 @@ export function createAdminStepsConfig({
selector: '[data-tour="config-button"]',
content: t(
"adminOnboarding.configButton",
"Open <strong>Settings</strong> to access all system configuration and administrative controls.",
"Click the <strong>Config</strong> button to access all system settings and administrative controls.",
),
position: "right",
padding: 10,
@@ -208,18 +204,15 @@ export function createAdminStepsConfig({
},
},
[AdminTourStep.WRAP_UP]: {
selector: '[data-tour="admin-help-nav"]',
selector: '[data-tour="help-button"]',
content: t(
"adminOnboarding.wrapUp",
"That's the admin tour! You've seen the enterprise features that make Stirling PDF a powerful, customisable solution for organisations. You can replay it anytime — just open <strong>Settings</strong> and find it here in the <strong>Tours</strong> section under Help.",
"That's the admin tour! You've seen the enterprise features that make Stirling PDF a powerful, customisable solution for organisations. Access this tour anytime from the <strong>Help</strong> menu.",
),
position: "right",
padding: 10,
action: async () => {
action: () => {
removeAllGlows();
navigateToSection("help");
await waitForElement('[data-tour="admin-help-nav"]', 5000);
await waitForHighlightable('[data-tour="admin-help-nav"]', 5000);
},
},
};
@@ -1,110 +0,0 @@
/**
* Waits for a CSS selector to appear in the DOM using MutationObserver.
* Resolves immediately if already present; resolves after timeoutMs if it
* never appears (no throw — tour steps are best-effort).
*/
export function waitForElement(
selector: string,
timeoutMs = 7000,
): Promise<void> {
return new Promise((resolve) => {
if (typeof document === "undefined") {
resolve();
return;
}
if (document.querySelector(selector)) {
resolve();
return;
}
const observer = new MutationObserver(() => {
if (document.querySelector(selector)) {
clearTimeout(timer);
observer.disconnect();
resolve();
}
});
const timer = setTimeout(() => {
observer.disconnect();
resolve();
}, timeoutMs);
observer.observe(document.body, { childList: true, subtree: true });
});
}
const nudgeReactour = () => {
window.dispatchEvent(new Event("resize"));
requestAnimationFrame(() => window.dispatchEvent(new Event("resize")));
};
/**
* Waits for a CSS selector to be present AND have a non-zero bounding box,
* then nudges Reactour to recalculate its spotlight position.
*
* Uses MutationObserver to detect element insertion, then ResizeObserver to
* detect when the element receives layout dimensions.
*/
export function waitForHighlightable(
selector: string,
timeoutMs = 7000,
): Promise<void> {
return new Promise((resolve) => {
if (typeof document === "undefined") {
resolve();
return;
}
let mutationObserver: MutationObserver | null = null;
let resizeObserver: ResizeObserver | null = null;
const cleanup = () => {
mutationObserver?.disconnect();
resizeObserver?.disconnect();
};
const done = () => {
clearTimeout(timer);
cleanup();
nudgeReactour();
resolve();
};
const timer = setTimeout(done, timeoutMs);
const watchLayout = (el: HTMLElement) => {
if (el.getClientRects().length > 0) {
done();
return;
}
resizeObserver = new ResizeObserver((entries) => {
for (const entry of entries) {
if (entry.contentRect.width > 0 || entry.contentRect.height > 0) {
done();
return;
}
}
});
resizeObserver.observe(el);
};
const el = document.querySelector<HTMLElement>(selector);
if (el) {
watchLayout(el);
return;
}
mutationObserver = new MutationObserver(() => {
const found = document.querySelector<HTMLElement>(selector);
if (found) {
mutationObserver!.disconnect();
mutationObserver = null;
watchLayout(found);
}
});
mutationObserver.observe(document.body, { childList: true, subtree: true });
});
}
@@ -35,8 +35,13 @@ export function useOnboardingDownload(): UseOnboardingDownloadResult {
switch (osType) {
case "windows":
return { label: "Windows", url: DOWNLOAD_URLS.WINDOWS };
case "mac":
return { label: "Mac", url: DOWNLOAD_URLS.MAC };
case "mac-apple":
return {
label: "Mac (Apple Silicon)",
url: DOWNLOAD_URLS.MAC_APPLE_SILICON,
};
case "mac-intel":
return { label: "Mac (Intel)", url: DOWNLOAD_URLS.MAC_INTEL };
case "linux-x64":
case "linux-arm64":
return { label: "Linux", url: DOWNLOAD_URLS.LINUX_DOCS };
@@ -49,7 +54,16 @@ export function useOnboardingDownload(): UseOnboardingDownloadResult {
() =>
[
{ label: "Windows", url: DOWNLOAD_URLS.WINDOWS, value: "windows" },
{ label: "Mac", url: DOWNLOAD_URLS.MAC, value: "mac" },
{
label: "Mac (Apple Silicon)",
url: DOWNLOAD_URLS.MAC_APPLE_SILICON,
value: "mac-apple",
},
{
label: "Mac (Intel)",
url: DOWNLOAD_URLS.MAC_INTEL,
value: "mac-intel",
},
{ label: "Linux", url: DOWNLOAD_URLS.LINUX_DOCS, value: "linux" },
].filter((opt) => opt.url),
[],
@@ -1,9 +1,5 @@
import type { StepType } from "@reactour/tour";
import type { TFunction } from "i18next";
import {
waitForElement,
waitForHighlightable,
} from "@app/components/onboarding/tourUtils";
export enum TourStep {
ALL_TOOLS,
@@ -30,11 +26,9 @@ interface UserStepActions {
loadSampleFile: () => void;
switchToActiveFiles: () => void;
pinFile: () => void;
revealFileCardHoverMenu: () => void;
modifyCropSettings: () => void;
executeTool: () => void;
openFilesModal: () => void;
openSettingsHelpSection: () => void;
}
interface CreateUserStepsConfigArgs {
@@ -54,11 +48,9 @@ export function createUserStepsConfig({
loadSampleFile,
switchToActiveFiles,
pinFile,
revealFileCardHoverMenu,
modifyCropSettings,
executeTool,
openFilesModal,
openSettingsHelpSection,
} = actions;
return {
@@ -103,7 +95,7 @@ export function createUserStepsConfig({
),
position: "right",
padding: 10,
actionAfter: () => openFilesModal(),
action: () => openFilesModal(),
},
[TourStep.FILE_SOURCES]: {
selector: '[data-tour="file-sources"]',
@@ -113,10 +105,6 @@ export function createUserStepsConfig({
),
position: "right",
padding: 0,
action: async () => {
await waitForElement('[data-tour="file-sources"]', 5000);
await waitForHighlightable('[data-tour="file-sources"]', 5000);
},
actionAfter: () => {
loadSampleFile();
closeFilesModal();
@@ -196,22 +184,16 @@ export function createUserStepsConfig({
),
position: "left",
padding: 10,
action: () => revealFileCardHoverMenu(),
actionAfter: () => pinFile(),
action: () => pinFile(),
},
[TourStep.WRAP_UP]: {
selector: '[data-tour="admin-help-nav"]',
selector: '[data-tour="help-button"]',
content: t(
"onboarding.wrapUp",
"You're all set! You can replay this tour anytime — just open <strong>Settings</strong> and find it here in the <strong>Tours</strong> section under Help.",
"You're all set! You've learnt about the main areas of the app and how to use them. Click the <strong>Help</strong> button whenever you like to see this tour again.",
),
position: "right",
padding: 10,
action: async () => {
openSettingsHelpSection();
await waitForElement('[data-tour="admin-help-nav"]', 5000);
await waitForHighlightable('[data-tour="admin-help-nav"]', 5000);
},
},
};
}
@@ -1,14 +1,58 @@
import type { StepType } from "@reactour/tour";
import type { TFunction } from "i18next";
import {
waitForElement,
waitForHighlightable,
} from "@app/components/onboarding/tourUtils";
async function waitForElement(
selector: string,
timeoutMs = 7000,
intervalMs = 100,
): Promise<void> {
if (typeof document === "undefined") return;
const start = Date.now();
// Immediate hit
if (document.querySelector(selector)) return;
return new Promise((resolve) => {
const check = () => {
if (document.querySelector(selector) || Date.now() - start >= timeoutMs) {
resolve();
return;
}
setTimeout(check, intervalMs);
};
check();
});
}
async function waitForHighlightable(
selector: string,
timeoutMs = 7000,
intervalMs = 500,
): Promise<void> {
if (typeof document === "undefined") return;
const start = Date.now();
return new Promise((resolve) => {
const check = () => {
const el = document.querySelector<HTMLElement>(selector);
const isVisible = !!el && el.getClientRects().length > 0;
if (isVisible || Date.now() - start >= timeoutMs) {
// Nudge Reactour to recalc positions in case layout shifted
window.dispatchEvent(new Event("resize"));
requestAnimationFrame(() => window.dispatchEvent(new Event("resize")));
resolve();
return;
}
setTimeout(check, intervalMs);
};
check();
});
}
export enum WhatsNewTourStep {
QUICK_ACCESS,
LEFT_PANEL,
FILE_UPLOAD,
RIGHT_RAIL,
TOP_BAR,
PAGE_EDITOR_VIEW,
ACTIVE_FILES_VIEW,
@@ -24,6 +68,7 @@ interface WhatsNewStepActions {
switchToViewer: () => void;
switchToPageEditor: () => void;
switchToActiveFiles: () => void;
selectFirstFile: () => void;
}
interface CreateWhatsNewStepsConfigArgs {
@@ -44,6 +89,7 @@ export function createWhatsNewStepsConfig({
switchToViewer,
switchToPageEditor,
switchToActiveFiles,
selectFirstFile,
} = actions;
return {
@@ -78,15 +124,34 @@ export function createWhatsNewStepsConfig({
),
position: "right",
padding: 10,
actionAfter: async () => {
action: async () => {
openFilesModal();
await waitForElement('[data-tour="file-sources"]', 5000);
await waitForElement('[data-tour="file-sources"]', 5000, 100);
},
actionAfter: async () => {
await Promise.resolve(loadSampleFile());
closeFilesModal();
switchToViewer();
// wait for file render and top controls to mount
await waitForElement('[data-tour="view-switcher"]', 7000);
await waitForHighlightable('[data-tour="view-switcher"]', 7000);
await waitForElement('[data-tour="view-switcher"]', 7000, 100);
await waitForHighlightable('[data-tour="view-switcher"]', 7000, 500);
},
},
[WhatsNewTourStep.RIGHT_RAIL]: {
selector: '[data-tour="right-rail-controls"]',
highlightedSelectors: [
'[data-tour="right-rail-controls"]',
'[data-tour="right-rail-settings"]',
],
content: t(
"onboarding.whatsNew.rightRail",
"The <strong>Right Rail</strong> holds quick actions to select files, change theme or language, and download results.",
),
position: "left",
padding: 10,
action: async () => {
await waitForElement('[data-tour="right-rail-controls"]', 7000, 100);
selectFirstFile();
},
},
[WhatsNewTourStep.TOP_BAR]: {
@@ -100,8 +165,8 @@ export function createWhatsNewStepsConfig({
// Ensure the switcher has mounted before this step renders
action: async () => {
switchToViewer();
await waitForElement('[data-tour="view-switcher"]', 7000);
await waitForHighlightable('[data-tour="view-switcher"]', 7000);
await waitForElement('[data-tour="view-switcher"]', 7000, 100);
await waitForHighlightable('[data-tour="view-switcher"]', 7000, 500);
},
},
[WhatsNewTourStep.PAGE_EDITOR_VIEW]: {
@@ -114,8 +179,8 @@ export function createWhatsNewStepsConfig({
padding: 8,
action: async () => {
switchToPageEditor();
await waitForElement('[data-tour="view-switcher"]', 7000);
await waitForHighlightable('[data-tour="view-switcher"]', 7000);
await waitForElement('[data-tour="view-switcher"]', 7000, 100);
await waitForHighlightable('[data-tour="view-switcher"]', 7000, 500);
},
},
[WhatsNewTourStep.ACTIVE_FILES_VIEW]: {
@@ -128,8 +193,8 @@ export function createWhatsNewStepsConfig({
padding: 8,
action: async () => {
switchToActiveFiles();
await waitForElement('[data-tour="view-switcher"]', 7000);
await waitForHighlightable('[data-tour="view-switcher"]', 7000);
await waitForElement('[data-tour="view-switcher"]', 7000, 100);
await waitForHighlightable('[data-tour="view-switcher"]', 7000, 500);
},
},
[WhatsNewTourStep.WRAP_UP]: {
@@ -17,7 +17,7 @@ import { GRID_CONSTANTS } from "@app/components/pageEditor/constants";
import { useInitialPageDocument } from "@app/components/pageEditor/hooks/useInitialPageDocument";
import { usePageDocument } from "@app/components/pageEditor/hooks/usePageDocument";
import { usePageEditorState } from "@app/components/pageEditor/hooks/usePageEditorState";
import { usePageEditorWorkbenchBarButtons } from "@app/components/pageEditor/pageEditorWorkbenchBarButtons";
import { usePageEditorRightRailButtons } from "@app/components/pageEditor/pageEditorRightRailButtons";
import { useFileColorMap } from "@app/components/pageEditor/hooks/useFileColorMap";
import { useWheelZoom } from "@app/hooks/useWheelZoom";
import { useEditedDocumentState } from "@app/components/pageEditor/hooks/useEditedDocumentState";
@@ -458,10 +458,10 @@ const PageEditor = ({ onFunctionsReady }: PageEditorProps) => {
unregisterNavigationWarningHandlers,
]);
// Derived values for usePageEditorWorkbenchBarButtons (must be after displayDocument)
// Derived values for right rail and usePageEditorRightRailButtons (must be after displayDocument)
const selectedPageCount = selectedPageIds.length;
usePageEditorWorkbenchBarButtons({
usePageEditorRightRailButtons({
totalPages,
selectedPageCount,
csvInput,
@@ -25,6 +25,7 @@ interface PageEditorControlsProps {
onPageBreak: () => void;
onPageBreakAll: () => void;
// Export functions (moved to right rail)
onExportAll: () => void;
exportLoading: boolean;
@@ -137,7 +138,9 @@ const PageEditorControls = ({
disabled={!canUndo}
variant="subtle"
style={{
color: canUndo ? "var(--text-secondary)" : "var(--text-muted)",
color: canUndo
? "var(--right-rail-icon)"
: "var(--right-rail-icon-disabled)",
}}
radius="md"
size="lg"
@@ -151,7 +154,9 @@ const PageEditorControls = ({
disabled={!canRedo}
variant="subtle"
style={{
color: canRedo ? "var(--text-secondary)" : "var(--text-muted)",
color: canRedo
? "var(--right-rail-icon)"
: "var(--right-rail-icon-disabled)",
}}
radius="md"
size="lg"
@@ -178,8 +183,8 @@ const PageEditorControls = ({
style={{
color:
selectedPageIds.length > 0
? "var(--text-secondary)"
: "var(--text-muted)",
? "var(--right-rail-icon)"
: "var(--right-rail-icon-disabled)",
}}
radius="md"
size="lg"
@@ -195,8 +200,8 @@ const PageEditorControls = ({
style={{
color:
selectedPageIds.length > 0
? "var(--text-secondary)"
: "var(--text-muted)",
? "var(--right-rail-icon)"
: "var(--right-rail-icon-disabled)",
}}
radius="md"
size="lg"
@@ -212,8 +217,8 @@ const PageEditorControls = ({
style={{
color:
selectedPageIds.length > 0
? "var(--text-secondary)"
: "var(--text-muted)",
? "var(--right-rail-icon)"
: "var(--right-rail-icon-disabled)",
}}
radius="md"
size="lg"
@@ -229,8 +234,8 @@ const PageEditorControls = ({
style={{
color:
selectedPageIds.length > 0
? "var(--text-secondary)"
: "var(--text-muted)",
? "var(--right-rail-icon)"
: "var(--right-rail-icon-disabled)",
}}
radius="md"
size="lg"
@@ -246,8 +251,8 @@ const PageEditorControls = ({
style={{
color:
selectedPageIds.length > 0
? "var(--text-secondary)"
: "var(--text-muted)",
? "var(--right-rail-icon)"
: "var(--right-rail-icon-disabled)",
}}
radius="md"
size="lg"
@@ -32,13 +32,14 @@ export default function PageSelectByNumberButton({
arrow
portalTarget={document.body}
>
<div>
<div className={`right-rail-fade enter`}>
<Popover position="left" withArrow shadow="md" offset={8}>
<Popover.Target>
<div style={{ display: "inline-flex" }}>
<ActionIcon
variant="subtle"
radius="md"
className="right-rail-icon"
disabled={disabled || totalPages === 0}
aria-label={label}
>
@@ -88,6 +88,7 @@ const PageThumbnail: React.FC<PageThumbnailProps> = ({
onTogglePage,
onExecuteCommand,
onSetStatus,
onSetMovingPage,
onDeletePage,
createRotateCommand,
createSplitCommand,
@@ -327,8 +328,10 @@ const PageThumbnail: React.FC<PageThumbnailProps> = ({
label: "Move Left",
onClick: (e) => {
e.stopPropagation();
if (pageIndex > 0 && !isAnimating) {
if (pageIndex > 0 && !movingPage && !isAnimating) {
onSetMovingPage(page.pageNumber);
onReorderPages(page.pageNumber, pageIndex - 1);
setTimeout(() => onSetMovingPage(null), 650);
onSetStatus(`Moved page ${page.pageNumber} left`);
}
},
@@ -340,9 +343,13 @@ const PageThumbnail: React.FC<PageThumbnailProps> = ({
label: "Move Right",
onClick: (e) => {
e.stopPropagation();
if (pageIndex < totalPages - 1 && !isAnimating) {
// +2 compensates for ReorderPagesCommand's internal targetIndex - 1 adjustment.
if (pageIndex < totalPages - 1 && !movingPage && !isAnimating) {
onSetMovingPage(page.pageNumber);
// ReorderPagesCommand expects target index relative to the original array.
// When moving toward the right (higher index), provide desiredIndex + 1
// so the command's internal adjustment (targetIndex - 1) lands correctly.
onReorderPages(page.pageNumber, pageIndex + 2);
setTimeout(() => onSetMovingPage(null), 650);
onSetStatus(`Moved page ${page.pageNumber} right`);
}
},
@@ -384,6 +391,7 @@ const PageThumbnail: React.FC<PageThumbnailProps> = ({
[
pageIndex,
totalPages,
movingPage,
isAnimating,
page.pageNumber,
handleRotateLeft,
@@ -392,6 +400,7 @@ const PageThumbnail: React.FC<PageThumbnailProps> = ({
handleSplit,
handleInsertFileAfter,
onReorderPages,
onSetMovingPage,
onSetStatus,
],
);
@@ -232,7 +232,7 @@ export class ReorderPagesCommand extends DOMCommand {
);
if (sourceIndex === -1) return;
let reorderedPages: PDFPage[];
const newPages = [...currentDoc.pages];
if (
this.selectedPages &&
@@ -246,15 +246,19 @@ export class ReorderPagesCommand extends DOMCommand {
)
.filter((page) => page !== undefined) as PDFPage[];
const remainingPages = currentDoc.pages.filter(
const remainingPages = newPages.filter(
(page) => !this.selectedPages!.includes(page.pageNumber),
);
remainingPages.splice(this.targetIndex, 0, ...selectedPageObjects);
reorderedPages = remainingPages;
remainingPages.forEach((page, index) => {
page.pageNumber = index + 1;
});
newPages.splice(0, newPages.length, ...remainingPages);
} else {
// Single page reorder
const working = [...currentDoc.pages];
const [movedPage] = working.splice(sourceIndex, 1);
const [movedPage] = newPages.splice(sourceIndex, 1);
// Adjust target index if moving forward (after removal, indices shift)
const adjustedTargetIndex =
@@ -262,14 +266,12 @@ export class ReorderPagesCommand extends DOMCommand {
? this.targetIndex - 1
: this.targetIndex;
working.splice(adjustedTargetIndex, 0, movedPage);
reorderedPages = working;
}
newPages.splice(adjustedTargetIndex, 0, movedPage);
const newPages = reorderedPages.map((page, index) => ({
...page,
pageNumber: index + 1,
}));
newPages.forEach((page, index) => {
page.pageNumber = index + 1;
});
}
const reorderedDocument: PDFDocument = {
...currentDoc,
@@ -1,13 +1,13 @@
import { useMemo } from "react";
import { useTranslation } from "react-i18next";
import {
useWorkbenchBarButtons,
WorkbenchBarButtonWithAction,
} from "@app/hooks/useWorkbenchBarButtons";
useRightRailButtons,
RightRailButtonWithAction,
} from "@app/hooks/useRightRailButtons";
import LocalIcon from "@app/components/shared/LocalIcon";
import PageSelectByNumberButton from "@app/components/pageEditor/PageSelectByNumberButton";
interface PageEditorWorkbenchBarButtonsParams {
interface PageEditorRightRailButtonsParams {
totalPages: number;
selectedPageCount: number;
csvInput: string;
@@ -23,8 +23,8 @@ interface PageEditorWorkbenchBarButtonsParams {
exportLoading: boolean;
}
export function usePageEditorWorkbenchBarButtons(
params: PageEditorWorkbenchBarButtonsParams,
export function usePageEditorRightRailButtons(
params: PageEditorRightRailButtonsParams,
) {
const {
totalPages,
@@ -45,22 +45,22 @@ export function usePageEditorWorkbenchBarButtons(
const { t, i18n } = useTranslation();
// Lift i18n labels out of memo for clarity
const selectAllLabel = t("workbenchBar.selectAll", "Select All");
const deselectAllLabel = t("workbenchBar.deselectAll", "Deselect All");
const selectAllLabel = t("rightRail.selectAll", "Select All");
const deselectAllLabel = t("rightRail.deselectAll", "Deselect All");
const selectByNumberLabel = t(
"workbenchBar.selectByNumber",
"rightRail.selectByNumber",
"Select by Page Numbers",
);
const deleteSelectedLabel = t(
"workbenchBar.deleteSelected",
"rightRail.deleteSelected",
"Delete Selected Pages",
);
const exportSelectedLabel = t(
"workbenchBar.exportSelected",
"rightRail.exportSelected",
"Export Selected Pages",
);
const saveChangesLabel = t("workbenchBar.saveChanges", "Save Changes");
const buttons = useMemo<WorkbenchBarButtonWithAction[]>(() => {
const saveChangesLabel = t("rightRail.saveChanges", "Save Changes");
const buttons = useMemo<RightRailButtonWithAction[]>(() => {
return [
{
id: "page-select-all",
@@ -175,5 +175,5 @@ export function usePageEditorWorkbenchBarButtons(
exportLoading,
]);
useWorkbenchBarButtons(buttons);
useRightRailButtons(buttons);
}
@@ -0,0 +1,9 @@
interface RightRailFooterExtensionsProps {
className?: string;
}
export function RightRailFooterExtensions(
_props: RightRailFooterExtensionsProps,
) {
return null;
}
@@ -108,26 +108,11 @@ const AppConfigModalInner: React.FC<AppConfigModalProps> = ({
const runningEE = config?.runningEE ?? false;
const loginEnabled = config?.enableLogin ?? false;
const handleClose = useCallback(async () => {
const canProceed = await confirmIfDirty();
if (!canProceed) return;
// Navigate back to home when closing modal
navigate("/", { replace: true });
onClose();
}, [confirmIfDirty, navigate, onClose]);
// Synchronous wrapper for contexts (e.g. tour buttons) that need () => void
const handleCloseSync = useCallback(() => {
void handleClose();
}, [handleClose]);
// Left navigation structure and icons
const configNavSections = useConfigNavSections(
isAdmin,
runningEE,
loginEnabled,
handleCloseSync,
);
const activeLabel = useMemo(() => {
@@ -146,6 +131,15 @@ const AppConfigModalInner: React.FC<AppConfigModalProps> = ({
return null;
}, [configNavSections, active]);
const handleClose = useCallback(async () => {
const canProceed = await confirmIfDirty();
if (!canProceed) return;
// Navigate back to home when closing modal
navigate("/", { replace: true });
onClose();
}, [confirmIfDirty, navigate, onClose]);
const handleNavigation = useCallback(
async (key: NavKey) => {
const canProceed = await confirmIfDirty();
@@ -51,7 +51,7 @@ export const FileDropdownMenu: React.FC<FileDropdownMenuProps> = ({
</Menu.Target>
<Menu.Dropdown
style={{
backgroundColor: "var(--bg-file-manager)",
backgroundColor: "var(--right-rail-bg)",
border: "1px solid var(--border-subtle)",
borderRadius: "8px",
boxShadow: "0 2px 8px rgba(0, 0, 0, 0.15)",
@@ -5,7 +5,7 @@
border-right: 1px solid var(--border-subtle);
display: flex;
flex-direction: column;
height: 100%;
height: 100vh;
position: relative;
z-index: 10;
transition:
@@ -316,7 +316,6 @@ const FileSidebar = forwardRef<HTMLDivElement, FileSidebarProps>(
style={{ width, minWidth: width, maxWidth: width }}
data-collapsed={collapsed}
data-sidebar="file-sidebar"
data-tour="quick-access-bar"
>
<div className="file-sidebar-inner">
{/* Header: hamburger + branding */}
@@ -393,7 +392,6 @@ const FileSidebar = forwardRef<HTMLDivElement, FileSidebarProps>(
<div
className="file-sidebar-action-row"
data-testid="files-button"
data-tour="files-button"
onClick={() => {
if (collapsed && onToggleCollapse) onToggleCollapse();
openFilesModal();
@@ -557,7 +555,6 @@ const FileSidebar = forwardRef<HTMLDivElement, FileSidebarProps>(
: undefined
}
data-testid={onOpenSettings ? "config-button" : undefined}
data-tour={onOpenSettings ? "config-button" : undefined}
aria-label={
onOpenSettings
? t("fileSidebar.openSettings", "Open settings")
@@ -11,7 +11,6 @@ export interface HoverAction {
disabled?: boolean;
color?: string;
hidden?: boolean;
dataTour?: string;
}
interface HoverActionMenuProps {
@@ -64,8 +63,7 @@ const HoverActionMenu: React.FC<HoverActionMenuProps> = ({
disabled={action.disabled}
onClick={action.onClick}
c={action.color}
style={{ color: action.color || "var(--text-secondary)" }}
data-tour={action.dataTour}
style={{ color: action.color || "var(--right-rail-icon)" }}
>
{action.icon}
</ActionIcon>
@@ -97,11 +97,7 @@ export const InfoBanner: React.FC<InfoBannerProps> = ({
radius={0}
style={{
background: background ?? toneStyle.background,
border: "none",
borderBottom:
borderColor === "transparent"
? "none"
: `1px solid ${borderColor ?? toneStyle.border}`,
borderBottom: `1px solid ${borderColor ?? toneStyle.border}`,
minHeight,
display: "flex",
alignItems: "center",
@@ -274,11 +274,12 @@ const LanguageSelector: React.FC<LanguageSelectorProps> = ({
<ActionIcon
variant="subtle"
radius="md"
className="right-rail-icon"
data-testid="language-selector-button"
title={!opened && tooltip ? tooltip : undefined}
styles={{
root: {
color: "var(--text-secondary)",
color: "var(--right-rail-icon)",
"&:hover": {
backgroundColor:
"light-dark(var(--mantine-color-gray-1), var(--mantine-color-dark-5))",
@@ -197,7 +197,7 @@ export const PageEditorFileDropdown: React.FC<PageEditorFileDropdownProps> = ({
<Menu.Dropdown
className="ph-no-capture"
style={{
backgroundColor: "var(--bg-file-manager)",
backgroundColor: "var(--right-rail-bg)",
border: "1px solid var(--border-subtle)",
borderRadius: "8px",
boxShadow: "0 2px 8px rgba(0, 0, 0, 0.15)",
@@ -0,0 +1,375 @@
import React, { useCallback, useMemo } from "react";
import { ActionIcon, Divider } from "@mantine/core";
import "@app/components/shared/rightRail/RightRail.css";
import { useToolWorkflow } from "@app/contexts/ToolWorkflowContext";
import { useRightRail } from "@app/contexts/RightRailContext";
import {
useFileState,
useFileSelection,
useFileActions,
} from "@app/contexts/FileContext";
import { isStirlingFile } from "@app/types/fileContext";
import { useNavigationState } from "@app/contexts/NavigationContext";
import { useTranslation } from "react-i18next";
import { useFileActionTerminology } from "@app/hooks/useFileActionTerminology";
import { useFileActionIcons } from "@app/hooks/useFileActionIcons";
import LanguageSelector from "@app/components/shared/LanguageSelector";
import { useRainbowThemeContext } from "@app/components/shared/RainbowThemeProvider";
import { Tooltip } from "@app/components/shared/Tooltip";
import { ViewerContext } from "@app/contexts/ViewerContext";
import LocalIcon from "@app/components/shared/LocalIcon";
import { RightRailFooterExtensions } from "@app/components/rightRail/RightRailFooterExtensions";
import DarkModeIcon from "@mui/icons-material/DarkMode";
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";
import { downloadFile } from "@app/services/downloadService";
const SECTION_ORDER: RightRailSection[] = ["top", "middle", "bottom"];
function renderWithTooltip(
node: React.ReactNode,
tooltip: React.ReactNode | undefined,
position: "left" | "right" | "bottom",
offset: number,
) {
if (!tooltip) return node;
const portalTarget =
typeof document !== "undefined" ? document.body : undefined;
return (
<Tooltip
content={tooltip}
position={position}
offset={offset}
arrow
portalTarget={portalTarget}
>
<div className="right-rail-tooltip-wrapper">{node}</div>
</Tooltip>
);
}
export default function RightRail() {
const { sidebarRefs } = useSidebarContext();
const { position: tooltipPosition, offset: tooltipOffset } =
useRightRailTooltipSide(sidebarRefs);
const { t } = useTranslation();
const terminology = useFileActionTerminology();
const icons = useFileActionIcons();
const viewerContext = React.useContext(ViewerContext);
const { toggleTheme, themeMode } = useRainbowThemeContext();
const { buttons, actions, allButtonsDisabled } = useRightRail();
const { pageEditorFunctions, toolPanelMode, leftPanelView } =
useToolWorkflow();
const disableForFullscreen =
toolPanelMode === "fullscreen" && leftPanelView === "toolPicker";
const { workbench: currentView } = useNavigationState();
const { selectors } = useFileState();
const { selectedFiles, selectedFileIds } = useFileSelection();
const { actions: fileActions } = useFileActions();
const activeFiles = selectors.getFiles();
const pageEditorTotalPages = pageEditorFunctions?.totalPages ?? 0;
const pageEditorSelectedCount =
pageEditorFunctions?.selectedPageIds?.length ?? 0;
const totalItems = useMemo(() => {
if (currentView === "pageEditor") return pageEditorTotalPages;
return activeFiles.length;
}, [currentView, pageEditorTotalPages, activeFiles.length]);
const selectedCount = useMemo(() => {
if (currentView === "pageEditor") {
return pageEditorSelectedCount;
}
return selectedFileIds.length;
}, [currentView, pageEditorSelectedCount, selectedFileIds.length]);
const sectionsWithButtons = useMemo(() => {
return SECTION_ORDER.map((section) => {
const sectionButtons = buttons.filter(
(btn) => (btn.section ?? "top") === section && (btn.visible ?? true),
);
return { section, buttons: sectionButtons };
}).filter((entry) => entry.buttons.length > 0);
}, [buttons]);
const renderButton = useCallback(
(btn: RightRailButtonConfig) => {
const action = actions[btn.id];
const disabled = Boolean(
btn.disabled || allButtonsDisabled || disableForFullscreen,
);
const isActive = Boolean(btn.active);
const triggerAction = () => {
if (!disabled) action?.();
};
if (btn.render) {
const context: RightRailRenderContext = {
id: btn.id,
disabled,
allButtonsDisabled,
action,
triggerAction,
active: isActive,
};
return btn.render(context) ?? null;
}
if (!btn.icon) return null;
const ariaLabel =
btn.ariaLabel ||
(typeof btn.tooltip === "string" ? (btn.tooltip as string) : undefined);
const className = ["right-rail-icon", btn.className]
.filter(Boolean)
.join(" ");
const buttonNode = (
<ActionIcon
variant={isActive ? "filled" : "subtle"}
color={isActive ? "blue" : undefined}
radius="md"
className={className}
onClick={triggerAction}
disabled={disabled}
aria-label={ariaLabel}
aria-pressed={isActive ? true : undefined}
data-active={isActive ? "true" : "false"}
>
{btn.icon}
</ActionIcon>
);
return renderWithTooltip(
buttonNode,
btn.tooltip,
tooltipPosition,
tooltipOffset,
);
},
[
actions,
allButtonsDisabled,
disableForFullscreen,
tooltipPosition,
tooltipOffset,
],
);
const handleExportAll = useCallback(
async (forceNewFile = false) => {
if (currentView === "viewer") {
const buffer = await viewerContext?.exportActions?.saveAsCopy?.();
if (!buffer) return;
const fileToExport =
selectedFiles.length > 0 ? selectedFiles[0] : activeFiles[0];
if (!fileToExport) return;
const stub = isStirlingFile(fileToExport)
? selectors.getStirlingFileStub(fileToExport.fileId)
: undefined;
try {
const result = await downloadFile({
data: new Blob([buffer], { type: "application/pdf" }),
filename: fileToExport.name,
localPath: forceNewFile ? undefined : stub?.localFilePath,
});
if (!forceNewFile && !result.cancelled && stub && result.savedPath) {
fileActions.updateStirlingFileStub(stub.id, {
localFilePath: stub.localFilePath ?? result.savedPath,
isDirty: false,
});
}
} catch (error) {
console.error("[RightRail] Failed to export viewer file:", error);
}
return;
}
if (currentView === "pageEditor") {
pageEditorFunctions?.onExportAll?.();
return;
}
const filesToExport =
selectedFiles.length > 0 ? selectedFiles : activeFiles;
if (filesToExport.length > 0) {
for (const file of filesToExport) {
const stub = isStirlingFile(file)
? selectors.getStirlingFileStub(file.fileId)
: undefined;
try {
const result = await downloadFile({
data: file,
filename: file.name,
localPath: forceNewFile ? undefined : stub?.localFilePath,
});
if (result.cancelled) continue;
if (!forceNewFile && stub && result.savedPath) {
fileActions.updateStirlingFileStub(stub.id, {
localFilePath: stub.localFilePath ?? result.savedPath,
isDirty: false,
});
}
} catch (error) {
console.error(
"[RightRail] Failed to export file:",
file.name,
error,
);
}
}
}
},
[
currentView,
selectedFiles,
activeFiles,
pageEditorFunctions,
viewerContext,
selectors,
fileActions,
],
);
const downloadTooltip = useMemo(() => {
if (currentView === "pageEditor") {
return t("rightRail.exportAll", "Export PDF");
}
if (currentView === "viewer") {
return terminology.download;
}
if (selectedCount > 0) {
return terminology.downloadSelected;
}
return terminology.downloadAll;
}, [currentView, selectedCount, t, terminology]);
return (
<div
ref={sidebarRefs.rightRailRef}
className="right-rail"
data-sidebar="right-rail"
>
<div className="right-rail-inner">
{sectionsWithButtons.map(({ section, buttons: sectionButtons }) => (
<React.Fragment key={section}>
<div className="right-rail-section" data-tour="right-rail-controls">
{sectionButtons.map((btn, index) => {
const content = renderButton(btn);
if (!content) return null;
return (
<div
key={btn.id}
className="right-rail-button-wrapper"
style={{ animationDelay: `${index * 50}ms` }}
>
{content}
</div>
);
})}
</div>
<Divider className="right-rail-divider" />
</React.Fragment>
))}
<div
style={{
display: "flex",
flexDirection: "column",
alignItems: "center",
gap: "1rem",
}}
data-tour="right-rail-settings"
>
{renderWithTooltip(
<ActionIcon
variant="subtle"
radius="md"
className="right-rail-icon"
onClick={toggleTheme}
>
{themeMode === "dark" ? (
<LightModeIcon sx={{ fontSize: "1.5rem" }} />
) : (
<DarkModeIcon sx={{ fontSize: "1.5rem" }} />
)}
</ActionIcon>,
t("rightRail.toggleTheme", "Toggle Theme"),
tooltipPosition,
tooltipOffset,
)}
<LanguageSelector
position="left-start"
offset={6}
compact
tooltip={t("rightRail.language", "Language")}
/>
{renderWithTooltip(
<ActionIcon
variant="subtle"
radius="md"
className="right-rail-icon"
onClick={() => handleExportAll()}
disabled={
disableForFullscreen ||
(currentView !== "viewer" &&
(totalItems === 0 || allButtonsDisabled))
}
>
<LocalIcon
icon={icons.downloadIconName}
width="1.5rem"
height="1.5rem"
/>
</ActionIcon>,
downloadTooltip,
tooltipPosition,
tooltipOffset,
)}
{icons.saveAsIconName &&
renderWithTooltip(
<ActionIcon
variant="subtle"
radius="md"
className="right-rail-icon"
onClick={() => handleExportAll(true)}
disabled={
disableForFullscreen ||
(currentView !== "viewer" &&
(totalItems === 0 || allButtonsDisabled))
}
>
<LocalIcon
icon={icons.saveAsIconName}
width="1.5rem"
height="1.5rem"
/>
</ActionIcon>,
t("rightRail.saveAs", "Save As"),
tooltipPosition,
tooltipOffset,
)}
</div>
<div className="right-rail-spacer" />
<RightRailFooterExtensions className="right-rail-footer" />
</div>
</div>
);
}
@@ -1,5 +1,6 @@
/* ========== WORKBENCH BAR ========== */
/* Horizontal toolbar at the top of the workbench area. */
/* Horizontal toolbar at the top of the workbench area.
Replaces TopControls (view switcher) and RightRail (action buttons). */
.workbench-bar {
display: flex;
@@ -1,7 +1,7 @@
import React, { useCallback, useEffect, useMemo, useRef } from "react";
import { ActionIcon } from "@mantine/core";
import { useTranslation } from "react-i18next";
import { useWorkbenchBar } from "@app/contexts/WorkbenchBarContext";
import { useRightRail } from "@app/contexts/RightRailContext";
import {
useFileState,
useFileSelection,
@@ -18,17 +18,17 @@ import { Tooltip } from "@app/components/shared/Tooltip";
import LocalIcon from "@app/components/shared/LocalIcon";
import { downloadFile } from "@app/services/downloadService";
import {
WorkbenchBarButtonConfig,
WorkbenchBarRenderContext,
WorkbenchBarSection,
} from "@app/types/workbenchBar";
RightRailButtonConfig,
RightRailRenderContext,
RightRailSection,
} from "@app/types/rightRail";
import InsertDriveFileIcon from "@mui/icons-material/InsertDriveFile";
import FolderIcon from "@mui/icons-material/Folder";
import CloseIcon from "@mui/icons-material/Close";
import PrintIcon from "@mui/icons-material/Print";
import "@app/components/shared/WorkbenchBar.css";
const SECTION_ORDER: WorkbenchBarSection[] = ["top", "middle", "bottom"];
const SECTION_ORDER: RightRailSection[] = ["top", "middle", "bottom"];
interface ViewOption {
value: WorkbenchType;
@@ -66,7 +66,7 @@ export default function WorkbenchBar({
hasFiles,
}: WorkbenchBarProps) {
const { t } = useTranslation();
const { buttons, actions, allButtonsDisabled } = useWorkbenchBar();
const { buttons, actions, allButtonsDisabled } = useRightRail();
const {
pageEditorFunctions,
toolPanelMode,
@@ -227,14 +227,14 @@ export default function WorkbenchBar({
const downloadTooltip = useMemo(() => {
if (currentView === "pageEditor")
return t("workbenchBar.exportAll", "Export PDF");
return t("rightRail.exportAll", "Export PDF");
if (currentView === "viewer") return terminology.download;
if (selectedCount > 0) return terminology.downloadSelected;
return terminology.downloadAll;
}, [currentView, selectedCount, t, terminology]);
const renderButton = useCallback(
(btn: WorkbenchBarButtonConfig) => {
(btn: RightRailButtonConfig) => {
const action = actions[btn.id];
const disabled = Boolean(
btn.disabled || allButtonsDisabled || disableForFullscreen,
@@ -246,7 +246,7 @@ export default function WorkbenchBar({
};
if (btn.render) {
const context: WorkbenchBarRenderContext = {
const context: RightRailRenderContext = {
id: btn.id,
disabled,
allButtonsDisabled,
@@ -357,7 +357,7 @@ export default function WorkbenchBar({
data-tour="workbench-bar"
>
{/* Left: View switcher */}
<div className="workbench-bar-views" data-tour="view-switcher">
<div className="workbench-bar-views">
{hasFiles &&
viewOptions.map((opt) => (
<button
@@ -408,11 +408,11 @@ export default function WorkbenchBar({
disabled={
totalItems === 0 || allButtonsDisabled || disableForFullscreen
}
aria-label={t("workbenchBar.print", "Print PDF")}
aria-label={t("rightRail.print", "Print PDF")}
>
<PrintIcon sx={{ fontSize: "1rem" }} />
</ActionIcon>,
t("workbenchBar.print", "Print PDF"),
t("rightRail.print", "Print PDF"),
)}
{/* Download */}
@@ -453,7 +453,7 @@ export default function WorkbenchBar({
height="1rem"
/>
</ActionIcon>,
t("workbenchBar.saveAs", "Save As"),
t("rightRail.saveAs", "Save As"),
)}
{/* Separator: export group | close */}
@@ -474,15 +474,15 @@ export default function WorkbenchBar({
}
aria-label={
currentView === "fileEditor"
? t("workbenchBar.closeAll", "Close All")
: t("workbenchBar.closePdf", "Close PDF")
? t("rightRail.closeAll", "Close All")
: t("rightRail.closePdf", "Close PDF")
}
>
<CloseIcon sx={{ fontSize: "1rem" }} />
</ActionIcon>,
currentView === "fileEditor"
? t("workbenchBar.closeAll", "Close All")
: t("workbenchBar.closePdf", "Close PDF"),
? t("rightRail.closeAll", "Close All")
: t("rightRail.closePdf", "Close PDF"),
)}
</div>
</div>
@@ -3,7 +3,6 @@ import { useTranslation } from "react-i18next";
import { NavKey } from "@app/components/shared/config/types";
import HotkeysSection from "@app/components/shared/config/configSections/HotkeysSection";
import GeneralSection from "@app/components/shared/config/configSections/GeneralSection";
import HelpSection from "@app/components/shared/config/configSections/HelpSection";
export interface ConfigNavItem {
key: NavKey;
@@ -35,7 +34,6 @@ export const useConfigNavSections = (
_isAdmin: boolean = false,
_runningEE: boolean = false,
_loginEnabled: boolean = false,
onRequestClose: () => void = () => {},
): ConfigNavSection[] => {
const { t } = useTranslation();
@@ -57,19 +55,6 @@ export const useConfigNavSections = (
},
],
},
{
title: t("settings.help.title", "Help"),
items: [
{
key: "help",
label: t("settings.help.label", "Tours"),
icon: "help-rounded",
component: (
<HelpSection isAdmin={_isAdmin} onRequestClose={onRequestClose} />
),
},
],
},
];
return sections;
@@ -1,86 +0,0 @@
import React from "react";
import { Button, Group, Paper, Stack, Text } from "@mantine/core";
import { useTranslation } from "react-i18next";
import LocalIcon from "@app/components/shared/LocalIcon";
import { requestStartTour } from "@app/constants/events";
interface HelpSectionProps {
isAdmin: boolean;
onRequestClose: () => void;
}
const HelpSection: React.FC<HelpSectionProps> = ({
isAdmin,
onRequestClose,
}) => {
const { t } = useTranslation();
const startTour = (tourType: "tools" | "admin") => {
onRequestClose();
setTimeout(() => requestStartTour(tourType), 300);
};
return (
<Stack gap="lg">
<Paper withBorder p="md" radius="md">
<Stack gap="md">
<Group justify="space-between" align="center">
<div>
<Text fw={600} size="sm">
{t("settings.help.toolsTour.title", "Tools Tour")}
</Text>
<Text size="xs" c="dimmed" mt={4}>
{t(
"settings.help.toolsTour.description",
"Walk through uploading files, picking a tool, and reviewing results.",
)}
</Text>
</div>
<Button
variant="default"
size="sm"
leftSection={
<LocalIcon
icon="build-outline-rounded"
width="1rem"
height="1rem"
/>
}
onClick={() => startTour("tools")}
>
{t("settings.help.toolsTour.start", "Start")}
</Button>
</Group>
{isAdmin && (
<Group justify="space-between" align="center">
<div>
<Text fw={600} size="sm">
{t("settings.help.adminTour.title", "Admin Tour")}
</Text>
<Text size="xs" c="dimmed" mt={4}>
{t(
"settings.help.adminTour.description",
"Explore team management, system settings, and enterprise features.",
)}
</Text>
</div>
<Button
variant="default"
size="sm"
leftSection={
<LocalIcon icon="person-rounded" width="1rem" height="1rem" />
}
onClick={() => startTour("admin")}
>
{t("settings.help.adminTour.start", "Start")}
</Button>
</Group>
)}
</Stack>
</Paper>
</Stack>
);
};
export default HelpSection;
@@ -30,7 +30,6 @@ export const VALID_NAV_KEYS = [
"adminUsage",
"adminEndpoints",
"adminStorageSharing",
"help",
] as const;
// Derive the type from the array
@@ -0,0 +1,145 @@
# RightRail Component
A dynamic vertical toolbar on the right side of the application that supports both static buttons (Undo/Redo, Save, Print, Share) and dynamic buttons registered by tools.
## Structure
- **Top Section**: Dynamic buttons from tools (empty when none)
- **Middle Section**: Grid, Cut, Undo, Redo
- **Bottom Section**: Save, Print, Share
## Usage
### For Tools (Recommended)
```tsx
import { useRightRailButtons } from '../hooks/useRightRailButtons';
import PlayArrowIcon from '@mui/icons-material/PlayArrow';
function MyTool() {
const handleAction = useCallback(() => {
// Your action here
}, []);
useRightRailButtons([
{
id: 'my-action',
icon: <PlayArrowIcon />,
tooltip: 'Execute Action',
onClick: handleAction,
},
]);
return <div>My Tool</div>;
}
```
### Multiple Buttons
```tsx
useRightRailButtons([
{
id: 'primary',
icon: <StarIcon />,
tooltip: 'Primary Action',
order: 1,
onClick: handlePrimary,
},
{
id: 'secondary',
icon: <SettingsIcon />,
tooltip: 'Secondary Action',
order: 2,
onClick: handleSecondary,
},
]);
```
### Conditional Buttons
```tsx
useRightRailButtons([
// Always show
{
id: 'process',
icon: <PlayArrowIcon />,
tooltip: 'Process',
disabled: isProcessing,
onClick: handleProcess,
},
// Only show when condition met
...(hasResults ? [{
id: 'export',
icon: <DownloadIcon />,
tooltip: 'Export',
onClick: handleExport,
}] : []),
]);
```
## API
### Button Config
```typescript
interface RightRailButtonWithAction {
id: string; // Unique identifier
icon?: React.ReactNode; // Icon component (omit when using render)
tooltip?: React.ReactNode; // Hover tooltip / description
active?: boolean; // Optional active state for highlight
section?: 'top' | 'middle' | 'bottom'; // Section (default: 'top')
order?: number; // Sort order (default: 0)
disabled?: boolean; // Disabled state (default: false)
visible?: boolean; // Visibility (default: true)
render?: (ctx: RightRailRenderContext) => React.ReactNode; // Custom renderer
onClick?: () => void; // Click handler (optional if using render)
}
interface RightRailRenderContext {
id: string;
disabled: boolean;
allButtonsDisabled: boolean;
action?: () => void;
triggerAction: () => void;
active: boolean;
}
```
### Custom Rendering (Popovers, Multi-button Blocks)
```tsx
useRightRailButtons([
{
id: 'viewer-search',
tooltip: t('rightRail.search', 'Search PDF'),
render: ({ disabled }) => (
<Tooltip content={t('rightRail.search', 'Search PDF')}>
<Popover position="left">
<Popover.Target>
<ActionIcon disabled={disabled}>
<SearchIcon />
</ActionIcon>
</Popover.Target>
<Popover.Dropdown>
<SearchInterface />
</Popover.Dropdown>
</Popover>
</Tooltip>
),
},
]);
```
## Built-in Features
- **Undo/Redo**: Automatically integrates with Page Editor
- **Theme Support**: Light/dark mode with CSS variables
- **Auto Cleanup**: Buttons unregister when tool unmounts
## Best Practices
- Use descriptive IDs: `'compress-optimize'`, `'ocr-process'`
- Choose appropriate Material-UI icons
- Keep tooltips concise: `'Compress PDF'`, `'Process with OCR'`
- Use `useCallback` for click handlers to prevent re-registration
- Reach for `render` when you need popovers or multi-control groups inside the rail
@@ -0,0 +1,170 @@
.right-rail {
background-color: var(--right-rail-bg);
width: 3.5rem;
min-width: 3.5rem;
max-width: 3.5rem;
position: relative;
z-index: 10;
display: flex;
flex-direction: column;
height: 100vh;
border-left: 1px solid var(--border-subtle);
}
.right-rail-inner {
display: flex;
flex-direction: column;
align-items: center;
gap: 0.75rem;
padding: 1rem 0.5rem;
width: 100%;
height: 100%;
flex: 1;
}
.right-rail-section {
background-color: var(--right-rail-foreground);
border-radius: 12px;
padding: 0.5rem;
display: flex;
flex-direction: column;
align-items: center;
gap: 0.75rem;
}
.right-rail-button-wrapper {
display: flex;
flex-direction: column;
align-items: center;
gap: 0.75rem;
width: 100%;
animation: rightRailButtonReveal 200ms ease forwards;
transform-origin: top center;
opacity: 0;
}
.right-rail-tooltip-wrapper {
display: inline-flex;
width: 100%;
justify-content: center;
}
@keyframes rightRailButtonReveal {
0% {
opacity: 0;
transform: scaleY(0.6) translateY(-6px);
}
100% {
opacity: 1;
transform: scaleY(1) translateY(0);
}
}
.right-rail-divider {
width: 2.75rem;
border: none;
border-top: 1px solid var(--tool-subcategory-rule-color);
margin: 0.25rem 0;
}
.right-rail-icon {
color: var(--right-rail-icon);
}
.right-rail-icon[data-active="true"] {
color: #fff;
}
.right-rail-icon[aria-disabled="true"],
.right-rail-icon[disabled] {
color: var(--right-rail-icon-disabled) !important;
background-color: transparent !important;
}
/* When all buttons are disabled via context */
.right-rail--all-disabled .right-rail-icon {
color: var(--right-rail-icon-disabled) !important;
background-color: transparent !important;
pointer-events: none !important;
}
.right-rail-spacer {
flex: 1;
}
/* Animated grow-down slot for buttons (mirrors current-tool-slot behavior) */
.right-rail-slot {
overflow: hidden;
max-height: 0;
opacity: 0;
transition:
max-height 450ms ease-out,
opacity 300ms ease-out;
}
.right-rail-enter {
animation: rightRailGrowDown 450ms ease-out;
}
.right-rail-exit {
animation: rightRailShrinkUp 450ms ease-out;
}
.right-rail-slot.visible {
max-height: 40rem; /* increased to fit additional controls + divider */
opacity: 1;
}
@keyframes rightRailGrowDown {
0% {
max-height: 0;
opacity: 0;
}
100% {
max-height: 40rem;
opacity: 1;
}
}
@keyframes rightRailShrinkUp {
0% {
max-height: 40rem;
opacity: 1;
}
100% {
max-height: 0;
opacity: 0;
}
}
/* Remove bottom margin from close icon */
.right-rail-slot .right-rail-icon {
margin-bottom: 0;
}
/* Inline appear/disappear animation for page-number selector button */
.right-rail-fade {
transition-property: opacity, transform, max-height, visibility;
transition-duration: 220ms, 220ms, 220ms, 0s;
transition-timing-function: ease, ease, ease, linear;
transition-delay: 0s, 0s, 0s, 0s;
transform-origin: top center;
overflow: hidden;
}
.right-rail-fade.enter {
opacity: 1;
transform: scale(1);
max-height: 3rem;
visibility: visible;
}
.right-rail-fade.exit {
opacity: 0;
transform: scale(0.85);
max-height: 0;
visibility: hidden;
/* delay visibility change so opacity/max-height can finish */
transition-delay: 0s, 0s, 0s, 220ms;
pointer-events: none;
}
@@ -12,7 +12,9 @@ import {
useNavigationGuard,
useNavigationActions,
} from "@app/contexts/NavigationContext";
import { useSidebarContext } from "@app/contexts/SidebarContext";
import { useToolWorkflow } from "@app/contexts/ToolWorkflowContext";
import { useRightRailTooltipSide } from "@app/hooks/useRightRailTooltipSide";
import { useRedactionMode, useRedaction } from "@app/contexts/RedactionContext";
import {
defaultParameters,
@@ -30,7 +32,10 @@ export default function ViewerAnnotationControls({
disabled = false,
}: ViewerAnnotationControlsProps) {
const { t } = useTranslation();
const { sidebarRefs } = useSidebarContext();
const { setLeftPanelView, setSidebarsVisible } = useToolWorkflow();
const { position: tooltipPosition, offset: tooltipOffset } =
useRightRailTooltipSide(sidebarRefs);
// Viewer context for PDF controls - safely handle when not available
const viewerContext = React.useContext(ViewerContext);
@@ -124,25 +129,31 @@ export default function ViewerAnnotationControls({
// Handle redaction mode toggle
const handleRedactionToggle = async () => {
if (isRedactMode) {
// Exit redaction mode
exitRedactionMode();
} else {
// Check for unsaved annotation changes
const hasAnnotationChanges = historyApiRef?.current?.canUndo() ?? false;
const enterRedactionMode = async () => {
await saveAnnotationsIfNeeded();
// Set redaction config to manual mode when opening from viewer
const manualConfig: RedactParameters = {
...defaultParameters,
mode: "manual",
};
setRedactionConfig(manualConfig);
// Set tool and keep viewer workbench
navActions.setToolAndWorkbench("redact", "viewer");
// Ensure sidebars are visible and open tool content
setSidebarsVisible(true);
setLeftPanelView("toolContent");
setRedactionMode(true);
// Activate unified redact mode after a short delay
setTimeout(() => {
const currentType = redactionApiRef.current?.getActiveType?.();
if (currentType !== RedactionMode.Redact) {
@@ -160,6 +171,7 @@ export default function ViewerAnnotationControls({
};
const handleToggleAnnotationsVisibility = useCallback(() => {
// When going from visible → hidden with unsaved changes, prompt to save first
if (!annotationsHidden && hasUnsavedChanges) {
requestNavigation(() => viewerContext?.toggleAnnotationsVisibility());
} else {
@@ -167,6 +179,7 @@ export default function ViewerAnnotationControls({
}
}, [annotationsHidden, hasUnsavedChanges, requestNavigation, viewerContext]);
// Don't show any annotation controls in sign mode
// NOTE: This early return is placed AFTER all hooks to satisfy React's rules of hooks
if (isSignMode) {
return null;
@@ -174,14 +187,15 @@ export default function ViewerAnnotationControls({
return (
<>
{/* Redaction Mode Toggle */}
<Tooltip
content={
isRedactMode
? t("workbenchBar.exitRedaction", "Exit Redaction Mode")
: t("workbenchBar.redact", "Redact")
? t("rightRail.exitRedaction", "Exit Redaction Mode")
: t("rightRail.redact", "Redact")
}
position="bottom"
offset={16}
position={tooltipPosition}
offset={tooltipOffset}
arrow
portalTarget={document.body}
>
@@ -201,13 +215,14 @@ export default function ViewerAnnotationControls({
</ActionIcon>
</Tooltip>
{/* Annotation Visibility Toggle */}
<Tooltip
content={t(
"workbenchBar.toggleAnnotations",
"rightRail.toggleAnnotations",
"Toggle Annotations Visibility",
)}
position="bottom"
offset={16}
position={tooltipPosition}
offset={tooltipOffset}
arrow
portalTarget={document.body}
>
@@ -15,7 +15,7 @@ import { useTranslation } from "react-i18next";
import FullscreenToolSurface from "@app/components/tools/FullscreenToolSurface";
import { ToolPanelViewerBar } from "@app/components/tools/ToolPanelViewerBar";
import { useToolPanelGeometry } from "@app/hooks/tools/useToolPanelGeometry";
import { useWorkbenchBar } from "@app/contexts/WorkbenchBarContext";
import { useRightRail } from "@app/contexts/RightRailContext";
import ChevronLeftIcon from "@mui/icons-material/ChevronLeft";
import ChevronRightIcon from "@mui/icons-material/ChevronRight";
import ArrowBackIcon from "@mui/icons-material/ArrowBack";
@@ -28,7 +28,7 @@ export default function ToolPanel() {
const { t } = useTranslation();
const { isRainbowMode } = useRainbowThemeContext();
const { sidebarRefs } = useSidebarContext();
const { toolPanelRef, quickAccessRef } = sidebarRefs;
const { toolPanelRef, quickAccessRef, rightRailRef } = sidebarRefs;
const isMobile = useIsMobile();
const {
@@ -51,7 +51,7 @@ export default function ToolPanel() {
readerMode,
} = useToolWorkflow();
const { setAllButtonsDisabled } = useWorkbenchBar();
const { setAllRightRailButtonsDisabled } = useRightRail();
const { preferences, updatePreference } = usePreferences();
const isFullscreenMode = toolPanelMode === "fullscreen";
@@ -62,15 +62,16 @@ export default function ToolPanel() {
!isMobile &&
toolPickerVisible;
// Disable workbench bar buttons when fullscreen mode is active
// Disable right rail buttons when fullscreen mode is active
useEffect(() => {
setAllButtonsDisabled(fullscreenExpanded);
}, [fullscreenExpanded, setAllButtonsDisabled]);
setAllRightRailButtonsDisabled(fullscreenExpanded);
}, [fullscreenExpanded, setAllRightRailButtonsDisabled]);
const fullscreenGeometry = useToolPanelGeometry({
enabled: fullscreenExpanded,
toolPanelRef,
quickAccessRef,
rightRailRef,
});
const handleExpand = () => {
@@ -240,10 +241,10 @@ export default function ToolPanel() {
radius={0}
leftSection={<ArrowBackIcon sx={{ fontSize: "0.9rem" }} />}
onClick={handleBackToTools}
aria-label={t("toolPanel.backToTools", "Back to tools")}
aria-label={t("toolPanel.backToTools", "Back to all tools")}
styles={{ root: { justifyContent: "flex-start" } }}
>
{t("toolPanel.backToTools", "Back to tools")}
{t("toolPanel.backToTools", "Back to all tools")}
</Button>
</div>
<div className="flex-1 min-h-0 overflow-hidden">
@@ -1,12 +1,12 @@
import React, { useCallback } from "react";
import { ActionIcon } from "@mantine/core";
import { useWorkbenchBar } from "@app/contexts/WorkbenchBarContext";
import { useRightRail } from "@app/contexts/RightRailContext";
import { useNavigationState } from "@app/contexts/NavigationContext";
import { Tooltip } from "@app/components/shared/Tooltip";
import type {
WorkbenchBarButtonConfig,
WorkbenchBarRenderContext,
} from "@app/types/workbenchBar";
RightRailButtonConfig,
RightRailRenderContext,
} from "@app/types/rightRail";
/**
* Mini toolbar rendered at the top of the ToolPanel when in viewer mode.
@@ -14,14 +14,14 @@ import type {
*/
export function ToolPanelViewerBar() {
const { workbench } = useNavigationState();
const { buttons, actions, allButtonsDisabled } = useWorkbenchBar();
const { buttons, actions, allButtonsDisabled } = useRightRail();
const toolPanelButtons = buttons
.filter((btn) => btn.section === "tool-panel" && (btn.visible ?? true))
.sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
const renderButton = useCallback(
(btn: WorkbenchBarButtonConfig) => {
(btn: RightRailButtonConfig) => {
const action = actions[btn.id];
const disabled = Boolean(btn.disabled || allButtonsDisabled);
const isActive = Boolean(btn.active);
@@ -31,7 +31,7 @@ export function ToolPanelViewerBar() {
};
if (btn.render) {
const context: WorkbenchBarRenderContext = {
const context: RightRailRenderContext = {
id: btn.id,
disabled,
allButtonsDisabled,
@@ -23,10 +23,7 @@ import {
AutomationTool,
} from "@app/types/automation";
import { useAutomationForm } from "@app/hooks/tools/automate/useAutomationForm";
import {
downloadAutomationConfig,
downloadFolderScanningConfig,
} from "@app/utils/automationConverter";
import { downloadFolderScanningConfig } from "@app/utils/automationConverter";
interface AutomationCreationProps {
mode: AutomationMode;
@@ -157,24 +154,6 @@ export default function AutomationCreation({
const currentConfigTool =
configuraingToolIndex >= 0 ? selectedTools[configuraingToolIndex] : null;
/**
* Build a temporary AutomationConfig from in-progress form state so the
* export buttons can run without requiring the user to save first. The
* `id` and timestamps are placeholders — the export utilities strip them.
*/
const buildExportableAutomation = (): AutomationConfig => ({
id: existingAutomation?.id || "temp",
name: automationName.trim(),
description: automationDescription.trim(),
icon: automationIcon,
operations: selectedTools.map((tool) => ({
operation: tool.operation,
parameters: tool.parameters || {},
})),
createdAt: existingAutomation?.createdAt || new Date().toISOString(),
updatedAt: new Date().toISOString(),
});
return (
<div>
<Text
@@ -258,34 +237,34 @@ export default function AutomationCreation({
{t("automate.creation.save", "Save Automation")}
</Button>
<Group gap="sm" grow>
<Button
leftSection={<DownloadIcon />}
onClick={() => {
downloadAutomationConfig(buildExportableAutomation());
}}
disabled={!canSaveAutomation()}
variant="light"
>
{t("automate.creation.export", "Export")}
</Button>
<Button
leftSection={<DownloadIcon />}
onClick={() => {
downloadFolderScanningConfig(
buildExportableAutomation(),
toolRegistry,
);
}}
disabled={!canSaveAutomation()}
variant="light"
>
{t(
"automate.creation.exportForFolderScanning",
"Export for Folder Scanning",
)}
</Button>
</Group>
<Button
leftSection={<DownloadIcon />}
onClick={() => {
// Create a temporary automation config from current state
const tempAutomation: AutomationConfig = {
id: existingAutomation?.id || "temp",
name: automationName.trim(),
description: automationDescription.trim(),
icon: automationIcon,
operations: selectedTools.map((tool) => ({
operation: tool.operation,
parameters: tool.parameters || {},
})),
createdAt:
existingAutomation?.createdAt || new Date().toISOString(),
updatedAt: new Date().toISOString(),
};
downloadFolderScanningConfig(tempAutomation, toolRegistry);
}}
disabled={!canSaveAutomation()}
variant="light"
fullWidth
>
{t(
"automate.creation.exportForFolderScanning",
"Export for Folder Scanning",
)}
</Button>
</Stack>
</Stack>
@@ -6,7 +6,6 @@ import EditIcon from "@mui/icons-material/Edit";
import DeleteIcon from "@mui/icons-material/Delete";
import ContentCopyIcon from "@mui/icons-material/ContentCopy";
import DownloadIcon from "@mui/icons-material/Download";
import UploadFileIcon from "@mui/icons-material/UploadFile";
import { Tooltip } from "@app/components/shared/Tooltip";
import { ToolIcon } from "@app/components/shared/ToolIcon";
import { ToolRegistry } from "@app/data/toolsTaxonomy";
@@ -33,12 +32,8 @@ interface AutomationEntryProps {
onDelete?: () => void;
/** Copy handler (for suggested automations) */
onCopy?: () => void;
/** Export handler — folder scanning JSON */
onExportFolderScan?: () => void;
/** Export handler — native Automate JSON (renders as just "Export") */
onExportAutomation?: () => void;
/** Import handler — opens the import modal (used on "Create New" entry) */
onImport?: () => void;
/** Export handler (for folder scanning) */
onExport?: () => void;
/** Tool registry to resolve operation names */
toolRegistry?: Partial<ToolRegistry>;
}
@@ -54,9 +49,7 @@ export default function AutomationEntry({
onEdit,
onDelete,
onCopy,
onExportFolderScan,
onExportAutomation,
onImport,
onExport,
toolRegistry,
}: AutomationEntryProps) {
const { t } = useTranslation();
@@ -218,11 +211,6 @@ export default function AutomationEntry({
variant="subtle"
c="dimmed"
size="md"
aria-label={t(
"automate.entryMenu.label",
"Open menu for {{title}}",
{ title: title || operations.join(" → ") },
)}
onClick={(e) => e.stopPropagation()}
style={{
position: "absolute",
@@ -240,17 +228,6 @@ export default function AutomationEntry({
</Menu.Target>
<Menu.Dropdown>
{onImport && (
<Menu.Item
leftSection={<UploadFileIcon style={{ fontSize: 16 }} />}
onClick={(e) => {
e.stopPropagation();
onImport();
}}
>
{t("automate.import", "Import")}
</Menu.Item>
)}
{onCopy && (
<Menu.Item
leftSection={<ContentCopyIcon style={{ fontSize: 16 }} />}
@@ -273,23 +250,12 @@ export default function AutomationEntry({
{t("edit", "Edit")}
</Menu.Item>
)}
{onExportAutomation && (
{onExport && (
<Menu.Item
leftSection={<DownloadIcon style={{ fontSize: 16 }} />}
onClick={(e) => {
e.stopPropagation();
onExportAutomation();
}}
>
{t("automate.export", "Export")}
</Menu.Item>
)}
{onExportFolderScan && (
<Menu.Item
leftSection={<DownloadIcon style={{ fontSize: 16 }} />}
onClick={(e) => {
e.stopPropagation();
onExportFolderScan();
onExport();
}}
>
{t(
@@ -1,235 +0,0 @@
import { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import {
Alert,
Badge,
Button,
Group,
Modal,
Stack,
Text,
Textarea,
} from "@mantine/core";
import { Dropzone } from "@mantine/dropzone";
import UploadFileIcon from "@mui/icons-material/UploadFile";
import { Z_INDEX_AUTOMATE_MODAL } from "@app/styles/zIndex";
import {
ParsedAutomationImport,
parseAutomationFile,
} from "@app/utils/automationConverter";
import { ToolRegistry } from "@app/data/toolsTaxonomy";
import type { ImportableAutomation } from "@app/hooks/tools/automate/useSavedAutomations";
interface AutomationImportModalProps {
opened: boolean;
toolRegistry: Partial<ToolRegistry>;
onCancel: () => void;
onImport: (
automation: ImportableAutomation,
meta: { format: ParsedAutomationImport["format"]; unresolved: string[] },
) => void | Promise<void>;
}
/**
* Single import surface for both supported automation JSON shapes.
*
* Accepts a file drop or pasted text, auto-detects whether the JSON is the
* native Automate config or the backend folder-scanning config, and shows
* the resolved name + format before the user commits the import.
*/
export default function AutomationImportModal({
opened,
toolRegistry,
onCancel,
onImport,
}: AutomationImportModalProps) {
const { t } = useTranslation();
const [pastedText, setPastedText] = useState("");
const [parsed, setParsed] = useState<ParsedAutomationImport | null>(null);
const [parseError, setParseError] = useState<string | null>(null);
const [submitting, setSubmitting] = useState(false);
// Reset modal state every time it's reopened so a previous import doesn't
// leak into the next one.
useEffect(() => {
if (opened) {
setPastedText("");
setParsed(null);
setParseError(null);
setSubmitting(false);
}
}, [opened]);
// Re-parse whenever the textarea changes — gives the user immediate feedback
// without requiring a click.
useEffect(() => {
const trimmed = pastedText.trim();
if (!trimmed) {
setParsed(null);
setParseError(null);
return;
}
try {
const result = parseAutomationFile(trimmed, toolRegistry);
setParsed(result);
setParseError(null);
} catch (err) {
setParsed(null);
setParseError(err instanceof Error ? err.message : String(err));
}
}, [pastedText, toolRegistry]);
const handleFileDrop = async (files: File[]) => {
const file = files[0];
if (!file) return;
try {
const text = await file.text();
setPastedText(text);
} catch (err) {
setParseError(err instanceof Error ? err.message : String(err));
}
};
const handleSubmit = async () => {
if (!parsed) return;
setSubmitting(true);
try {
await onImport(parsed.automation, {
format: parsed.format,
unresolved: parsed.unresolvedOperations,
});
} finally {
setSubmitting(false);
}
};
const formatLabel =
parsed?.format === "automate"
? t("automate.importModal.detectedAutomation", "Automate JSON")
: parsed?.format === "folderScanning"
? t("automate.importModal.detectedFolderScan", "Folder Scanning JSON")
: null;
return (
<Modal
opened={opened}
onClose={onCancel}
title={t("automate.importModal.title", "Import automation")}
centered
size="lg"
zIndex={Z_INDEX_AUTOMATE_MODAL}
>
<Stack gap="md">
<Text size="sm" c="dimmed">
{t(
"automate.importModal.intro",
"Drop a JSON file or paste its contents below. The format (Automate or Folder Scanning) is detected automatically.",
)}
</Text>
<Dropzone
onDrop={(files) => void handleFileDrop(files)}
accept={["application/json", "text/plain"]}
multiple={false}
maxSize={10 * 1024 * 1024}
aria-label={t(
"automate.importModal.dropzoneAriaLabel",
"Drop an automation JSON file here",
)}
>
<Group
gap="md"
align="center"
wrap="nowrap"
mih={80}
justify="center"
>
<UploadFileIcon style={{ fontSize: 32, opacity: 0.6 }} />
<div>
<Text size="sm" fw={500}>
{t(
"automate.importModal.dropHint",
"Drop JSON here or click to choose a file",
)}
</Text>
<Text size="xs" c="dimmed">
{t(
"automate.importModal.dropSubhint",
"Both Automate and Folder Scanning configs are accepted",
)}
</Text>
</div>
</Group>
</Dropzone>
<Textarea
label={t("automate.importModal.pasteLabel", "Or paste JSON")}
placeholder={t(
"automate.importModal.pastePlaceholder",
"Paste your automation JSON here…",
)}
value={pastedText}
onChange={(e) => setPastedText(e.currentTarget.value)}
autosize
minRows={6}
maxRows={12}
spellCheck={false}
styles={{ input: { fontFamily: "monospace", fontSize: 12 } }}
/>
{parseError && (
<Alert color="red" variant="light">
{t(
"automate.importModal.parseError",
"Could not parse: {{message}}",
{
message: parseError,
},
)}
</Alert>
)}
{parsed && (
<Alert color="green" variant="light">
<Stack gap="xs">
<Group gap="xs" align="center">
<Badge color="green" variant="light">
{formatLabel}
</Badge>
<Text size="sm" fw={500}>
{parsed.automation.name}
</Text>
</Group>
<Text size="xs" c="dimmed">
{t("automate.importModal.opCount", "{{count}} operation(s)", {
count: parsed.automation.operations.length,
})}
</Text>
{parsed.unresolvedOperations.length > 0 && (
<Text size="xs" c="orange">
{t("automate.importModal.unresolved", "Unmapped: {{ops}}", {
ops: parsed.unresolvedOperations.join(", "),
})}
</Text>
)}
</Stack>
</Alert>
)}
<Group gap="sm" justify="flex-end">
<Button variant="subtle" onClick={onCancel} disabled={submitting}>
{t("automate.importModal.cancel", "Cancel")}
</Button>
<Button
onClick={() => void handleSubmit()}
disabled={!parsed || submitting}
loading={submitting}
>
{t("automate.importModal.confirm", "Import")}
</Button>
</Group>
</Stack>
</Modal>
);
}
@@ -1,19 +1,13 @@
import { useState } from "react";
import { useTranslation } from "react-i18next";
import { Title, Stack, Divider } from "@mantine/core";
import AddCircleOutline from "@mui/icons-material/AddCircleOutlined";
import SettingsIcon from "@mui/icons-material/Settings";
import AutomationEntry from "@app/components/tools/automate/AutomationEntry";
import AutomationImportModal from "@app/components/tools/automate/AutomationImportModal";
import { useSuggestedAutomations } from "@app/hooks/tools/automate/useSuggestedAutomations";
import { AutomationConfig, SuggestedAutomation } from "@app/types/automation";
import { iconMap } from "@app/components/tools/automate/iconMap";
import { ToolRegistry } from "@app/data/toolsTaxonomy";
import {
downloadAutomationConfig,
downloadFolderScanningConfig,
} from "@app/utils/automationConverter";
import type { ImportableAutomation } from "@app/hooks/tools/automate/useSavedAutomations";
import { downloadFolderScanningConfig } from "@app/utils/automationConverter";
interface AutomationSelectionProps {
savedAutomations: AutomationConfig[];
@@ -22,11 +16,6 @@ interface AutomationSelectionProps {
onEdit: (automation: AutomationConfig) => void;
onDelete: (automation: AutomationConfig) => void;
onCopyFromSuggested: (automation: SuggestedAutomation) => void;
onImportAutomation: (
automation: ImportableAutomation,
) => Promise<AutomationConfig>;
onImportError?: (message: string) => void;
onImportSuccess?: (message: string) => void;
toolRegistry: Partial<ToolRegistry>;
}
@@ -37,49 +26,11 @@ export default function AutomationSelection({
onEdit,
onDelete,
onCopyFromSuggested,
onImportAutomation,
onImportError,
onImportSuccess,
toolRegistry,
}: AutomationSelectionProps) {
const { t } = useTranslation();
const suggestedAutomations = useSuggestedAutomations();
const [importModalOpen, setImportModalOpen] = useState(false);
const handleImportSubmit = async (
automation: ImportableAutomation,
meta: { format: "automate" | "folderScanning"; unresolved: string[] },
) => {
try {
await onImportAutomation(automation);
setImportModalOpen(false);
if (meta.unresolved.length > 0) {
onImportSuccess?.(
t(
"automate.importPartialSuccess",
"Imported with {{count}} unmapped operation(s): {{ops}}",
{
count: meta.unresolved.length,
ops: meta.unresolved.join(", "),
},
),
);
} else {
onImportSuccess?.(
t("automate.importSuccess", "Imported automation: {{name}}", {
name: automation.name,
}),
);
}
} catch (err) {
const message =
err instanceof Error ? err.message : "Failed to import automation";
console.error("Failed to import automation:", err);
onImportError?.(message);
}
};
return (
<div>
<Title
@@ -102,8 +53,6 @@ export default function AutomationSelection({
operations={[]}
onClick={onCreateNew}
keepIconColor={true}
showMenu={true}
onImport={() => setImportModalOpen(true)}
toolRegistry={toolRegistry}
/>
{/* Saved Automations */}
@@ -123,8 +72,7 @@ export default function AutomationSelection({
onClick={() => onRun(automation)}
showMenu={true}
onEdit={() => onEdit(automation)}
onExportAutomation={() => downloadAutomationConfig(automation)}
onExportFolderScan={() =>
onExport={() =>
downloadFolderScanningConfig(automation, toolRegistry)
}
onDelete={() => onDelete(automation)}
@@ -162,13 +110,6 @@ export default function AutomationSelection({
</Stack>
</div>
</Stack>
<AutomationImportModal
opened={importModalOpen}
toolRegistry={toolRegistry}
onCancel={() => setImportModalOpen(false)}
onImport={handleImportSubmit}
/>
</div>
);
}
@@ -14,14 +14,14 @@ import {
import { CompareResultData, CompareWorkbenchData } from "@app/types/compare";
import ComparePixelWorkbenchView from "@app/components/tools/compare/ComparePixelWorkbenchView";
import { useFileContext } from "@app/contexts/file/fileHooks";
import { useWorkbenchBarButtons } from "@app/hooks/useWorkbenchBarButtons";
import { useRightRailButtons } from "@app/hooks/useRightRailButtons";
import CompareDocumentPane from "@app/components/tools/compare/CompareDocumentPane";
import { useComparePagePreviews } from "@app/components/tools/compare/hooks/useComparePagePreviews";
import { useComparePanZoom } from "@app/components/tools/compare/hooks/useComparePanZoom";
import { useCompareHighlights } from "@app/components/tools/compare/hooks/useCompareHighlights";
import { useCompareChangeNavigation } from "@app/components/tools/compare/hooks/useCompareChangeNavigation";
import "@app/components/tools/compare/compareView.css";
import { useCompareWorkbenchBarButtons } from "@app/components/tools/compare/hooks/useCompareWorkbenchBarButtons";
import { useCompareRightRailButtons } from "@app/components/tools/compare/hooks/useCompareRightRailButtons";
import {
alert,
updateToast,
@@ -209,7 +209,7 @@ const CompareTextWorkbenchView = ({ data }: CompareTextWorkbenchViewProps) => {
})
);
const workbenchBarButtons = useCompareWorkbenchBarButtons({
const rightRailButtons = useCompareRightRailButtons({
layout,
toggleLayout,
isPanMode,
@@ -230,7 +230,7 @@ const CompareTextWorkbenchView = ({ data }: CompareTextWorkbenchViewProps) => {
comparisonScrollRef,
});
useWorkbenchBarButtons(workbenchBarButtons);
useRightRailButtons(rightRailButtons);
// Rendering progress toast for very large PDFs
const LARGE_PAGE_THRESHOLD = 400; // show banner when one or both exceed threshold
@@ -25,7 +25,7 @@
padding: 1rem;
height: 100%;
min-height: 0;
/* Allow the custom workbench to shrink within flex parents */
/* Allow the custom workbench to shrink within flex parents (prevents pushing right rail off-screen) */
min-width: 0;
}
@@ -4,12 +4,12 @@ import { useTranslation } from "react-i18next";
import LocalIcon from "@app/components/shared/LocalIcon";
import { alert } from "@app/components/toast";
import type { ToastLocation } from "@app/components/toast/types";
import type { WorkbenchBarButtonWithAction } from "@app/hooks/useWorkbenchBarButtons";
import type { RightRailButtonWithAction } from "@app/hooks/useRightRailButtons";
import { useIsMobile } from "@app/hooks/useIsMobile";
type Pane = "base" | "comparison";
export interface UseCompareWorkbenchBarButtonsOptions {
export interface UseCompareRightRailButtonsOptions {
layout: "side-by-side" | "stacked";
toggleLayout: () => void;
isPanMode: boolean;
@@ -30,7 +30,7 @@ export interface UseCompareWorkbenchBarButtonsOptions {
comparisonScrollRef?: React.RefObject<HTMLDivElement | null>;
}
export const useCompareWorkbenchBarButtons = ({
export const useCompareRightRailButtons = ({
layout,
toggleLayout,
isPanMode,
@@ -49,11 +49,11 @@ export const useCompareWorkbenchBarButtons = ({
zoomLimits,
baseScrollRef,
comparisonScrollRef,
}: UseCompareWorkbenchBarButtonsOptions): WorkbenchBarButtonWithAction[] => {
}: UseCompareRightRailButtonsOptions): RightRailButtonWithAction[] => {
const { t, i18n } = useTranslation();
const isMobile = useIsMobile();
return useMemo<WorkbenchBarButtonWithAction[]>(
return useMemo<RightRailButtonWithAction[]>(
() => [
{
id: "compare-toggle-layout",
@@ -212,6 +212,6 @@ export const useCompareWorkbenchBarButtons = ({
);
};
export type UseCompareWorkbenchBarButtonsReturn = ReturnType<
typeof useCompareWorkbenchBarButtons
export type UseCompareRightRailButtonsReturn = ReturnType<
typeof useCompareRightRailButtons
>;
@@ -92,7 +92,7 @@
border: 1px solid var(--mantine-color-gray-4);
border-radius: 8px;
overflow: hidden;
background: var(--bg-file-manager);
background: var(--right-rail-bg);
}
.showjs-toolbar {
@@ -538,7 +538,7 @@ export function CommentsSidebar({
top: 0,
bottom: 0,
width: SIDEBAR_WIDTH,
backgroundColor: "var(--bg-file-manager)",
backgroundColor: "var(--right-rail-bg)",
borderLeft: "1px solid var(--border-subtle)",
zIndex: 998,
display: "flex",
@@ -28,7 +28,7 @@ import { useRedaction } from "@app/contexts/RedactionContext";
import type { RedactionPendingTrackerAPI } from "@app/components/viewer/RedactionPendingTracker";
import { createStirlingFilesAndStubs } from "@app/services/fileStubHelpers";
import { isStirlingFile, getFormFillFileId } from "@app/types/fileContext";
import { useViewerWorkbenchBarButtons } from "@app/components/viewer/useViewerWorkbenchBarButtons";
import { useViewerRightRailButtons } from "@app/components/viewer/useViewerRightRailButtons";
import { StampPlacementOverlay } from "@app/components/viewer/StampPlacementOverlay";
import {
RulerOverlay,
@@ -1082,8 +1082,8 @@ const EmbedPdfViewerContent = ({
};
}, [effectiveFile]);
// Register workbench bar buttons for the viewer
useViewerWorkbenchBarButtons(isRulerActive, setIsRulerActive);
// Register viewer right-rail buttons
useViewerRightRailButtons(isRulerActive, setIsRulerActive);
// Auto-fetch form fields when a PDF is loaded in the viewer.
// In normal viewer mode, this uses PDFium WASM (frontend-only).
@@ -4,15 +4,15 @@ import { useTranslation } from "react-i18next";
import { supportedLanguages } from "@app/i18n";
import { useViewer } from "@app/contexts/ViewerContext";
import {
useWorkbenchBarButtons,
WorkbenchBarButtonWithAction,
} from "@app/hooks/useWorkbenchBarButtons";
useRightRailButtons,
RightRailButtonWithAction,
} from "@app/hooks/useRightRailButtons";
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/viewer/ViewerAnnotationControls";
import ViewerAnnotationControls from "@app/components/shared/rightRail/ViewerAnnotationControls";
import { useSidebarContext } from "@app/contexts/SidebarContext";
import { useWorkbenchBarTooltipSide } from "@app/hooks/useWorkbenchBarTooltipSide";
import { useRightRailTooltipSide } from "@app/hooks/useRightRailTooltipSide";
import { useToolWorkflow } from "@app/contexts/ToolWorkflowContext";
import {
useNavigationState,
@@ -27,7 +27,7 @@ import VolumeUpIcon from "@mui/icons-material/VolumeUp";
import StopIcon from "@mui/icons-material/Stop";
import { useViewerReadAloud } from "@app/components/viewer/useViewerReadAloud";
export function useViewerWorkbenchBarButtons(
export function useViewerRightRailButtons(
isRulerActive?: boolean,
setIsRulerActive?: (v: boolean) => void,
) {
@@ -46,7 +46,7 @@ export function useViewerWorkbenchBarButtons(
} = viewer;
const [isPanning, setIsPanning] = useState<boolean>(false);
const { sidebarRefs } = useSidebarContext();
const { position: tooltipPosition } = useWorkbenchBarTooltipSide(
const { position: tooltipPosition } = useRightRailTooltipSide(
sidebarRefs,
12,
);
@@ -105,27 +105,27 @@ export function useViewerWorkbenchBarButtons(
return () => window.removeEventListener("popstate", handlePopState);
}, [isAnnotationsPath]);
const searchLabel = t("workbenchBar.search", "Search PDF");
const panLabel = t("workbenchBar.panMode", "Pan Mode");
const searchLabel = t("rightRail.search", "Search PDF");
const panLabel = t("rightRail.panMode", "Pan Mode");
const applyRedactionsLabel = t(
"workbenchBar.applyRedactionsFirst",
"rightRail.applyRedactionsFirst",
"Apply redactions first",
);
const rotateLeftLabel = t("workbenchBar.rotateLeft", "Rotate Left");
const rotateRightLabel = t("workbenchBar.rotateRight", "Rotate Right");
const sidebarLabel = t("workbenchBar.toggleSidebar", "Toggle Sidebar");
const bookmarkLabel = t("workbenchBar.toggleBookmarks", "Toggle Bookmarks");
const rotateLeftLabel = t("rightRail.rotateLeft", "Rotate Left");
const rotateRightLabel = t("rightRail.rotateRight", "Rotate Right");
const sidebarLabel = t("rightRail.toggleSidebar", "Toggle Sidebar");
const bookmarkLabel = t("rightRail.toggleBookmarks", "Toggle Bookmarks");
const attachmentLabel = t(
"workbenchBar.toggleAttachments",
"rightRail.toggleAttachments",
"Toggle Attachments",
);
const layersLabel = t("workbenchBar.toggleLayers", "Toggle Layers");
const commentsLabel = t("workbenchBar.toggleComments", "Comments");
const annotationsLabel = t("workbenchBar.annotations", "Annotations");
const formFillLabel = t("workbenchBar.formFill", "Fill Form");
const rulerLabel = t("workbenchBar.ruler", "Ruler / Measure");
const readAloudLabel = t("workbenchBar.readAloud", "Read Aloud");
const readAloudSpeedLabel = t("workbenchBar.readAloudSpeed", "Speed");
const layersLabel = t("rightRail.toggleLayers", "Toggle Layers");
const commentsLabel = t("rightRail.toggleComments", "Comments");
const annotationsLabel = t("rightRail.annotations", "Annotations");
const formFillLabel = t("rightRail.formFill", "Fill Form");
const rulerLabel = t("rightRail.ruler", "Ruler / Measure");
const readAloudLabel = t("rightRail.readAloud", "Read Aloud");
const readAloudSpeedLabel = t("rightRail.readAloudSpeed", "Speed");
const isFormFillActive = (selectedTool as string) === "formFill";
@@ -149,8 +149,8 @@ export function useViewerWorkbenchBarButtons(
const shouldShowLanguageSelector =
supportedLanguageCodes.size === 0 || filteredLanguages.length > 1;
const viewerButtons = useMemo<WorkbenchBarButtonWithAction[]>(() => {
const buttons: WorkbenchBarButtonWithAction[] = [
const viewerButtons = useMemo<RightRailButtonWithAction[]>(() => {
const buttons: RightRailButtonWithAction[] = [
{
id: "viewer-search",
tooltip: searchLabel,
@@ -420,9 +420,9 @@ export function useViewerWorkbenchBarButtons(
/>
{shouldShowLanguageSelector && (
<Select
label={t("workbenchBar.readAloudLanguage", "Language")}
label={t("rightRail.readAloudLanguage", "Language")}
placeholder={t(
"workbenchBar.selectLanguage",
"rightRail.selectLanguage",
"Select language",
)}
value={speechLanguage}
@@ -584,5 +584,5 @@ export function useViewerWorkbenchBarButtons(
handleSpeechLanguageChange,
]);
useWorkbenchBarButtons(viewerButtons);
useRightRailButtons(viewerButtons);
}
+2 -1
View File
@@ -1,7 +1,8 @@
// Centralized download URLs for Stirling PDF desktop installers
export const DOWNLOAD_URLS = {
WINDOWS: "https://files.stirlingpdf.com/win-installer.exe",
MAC: "https://files.stirlingpdf.com/mac-installer.dmg",
MAC_APPLE_SILICON: "https://files.stirlingpdf.com/mac-installer.dmg",
MAC_INTEL: "https://files.stirlingpdf.com/mac-x86_64-installer.dmg",
LINUX_DOCS: "https://docs.stirlingpdf.com/Installation/Unix%20Installation/",
} as const;
@@ -0,0 +1,116 @@
import React, {
createContext,
useCallback,
useContext,
useMemo,
useState,
} from "react";
import { RightRailAction, RightRailButtonConfig } from "@app/types/rightRail";
interface RightRailContextValue {
buttons: RightRailButtonConfig[];
actions: Record<string, RightRailAction>;
allButtonsDisabled: boolean;
registerButtons: (buttons: RightRailButtonConfig[]) => void;
unregisterButtons: (ids: string[]) => void;
setAction: (id: string, action?: RightRailAction) => void;
setAllRightRailButtonsDisabled: (disabled: boolean) => void;
clear: () => void;
}
const RightRailContext = createContext<RightRailContextValue | undefined>(
undefined,
);
export function RightRailProvider({ children }: { children: React.ReactNode }) {
const [buttons, setButtons] = useState<RightRailButtonConfig[]>([]);
const [actions, setActions] = useState<Record<string, RightRailAction>>({});
const [allButtonsDisabled, setAllButtonsDisabled] = useState<boolean>(false);
const registerButtons = useCallback((newButtons: RightRailButtonConfig[]) => {
setButtons((prev) => {
const byId = new Map(prev.map((b) => [b.id, b] as const));
newButtons.forEach((nb) => {
const existing = byId.get(nb.id) || ({} as RightRailButtonConfig);
byId.set(nb.id, { ...existing, ...nb });
});
const merged = Array.from(byId.values());
merged.sort(
(a, b) => (a.order ?? 0) - (b.order ?? 0) || a.id.localeCompare(b.id),
);
if (process.env.NODE_ENV === "development") {
const ids = newButtons.map((b) => b.id);
const dupes = ids.filter((id, idx) => ids.indexOf(id) !== idx);
if (dupes.length)
console.warn("[RightRail] Duplicate ids in registerButtons:", dupes);
}
return merged;
});
}, []);
const unregisterButtons = useCallback((ids: string[]) => {
setButtons((prev) => prev.filter((b) => !ids.includes(b.id)));
setActions((prev) =>
Object.fromEntries(
Object.entries(prev).filter(([id]) => !ids.includes(id)),
),
);
}, []);
const setAction = useCallback((id: string, action?: RightRailAction) => {
setActions((prev) => {
if (!action) {
if (!(id in prev)) return prev;
const next = { ...prev };
delete next[id];
return next;
}
return { ...prev, [id]: action };
});
}, []);
const setAllRightRailButtonsDisabled = useCallback((disabled: boolean) => {
setAllButtonsDisabled(disabled);
}, []);
const clear = useCallback(() => {
setButtons([]);
setActions({});
}, []);
const value = useMemo<RightRailContextValue>(
() => ({
buttons,
actions,
allButtonsDisabled,
registerButtons,
unregisterButtons,
setAction,
setAllRightRailButtonsDisabled,
clear,
}),
[
buttons,
actions,
allButtonsDisabled,
registerButtons,
unregisterButtons,
setAction,
setAllRightRailButtonsDisabled,
clear,
],
);
return (
<RightRailContext.Provider value={value}>
{children}
</RightRailContext.Provider>
);
}
export function useRightRail() {
const ctx = useContext(RightRailContext);
if (!ctx)
throw new Error("useRightRail must be used within RightRailProvider");
return ctx;
}
@@ -14,6 +14,7 @@ export function SidebarProvider({ children }: SidebarProviderProps) {
// All sidebar state management
const quickAccessRef = useRef<HTMLDivElement>(null);
const toolPanelRef = useRef<HTMLDivElement>(null);
const rightRailRef = useRef<HTMLDivElement>(null);
const [sidebarsVisible, setSidebarsVisible] = useState(true);
const [leftPanelView, setLeftPanelView] = useState<
@@ -34,8 +35,9 @@ export function SidebarProvider({ children }: SidebarProviderProps) {
() => ({
quickAccessRef,
toolPanelRef,
rightRailRef,
}),
[quickAccessRef, toolPanelRef],
[quickAccessRef, toolPanelRef, rightRailRef],
);
const contextValue: SidebarContextValue = useMemo(
@@ -30,7 +30,6 @@ interface TourOrchestrationContextType {
// File operations
selectFirstFile: () => void;
pinFile: () => void;
revealFileCardHoverMenu: () => void;
// Crop settings (placeholder for now)
modifyCropSettings: () => void;
@@ -193,20 +192,6 @@ export const TourOrchestrationProvider: React.FC<{
window.dispatchEvent(event);
}, []);
const revealFileCardHoverMenu = useCallback(() => {
// The hover menu is hidden via CSS until the card is hovered.
// Override data-force-visible so the CSS rule makes it opacity:1 / pointer-events:auto,
// then nudge Reactour to re-measure the now-visible pin button.
const menu = document.querySelector(
'[data-hover-action-menu-mode="cssHover"]',
) as HTMLElement | null;
if (menu) {
menu.setAttribute("data-force-visible", "true");
window.dispatchEvent(new Event("resize"));
requestAnimationFrame(() => window.dispatchEvent(new Event("resize")));
}
}, []);
const executeTool = useCallback(() => {
// Trigger the run button click
const runButton = document.querySelector(
@@ -228,7 +213,6 @@ export const TourOrchestrationProvider: React.FC<{
switchToActiveFiles,
selectFirstFile,
pinFile,
revealFileCardHoverMenu,
modifyCropSettings,
executeTool,
};
@@ -1,132 +0,0 @@
import React, {
createContext,
useCallback,
useContext,
useMemo,
useState,
} from "react";
import {
WorkbenchBarAction,
WorkbenchBarButtonConfig,
} from "@app/types/workbenchBar";
interface WorkbenchBarContextValue {
buttons: WorkbenchBarButtonConfig[];
actions: Record<string, WorkbenchBarAction>;
allButtonsDisabled: boolean;
registerButtons: (buttons: WorkbenchBarButtonConfig[]) => void;
unregisterButtons: (ids: string[]) => void;
setAction: (id: string, action?: WorkbenchBarAction) => void;
setAllButtonsDisabled: (disabled: boolean) => void;
clear: () => void;
}
const WorkbenchBarContext = createContext<WorkbenchBarContextValue | undefined>(
undefined,
);
export function WorkbenchBarProvider({
children,
}: {
children: React.ReactNode;
}) {
const [buttons, setButtons] = useState<WorkbenchBarButtonConfig[]>([]);
const [actions, setActions] = useState<Record<string, WorkbenchBarAction>>(
{},
);
const [allButtonsDisabled, setAllButtonsDisabledState] =
useState<boolean>(false);
const registerButtons = useCallback(
(newButtons: WorkbenchBarButtonConfig[]) => {
setButtons((prev) => {
const byId = new Map(prev.map((b) => [b.id, b] as const));
newButtons.forEach((nb) => {
const existing = byId.get(nb.id) || ({} as WorkbenchBarButtonConfig);
byId.set(nb.id, { ...existing, ...nb });
});
const merged = Array.from(byId.values());
merged.sort(
(a, b) => (a.order ?? 0) - (b.order ?? 0) || a.id.localeCompare(b.id),
);
if (process.env.NODE_ENV === "development") {
const ids = newButtons.map((b) => b.id);
const dupes = ids.filter((id, idx) => ids.indexOf(id) !== idx);
if (dupes.length)
console.warn(
"[WorkbenchBar] Duplicate ids in registerButtons:",
dupes,
);
}
return merged;
});
},
[],
);
const unregisterButtons = useCallback((ids: string[]) => {
setButtons((prev) => prev.filter((b) => !ids.includes(b.id)));
setActions((prev) =>
Object.fromEntries(
Object.entries(prev).filter(([id]) => !ids.includes(id)),
),
);
}, []);
const setAction = useCallback((id: string, action?: WorkbenchBarAction) => {
setActions((prev) => {
if (!action) {
if (!(id in prev)) return prev;
const next = { ...prev };
delete next[id];
return next;
}
return { ...prev, [id]: action };
});
}, []);
const setAllButtonsDisabled = useCallback((disabled: boolean) => {
setAllButtonsDisabledState(disabled);
}, []);
const clear = useCallback(() => {
setButtons([]);
setActions({});
}, []);
const value = useMemo<WorkbenchBarContextValue>(
() => ({
buttons,
actions,
allButtonsDisabled,
registerButtons,
unregisterButtons,
setAction,
setAllButtonsDisabled,
clear,
}),
[
buttons,
actions,
allButtonsDisabled,
registerButtons,
unregisterButtons,
setAction,
setAllButtonsDisabled,
clear,
],
);
return (
<WorkbenchBarContext.Provider value={value}>
{children}
</WorkbenchBarContext.Provider>
);
}
export function useWorkbenchBar() {
const ctx = useContext(WorkbenchBarContext);
if (!ctx)
throw new Error("useWorkbenchBar must be used within WorkbenchBarProvider");
return ctx;
}
@@ -24,11 +24,7 @@ export function useAutomationForm({
const [automationName, setAutomationName] = useState("");
const [automationDescription, setAutomationDescription] = useState("");
// Default to "SettingsIcon" so the saved entry always has a valid icon key
// matching what the IconSelector renders visually. Saving an empty string
// here would round-trip into a fallback cog, making it look like the
// picker silently lost the user's choice.
const [automationIcon, setAutomationIcon] = useState<string>("SettingsIcon");
const [automationIcon, setAutomationIcon] = useState<string>("");
const [selectedTools, setSelectedTools] = useState<AutomationTool[]>([]);
const getToolName = useCallback(
@@ -58,7 +54,7 @@ export function useAutomationForm({
) {
setAutomationName(existingAutomation.name || "");
setAutomationDescription(existingAutomation.description || "");
setAutomationIcon(existingAutomation.icon || "SettingsIcon");
setAutomationIcon(existingAutomation.icon || "");
const operations = existingAutomation.operations || [];
const tools = operations.map((op, index) => {
@@ -4,11 +4,6 @@ import { SuggestedAutomation } from "@app/types/automation";
export interface SavedAutomation extends AutomationConfig {}
export type ImportableAutomation = Omit<
AutomationConfig,
"id" | "createdAt" | "updatedAt"
>;
export function useSavedAutomations() {
const [savedAutomations, setSavedAutomations] = useState<SavedAutomation[]>(
[],
@@ -94,22 +89,6 @@ export function useSavedAutomations() {
[refreshAutomations],
);
const importAutomation = useCallback(
async (automation: ImportableAutomation): Promise<SavedAutomation> => {
try {
const { automationStorage } =
await import("@app/services/automationStorage");
const saved = await automationStorage.saveAutomation(automation);
refreshAutomations();
return saved;
} catch (err) {
console.error("Error importing automation:", err);
throw err;
}
},
[refreshAutomations],
);
// Load automations on mount
useEffect(() => {
loadSavedAutomations();
@@ -122,6 +101,5 @@ export function useSavedAutomations() {
refreshAutomations,
deleteAutomation,
copyFromSuggested,
importAutomation,
};
}
@@ -11,12 +11,14 @@ interface UseToolPanelGeometryOptions {
enabled: boolean;
toolPanelRef: RefObject<HTMLDivElement | null>;
quickAccessRef: RefObject<HTMLDivElement | null>;
rightRailRef?: RefObject<HTMLDivElement | null>;
}
export function useToolPanelGeometry({
enabled,
toolPanelRef,
quickAccessRef,
rightRailRef,
}: UseToolPanelGeometryOptions) {
const [geometry, setGeometry] = useState<ToolPanelGeometry | null>(null);
const scheduleUpdateRef = useRef<() => void>(() => {});
@@ -33,19 +35,30 @@ export function useToolPanelGeometry({
return;
}
const rightRailEl = () => rightRailRef?.current ?? null;
let rafId: number | null = null;
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) {
// RTL: panel is on the left, expands rightward
width = Math.max(360, window.innerWidth - rect.right);
width = Math.max(360, window.innerWidth - rect.right - rightOffset);
left = rect.right;
} else {
// LTR: panel is on the right, expands leftward to the file sidebar
@@ -84,6 +97,10 @@ export function useToolPanelGeometry({
if (quickAccessRef.current) {
resizeObserver.observe(quickAccessRef.current);
}
const rail = rightRailEl();
if (rail) {
resizeObserver.observe(rail);
}
// Observe root element to react to viewport-driven layout changes
if (document.documentElement) {
resizeObserver.observe(document.documentElement);
@@ -105,19 +122,21 @@ export function useToolPanelGeometry({
scheduleUpdateRef.current = () => {};
resizeObserver?.disconnect();
};
}, [enabled, quickAccessRef, toolPanelRef]);
}, [enabled, quickAccessRef, toolPanelRef, rightRailRef]);
// Secondary effect: (re)attach observer when quickAccessRef.current becomes available later
// Secondary effect: (re)attach observers when refs' .current become available later
useLayoutEffect(() => {
if (!enabled) return;
if (typeof ResizeObserver === "undefined") return;
const qa = quickAccessRef.current;
if (!qa) return;
const rail = rightRailRef?.current ?? null;
if (!qa && !rail) return;
const ro = new ResizeObserver(() => scheduleUpdateRef.current());
ro.observe(qa);
if (qa) ro.observe(qa);
if (rail) ro.observe(rail);
return () => ro.disconnect();
}, [enabled, quickAccessRef.current]);
}, [enabled, quickAccessRef.current, rightRailRef?.current]);
return geometry;
}
@@ -19,7 +19,7 @@ export function useFileActionTerminology() {
mobileUpload: t("landing.mobileUpload", "Upload from Mobile"),
uploadFromComputer: t("landing.uploadFromComputer", "Upload from computer"),
download: t("download", "Download"),
downloadAll: t("workbenchBar.downloadAll", "Download All"),
downloadAll: t("rightRail.downloadAll", "Download All"),
downloadSelected: t("fileManager.downloadSelected", "Download Selected"),
downloadUnavailable: t(
"downloadUnavailable",
+18 -3
View File
@@ -2,7 +2,8 @@ import { useEffect, useState } from "react";
export type OS =
| "windows"
| "mac"
| "mac-intel"
| "mac-apple"
| "linux-x64"
| "linux-arm64"
| "ios"
@@ -22,7 +23,15 @@ function parseUA(ua: string): OS {
if (/android/.test(uaLower)) return "android";
if (/windows nt/.test(uaLower)) return "windows";
if (/mac os x/.test(uaLower)) return "mac";
if (/mac os x/.test(uaLower)) {
// Default to Intel; refine via hints below
let detected: OS = "mac-intel";
// Safari on Apple Silicon sometimes exposes both tokens
if (ua.includes("Apple") && ua.includes("ARM")) {
detected = "mac-apple";
}
return detected; // will be further refined via Client Hints if available
}
if (/linux|x11/.test(uaLower)) return "linux-x64";
return "unknown";
@@ -55,7 +64,10 @@ export function useOs(): OS {
else if (plat.includes("ios")) detected = "ios";
else if (plat.includes("android")) detected = "android";
else if (plat.includes("mac")) {
detected = "mac";
// CH “architecture” is often "arm" on Apple Silicon
detected = architecture?.toLowerCase().includes("arm")
? "mac-apple"
: "mac-intel";
} else if (plat.includes("linux") || plat.includes("chrome os")) {
const archLower = (architecture || "").toLowerCase();
const isArm =
@@ -66,6 +78,9 @@ export function useOs(): OS {
} catch {
// ignore
}
} else {
// Heuristic Apple Silicon from UA when no Client Hints (Safari): uncertain, prefer not to guess
// Keep detected as-is (often 'mac-intel').
}
if (!cancelled) setOs(detected);
@@ -1,26 +1,23 @@
import { useEffect, useMemo } from "react";
import { useWorkbenchBar } from "@app/contexts/WorkbenchBarContext";
import {
WorkbenchBarAction,
WorkbenchBarButtonConfig,
} from "@app/types/workbenchBar";
import { useRightRail } from "@app/contexts/RightRailContext";
import { RightRailAction, RightRailButtonConfig } from "@app/types/rightRail";
export interface WorkbenchBarButtonWithAction extends WorkbenchBarButtonConfig {
onClick?: WorkbenchBarAction;
export interface RightRailButtonWithAction extends RightRailButtonConfig {
onClick?: RightRailAction;
}
/**
* Registers one or more WorkbenchBar buttons and their actions.
* Registers one or more RightRail buttons and their actions.
* - Automatically registers on mount and unregisters on unmount
* - Updates registration when the input array reference changes
*/
export function useWorkbenchBarButtons(
buttons: readonly WorkbenchBarButtonWithAction[],
export function useRightRailButtons(
buttons: readonly RightRailButtonWithAction[],
) {
const { registerButtons, unregisterButtons, setAction } = useWorkbenchBar();
const { registerButtons, unregisterButtons, setAction } = useRightRail();
// Memoize configs and ids to reduce churn
const configs: WorkbenchBarButtonConfig[] = useMemo(
const configs: RightRailButtonConfig[] = useMemo(
() => buttons.map(({ onClick, ...cfg }) => cfg),
[buttons],
);
@@ -34,9 +31,9 @@ export function useWorkbenchBarButtons(
const idSet = new Set<string>();
buttons.forEach((b) => {
if (!b.onClick && !b.render)
console.warn("[WorkbenchBar] Missing onClick/render for id:", b.id);
console.warn("[RightRail] Missing onClick/render for id:", b.id);
if (idSet.has(b.id))
console.warn("[WorkbenchBar] Duplicate id in buttons array:", b.id);
console.warn("[RightRail] Duplicate id in buttons array:", b.id);
idSet.add(b.id);
});
}
@@ -0,0 +1,37 @@
import { useEffect, useState } from "react";
import { SidebarRefs } from "@app/types/sidebar";
export function useRightRailTooltipSide(
sidebarRefs?: SidebarRefs,
defaultOffset: number = 16,
): { position: "left" | "right" | "bottom"; offset: number } {
const [position, setPosition] = useState<"left" | "right" | "bottom">(
"bottom",
);
useEffect(() => {
const computePosition = () => {
const rail = sidebarRefs?.rightRailRef?.current;
const isRTL =
typeof document !== "undefined" &&
document.documentElement.dir === "rtl";
// No rail visible — buttons are in the top bar, tooltips should point down
if (!rail || typeof window === "undefined") {
setPosition("bottom");
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 };
}
@@ -1,8 +0,0 @@
import { SidebarRefs } from "@app/types/sidebar";
export function useWorkbenchBarTooltipSide(
_sidebarRefs?: SidebarRefs,
defaultOffset: number = 16,
): { position: "left" | "right" | "bottom"; offset: number } {
return { position: "bottom", offset: defaultOffset };
}
+2 -9
View File
@@ -15,11 +15,11 @@ import {
useNavigationActions,
} from "@app/contexts/NavigationContext";
import { useViewer } from "@app/contexts/ViewerContext";
import { useLocation } from "react-router-dom";
import AppsIcon from "@mui/icons-material/AppsRounded";
import ToolPanel from "@app/components/tools/ToolPanel";
import Workbench from "@app/components/layout/Workbench";
import RightRail from "@app/components/shared/RightRail";
import FileSidebar from "@app/components/shared/FileSidebar";
import FileManager from "@app/components/FileManager";
import LocalIcon from "@app/components/shared/LocalIcon";
@@ -57,14 +57,6 @@ export default function HomePage() {
const isProgrammaticScroll = useRef(false);
const [configModalOpen, setConfigModalOpen] = useState(false);
const [fileSidebarCollapsed, setFileSidebarCollapsed] = useState(false);
const location = useLocation();
// Open the config modal whenever the URL is /settings/* (e.g. from the admin
// tour's openConfigModal action which navigates to /settings/overview).
useEffect(() => {
const isSettings = location.pathname.startsWith("/settings");
setConfigModalOpen(isSettings);
}, [location.pathname]);
const { activeFiles } = useFileContext();
const navigationState = useNavigationState();
@@ -300,6 +292,7 @@ export default function HomePage() {
<div className="mobile-slide-content">
<div className="flex-1 min-h-0 flex">
<Workbench />
<RightRail />
</div>
</div>
</div>
+14
View File
@@ -209,6 +209,13 @@
--icon-config-bg: #9ca3af;
--icon-config-color: #ffffff;
/* RightRail (light) */
--right-rail-bg: #f5f6f8; /* light background */
--right-rail-foreground: #e3e4e5; /* panel behind custom tool icons */
--right-rail-icon: #4b5563; /* icon color */
--right-rail-icon-disabled: #cecece; /* disabled icon */
--right-rail-pan-active-bg: #eaeaea;
/* Colors for tooltips */
--tooltip-title-bg: #dbefff;
--tooltip-title-color: #31528e;
@@ -546,6 +553,13 @@
--icon-inactive-bg: #2a2f36;
--icon-inactive-color: #6e7581;
/* RightRail (dark) */
--right-rail-bg: #1f2329; /* dark background */
--right-rail-foreground: #2a2f36; /* panel behind custom tool icons */
--right-rail-icon: #bcbebf; /* icon color */
--right-rail-icon-disabled: #43464b; /* disabled icon */
--right-rail-pan-active-bg: #eaeaea;
/* Dark mode tooltip colors */
--tooltip-title-bg: #4b525a;
--tooltip-title-color: #fff;
@@ -38,7 +38,7 @@ const FREE_LICENSE_INFO: LicenseInfo = {
const BASE_NO_LOGIN_CONFIG: AppConfig = {
enableAnalytics: true,
appVersion: "2.10.1",
appVersion: "2.10.0",
serverCertificateEnabled: false,
enableAlphaFunctionality: false,
serverPort: 8080,
@@ -52,10 +52,8 @@ test.describe("Enterprise OAuth (Keycloak) — full SSO flow", () => {
await page.waitForURL((url) => !url.pathname.includes("/login"), {
timeout: 30_000,
});
// The redesigned UI has no "Tools" nav link; the config button is the
// reliable post-login landmark that's always present on the dashboard.
await expect(
page.locator('[data-testid="config-button"]').first(),
page.getByRole("link", { name: /^Tools$/i }).first(),
).toBeVisible({ timeout: 15_000 });
// ── 2. Identity surfaced in settings → Account ────────────
@@ -46,10 +46,8 @@ test.describe("Enterprise SAML (Keycloak) — full SSO flow", () => {
await page.waitForURL((url) => !url.pathname.includes("/login"), {
timeout: 30_000,
});
// The redesigned UI has no "Tools" nav link; the config button is the
// reliable post-login landmark that's always present on the dashboard.
await expect(
page.locator('[data-testid="config-button"]').first(),
page.getByRole("link", { name: /^Tools$/i }).first(),
).toBeVisible({ timeout: 15_000 });
// ── 2. Identity in settings → Account ────────────────────
@@ -118,8 +118,6 @@ const DEFAULT_ENDPOINTS_AVAILABILITY = Object.fromEntries(
export interface MockAppApiOptions {
/** Override `enableLogin`. Default `false` — app loads in anonymous mode. */
enableLogin?: boolean;
/** Override `isAdmin` in app-config. Default `false`. */
isAdmin?: boolean;
/** Override the logged-in user returned by `/auth/me`. */
user?: {
id?: number;
@@ -135,12 +133,6 @@ export interface MockAppApiOptions {
endpointsAvailability?: Record<string, { enabled: boolean }>;
/** Backend probe status. Set to `"DOWN"` to exercise offline-mode UI. */
backendStatus?: "UP" | "DOWN";
/**
* Seed a dummy JWT in localStorage before the app boots.
* Required when `enableLogin: true` so the proprietary client considers the
* user authenticated and renders the main UI instead of the login page.
*/
seedAuthToken?: boolean;
}
/**
@@ -153,8 +145,6 @@ export async function mockAppApis(
): Promise<void> {
const {
enableLogin = false,
isAdmin = false,
seedAuthToken = false,
user = {
id: 1,
username: "testuser",
@@ -167,24 +157,6 @@ export async function mockAppApis(
backendStatus = "UP",
} = opts;
if (seedAuthToken) {
await page.addInitScript(() => {
// Minimal JWT-shape value — the proprietary client only checks presence
// before deciding to call /account, then trusts the API mocks.
localStorage.setItem(
"stirling_jwt",
"eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0dXNlciJ9.signature",
);
// Suppress the analytics opt-in and other post-login onboarding overlays
// that fire when the orchestrator sees an authenticated session.
try {
sessionStorage.setItem("onboarding::bypass-all", "true");
} catch {
/* sessionStorage may be unavailable in some contexts */
}
});
}
// Backend liveness probe — determines whether the UI shows the app or an offline screen
await page.route("**/api/v1/info/status", (route: Route) =>
route.fulfill({ json: { status: backendStatus } }),
@@ -195,7 +167,6 @@ export async function mockAppApis(
route.fulfill({
json: {
enableLogin,
isAdmin,
languages,
defaultLocale,
},
@@ -255,11 +226,6 @@ export async function mockAppApis(
route.fulfill({ json: {} }),
);
// License info — stubbed so admin settings doesn't log proxy errors
await page.route("**/api/v1/admin/license-info", (route: Route) =>
route.fulfill({ json: { licenseType: "FREE", valid: true, maxUsers: 5 } }),
);
// Settings sections touched by the settings page
await page.route("**/api/v1/admin/settings", (route: Route) =>
route.fulfill({ json: {} }),
@@ -1,382 +0,0 @@
import { test, expect } from "@app/tests/helpers/stub-test-base";
import type { Page } from "@playwright/test";
/**
* Stubbed coverage for the Automate tool's import / export flows.
*
* Imports go through a single "Import" entry on the Create New kebab that
* opens a modal. The modal accepts either a dropped JSON file or pasted
* text, auto-detects the format (Automate vs Folder Scanning), and only
* enables the Import button once the input parses cleanly.
*
* Exports come in two flavours:
* - Per-automation kebab: "Export" (native Automate) + "Export for
* Folder Scanning" (backend pipeline shape).
* - Builder buttons: same two options, side by side.
*/
async function clearAutomationStorage(page: Page): Promise<void> {
await page.addInitScript(() => {
try {
indexedDB.deleteDatabase("StirlingPDF_Automations");
} catch {
// First-page-load case where IDB hasn't been opened yet — safe to ignore.
}
});
}
async function gotoAutomate(page: Page): Promise<void> {
await clearAutomationStorage(page);
await page.goto("/automate");
await page.waitForLoadState("domcontentloaded");
}
async function ensureOnSelection(page: Page): Promise<void> {
const savedHeader = page.getByText("Saved").first();
if (!(await savedHeader.isVisible({ timeout: 2_000 }).catch(() => false))) {
await page
.getByText(/Automation Selection/i)
.first()
.click();
await expect(savedHeader).toBeVisible({ timeout: 5_000 });
}
}
/**
* Hover the entry button matching `entryTitle` to reveal its kebab, then
* click the kebab. Returns once the menu is open.
*/
async function openEntryMenu(
page: Page,
entryTitle: RegExp | string,
): Promise<void> {
const entryButton = page
.getByRole("button", { name: entryTitle as RegExp })
.first();
await entryButton.hover();
const titleSource =
typeof entryTitle === "string" ? entryTitle : entryTitle.source;
const escaped = titleSource.replace(/^\^|\$$/g, "");
const kebab = page
.getByRole("button", {
name: new RegExp(`Open menu for .*${escaped}`, "i"),
})
.first();
await kebab.click();
}
function makeAutomateJson(name: string): string {
return JSON.stringify({
name,
description: "Imported via Playwright",
icon: "CompressIcon",
operations: [
{ operation: "merge", parameters: { generateToc: true } },
{ operation: "compress", parameters: { compressionLevel: 3 } },
],
});
}
function makeFolderScanJson(name: string): string {
return JSON.stringify({
name,
pipeline: [
{
operation: "/api/v1/general/merge-pdfs",
parameters: {
generateToc: true,
fileInput: "automated",
},
},
{
operation: "/api/v1/misc/compress-pdf",
parameters: {
compressionLevel: 3,
fileInput: "automated",
},
},
],
_examples: {
outputDir: "{outputFolder}/{folderName}",
outputFileName: "{filename}-{pipelineName}-{date}-{time}",
},
outputDir: "{outputFolder}",
outputFileName: "{filename}",
});
}
/**
* Open the import modal from the "Create New Automation" kebab.
*/
async function openImportModal(page: Page): Promise<void> {
await openEntryMenu(page, /Create New Automation/i);
await page.getByRole("menuitem", { name: /^Import$/ }).click();
await expect(
page.getByRole("dialog", { name: /Import automation/i }),
).toBeVisible({ timeout: 5_000 });
}
test.describe("12. Automation Page — Import / Export", () => {
test.beforeEach(async ({ page }) => {
await gotoAutomate(page);
await ensureOnSelection(page);
});
test.describe("12.1 Create New kebab — single Import option", () => {
test("kebab on Create New entry exposes a single Import option", async ({
page,
}) => {
await openEntryMenu(page, /Create New Automation/i);
await expect(
page.getByRole("menuitem", { name: /^Import$/ }),
).toBeVisible({ timeout: 5_000 });
// Saved-only options should not appear on Create New.
await expect(
page.getByRole("menuitem", { name: /^Edit$/ }),
).not.toBeVisible();
await expect(
page.getByRole("menuitem", { name: /^Delete$/ }),
).not.toBeVisible();
await expect(
page.getByRole("menuitem", { name: /^Export$/ }),
).not.toBeVisible();
});
});
test.describe("12.2 Import modal — paste flow", () => {
test("pasting valid Automate JSON enables Import and saves the entry", async ({
page,
}) => {
await openImportModal(page);
// Import button starts disabled.
const importBtn = page.getByRole("button", { name: /^Import$/ }).last();
await expect(importBtn).toBeDisabled();
const textarea = page.getByLabel(/Or paste JSON/i);
await textarea.fill(makeAutomateJson("Pasted Automate"));
// Detected-format badge should appear.
await expect(page.getByText(/Automate JSON/).first()).toBeVisible({
timeout: 5_000,
});
await expect(importBtn).toBeEnabled();
await importBtn.click();
// Modal closes and the new entry appears in Saved.
await expect(
page.getByRole("dialog", { name: /Import automation/i }),
).not.toBeVisible({ timeout: 5_000 });
await expect(
page.getByRole("button", { name: /Pasted Automate/i }).first(),
).toBeVisible({ timeout: 10_000 });
// Icon must round-trip into IndexedDB. If it doesn't, the saved-entry
// render falls back to SettingsIcon and looks like a silent picker bug.
const persistedIcon = await page.evaluate(
() =>
new Promise<string | undefined>((resolve) => {
const req = indexedDB.open("StirlingPDF_Automations", 1);
req.onsuccess = () => {
const db = req.result;
const tx = db.transaction("automations", "readonly");
const store = tx.objectStore("automations");
const all = store.getAll();
all.onsuccess = () => {
const match = (
all.result as Array<{
name: string;
icon?: string;
}>
).find((a) => a.name === "Pasted Automate");
resolve(match?.icon);
};
all.onerror = () => resolve(undefined);
};
req.onerror = () => resolve(undefined);
}),
);
expect(persistedIcon).toBe("CompressIcon");
});
test("pasting valid Folder Scanning JSON shows the right format and imports", async ({
page,
}) => {
await openImportModal(page);
const textarea = page.getByLabel(/Or paste JSON/i);
await textarea.fill(makeFolderScanJson("Pasted Folder Scan"));
await expect(page.getByText(/Folder Scanning JSON/).first()).toBeVisible({
timeout: 5_000,
});
await page
.getByRole("button", { name: /^Import$/ })
.last()
.click();
await expect(
page.getByRole("button", { name: /Pasted Folder Scan/i }).first(),
).toBeVisible({ timeout: 10_000 });
});
test("pasting invalid JSON shows an error and keeps Import disabled", async ({
page,
}) => {
await openImportModal(page);
const textarea = page.getByLabel(/Or paste JSON/i);
await textarea.fill("{ this is not valid json");
await expect(page.getByText(/Could not parse/i).first()).toBeVisible({
timeout: 5_000,
});
const importBtn = page.getByRole("button", { name: /^Import$/ }).last();
await expect(importBtn).toBeDisabled();
});
});
test.describe("12.3 Import modal — file drop flow", () => {
test("dropping an Automate JSON file fills the textarea and imports", async ({
page,
}) => {
await openImportModal(page);
// The Mantine Dropzone exposes a hidden file input we can target via
// `setInputFiles`. There's only one file input inside the modal.
const fileInput = page
.getByRole("dialog", { name: /Import automation/i })
.locator('input[type="file"]');
await fileInput.setInputFiles({
name: "dropped.automate.json",
mimeType: "application/json",
buffer: Buffer.from(makeAutomateJson("Dropped Automate")),
});
// The textarea should reflect the dropped content.
await expect(page.getByLabel(/Or paste JSON/i)).toHaveValue(
/Dropped Automate/,
{ timeout: 5_000 },
);
await page
.getByRole("button", { name: /^Import$/ })
.last()
.click();
await expect(
page.getByRole("button", { name: /Dropped Automate/i }).first(),
).toBeVisible({ timeout: 10_000 });
});
test("dropping a Folder Scanning JSON file imports it", async ({
page,
}) => {
await openImportModal(page);
const fileInput = page
.getByRole("dialog", { name: /Import automation/i })
.locator('input[type="file"]');
await fileInput.setInputFiles({
name: "dropped.folder-scan.json",
mimeType: "application/json",
buffer: Buffer.from(makeFolderScanJson("Dropped Folder Scan")),
});
await expect(page.getByText(/Folder Scanning JSON/).first()).toBeVisible({
timeout: 5_000,
});
await page
.getByRole("button", { name: /^Import$/ })
.last()
.click();
await expect(
page.getByRole("button", { name: /Dropped Folder Scan/i }).first(),
).toBeVisible({ timeout: 10_000 });
});
});
test.describe("12.4 Export — per-automation kebab menu", () => {
test("saved entry kebab exposes Export and Export for Folder Scanning", async ({
page,
}) => {
// Seed a saved automation by importing one first.
await openImportModal(page);
await page
.getByLabel(/Or paste JSON/i)
.fill(makeAutomateJson("Export Menu Seed"));
await page
.getByRole("button", { name: /^Import$/ })
.last()
.click();
const seededEntry = page
.getByRole("button", { name: /Export Menu Seed/i })
.first();
await expect(seededEntry).toBeVisible({ timeout: 10_000 });
await openEntryMenu(page, /Export Menu Seed/i);
await expect(
page.getByRole("menuitem", { name: /^Export$/ }),
).toBeVisible({ timeout: 5_000 });
await expect(
page.getByRole("menuitem", { name: /Export for Folder Scanning/i }),
).toBeVisible({ timeout: 5_000 });
await expect(
page.getByRole("menuitem", { name: /^Edit$/ }),
).toBeVisible();
await expect(
page.getByRole("menuitem", { name: /^Delete$/ }),
).toBeVisible();
});
test("clicking 'Export' triggers a .automate.json download", async ({
page,
}) => {
await openImportModal(page);
await page
.getByLabel(/Or paste JSON/i)
.fill(makeAutomateJson("Download Test"));
await page
.getByRole("button", { name: /^Import$/ })
.last()
.click();
await expect(
page.getByRole("button", { name: /Download Test/i }).first(),
).toBeVisible({ timeout: 10_000 });
await openEntryMenu(page, /Download Test/i);
const downloadPromise = page.waitForEvent("download");
await page.getByRole("menuitem", { name: /^Export$/ }).click();
const download = await downloadPromise;
expect(download.suggestedFilename()).toMatch(/\.automate\.json$/);
});
test("clicking 'Export for Folder Scanning' triggers a .folder-scan.json download", async ({
page,
}) => {
await openImportModal(page);
await page
.getByLabel(/Or paste JSON/i)
.fill(makeAutomateJson("Folder Download Test"));
await page
.getByRole("button", { name: /^Import$/ })
.last()
.click();
await expect(
page.getByRole("button", { name: /Folder Download Test/i }).first(),
).toBeVisible({ timeout: 10_000 });
await openEntryMenu(page, /Folder Download Test/i);
const downloadPromise = page.waitForEvent("download");
await page
.getByRole("menuitem", { name: /Export for Folder Scanning/i })
.click();
const download = await downloadPromise;
expect(download.suggestedFilename()).toMatch(/\.folder-scan\.json$/);
});
});
});
@@ -1,98 +1,35 @@
import { test, expect } from "@app/tests/helpers/stub-test-base";
import type { Page } from "@playwright/test";
/**
* Stubbed coverage for the `/automate` super-tool. The Automate UI is a small
* three-step state machine: Selection ↔ Creation ↔ Run. These specs exercise
* the surface area that doesn't require a live backend run — the catalogue,
* the builder save flow, and the per-automation menu.
*
* Live runs (actually executing a pipeline against a real backend) live in
* `src/core/tests/live/automate-chain.spec.ts`.
*/
/**
* IndexedDB persists across tests sharing a worker. Each test wipes the
* automation store before navigating so the "Saved" list starts empty.
*/
async function clearAutomationStorage(page: Page): Promise<void> {
await page.addInitScript(() => {
try {
indexedDB.deleteDatabase("StirlingPDF_Automations");
} catch {
// First-page-load case where IDB hasn't been opened yet — safe to ignore.
}
});
}
async function gotoAutomate(page: Page): Promise<void> {
await clearAutomationStorage(page);
await page.goto("/automate");
await page.waitForLoadState("domcontentloaded");
}
/**
* Land on the Selection step. The auto-goto fixture sometimes parks us on the
* builder if a previous test left state behind; click the section header to
* snap back to a known state.
*/
async function ensureOnSelection(page: Page): Promise<void> {
const savedHeader = page.getByText("Saved").first();
if (!(await savedHeader.isVisible({ timeout: 2_000 }).catch(() => false))) {
await page
.getByText(/Automation Selection/i)
.first()
.click();
await expect(savedHeader).toBeVisible({ timeout: 5_000 });
}
}
/**
* Hover the entry whose title matches `entryTitle` and click its kebab.
* Returns once the kebab menu is open and the dropdown is visible.
*/
async function openEntryMenu(page: Page, entryTitle: RegExp): Promise<void> {
const entry = page.getByRole("button", { name: entryTitle }).first();
await entry.hover();
const kebab = page
.getByRole("button", { name: /^Open menu for / })
.filter({ hasText: "" }) // ActionIcon has no text content
.first();
// Match by accessible-name fragment — the title is interpolated.
const titleHint = (entryTitle.source || "")
.replace(/^\^|\$$/g, "")
.replace(/\\/g, "");
const scopedKebab = page
.getByRole("button", {
name: new RegExp(`Open menu for .*${titleHint}`, "i"),
})
.first();
if (await scopedKebab.isVisible({ timeout: 1_000 }).catch(() => false)) {
await scopedKebab.click();
} else {
await kebab.click();
}
}
test.describe("11. Automation Page", () => {
test.beforeEach(async ({ page }) => {
await gotoAutomate(page);
await page.goto("/automate");
await page.waitForLoadState("domcontentloaded");
});
test.describe("11.1 Automation - Suggested Workflows", () => {
test("should display saved and suggested workflows", async ({ page }) => {
// Step 1: Verify the Automation Selection header is present
await expect(page).toHaveURL(/\/automate/);
await expect(
page.getByText(/Automation Selection/i).first(),
).toBeVisible();
await ensureOnSelection(page);
// If we accidentally landed on the creation step, click back to selection
const selectionHeader = page.getByText(/Automation Selection/i).first();
const savedText = page.getByText(/Saved/i).first();
if (!(await savedText.isVisible().catch(() => false))) {
await selectionHeader.click();
await page.waitForTimeout(500);
}
// Step 3: Verify the Saved section is visible
await expect(page.getByText("Saved").first()).toBeVisible();
// Step 4: Verify the Create New Automation entry is present
await expect(
page.getByText(/Create New Automation/i).first(),
).toBeVisible();
// Step 5: Verify suggested preset workflows are listed
await expect(page.getByText("Suggested").first()).toBeVisible();
const suggestedWorkflows = [
@@ -105,7 +42,7 @@ test.describe("11. Automation Page", () => {
for (const workflow of suggestedWorkflows) {
await expect(page.getByText(workflow).first()).toBeVisible({
timeout: 5_000,
timeout: 5000,
});
}
});
@@ -115,85 +52,31 @@ test.describe("11. Automation Page", () => {
test("should open automation builder when clicking create button", async ({
page,
}) => {
await ensureOnSelection(page);
// Ensure we're on the selection step first
const savedText = page.getByText("Saved").first();
if (!(await savedText.isVisible().catch(() => false))) {
const selectionHeader = page.getByText(/Automation Selection/i).first();
await selectionHeader.click();
await page.waitForTimeout(500);
}
await page
.getByText(/Create New Automation/i)
.first()
.click();
// Step 1: Click the Create New Automation entry
const createEntry = page.getByText(/Create New Automation/i).first();
await createEntry.click();
// Step 2: Verify the automation builder/editor opens with form fields
await expect(page.getByText(/Create Automation/i).first()).toBeVisible({
timeout: 5_000,
timeout: 5000,
});
// Step 3: Verify the user can see automation configuration fields
await expect(page.getByText(/Automation Name/i).first()).toBeVisible({
timeout: 5_000,
timeout: 5000,
});
await expect(page.getByText(/Add Tool/i).first()).toBeVisible();
await expect(
page.getByRole("button", { name: /Save Automation/i }).first(),
).toBeVisible();
});
test("save button stays disabled until a name is filled", async ({
page,
}) => {
await ensureOnSelection(page);
await page
.getByText(/Create New Automation/i)
.first()
.click();
const saveBtn = page
.getByRole("button", { name: /Save Automation/i })
.first();
await expect(saveBtn).toBeVisible({ timeout: 5_000 });
await expect(saveBtn).toBeDisabled();
// Naming alone shouldn't enable save — a tool must be added too.
await page.getByLabel(/Automation Name/i).fill("E2E Builder Smoke");
await expect(saveBtn).toBeDisabled();
});
test("both export buttons render in the builder and are disabled until valid", async ({
page,
}) => {
await ensureOnSelection(page);
await page
.getByText(/Create New Automation/i)
.first()
.click();
const exportAutomate = page
.getByRole("button", { name: /^Export$/ })
.first();
const exportFolderScan = page
.getByRole("button", { name: /Export for Folder Scanning/i })
.first();
await expect(exportAutomate).toBeVisible({ timeout: 5_000 });
await expect(exportFolderScan).toBeVisible({ timeout: 5_000 });
// Same disabled-when-invalid contract as Save — no name + no tool.
await expect(exportAutomate).toBeDisabled();
await expect(exportFolderScan).toBeDisabled();
});
});
test.describe("11.3 Automation - Suggested copy-to-saved", () => {
test("copies a suggested automation into the Saved list", async ({
page,
}) => {
await ensureOnSelection(page);
await openEntryMenu(page, /Secure PDF Ingestion/i);
await page.getByRole("menuitem", { name: /Copy to Saved/i }).click();
// The suggested entry stays in the list and a duplicate appears under
// Saved, so the count of matching texts goes from 1 to 2.
await expect
.poll(async () => page.getByText(/Secure PDF Ingestion/i).count(), {
timeout: 5_000,
})
.toBeGreaterThanOrEqual(2);
});
});
});
@@ -18,8 +18,8 @@ test.describe("13. Language / Localization", () => {
test.describe("13.1 Language Switcher", () => {
test("should switch UI text when language is changed", async ({ page }) => {
// Step 1: Locate the Language selector.
// The language selector is accessed via Settings > General.
// In the redesigned UI the right rail is only shown in the mobile layout, so
// the language selector is accessed via Settings > General on desktop.
let languageButton = page
.locator('[data-testid="language-selector-button"]')
.first();
@@ -1,224 +1,73 @@
import path from "path";
import { test, expect } from "@app/tests/helpers/stub-test-base";
import { uploadFiles, openSettings } from "@app/tests/helpers/ui-helpers";
/**
* Tour selector integrity tests.
*
* Each test asserts that a `data-tour="…"` element referenced by one of the
* three guided tours (user, admin, whats-new) is actually present in the DOM
* at the point in the UI where the tour step would fire. If an element is
* renamed or removed the test fails immediately, surfacing the breakage before
* it silently breaks the tour for real users.
*
* Selectors under test come from:
* - userStepsConfig.ts
* - adminStepsConfig.ts
* - whatsNewStepsConfig.ts
*/
test.describe("15. Tour/Onboarding", () => {
test.describe("15.1 Tour Button", () => {
test("should start and dismiss tour guide", async ({ page }) => {
// The help/tours button was in the old QuickAccessBar which is not rendered
// in the redesigned UI (replaced by FileSidebar). Skip until a tour entry
// point is added to the new layout.
test.skip(
true,
"Help/tour button not yet present in redesigned FileSidebar UI",
);
const SAMPLE_PDF = path.join(__dirname, "../test-fixtures/sample.pdf");
// Step 1: Click the Tours button (identified by data-tour="help-button")
const tourButton = page.locator('[data-tour="help-button"]').first();
await expect(tourButton).toBeVisible({ timeout: 5000 });
await tourButton.click();
// ---------------------------------------------------------------------------
// 15.1 Static layout — always visible on the main page
// ---------------------------------------------------------------------------
test.describe("15.1 Tour selectors — static layout", () => {
test("tool-panel is present", async ({ page }) => {
await expect(page.locator('[data-tour="tool-panel"]').first()).toBeVisible({
timeout: 10_000,
});
});
// Step 2: Verify the tours menu opens with tour options
const toursMenu = page.locator(".mantine-Menu-dropdown").first();
await expect(toursMenu).toBeVisible({ timeout: 5000 });
test("quick-access-bar (FileSidebar) is present", async ({ page }) => {
await expect(
page.locator('[data-tour="quick-access-bar"]').first(),
).toBeVisible({ timeout: 10_000 });
});
// Step 3: Click on the "See what's new in V2" tour option to start a tour
const whatsNewOption = page.getByText(/what.?s new|See what/i).first();
await expect(whatsNewOption).toBeVisible({ timeout: 5000 });
await whatsNewOption.click();
test("files-button is present", async ({ page }) => {
await expect(
page.locator('[data-tour="files-button"]').first(),
).toBeVisible({ timeout: 10_000 });
});
// Step 4: Verify the reactour popover appears (tour has started)
const tourPopover = page.locator(".reactour__popover").first();
await expect(tourPopover).toBeVisible({ timeout: 10000 });
test("config-button is present", async ({ page }) => {
await expect(
page.locator('[data-tour="config-button"]').first(),
).toBeVisible({ timeout: 10_000 });
});
test("tool-button-crop is present in tool panel", async ({ page }) => {
await expect(
page.locator('[data-tour="tool-button-crop"]').first(),
).toBeVisible({ timeout: 10_000 });
});
// help-button: not yet implemented in the redesigned FileSidebar layout.
// Re-enable once a tours/help entry point is added to the new UI.
test.skip("help-button is present — TODO: add to new sidebar layout", async ({
page,
}) => {
await expect(page.locator('[data-tour="help-button"]').first()).toBeVisible(
{ timeout: 10_000 },
);
});
});
// ---------------------------------------------------------------------------
// 15.2 Tour selectors — files modal
// ---------------------------------------------------------------------------
test.describe("15.2 Tour selectors — files modal", () => {
test("file-sources is present when files modal is open", async ({ page }) => {
await page.getByTestId("files-button").click();
await expect(
page.locator('[data-tour="file-sources"]').first(),
).toBeVisible({ timeout: 10_000 });
await page.keyboard.press("Escape");
});
});
// ---------------------------------------------------------------------------
// 15.3 Tour selectors — workbench elements (require a loaded file)
// ---------------------------------------------------------------------------
test.describe("15.3 Tour selectors — workbench with file", () => {
test.beforeEach(async ({ page }) => {
await uploadFiles(page, SAMPLE_PDF);
});
test("workbench is present", async ({ page }) => {
await expect(page.locator('[data-tour="workbench"]').first()).toBeVisible({
timeout: 10_000,
});
});
test("view-switcher is present in viewer mode", async ({ page }) => {
await expect(
page.locator('[data-tour="view-switcher"]').first(),
).toBeVisible({ timeout: 10_000 });
});
});
// ---------------------------------------------------------------------------
// 15.4 Tour selectors — active files view (file-card-checkbox, file-card-pin)
// Two files → app auto-navigates to fileEditor (active files) mode.
// ---------------------------------------------------------------------------
test.describe("15.4 Tour selectors — active files view", () => {
test.beforeEach(async ({ page }) => {
// Two files → getStartupNavigationAction returns workbench:"fileEditor"
await uploadFiles(page, [SAMPLE_PDF, SAMPLE_PDF]);
});
test("file-card-checkbox is present in active files view", async ({
page,
}) => {
await expect(
page.locator('[data-tour="file-card-checkbox"]').first(),
).toBeVisible({ timeout: 15_000 });
});
test("file-card-pin is in DOM when file cards are rendered", async ({
page,
}) => {
// The pin button lives inside HoverActionMenu (CSS-hover driven, always
// attached to DOM). Hover over the first file card to ensure the element
// is rendered, then assert it is attached.
const fileCard = page.locator('[data-tour="file-card-checkbox"]').first();
await expect(fileCard).toBeVisible({ timeout: 15_000 });
await fileCard.hover();
await expect(
page.locator('[data-tour="file-card-pin"]').first(),
).toBeAttached({ timeout: 5_000 });
});
});
// ---------------------------------------------------------------------------
// 15.5 Tour selectors — crop tool (crop-settings, run-button)
// ---------------------------------------------------------------------------
test.describe("15.5 Tour selectors — crop tool", () => {
test.beforeEach(async ({ page }) => {
await page.goto("/crop", { waitUntil: "domcontentloaded" });
await uploadFiles(page, SAMPLE_PDF);
});
test("crop-settings is present", async ({ page }) => {
await expect(
page.locator('[data-tour="crop-settings"]').first(),
).toBeVisible({ timeout: 10_000 });
});
test("run-button is present", async ({ page }) => {
await expect(page.locator('[data-tour="run-button"]').first()).toBeVisible({
timeout: 10_000,
});
});
});
// ---------------------------------------------------------------------------
// 15.6 Tour selectors — config modal (non-admin)
// ---------------------------------------------------------------------------
test.describe("15.6 Tour selectors — config modal", () => {
test.beforeEach(async ({ page }) => {
await openSettings(page);
});
test("modal-nav is present", async ({ page }) => {
await expect(page.locator(".modal-nav").first()).toBeVisible({
timeout: 10_000,
});
});
test("settings-content-area is present", async ({ page }) => {
await expect(
page.locator('[data-tour="settings-content-area"]').first(),
).toBeVisible({ timeout: 10_000 });
});
});
// ---------------------------------------------------------------------------
// 15.7 Tour selectors — admin config modal nav items
// Requires isAdmin:true in app-config so the proprietary admin sections render.
// These nav items are EE-only; the test is skipped in core-only builds where
// the sections are not registered.
// ---------------------------------------------------------------------------
test.describe("15.7 Tour selectors — admin modal nav items", () => {
test.use({
stubOptions: { enableLogin: true, isAdmin: true, seedAuthToken: true },
});
const adminNavSections = [
"people",
"teams",
"adminGeneral",
"adminFeatures",
"adminEndpoints",
"adminDatabase",
"adminConnections",
"adminAudit",
"adminUsage",
"help",
] as const;
for (const section of adminNavSections) {
test(`admin-${section}-nav is present`, async ({ page }) => {
await openSettings(page);
const navItem = page
.locator(`[data-tour="admin-${section}-nav"]`)
.first();
// Use waitFor attached (not isVisible) because admin nav items live in a
// scrollable sidebar and may be below the visible fold even when rendered.
const isPresent = await navItem
.waitFor({ state: "attached", timeout: 5_000 })
.then(() => true)
.catch(() => false);
if (!isPresent) {
test.skip(
true,
`admin-${section}-nav not rendered — section may be EE-only or not yet ported to this build`,
);
return;
// Step 5: Dismiss the tour by clicking the close button inside the popover
const closeButton = tourPopover.locator("button").first();
if (await closeButton.isVisible({ timeout: 3000 }).catch(() => false)) {
await closeButton.click();
} else {
// Fallback: press Escape to close the tour
await page.keyboard.press("Escape");
}
await navItem.scrollIntoViewIfNeeded();
await expect(navItem).toBeVisible();
// Step 6: Verify the tour popover disappears
await expect(tourPopover).not.toBeVisible({ timeout: 5000 });
});
}
});
test.describe("15.2 Tour Tooltip", () => {
test("should show and dismiss tour tooltip", async ({ page }) => {
// Step 1: Check if a tours tooltip with a close button appears near the help button
// The tooltip uses the custom Tooltip component with showCloseButton enabled
const tooltipContent = page
.locator('[data-radix-popper-content-wrapper], [role="tooltip"]')
.first();
// Step 2: If a tooltip with a close button is visible, dismiss it
const closeButton = tooltipContent.locator("button").first();
if (await closeButton.isVisible({ timeout: 5000 }).catch(() => false)) {
await closeButton.click();
// Step 3: Verify the tooltip content disappears
await expect(tooltipContent).not.toBeVisible({ timeout: 5000 });
}
// Step 4: Refresh the page and verify it loads normally
await page.reload();
await page.waitForLoadState("domcontentloaded");
// Step 5: Verify the page loaded (search box or navigation visible)
await expect(page.getByPlaceholder(/search|cari/i).first()).toBeVisible({
timeout: 10000,
});
});
});
});
-3
View File
@@ -45,7 +45,6 @@ const Automate = ({ onPreviewFile, onComplete, onError }: BaseToolProps) => {
deleteAutomation,
refreshAutomations,
copyFromSuggested,
importAutomation,
} = useSavedAutomations();
// Use ref to store the latest reset function to avoid closure issues
@@ -154,8 +153,6 @@ const Automate = ({ onPreviewFile, onComplete, onError }: BaseToolProps) => {
);
}
}}
onImportAutomation={importAutomation}
onImportError={(message) => onError?.(message)}
toolRegistry={toolRegistry}
/>
);
@@ -1,19 +1,19 @@
import React from "react";
export type WorkbenchBarSection = "top" | "middle" | "bottom" | "tool-panel";
export type RightRailSection = "top" | "middle" | "bottom" | "tool-panel";
export type WorkbenchBarAction = () => void;
export type RightRailAction = () => void;
export interface WorkbenchBarRenderContext {
export interface RightRailRenderContext {
id: string;
disabled: boolean;
allButtonsDisabled: boolean;
action?: WorkbenchBarAction;
action?: RightRailAction;
triggerAction: () => void;
active: boolean;
}
export interface WorkbenchBarButtonConfig {
export interface RightRailButtonConfig {
/** Unique id for the button, also used to bind action callbacks */
id: string;
/** Icon element to render when using default renderer */
@@ -25,7 +25,7 @@ export interface WorkbenchBarButtonConfig {
/** Optional i18n key carried by config */
templateKey?: string;
/** Visual grouping lane */
section?: WorkbenchBarSection;
section?: RightRailSection;
/** Sorting within a section (lower first); ties broken by id */
order?: number;
/** Initial disabled state */
@@ -33,7 +33,7 @@ export interface WorkbenchBarButtonConfig {
/** Initial visibility */
visible?: boolean;
/** Optional custom renderer for advanced layouts */
render?: (ctx: WorkbenchBarRenderContext) => React.ReactNode;
render?: (ctx: RightRailRenderContext) => React.ReactNode;
/** Optional className applied to wrapper when using default renderer */
className?: string;
/** Optional active state to highlight the control */
+1
View File
@@ -7,6 +7,7 @@ export interface SidebarState {
export interface SidebarRefs {
quickAccessRef: React.RefObject<HTMLDivElement | null>;
toolPanelRef: React.RefObject<HTMLDivElement | null>;
rightRailRef: React.RefObject<HTMLDivElement | null>;
}
export interface SidebarInfo {
@@ -1,273 +0,0 @@
/**
* Unit tests for automationConverter import/export round-tripping.
*/
import { describe, test, expect } from "vitest";
import {
convertToAutomationConfig,
convertToFolderScanningConfig,
detectAutomationFormat,
parseAutomationConfigJson,
parseAutomationFile,
parseFolderScanningConfig,
} from "@app/utils/automationConverter";
import { AutomationConfig } from "@app/types/automation";
import type { ToolRegistry } from "@app/data/toolsTaxonomy";
// Minimal stub registry — only the fields automationConverter actually reads.
const registry = {
merge: {
operationConfig: {
endpoint: "/api/v1/general/merge-pdfs",
},
},
compress: {
operationConfig: {
endpoint: "/api/v1/misc/compress-pdf",
},
},
ocr: {
operationConfig: {
endpoint: "/api/v1/misc/ocr-pdf",
},
},
// Dynamic endpoint — endpoint depends on parameters.
convert: {
operationConfig: {
endpoint: (params: Record<string, any>) =>
`/api/v1/convert/${params.fromExtension}-to-${params.toExtension}`,
},
},
} as unknown as Partial<ToolRegistry>;
const sampleAutomation: AutomationConfig = {
id: "auto-123",
name: "Sample",
description: "Test automation",
icon: "CompressIcon",
operations: [
{ operation: "merge", parameters: { generateToc: true } },
{ operation: "compress", parameters: { compressionLevel: 3 } },
],
createdAt: "2025-01-01T00:00:00.000Z",
updatedAt: "2025-01-02T00:00:00.000Z",
};
describe("automationConverter", () => {
describe("convertToAutomationConfig", () => {
test("strips id/createdAt/updatedAt and clones parameters", () => {
const result = convertToAutomationConfig(sampleAutomation);
expect(result).toEqual({
name: "Sample",
description: "Test automation",
icon: "CompressIcon",
operations: [
{ operation: "merge", parameters: { generateToc: true } },
{ operation: "compress", parameters: { compressionLevel: 3 } },
],
});
expect(result).not.toHaveProperty("id");
expect(result).not.toHaveProperty("createdAt");
expect(result).not.toHaveProperty("updatedAt");
// Parameters should be cloned, not the same reference.
expect(result.operations[0].parameters).not.toBe(
sampleAutomation.operations[0].parameters,
);
});
});
describe("convertToFolderScanningConfig", () => {
test("rewrites operation keys to backend endpoints and adds fileInput", () => {
const config = convertToFolderScanningConfig(sampleAutomation, registry);
expect(config.pipeline).toEqual([
{
operation: "/api/v1/general/merge-pdfs",
parameters: { generateToc: true, fileInput: "automated" },
},
{
operation: "/api/v1/misc/compress-pdf",
parameters: { compressionLevel: 3, fileInput: "automated" },
},
]);
});
test("preserves icon and description so round-tripping keeps UI metadata", () => {
const config = convertToFolderScanningConfig(sampleAutomation, registry);
expect(config.icon).toBe("CompressIcon");
expect(config.description).toBe("Test automation");
});
test("omits icon and description when not set on the source automation", () => {
const minimal: AutomationConfig = {
id: "min",
name: "Minimal",
operations: [{ operation: "merge", parameters: {} }],
createdAt: "2025-01-01T00:00:00.000Z",
updatedAt: "2025-01-01T00:00:00.000Z",
};
const config = convertToFolderScanningConfig(minimal, registry);
expect(config).not.toHaveProperty("icon");
expect(config).not.toHaveProperty("description");
});
test("falls back to operation key when no endpoint is registered", () => {
const automation: AutomationConfig = {
...sampleAutomation,
operations: [{ operation: "unknownTool", parameters: {} }],
};
const config = convertToFolderScanningConfig(automation, registry);
expect(config.pipeline[0].operation).toBe("unknownTool");
});
});
describe("detectAutomationFormat", () => {
test("detects native Automate JSON", () => {
expect(detectAutomationFormat({ operations: [] })).toBe("automate");
});
test("detects folder-scanning JSON", () => {
expect(detectAutomationFormat({ pipeline: [] })).toBe("folderScanning");
});
test("returns unknown for ambiguous or invalid input", () => {
expect(detectAutomationFormat({ pipeline: [], operations: [] })).toBe(
"unknown",
);
expect(detectAutomationFormat(null)).toBe("unknown");
expect(detectAutomationFormat("string")).toBe("unknown");
});
});
describe("parseAutomationConfigJson", () => {
test("accepts a previously exported native Automate JSON", () => {
const exported = convertToAutomationConfig(sampleAutomation);
const parsed = parseAutomationConfigJson(exported, registry);
expect(parsed.unresolvedOperations).toEqual([]);
expect(parsed.automation.name).toBe("Sample");
expect(parsed.automation.operations).toHaveLength(2);
expect(parsed.automation.operations[0].operation).toBe("merge");
// Icon must round-trip — losing it makes saved entries fall back to the
// settings cog, which historically looked like a silent picker bug.
expect(parsed.automation.icon).toBe("CompressIcon");
});
test("flags operations not present in the registry", () => {
const result = parseAutomationConfigJson(
{
name: "x",
operations: [{ operation: "notARealTool", parameters: {} }],
},
registry,
);
expect(result.unresolvedOperations).toEqual(["notARealTool"]);
});
test("throws on missing operations array", () => {
expect(() => parseAutomationConfigJson({ name: "x" }, registry)).toThrow(
/operations/,
);
});
});
describe("parseFolderScanningConfig", () => {
test("round-trips a folder-scan export back to tool IDs", () => {
const exported = convertToFolderScanningConfig(
sampleAutomation,
registry,
);
const parsed = parseFolderScanningConfig(exported, registry);
expect(parsed.unresolvedOperations).toEqual([]);
expect(parsed.automation.operations.map((o) => o.operation)).toEqual([
"merge",
"compress",
]);
// Icon survives the round trip even through the folder-scan format.
expect(parsed.automation.icon).toBe("CompressIcon");
// The export-time `fileInput: "automated"` marker must not survive import.
for (const op of parsed.automation.operations) {
expect(op.parameters).not.toHaveProperty("fileInput");
}
});
test("resolves a dynamic endpoint by replaying it with the imported parameters", () => {
const config = {
name: "Convert",
pipeline: [
{
operation: "/api/v1/convert/pdf-to-docx",
parameters: {
fromExtension: "pdf",
toExtension: "docx",
fileInput: "automated",
},
},
],
};
const parsed = parseFolderScanningConfig(config, registry);
expect(parsed.unresolvedOperations).toEqual([]);
expect(parsed.automation.operations[0].operation).toBe("convert");
expect(parsed.automation.operations[0].parameters).toEqual({
fromExtension: "pdf",
toExtension: "docx",
});
});
test("keeps unmappable endpoints verbatim and reports them", () => {
const config = {
name: "Mystery",
pipeline: [{ operation: "/api/v1/unknown/op", parameters: {} }],
};
const parsed = parseFolderScanningConfig(config, registry);
expect(parsed.unresolvedOperations).toEqual(["/api/v1/unknown/op"]);
expect(parsed.automation.operations[0].operation).toBe(
"/api/v1/unknown/op",
);
});
test("throws on missing pipeline array", () => {
expect(() => parseFolderScanningConfig({ name: "x" }, registry)).toThrow(
/pipeline/,
);
});
});
describe("parseAutomationFile", () => {
test("auto-detects Automate JSON", () => {
const text = JSON.stringify({
name: "x",
operations: [{ operation: "merge", parameters: {} }],
});
const result = parseAutomationFile(text, registry);
expect(result.format).toBe("automate");
});
test("auto-detects Folder Scanning JSON", () => {
const text = JSON.stringify({
name: "x",
pipeline: [{ operation: "/api/v1/general/merge-pdfs", parameters: {} }],
});
const result = parseAutomationFile(text, registry);
expect(result.format).toBe("folderScanning");
});
test("rejects mismatched explicit format", () => {
const text = JSON.stringify({
name: "x",
operations: [{ operation: "merge", parameters: {} }],
});
expect(() =>
parseAutomationFile(text, registry, "folderScanning"),
).toThrow();
});
test("rejects malformed JSON", () => {
expect(() => parseAutomationFile("{ not json", registry)).toThrow(
/not valid JSON/,
);
});
test("rejects unrecognized shape", () => {
expect(() =>
parseAutomationFile(JSON.stringify({ foo: "bar" }), registry),
).toThrow(/Unrecognized JSON/);
});
});
});
+13 -339
View File
@@ -1,33 +1,17 @@
/**
* Utility functions for converting between automation formats.
*
* Two on-disk formats are supported:
*
* 1. **Automate JSON** (native) — mirrors {@link AutomationConfig}; the format
* used internally by the Automate tool and persisted in IndexedDB. Operation
* names are frontend tool IDs (e.g. "merge", "compress").
*
* 2. **Folder Scanning JSON** — the format consumed by the backend
* PipelineDirectoryProcessor. Operation names are full backend endpoint
* paths (e.g. "/api/v1/general/merge-pdfs").
* Utility functions for converting between automation formats
*/
import { AutomationConfig, AutomationOperation } from "@app/types/automation";
import { AutomationConfig } from "@app/types/automation";
import { ToolRegistry } from "@app/data/toolsTaxonomy";
import { downloadFile } from "@app/services/downloadService";
import { ToolId } from "@app/types/toolId";
/**
* Pipeline configuration format used by folder scanning.
*
* `description` and `icon` are unused by the backend pipeline runner but are
* preserved so a folder-scan export can round-trip cleanly back into the
* Automate UI without losing display metadata.
* Pipeline configuration format used by folder scanning
*/
interface FolderScanningPipeline {
name: string;
description?: string;
icon?: string;
pipeline: Array<{
operation: string;
parameters: Record<string, any>;
@@ -41,28 +25,10 @@ interface FolderScanningPipeline {
}
/**
* Discriminated result returned by {@link parseAutomationFile}.
*/
export type ParsedAutomationImport =
| {
format: "automate";
automation: Omit<AutomationConfig, "id" | "createdAt" | "updatedAt">;
unresolvedOperations: string[];
}
| {
format: "folderScanning";
automation: Omit<AutomationConfig, "id" | "createdAt" | "updatedAt">;
unresolvedOperations: string[];
};
/**
* Sanitize a filename so it works on Windows / macOS / Linux.
*/
const sanitizeFilename = (name: string): string =>
(name || "automation").replace(/[\\/:*?"<>|]+/g, "_").trim() || "automation";
/**
* Converts an AutomationConfig to a folder scanning pipeline configuration.
* Converts an AutomationConfig to a folder scanning pipeline configuration
* @param automation The automation configuration to convert
* @param toolRegistry The tool registry to map operation types to endpoints
* @returns Folder scanning pipeline configuration
*/
export function convertToFolderScanningConfig(
automation: AutomationConfig,
@@ -70,9 +36,8 @@ export function convertToFolderScanningConfig(
): FolderScanningPipeline {
return {
name: automation.name,
...(automation.description ? { description: automation.description } : {}),
...(automation.icon ? { icon: automation.icon } : {}),
pipeline: automation.operations.map((op) => {
// Map operationType to full API endpoint path
const toolId = op.operation as ToolId;
const toolEntry = toolRegistry[toolId];
const endpointConfig = toolEntry?.operationConfig?.endpoint;
@@ -82,6 +47,7 @@ export function convertToFolderScanningConfig(
if (typeof endpointConfig === "string") {
endpoint = endpointConfig;
} else if (typeof endpointConfig === "function") {
// For dynamic endpoints, call with the saved parameters
try {
endpoint = endpointConfig(op.parameters);
} catch (error) {
@@ -119,7 +85,9 @@ export function convertToFolderScanningConfig(
}
/**
* Downloads a folder scanning configuration as a JSON file.
* Downloads a folder scanning configuration as a JSON file
* @param automation The automation configuration to export
* @param toolRegistry The tool registry to map operation types to endpoints
*/
export function downloadFolderScanningConfig(
automation: AutomationConfig,
@@ -128,299 +96,5 @@ export function downloadFolderScanningConfig(
const config = convertToFolderScanningConfig(automation, toolRegistry);
const json = JSON.stringify(config, null, 2);
const blob = new Blob([json], { type: "application/json" });
void downloadFile({
data: blob,
filename: `${sanitizeFilename(automation.name)}.folder-scan.json`,
});
}
/**
* Builds an exportable native Automate JSON object. Strips the IndexedDB
* primary key and timestamps so an imported copy looks fresh.
*/
export function convertToAutomationConfig(
automation: AutomationConfig,
): Omit<AutomationConfig, "id" | "createdAt" | "updatedAt"> {
return {
name: automation.name,
description: automation.description,
icon: automation.icon,
operations: automation.operations.map((op) => ({
operation: op.operation,
parameters: { ...(op.parameters || {}) },
})),
};
}
/**
* Downloads an automation in the native Automate JSON format. The file can be
* re-imported via {@link parseAutomationFile} to restore the automation on a
* different machine or browser profile.
*/
export function downloadAutomationConfig(automation: AutomationConfig): void {
const config = convertToAutomationConfig(automation);
const json = JSON.stringify(config, null, 2);
const blob = new Blob([json], { type: "application/json" });
void downloadFile({
data: blob,
filename: `${sanitizeFilename(automation.name)}.automate.json`,
});
}
/**
* Build an inverse map of `endpoint string` → `frontend tool ID` from the
* tool registry. Only static string endpoints are added — dynamic
* (function) endpoints are matched at parse time by replaying them.
*/
function buildEndpointToToolIdMap(
toolRegistry: Partial<ToolRegistry>,
): Map<string, ToolId> {
const map = new Map<string, ToolId>();
for (const [toolId, entry] of Object.entries(toolRegistry)) {
const endpoint = entry?.operationConfig?.endpoint;
if (typeof endpoint === "string" && !map.has(endpoint)) {
map.set(endpoint, toolId as ToolId);
}
}
return map;
}
/**
* Try every dynamic endpoint in the registry with the supplied parameters,
* returning the first tool ID whose endpoint function produces `targetEndpoint`.
*/
function findDynamicEndpointMatch(
targetEndpoint: string,
parameters: Record<string, any>,
toolRegistry: Partial<ToolRegistry>,
): ToolId | undefined {
for (const [toolId, entry] of Object.entries(toolRegistry)) {
const endpoint = entry?.operationConfig?.endpoint;
if (typeof endpoint === "function") {
try {
if (endpoint(parameters) === targetEndpoint) {
return toolId as ToolId;
}
} catch {
// Endpoint function expected different parameters — ignore.
}
}
}
return undefined;
}
const isToolIdInRegistry = (
candidate: string,
toolRegistry: Partial<ToolRegistry>,
): boolean => Object.prototype.hasOwnProperty.call(toolRegistry, candidate);
/**
* Parse a folder-scanning pipeline JSON into the native AutomationConfig
* shape. Endpoint paths are reverse-mapped to frontend tool IDs via the
* supplied registry; unmappable operations are kept verbatim and reported in
* `unresolvedOperations`.
*/
export function parseFolderScanningConfig(
raw: unknown,
toolRegistry: Partial<ToolRegistry>,
): {
automation: Omit<AutomationConfig, "id" | "createdAt" | "updatedAt">;
unresolvedOperations: string[];
} {
if (!raw || typeof raw !== "object") {
throw new Error("Invalid folder scanning config: expected JSON object");
}
const obj = raw as Record<string, unknown>;
const pipeline = obj.pipeline;
if (!Array.isArray(pipeline)) {
throw new Error("Invalid folder scanning config: missing 'pipeline' array");
}
const endpointMap = buildEndpointToToolIdMap(toolRegistry);
const unresolved: string[] = [];
const operations: AutomationOperation[] = pipeline.map(
(step: unknown, index: number) => {
if (!step || typeof step !== "object") {
throw new Error(
`Invalid folder scanning config: pipeline[${index}] is not an object`,
);
}
const stepObj = step as Record<string, unknown>;
const rawOperation = stepObj.operation;
if (typeof rawOperation !== "string" || rawOperation.length === 0) {
throw new Error(
`Invalid folder scanning config: pipeline[${index}].operation must be a non-empty string`,
);
}
const rawParameters = (stepObj.parameters as Record<string, any>) || {};
// Strip the export-time marker so the imported automation runs cleanly.
const { fileInput: _fileInput, ...parameters } = rawParameters;
// 1) Direct frontend-tool-id match (handles the converter's fallback when
// no endpoint could be resolved at export time).
if (isToolIdInRegistry(rawOperation, toolRegistry)) {
return { operation: rawOperation, parameters };
}
// 2) Static endpoint string match.
const staticMatch = endpointMap.get(rawOperation);
if (staticMatch) {
return { operation: staticMatch, parameters };
}
// 3) Dynamic endpoint match — replay each function endpoint with the
// parameters we have and look for a match.
const dynamicMatch = findDynamicEndpointMatch(
rawOperation,
parameters,
toolRegistry,
);
if (dynamicMatch) {
return { operation: dynamicMatch, parameters };
}
unresolved.push(rawOperation);
return { operation: rawOperation, parameters };
},
);
const name =
typeof obj.name === "string" && obj.name.length > 0
? obj.name
: "Imported Automation";
return {
automation: {
name,
description: typeof obj.description === "string" ? obj.description : "",
icon: typeof obj.icon === "string" ? obj.icon : undefined,
operations,
},
unresolvedOperations: unresolved,
};
}
/**
* Parse a native Automate JSON file (a previously-exported AutomationConfig).
* The id / createdAt / updatedAt fields are dropped — the storage layer
* regenerates them on save.
*/
export function parseAutomationConfigJson(
raw: unknown,
toolRegistry: Partial<ToolRegistry>,
): {
automation: Omit<AutomationConfig, "id" | "createdAt" | "updatedAt">;
unresolvedOperations: string[];
} {
if (!raw || typeof raw !== "object") {
throw new Error("Invalid automation config: expected JSON object");
}
const obj = raw as Record<string, unknown>;
const operations = obj.operations;
if (!Array.isArray(operations)) {
throw new Error("Invalid automation config: missing 'operations' array");
}
const unresolved: string[] = [];
const parsedOperations: AutomationOperation[] = operations.map(
(op: unknown, index: number) => {
if (!op || typeof op !== "object") {
throw new Error(
`Invalid automation config: operations[${index}] is not an object`,
);
}
const opObj = op as Record<string, unknown>;
const operation = opObj.operation;
if (typeof operation !== "string" || operation.length === 0) {
throw new Error(
`Invalid automation config: operations[${index}].operation must be a non-empty string`,
);
}
const parameters = (opObj.parameters as Record<string, any>) || {};
if (!isToolIdInRegistry(operation, toolRegistry)) {
unresolved.push(operation);
}
return { operation, parameters };
},
);
const name =
typeof obj.name === "string" && obj.name.length > 0
? obj.name
: "Imported Automation";
return {
automation: {
name,
description: typeof obj.description === "string" ? obj.description : "",
icon: typeof obj.icon === "string" ? obj.icon : undefined,
operations: parsedOperations,
},
unresolvedOperations: unresolved,
};
}
/**
* Heuristic format detector. Folder-scanning JSON uses a `pipeline` array;
* native Automate JSON uses an `operations` array. Both is invalid.
*/
export function detectAutomationFormat(
raw: unknown,
): "automate" | "folderScanning" | "unknown" {
if (!raw || typeof raw !== "object") return "unknown";
const obj = raw as Record<string, unknown>;
const hasPipeline = Array.isArray(obj.pipeline);
const hasOperations = Array.isArray(obj.operations);
if (hasPipeline && !hasOperations) return "folderScanning";
if (hasOperations && !hasPipeline) return "automate";
return "unknown";
}
/**
* Parse a JSON file's text content into a normalized AutomationConfig.
* Auto-detects the format unless `expectedFormat` is supplied; throws with a
* user-readable message on any structural problem.
*/
export function parseAutomationFile(
fileText: string,
toolRegistry: Partial<ToolRegistry>,
expectedFormat?: "automate" | "folderScanning",
): ParsedAutomationImport {
let raw: unknown;
try {
raw = JSON.parse(fileText);
} catch (err) {
throw new Error(`File is not valid JSON: ${(err as Error).message}`, {
cause: err,
});
}
const detected = detectAutomationFormat(raw);
const format = expectedFormat ?? detected;
if (expectedFormat && detected !== "unknown" && detected !== expectedFormat) {
throw new Error(
`Expected ${
expectedFormat === "automate"
? "Automate JSON (operations array)"
: "Folder Scanning JSON (pipeline array)"
} but file looks like ${
detected === "automate" ? "Automate JSON" : "Folder Scanning JSON"
}.`,
);
}
if (format === "automate") {
const result = parseAutomationConfigJson(raw, toolRegistry);
return { format: "automate", ...result };
}
if (format === "folderScanning") {
const result = parseFolderScanningConfig(raw, toolRegistry);
return { format: "folderScanning", ...result };
}
throw new Error(
"Unrecognized JSON shape. Expected an Automate config (operations[]) or a Folder Scanning config (pipeline[]).",
);
void downloadFile({ data: blob, filename: `${automation.name}.json` });
}
@@ -0,0 +1,75 @@
import React from "react";
import { describe, expect, test } from "vitest";
import { render, screen } from "@testing-library/react";
import { MantineProvider } from "@mantine/core";
import FileEditorFileName from "@app/components/fileEditor/FileEditorFileName";
import type { StirlingFileStub } from "@app/types/fileContext";
import type { FileId } from "@app/types/file";
const buildFileStub = (
overrides: Partial<StirlingFileStub> = {},
): StirlingFileStub => ({
id: "file-1" as FileId,
name: "report.pdf",
type: "application/pdf",
size: 1024,
lastModified: 0,
isLeaf: true,
originalFileId: "file-1",
versionNumber: 1,
...overrides,
});
const renderName = (file: StirlingFileStub) =>
render(
<MantineProvider>
<FileEditorFileName file={file} />
</MantineProvider>,
);
describe("FileEditorFileName (desktop)", () => {
test("renders red 'not saved' indicator when file has no local path", () => {
renderName(buildFileStub());
const indicator = screen.getByLabelText("fileNotSavedToDisk");
expect(indicator).toBeInTheDocument();
expect(indicator).toHaveStyle({
backgroundColor: "var(--mantine-color-red-6)",
});
expect(screen.queryByLabelText("unsavedChanges")).toBeNull();
expect(screen.queryByLabelText("fileSavedToDisk")).toBeNull();
});
test("renders yellow 'unsaved changes' indicator when file is dirty", () => {
renderName(
buildFileStub({ localFilePath: "/tmp/report.pdf", isDirty: true }),
);
const indicator = screen.getByLabelText("unsavedChanges");
expect(indicator).toBeInTheDocument();
expect(indicator).toHaveStyle({
backgroundColor: "var(--mantine-color-yellow-6)",
});
expect(screen.queryByLabelText("fileNotSavedToDisk")).toBeNull();
expect(screen.queryByLabelText("fileSavedToDisk")).toBeNull();
});
test("renders green 'saved' indicator when file is persisted and clean", () => {
renderName(
buildFileStub({ localFilePath: "/tmp/report.pdf", isDirty: false }),
);
const indicator = screen.getByLabelText("fileSavedToDisk");
expect(indicator).toBeInTheDocument();
expect(indicator).toHaveStyle({
backgroundColor: "var(--mantine-color-green-6)",
});
expect(screen.queryByLabelText("fileNotSavedToDisk")).toBeNull();
expect(screen.queryByLabelText("unsavedChanges")).toBeNull();
});
test("renders the filename alongside the indicator", () => {
renderName(buildFileStub({ name: "invoice.pdf" }));
expect(screen.getByText("invoice.pdf")).toBeInTheDocument();
});
});
@@ -0,0 +1,71 @@
import React from "react";
import { Tooltip } from "@mantine/core";
import { useTranslation } from "react-i18next";
import { StirlingFileStub } from "@app/types/fileContext";
import { PrivateContent } from "@app/components/shared/PrivateContent";
import { truncateCenter } from "@app/utils/textUtils";
interface FileEditorFileNameProps {
file: StirlingFileStub;
maxLength?: number;
}
const FileEditorFileName = ({
file,
maxLength = 40,
}: FileEditorFileNameProps) => {
const { t } = useTranslation();
return (
<>
<PrivateContent>{truncateCenter(file.name, maxLength)}</PrivateContent>
{!file.localFilePath && (
<Tooltip label={t("fileNotSavedToDisk", "Not saved to disk")}>
<span
style={{
display: "inline-block",
width: "6px",
height: "6px",
borderRadius: "50%",
backgroundColor: "var(--mantine-color-red-6)",
flexShrink: 0,
}}
aria-label={t("fileNotSavedToDisk", "Not saved to disk")}
/>
</Tooltip>
)}
{file.localFilePath && file.isDirty && (
<Tooltip label={t("unsavedChanges", "Unsaved changes")}>
<span
style={{
display: "inline-block",
width: "6px",
height: "6px",
borderRadius: "50%",
backgroundColor: "var(--mantine-color-yellow-6)",
flexShrink: 0,
}}
aria-label={t("unsavedChanges", "Unsaved changes")}
/>
</Tooltip>
)}
{file.localFilePath && !file.isDirty && (
<Tooltip label={t("fileSavedToDisk", "File saved to disk")}>
<span
style={{
display: "inline-block",
width: "6px",
height: "6px",
borderRadius: "50%",
backgroundColor: "var(--mantine-color-green-6)",
flexShrink: 0,
}}
aria-label={t("fileSavedToDisk", "File saved to disk")}
/>
</Tooltip>
)}
</>
);
};
export default FileEditorFileName;
@@ -1,36 +0,0 @@
import { Tooltip } from "@mantine/core";
import { useTranslation } from "react-i18next";
import { StirlingFileStub } from "@app/types/fileContext";
import styles from "@app/components/fileEditor/FileEditorThumbnail.module.css";
interface FileEditorStatusDotProps {
file: StirlingFileStub;
}
export function FileEditorStatusDot({ file }: FileEditorStatusDotProps) {
const { t } = useTranslation();
const label = !file.localFilePath
? t("fileNotSavedToDisk", "Not saved to disk")
: file.isDirty
? t("unsavedChanges", "Unsaved changes")
: t("fileSavedToDisk", "Saved to disk");
const color = !file.localFilePath
? "var(--mantine-color-red-6)"
: file.isDirty
? "var(--mantine-color-yellow-6)"
: "var(--mantine-color-green-6)";
return (
<div className={styles.thumbBadgesRight}>
<Tooltip label={label}>
<span
className={styles.statusDot}
style={{ backgroundColor: color }}
aria-label={label}
/>
</Tooltip>
</div>
);
}
@@ -0,0 +1,131 @@
import { useState, useEffect, useMemo } from "react";
import { Box, Tooltip, rem } from "@mantine/core";
import { useTranslation } from "react-i18next";
import {
connectionModeService,
type ConnectionMode,
} from "@app/services/connectionModeService";
import {
selfHostedServerMonitor,
type SelfHostedServerState,
} from "@app/services/selfHostedServerMonitor";
import { useBackendHealth } from "@app/hooks/useBackendHealth";
import { OPEN_SIGN_IN_EVENT } from "@app/constants/signInEvents";
interface RightRailFooterExtensionsProps {
className?: string;
}
function ConnectionStatusDot() {
const { t } = useTranslation();
const [connectionMode, setConnectionMode] = useState<ConnectionMode | null>(
null,
);
const [selfHostedState, setSelfHostedState] = useState<SelfHostedServerState>(
() => selfHostedServerMonitor.getSnapshot(),
);
const { isOnline, checkHealth } = useBackendHealth();
useEffect(() => {
void connectionModeService.getCurrentMode().then(setConnectionMode);
const unsubscribe = connectionModeService.subscribeToModeChanges(
(config) => {
setConnectionMode(config.mode);
},
);
return unsubscribe;
}, []);
useEffect(() => {
return selfHostedServerMonitor.subscribe(setSelfHostedState);
}, []);
const { label, color } = useMemo(() => {
if (connectionMode === "saas") {
return {
label: t("connectionMode.status.saas", "Connected to Stirling Cloud"),
color: "#3b82f6",
};
}
if (connectionMode === "selfhosted") {
const serverOnline = selfHostedState.isOnline;
const serverChecking = selfHostedState.status === "checking";
const backendLabel = serverChecking
? t(
"connectionMode.status.selfhostedChecking",
"Connected to self-hosted server (checking...)",
)
: serverOnline
? t(
"connectionMode.status.selfhostedOnline",
"Connected to self-hosted server",
)
: t(
"connectionMode.status.selfhostedOffline",
"Self-hosted server unreachable",
);
return {
label: backendLabel,
color: serverChecking
? "#fcc419"
: serverOnline
? "#37b24d"
: "#e03131",
};
}
// local
return {
label: isOnline
? t("connectionMode.status.localOnline", "Offline mode running")
: t("connectionMode.status.localOffline", "Offline mode running"),
color: "#868e96",
};
}, [connectionMode, selfHostedState, isOnline, t]);
return (
<Tooltip label={label} position="left" offset={12} withArrow withinPortal>
<Box
component="span"
role="status"
aria-label={label}
tabIndex={0}
onClick={() => {
if (connectionMode === "local") {
window.dispatchEvent(new CustomEvent(OPEN_SIGN_IN_EVENT));
} else {
void checkHealth();
}
}}
style={{
width: rem(10),
height: rem(10),
borderRadius: "50%",
backgroundColor: color,
boxShadow: "var(--status-dot-ring)",
display: "inline-block",
cursor: "pointer",
outline: "none",
}}
/>
</Tooltip>
);
}
export function RightRailFooterExtensions({
className,
}: RightRailFooterExtensionsProps) {
return (
<Box
className={className}
style={{
width: "100%",
display: "flex",
justifyContent: "center",
alignItems: "center",
paddingBottom: rem(12),
}}
>
<ConnectionStatusDot />
</Box>
);
}
@@ -4,7 +4,7 @@ import SaveOutlinedIcon from "@mui/icons-material/SaveOutlined";
/**
* File action icons for desktop builds.
* Overrides the core implementation with desktop-appropriate icons.
* The presence of `saveAsIconName` signals the WorkbenchBar to show the Save As button.
* The presence of `saveAsIconName` signals RightRail to show the Save As button.
*/
export function useFileActionIcons() {
return {
@@ -12,7 +12,7 @@ export function useFileActionIcons() {
download: SaveOutlinedIcon,
uploadIconName: "folder-rounded" as const,
downloadIconName: "save-rounded" as const,
// Returning this icon name causes WorkbenchBar to render the Save As button.
// Returning this icon name causes RightRail to render the Save As button.
// On desktop, downloadFile() without a localPath shows a native save dialog.
saveAsIconName: "save-as-rounded" as string | undefined,
};
@@ -19,7 +19,7 @@ export function useFileActionTerminology() {
mobileUpload: t("landing.mobileUpload", "Upload from Mobile"),
uploadFromComputer: t("landing.openFromComputer", "Open from computer"),
download: t("save", "Save"),
downloadAll: t("workbenchBar.saveAll", "Save All"),
downloadAll: t("rightRail.saveAll", "Save All"),
downloadSelected: t("fileManager.saveSelected", "Save Selected"),
downloadUnavailable: t("saveUnavailable", "Save unavailable for this item"),
noFilesInStorage: t(

Some files were not shown because too many files have changed in this diff Show More