Fix lint, formatting, and TOML parse errors post-merge
- Remove unused meta variable and getFileTypeMeta import from NonPdfViewer - Fix TOML: move compare.edited.selectBaseFirst and compare.swap.label from dotted-key form in [compare] to their proper subsections - Run Prettier on 7 files flagged by format check
This commit is contained in:
@@ -2702,13 +2702,11 @@ addFilesHint = "Add PDFs in the Files step to enable selection."
|
||||
clearSelected = "Clear selected"
|
||||
clearSlot = "Remove file"
|
||||
cta = "Compare"
|
||||
edited.selectBaseFirst = "Select original PDF first"
|
||||
header = "Compare PDFs"
|
||||
loading = "Comparing..."
|
||||
newLine = "new-line"
|
||||
noFiles = "No PDFs available yet"
|
||||
pages = "Pages"
|
||||
swap.label = "Swap"
|
||||
tags = "differentiate,contrast,changes,analysis"
|
||||
title = "Compare"
|
||||
|
||||
@@ -2754,6 +2752,7 @@ title = "These PDFs look highly different"
|
||||
|
||||
[compare.edited]
|
||||
label = "Edited PDF"
|
||||
selectBaseFirst = "Select original PDF first"
|
||||
placeholder = "Select the edited PDF"
|
||||
|
||||
[compare.error]
|
||||
@@ -2835,6 +2834,7 @@ pageLabel = "Page"
|
||||
|
||||
[compare.swap]
|
||||
confirm = "Swap and Re-run"
|
||||
label = "Swap"
|
||||
confirmBody = "This will rerun the tool. Are you sure you want to swap the order of Original and Edited?"
|
||||
confirmTitle = "Re-run comparison?"
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ export default function Workbench() {
|
||||
}
|
||||
}
|
||||
|
||||
if (activeFiles.length === 0) {
|
||||
if (activeFiles.length === 0) {
|
||||
return <LandingPage />;
|
||||
}
|
||||
|
||||
|
||||
@@ -684,21 +684,19 @@ const PageEditor = ({ onFunctionsReady }: PageEditorProps) => {
|
||||
>
|
||||
<LoadingOverlay visible={globalProcessing && !initialDocument} />
|
||||
|
||||
{!initialDocument &&
|
||||
!globalProcessing &&
|
||||
!hasPdfFiles && (
|
||||
<Center h="100%">
|
||||
<Stack align="center" gap="md">
|
||||
<Text size="lg" c="dimmed">
|
||||
📄
|
||||
</Text>
|
||||
<Text c="dimmed">No PDF files loaded</Text>
|
||||
<Text size="sm" c="dimmed">
|
||||
Add files to start editing pages
|
||||
</Text>
|
||||
</Stack>
|
||||
</Center>
|
||||
)}
|
||||
{!initialDocument && !globalProcessing && !hasPdfFiles && (
|
||||
<Center h="100%">
|
||||
<Stack align="center" gap="md">
|
||||
<Text size="lg" c="dimmed">
|
||||
📄
|
||||
</Text>
|
||||
<Text c="dimmed">No PDF files loaded</Text>
|
||||
<Text size="sm" c="dimmed">
|
||||
Add files to start editing pages
|
||||
</Text>
|
||||
</Stack>
|
||||
</Center>
|
||||
)}
|
||||
|
||||
{!initialDocument && (globalProcessing || hasPdfFiles) && (
|
||||
<Box p={0}>
|
||||
|
||||
@@ -67,7 +67,8 @@ const FileSidebar = forwardRef<HTMLDivElement, FileSidebarProps>(
|
||||
const { actions: fileActions } = useFileActions();
|
||||
const { actions: navActions } = useNavigationActions();
|
||||
const { workbench: currentWorkbench, selectedTool } = useNavigationState();
|
||||
const isMultiTool = currentWorkbench === "pageEditor" && selectedTool === "multiTool";
|
||||
const isMultiTool =
|
||||
currentWorkbench === "pageEditor" && selectedTool === "multiTool";
|
||||
const { requestNavigation } = useNavigationGuard();
|
||||
const { activeFileId, setActiveFileId } = useViewer();
|
||||
const { addFiles } = useFileHandler();
|
||||
@@ -163,7 +164,13 @@ const FileSidebar = forwardRef<HTMLDivElement, FileSidebarProps>(
|
||||
navActions.setWorkbench(files.length === 1 ? "viewer" : "fileEditor");
|
||||
}
|
||||
}
|
||||
}, [isGoogleDriveEnabled, openGoogleDrivePicker, addFiles, navActions, isMultiTool]);
|
||||
}, [
|
||||
isGoogleDriveEnabled,
|
||||
openGoogleDrivePicker,
|
||||
addFiles,
|
||||
navActions,
|
||||
isMultiTool,
|
||||
]);
|
||||
|
||||
// Toggle file in/out of workbench
|
||||
const handleFileClick = useCallback(
|
||||
@@ -287,7 +294,9 @@ const FileSidebar = forwardRef<HTMLDivElement, FileSidebarProps>(
|
||||
if (files.length > 0) {
|
||||
await addFiles(files);
|
||||
if (!isMultiTool) {
|
||||
navActions.setWorkbench(files.length === 1 ? "viewer" : "fileEditor");
|
||||
navActions.setWorkbench(
|
||||
files.length === 1 ? "viewer" : "fileEditor",
|
||||
);
|
||||
}
|
||||
}
|
||||
e.target.value = "";
|
||||
|
||||
@@ -153,9 +153,30 @@ function FilePdfIcon({
|
||||
d="M9.5 0L15 5.5H11C10.172 5.5 9.5 4.828 9.5 4V0Z"
|
||||
fill="rgba(0,0,0,0.2)"
|
||||
/>
|
||||
<rect x="3.5" y="8.5" width="7" height="1.2" rx=".6" fill="rgba(255,255,255,.85)" />
|
||||
<rect x="3.5" y="11" width="9" height="1.2" rx=".6" fill="rgba(255,255,255,.85)" />
|
||||
<rect x="3.5" y="13.5" width="5.5" height="1.2" rx=".6" fill="rgba(255,255,255,.85)" />
|
||||
<rect
|
||||
x="3.5"
|
||||
y="8.5"
|
||||
width="7"
|
||||
height="1.2"
|
||||
rx=".6"
|
||||
fill="rgba(255,255,255,.85)"
|
||||
/>
|
||||
<rect
|
||||
x="3.5"
|
||||
y="11"
|
||||
width="9"
|
||||
height="1.2"
|
||||
rx=".6"
|
||||
fill="rgba(255,255,255,.85)"
|
||||
/>
|
||||
<rect
|
||||
x="3.5"
|
||||
y="13.5"
|
||||
width="5.5"
|
||||
height="1.2"
|
||||
rx=".6"
|
||||
fill="rgba(255,255,255,.85)"
|
||||
/>
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,8 +67,12 @@ export default function WorkbenchBar({
|
||||
}: WorkbenchBarProps) {
|
||||
const { t } = useTranslation();
|
||||
const { buttons, actions, allButtonsDisabled } = useRightRail();
|
||||
const { pageEditorFunctions, toolPanelMode, leftPanelView, customWorkbenchViews } =
|
||||
useToolWorkflow();
|
||||
const {
|
||||
pageEditorFunctions,
|
||||
toolPanelMode,
|
||||
leftPanelView,
|
||||
customWorkbenchViews,
|
||||
} = useToolWorkflow();
|
||||
const { selectedTool } = useNavigationState();
|
||||
const isCustomView = !isBaseWorkbench(currentView);
|
||||
const disableForFullscreen =
|
||||
@@ -453,30 +457,33 @@ export default function WorkbenchBar({
|
||||
)}
|
||||
|
||||
{/* Separator: export group | close */}
|
||||
{!isCustomView && <div className="workbench-bar-divider workbench-bar-globals-sep" />}
|
||||
{!isCustomView && (
|
||||
<div className="workbench-bar-divider workbench-bar-globals-sep" />
|
||||
)}
|
||||
|
||||
{/* Close (context-aware: close all / close viewer file / close page editor) */}
|
||||
{!isCustomView && renderWithTooltip(
|
||||
<ActionIcon
|
||||
variant="subtle"
|
||||
radius="md"
|
||||
className="workbench-bar-action-icon"
|
||||
onClick={handleClose}
|
||||
disabled={
|
||||
totalItems === 0 || allButtonsDisabled || disableForFullscreen
|
||||
}
|
||||
aria-label={
|
||||
currentView === "fileEditor"
|
||||
? t("rightRail.closeAll", "Close All")
|
||||
: t("rightRail.closePdf", "Close PDF")
|
||||
}
|
||||
>
|
||||
<CloseIcon sx={{ fontSize: "1rem" }} />
|
||||
</ActionIcon>,
|
||||
currentView === "fileEditor"
|
||||
? t("rightRail.closeAll", "Close All")
|
||||
: t("rightRail.closePdf", "Close PDF"),
|
||||
)}
|
||||
{!isCustomView &&
|
||||
renderWithTooltip(
|
||||
<ActionIcon
|
||||
variant="subtle"
|
||||
radius="md"
|
||||
className="workbench-bar-action-icon"
|
||||
onClick={handleClose}
|
||||
disabled={
|
||||
totalItems === 0 || allButtonsDisabled || disableForFullscreen
|
||||
}
|
||||
aria-label={
|
||||
currentView === "fileEditor"
|
||||
? t("rightRail.closeAll", "Close All")
|
||||
: t("rightRail.closePdf", "Close PDF")
|
||||
}
|
||||
>
|
||||
<CloseIcon sx={{ fontSize: "1rem" }} />
|
||||
</ActionIcon>,
|
||||
currentView === "fileEditor"
|
||||
? t("rightRail.closeAll", "Close All")
|
||||
: t("rightRail.closePdf", "Close PDF"),
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -13,7 +13,6 @@ import {
|
||||
import { CONVERSION_MATRIX } from "@app/constants/convertConstants";
|
||||
|
||||
import { NonPdfBanner } from "@app/components/viewer/nonpdf/NonPdfBanner";
|
||||
import { getFileTypeMeta } from "@app/components/viewer/nonpdf/types";
|
||||
import { ImageViewer } from "@app/components/viewer/nonpdf/ImageViewer";
|
||||
import { CsvViewer } from "@app/components/viewer/nonpdf/CsvViewer";
|
||||
import { JsonViewer } from "@app/components/viewer/nonpdf/JsonViewer";
|
||||
@@ -33,10 +32,6 @@ export interface NonPdfViewerProps extends ViewerProps {
|
||||
|
||||
export function NonPdfViewer({ file }: NonPdfViewerProps) {
|
||||
const fileType = useMemo(() => detectNonPdfFileType(file), [file]);
|
||||
const meta = useMemo(
|
||||
() => getFileTypeMeta(fileType, file.name),
|
||||
[fileType, file.name],
|
||||
);
|
||||
|
||||
const { handleToolSelect, toolAvailability } = useToolWorkflow();
|
||||
|
||||
|
||||
@@ -50,7 +50,8 @@ export const FilesModalProvider: React.FC<{ children: React.ReactNode }> = ({
|
||||
const fileCtx = useFileContext();
|
||||
const { actions: navActions } = useNavigationActions();
|
||||
const { workbench: currentWorkbench, selectedTool } = useNavigationState();
|
||||
const isMultiTool = currentWorkbench === "pageEditor" && selectedTool === "multiTool";
|
||||
const isMultiTool =
|
||||
currentWorkbench === "pageEditor" && selectedTool === "multiTool";
|
||||
const [isFilesModalOpen, setIsFilesModalOpen] = useState(false);
|
||||
const [onModalClose, setOnModalClose] = useState<(() => void) | undefined>();
|
||||
const [insertAfterPage, setInsertAfterPage] = useState<number | undefined>();
|
||||
|
||||
@@ -366,10 +366,17 @@ export function ToolWorkflowProvider({ children }: ToolWorkflowProviderProps) {
|
||||
|
||||
if (navigationState.workbench === "pageEditor" && prev !== "pageEditor") {
|
||||
setLeftPanelView("hidden");
|
||||
} else if (navigationState.workbench !== "pageEditor" && prev === "pageEditor") {
|
||||
} else if (
|
||||
navigationState.workbench !== "pageEditor" &&
|
||||
prev === "pageEditor"
|
||||
) {
|
||||
setLeftPanelView("toolPicker");
|
||||
}
|
||||
}, [navigationState.workbench, navigationState.selectedTool, setLeftPanelView]);
|
||||
}, [
|
||||
navigationState.workbench,
|
||||
navigationState.selectedTool,
|
||||
setLeftPanelView,
|
||||
]);
|
||||
|
||||
// Tool reset methods
|
||||
const registerToolReset = useCallback(
|
||||
|
||||
Reference in New Issue
Block a user