open as worspace implementation
This commit is contained in:
@@ -12,6 +12,7 @@ interface ActionsPanelProps {
|
||||
|
||||
onSplit: () => void;
|
||||
onExtractSelected: () => void;
|
||||
onOpenSelectionAsWorkspace: () => void;
|
||||
onExportReordered: () => void;
|
||||
|
||||
splitDownloads: SplitPdfDownload[];
|
||||
@@ -25,6 +26,7 @@ const ActionsPanel: React.FC<ActionsPanelProps> = ({
|
||||
selectedCount,
|
||||
onSplit,
|
||||
onExtractSelected,
|
||||
onOpenSelectionAsWorkspace,
|
||||
onExportReordered,
|
||||
splitDownloads,
|
||||
subsetDownload,
|
||||
@@ -37,6 +39,11 @@ const ActionsPanel: React.FC<ActionsPanelProps> = ({
|
||||
onExtractSelected();
|
||||
};
|
||||
|
||||
const handleOpenSelectionAsWorkspaceClick = () => {
|
||||
if (selectedCount === 0) return;
|
||||
onOpenSelectionAsWorkspace();
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="card">
|
||||
<h2>Tools</h2>
|
||||
@@ -72,6 +79,20 @@ const ActionsPanel: React.FC<ActionsPanelProps> = ({
|
||||
📤 Extract selected ({selectedCount})
|
||||
</button>
|
||||
|
||||
<button
|
||||
className="secondary"
|
||||
disabled={disabled || selectedCount === 0}
|
||||
onClick={handleOpenSelectionAsWorkspaceClick}
|
||||
style={{ flex: '1 1 45%' }}
|
||||
title={
|
||||
selectedCount === 0
|
||||
? 'Select at least one page'
|
||||
: 'Open selected pages as a new unsaved workspace'
|
||||
}
|
||||
>
|
||||
🧩 Open selection as workspace
|
||||
</button>
|
||||
|
||||
<button
|
||||
className="secondary"
|
||||
disabled={disabled}
|
||||
|
||||
@@ -45,11 +45,15 @@ const tutorialSteps = [
|
||||
body: "Use the checkbox on a page card to select it. Shift-click extends a range. Dragging a selected page moves the whole selection; the copy controls duplicate selected pages into a chosen slot.",
|
||||
},
|
||||
{
|
||||
title: "4. Save your workspace or export a PDF",
|
||||
title: "4. Extract selected pages or branch into a new workspace",
|
||||
body: "Extract selected pages when you only need a download. Open the selection as a new workspace when you want to continue working on that subset.",
|
||||
},
|
||||
{
|
||||
title: "5. Save your workspace or export a PDF",
|
||||
body: "Saving a workspace keeps the current working state in this browser. Exporting creates a new PDF file for download.",
|
||||
},
|
||||
{
|
||||
title: "5. Use history deliberately",
|
||||
title: "6. Use history deliberately",
|
||||
body: "Each workspace operation is stored as a command with label and timestamp. Undo and redo walk through that command history.",
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user