diff --git a/apps/remix/app/components/dialogs/organisation-email-create-dialog.tsx b/apps/remix/app/components/dialogs/organisation-email-create-dialog.tsx index cb7ab064a..9676fc269 100644 --- a/apps/remix/app/components/dialogs/organisation-email-create-dialog.tsx +++ b/apps/remix/app/components/dialogs/organisation-email-create-dialog.tsx @@ -72,7 +72,6 @@ export const OrganisationEmailCreateDialog = ({ const { mutateAsync: createOrganisationEmail, isPending } = trpc.enterprise.organisation.email.create.useMutation(); - // Reset state when dialog closes useEffect(() => { if (!open) { form.reset(); diff --git a/apps/remix/app/components/dialogs/suggested-recipients-form.tsx b/apps/remix/app/components/dialogs/suggested-recipients-form.tsx index ff60acde2..126adcddc 100644 --- a/apps/remix/app/components/dialogs/suggested-recipients-form.tsx +++ b/apps/remix/app/components/dialogs/suggested-recipients-form.tsx @@ -171,9 +171,7 @@ export const SuggestedRecipientsForm = ({ try { await onSubmit(normalizedRecipients); } catch (error) { - // Log for debugging console.error('Failed to submit recipients:', error); - // Form level errors are surfaced via toasts in the parent. Keep the dialog open. } }); @@ -194,9 +192,7 @@ export const SuggestedRecipientsForm = ({ try { await onAutoAddFields(normalizedRecipients); } catch (error) { - // Log for debugging console.error('Failed to auto-add fields:', error); - // Form level errors are surfaced via toasts in the parent. Keep the dialog open. } }); diff --git a/apps/remix/app/components/embed/authoring/configure-document-recipients.tsx b/apps/remix/app/components/embed/authoring/configure-document-recipients.tsx index ac4595f8c..25003b712 100644 --- a/apps/remix/app/components/embed/authoring/configure-document-recipients.tsx +++ b/apps/remix/app/components/embed/authoring/configure-document-recipients.tsx @@ -29,7 +29,6 @@ import { Tooltip, TooltipContent, TooltipTrigger } from '@documenso/ui/primitive import { useConfigureDocument } from './configure-document-context'; import type { TConfigureEmbedFormSchema } from './configure-document-view.types'; -// Define a type for signer items type SignerItem = TConfigureEmbedFormSchema['signers'][number]; export interface ConfigureDocumentRecipientsProps { @@ -97,18 +96,15 @@ export const ConfigureDocumentRecipients = ({ const currentSigners = getValues('signers') || [...signers]; const signer = currentSigners[index]; - // Remove signer from current position and insert at new position const remainingSigners = currentSigners.filter((_: unknown, idx: number) => idx !== index); const newPosition = Math.min(Math.max(0, newOrder - 1), currentSigners.length - 1); remainingSigners.splice(newPosition, 0, signer); - // Update signing order for each item const updatedSigners = remainingSigners.map((s: SignerItem, idx: number) => ({ ...s, signingOrder: signingOrder === DocumentSigningOrder.SEQUENTIAL ? idx + 1 : undefined, })); - // Update the form replace(updatedSigners); }, [signers, replace, getValues], @@ -118,17 +114,14 @@ export const ConfigureDocumentRecipients = ({ (result: DropResult) => { if (!result.destination) return; - // Use the move function from useFieldArray which preserves input values move(result.source.index, result.destination.index); - // Update signing orders after move const currentSigners = getValues('signers'); const updatedSigners = currentSigners.map((signer: SignerItem, index: number) => ({ ...signer, signingOrder: signingOrder === DocumentSigningOrder.SEQUENTIAL ? index + 1 : undefined, })); - // Update the form with new ordering replace(updatedSigners); }, [move, replace, getValues], diff --git a/apps/remix/app/components/general/envelope-editor/envelope-editor-fields-page-renderer.tsx b/apps/remix/app/components/general/envelope-editor/envelope-editor-fields-page-renderer.tsx index b5f3f56f1..88839a4dd 100644 --- a/apps/remix/app/components/general/envelope-editor/envelope-editor-fields-page-renderer.tsx +++ b/apps/remix/app/components/general/envelope-editor/envelope-editor-fields-page-renderer.tsx @@ -187,18 +187,12 @@ export default function EnvelopeEditorFieldsPageRenderer() { * Initialize the Konva page canvas and all fields and interactions. */ const createPageCanvas = (currentStage: Konva.Stage, currentPageLayer: Konva.Layer) => { - // Initialize snap guides layer - // snapGuideLayer.current = initializeSnapGuides(stage.current); - - // Add transformer for resizing and rotating. interactiveTransformer.current = createInteractiveTransformer(currentStage, currentPageLayer); - // Render the fields. for (const field of localPageFields) { renderFieldOnLayer(field); } - // Handle stage click to deselect. currentStage.on('mousedown', (e) => { removePendingField(); @@ -292,7 +286,6 @@ export default function EnvelopeEditorFieldsPageRenderer() { let y2: number; currentStage.on('mousedown touchstart', (e) => { - // do nothing if we mousedown on any shape if (e.target !== currentStage) { return; } @@ -318,7 +311,6 @@ export default function EnvelopeEditorFieldsPageRenderer() { }); currentStage.on('mousemove touchmove', () => { - // do nothing if we didn't start selection if (!selectionRectangle.visible()) { return; } @@ -343,7 +335,6 @@ export default function EnvelopeEditorFieldsPageRenderer() { }); currentStage.on('mouseup touchend', () => { - // do nothing if we didn't start selection if (!selectionRectangle.visible()) { return; } @@ -397,34 +388,25 @@ export default function EnvelopeEditorFieldsPageRenderer() { return; } - // If empty area clicked, remove all selections if (e.target === stage.current) { setSelectedFields([]); return; } - // Do nothing if field not clicked, or if field is not editable if (!e.target.hasName('field-group') || e.target.draggable() === false) { return; } - // do we pressed shift or ctrl? const metaPressed = e.evt.shiftKey || e.evt.ctrlKey || e.evt.metaKey; const isSelected = transformer.nodes().indexOf(e.target) >= 0; if (!metaPressed && !isSelected) { - // if no key pressed and the node is not selected - // select just one setSelectedFields([e.target]); } else if (metaPressed && isSelected) { - // if we pressed keys and node was selected - // we need to remove it from selection: - const nodes = transformer.nodes().slice(); // use slice to have new copy of array - // remove node from array + const nodes = transformer.nodes().slice(); nodes.splice(nodes.indexOf(e.target), 1); setSelectedFields(nodes); } else if (metaPressed && !isSelected) { - // add the node into selection const nodes = transformer.nodes().concat([e.target]); setSelectedFields(nodes); } @@ -451,12 +433,10 @@ export default function EnvelopeEditorFieldsPageRenderer() { } }); - // If it exists, rerender. localPageFields.forEach((field) => { renderFieldOnLayer(field); }); - // Rerender the transformer interactiveTransformer.current?.forceUpdate(); pageLayer.current.batchDraw(); diff --git a/apps/remix/app/components/general/envelope-editor/envelope-editor-upload-page.tsx b/apps/remix/app/components/general/envelope-editor/envelope-editor-upload-page.tsx index c606d267e..76defeef6 100644 --- a/apps/remix/app/components/general/envelope-editor/envelope-editor-upload-page.tsx +++ b/apps/remix/app/components/general/envelope-editor/envelope-editor-upload-page.tsx @@ -173,7 +173,6 @@ export const EnvelopeEditorUploadPage = () => { fields: envelope.fields.filter((field) => field.envelopeItemId !== envelopeItemId), }); - // Reset editor fields. editorFields.resetForm(fieldsWithoutDeletedItem); }; diff --git a/apps/remix/app/components/general/envelope/envelope-drop-zone-wrapper.tsx b/apps/remix/app/components/general/envelope/envelope-drop-zone-wrapper.tsx index d1e7323ea..6cbdbaab2 100644 --- a/apps/remix/app/components/general/envelope/envelope-drop-zone-wrapper.tsx +++ b/apps/remix/app/components/general/envelope/envelope-drop-zone-wrapper.tsx @@ -120,13 +120,11 @@ export const EnvelopeDropZoneWrapper = ({ timestamp: new Date().toISOString(), }); - // Show AI prompt dialog for documents setUploadedDocumentId(id); setPendingRecipients(null); setShouldNavigateAfterPromptClose(true); setShowExtractionPrompt(true); } else { - // Templates - navigate immediately const pathPrefix = formatTemplatesPath(team.url); await navigate(`${pathPrefix}/${id}/edit`); } @@ -175,7 +173,6 @@ export const EnvelopeDropZoneWrapper = ({ return; } - // Since users can only upload only one file (no multi-upload), we only handle the first file rejection const { file, errors } = fileRejections[0]; if (!errors.length) { diff --git a/apps/remix/app/components/general/envelope/envelope-upload-button.tsx b/apps/remix/app/components/general/envelope/envelope-upload-button.tsx index d0f3bbe01..28d279dba 100644 --- a/apps/remix/app/components/general/envelope/envelope-upload-button.tsx +++ b/apps/remix/app/components/general/envelope/envelope-upload-button.tsx @@ -42,9 +42,6 @@ export type EnvelopeUploadButtonProps = { folderId?: string; }; -/** - * Upload an envelope - */ export const EnvelopeUploadButton = ({ className, type, folderId }: EnvelopeUploadButtonProps) => { const { t } = useLingui(); const { toast } = useToast(); diff --git a/apps/remix/server/api/document-analysis/index.ts b/apps/remix/server/api/document-analysis/index.ts index 7f63c3235..0333b5e2f 100644 --- a/apps/remix/server/api/document-analysis/index.ts +++ b/apps/remix/server/api/document-analysis/index.ts @@ -163,7 +163,6 @@ const authorizeDocumentAccess = async (envelopeId: string, userId: number) => { }); } - // Return the first document data from the envelope const documentData = envelope.envelopeItems[0]?.documentData; if (!documentData) { @@ -193,7 +192,6 @@ export const aiRoute = new Hono() const { envelopeId } = parsed.data; - // Use shared authorization function const documentData = await authorizeDocumentAccess(envelopeId, user.id); const envelopeRecipients = await prisma.recipient.findMany({ @@ -410,7 +408,6 @@ export const aiRoute = new Hono() const { envelopeId } = parsed.data; - // Use shared authorization function const documentData = await authorizeDocumentAccess(envelopeId, user.id); const pdfBytes = await getFileServerSide({ @@ -420,7 +417,6 @@ export const aiRoute = new Hono() const renderedPages = await renderPdfToImage(pdfBytes); - // Only analyze first few pages for performance const pagesToAnalyze = renderedPages.slice(0, MAX_PAGES_FOR_RECIPIENT_ANALYSIS); const results = await Promise.allSettled(