chore: remove extra comments

This commit is contained in:
Catalin Pit
2026-09-08 13:54:49 +03:00
parent 1fb4610a1d
commit 57712ee33a
10 changed files with 7 additions and 41 deletions
@@ -21,11 +21,6 @@ export type DocumentAttachmentsPopoverProps = {
envelopeId: string;
buttonClassName?: string;
buttonSize?: 'sm' | 'default';
/**
* Visually hide the button label below the `sm` breakpoint while keeping it
* available to screen readers.
*/
collapseLabelOnMobile?: boolean;
};
@@ -19,11 +19,6 @@ import { z } from 'zod';
export type EmbeddedEditorAttachmentPopoverProps = {
buttonClassName?: string;
buttonSize?: 'sm' | 'default';
/**
* Visually hide the button label below the `sm` breakpoint while keeping it
* available to screen readers.
*/
collapseLabelOnMobile?: boolean;
};
@@ -89,11 +89,6 @@ export const fieldButtonList = [
type EnvelopeEditorFieldDragDropProps = {
selectedRecipientId: number | null;
selectedEnvelopeItemId: string | null;
/**
* Called when the user picks a field type from the palette, before the field
* is placed on the document.
*/
onFieldSelect?: (fieldType: FieldType) => void;
};
@@ -89,8 +89,6 @@ export const EnvelopeEditorFieldsPage = () => {
const [isAiEnableDialogOpen, setIsAiEnableDialogOpen] = useState(false);
const { revalidate } = useRevalidator();
// Whether the fields panel overlay is open. Only relevant below the `md`
// breakpoint, where the panel is hidden behind a floating trigger button.
const [isMobileFieldsPanelOpen, setIsMobileFieldsPanelOpen] = useState(false);
const envelopeItemPermissions = useMemo(
@@ -191,8 +189,6 @@ export const EnvelopeEditorFieldsPage = () => {
}, []);
const onDetectClick = () => {
// Close the panel overlay on small viewports so the document stays
// visible while the AI dialogs are open.
setIsMobileFieldsPanelOpen(false);
if (!team.preferences.aiFeaturesEnabled) {
@@ -336,24 +332,19 @@ export const EnvelopeEditorFieldsPage = () => {
)}
{/*
* Below `md` the panel is a slide-in overlay, from `md` upwards it is a
* static sidebar.
*
* This is deliberately one always-mounted element toggled with CSS rather
* than a Sheet/Drawer: the field palette registers window-level mouse
* listeners that must survive the panel closing mid click-to-place, and
* unmounting would also double-mount the field settings forms and AI
* dialogs. `invisible` (with the transition covering visibility) keeps the
* closed overlay out of the tab order and accessibility tree.
* Always mounted and toggled with CSS rather than a Sheet/Drawer: the field
* palette registers window-level mouse listeners that must survive the panel
* closing mid click-to-place, and unmounting would also double-mount the field
* settings forms and AI dialogs. `invisible` keeps the closed overlay out of
* the tab order and accessibility tree.
*/}
<div
className={cn(
'fixed inset-y-0 right-0 z-50 w-80 max-w-[85vw] overflow-y-auto border-border border-l bg-background py-4 transition-[transform,visibility] duration-200',
isMobileFieldsPanelOpen ? 'translate-x-0 shadow-xl' : 'invisible translate-x-full',
'md:visible md:sticky md:top-0 md:z-auto md:h-full md:w-80 md:max-w-none md:flex-shrink-0 md:translate-x-0 md:shadow-none md:transition-none',
'md:visible md:sticky md:top-0 md:z-auto md:h-full md:w-80 md:max-w-none md:flex-shrink-0 md:transform-none md:shadow-none md:transition-none',
)}
>
{/* Panel header with close button, visible below the `md` breakpoint. */}
<div className="mb-4 flex items-center justify-between px-4 md:hidden">
<h3 className="font-semibold text-foreground text-sm">
<Trans>Fields</Trans>
@@ -71,7 +71,6 @@ export default function EnvelopeEditorHeader() {
<nav className="w-full border-border border-b bg-background px-4 py-3 md:px-6">
<div className="flex items-center justify-between gap-4">
<div className="flex min-w-0 flex-1 items-center gap-2 sm:gap-4">
{/* The logo and separator are hidden on small viewports to leave room for the title. */}
{editorConfig.embedded?.customBrandingLogo ? (
<img src={`/api/branding/logo/team/${envelope.teamId}`} alt="Logo" className="hidden h-6 w-auto sm:block" />
) : (
@@ -897,11 +897,6 @@ export const EnvelopeEditorRecipientForm = () => {
/>
)}
{/*
* Below `sm` the fields are stacked, so each recipient gets a header line
* (title, role and delete) with the inputs underneath. The `order` classes
* pull the role and delete controls up next to this title.
*/}
<span className="order-1 min-w-0 flex-1 truncate font-medium text-sm sm:hidden">
<Trans>Recipient {index + 1}</Trans>
</span>
@@ -314,7 +314,6 @@ export const EnvelopeEditorSettingsDialog = ({ trigger, ...props }: EnvelopeEdit
)}
</DialogTrigger>
{/* Below `md` the sidebar stacks above the content and the form body scrolls within the viewport. */}
<DialogContent className="!max-w-5xl flex max-h-[100dvh] w-full flex-col gap-0 p-0 md:max-h-none md:flex-row">
{/* Sidebar. */}
<div className="flex shrink-0 flex-col border-b bg-accent/20 md:w-80 md:border-r md:border-b-0">
@@ -646,7 +646,6 @@ export const EnvelopeEditorUploadPage = () => {
{/* Recipients Section */}
<EnvelopeEditorRecipientForm />
{/* Below `md` the step bar already offers this, so the button only shows alongside the sidebar. */}
{editorConfig.general.allowAddFieldsStep && (
<div className="hidden justify-end md:flex">
<Button type="button" onClick={() => void navigateToStep('addFields')}>
@@ -157,7 +157,6 @@ export const EnvelopeEditor = () => {
<div className="flex h-[100dvh] w-full flex-col bg-envelope-editor-background">
<EnvelopeEditorHeader />
{/* Embedded hosts control their own frame size, so the notice only applies to the full app. */}
{!editorConfig.embedded && <EnvelopeEditorMobileNotice />}
{/* Main Content Area */}
@@ -404,7 +403,7 @@ export const EnvelopeEditor = () => {
{/* Mobile quick actions, opened from the "More" item in the step bar. */}
{hasMobileMenu && (
<Sheet open={isMobileMenuOpen} onOpenChange={setIsMobileMenuOpen}>
<SheetContent className="flex w-full max-w-[350px] flex-col">
<SheetContent className="flex w-full max-w-[350px] flex-col overflow-y-auto">
<SheetHeader className="text-left">
<SheetTitle>
<Trans>Quick Actions</Trans>
@@ -153,7 +153,6 @@ export const DocumentDropzone = ({
{_(heading[type])}
</p>
{/* The drag & drop hint is irrelevant on touch devices, but the disabled reason must always show. */}
<p className={cn('mt-1 text-center text-muted-foreground/80 text-sm', !disabled && 'hidden sm:block')}>
{_(disabled ? disabledMessage : msg`Drag & drop your document here.`)}
</p>