From 244988e21226a861c57e908c7b78747bfc9ff5cc Mon Sep 17 00:00:00 2001 From: James Ritchie Date: Thu, 10 Oct 2024 14:28:18 +0100 Subject: [PATCH] New Help & Feedback menu and tab-selected styles (#1374) * Added a new dropdown help and feedback menu to the side menu * Added a shortcut to the popover menu * Removed dev cli connected button for now * Contact us form uses original Feedback component to prevent broken links * Improved the messaging when selecting different options in the email form * buttons style tweak * SideMenuItem supports the trailingIconClassName * Adding a consistent focus-visible states * Removing tooltips for now * Squashed commit of the following: commit 7d11123c0a0c98df9196c5d52998ed2fc3e2f4f9 Author: Eric Goldman Date: Mon Sep 30 17:54:06 2024 -0700 Add sequin guide (#1368) Co-authored-by: James Ritchie commit 8da495ac00e58c8afcafd43044520de4c771f64b Author: nicktrn <55853254+nicktrn@users.noreply.github.com> Date: Mon Sep 30 13:42:22 2024 +0100 Improve checkpoint reliability and cleanup of temp files (#1367) * improve cleanup reliability * improve logging * bye-bye execa * fix for trailing newlines * prettier errors * trim args and log output by default * fix archive cleanup * prevent potential memleak * more cleanup debug logs * ignore abort during cleanup * rename checkpoint dir env var and move to helper * add global never throw override * add tmp cleaner * also clean up checkpoint dir by default * split by any whitespace, not just tabs * only create tmp cleaner if paths to clean commit 69ec68ee310e8a05cfde64a774139d8e6222ac5d Author: Eric Allam Date: Sun Sep 29 19:18:39 2024 -0700 Release 3.0.9 commit a6ea8444c90fe046364117cd3b4c4a345c6f7a5c Author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun Sep 29 19:17:26 2024 -0700 chore: Update version for release (#1366) Co-authored-by: github-actions[bot] commit 4c1ee3d6ea5f2e1dfc9f475c99ecd236bf780a19 Author: Eric Allam Date: Sun Sep 29 19:09:38 2024 -0700 fix: run metadata not working when using npx/pnpm dlx * More support for custom-focus * More custom focus styles added * Support for focus-visible style for the Segmented control * Fixed table triple dot menu z-index issue * Improved help menu wording * When you submit the help form, close the modal * focus-visible style for radio buttons * button prop is now optional in the SideMenu component * focus styling for a text link * Deleted unused sequin files --- apps/webapp/app/components/Feedback.tsx | 258 ++++++--------- .../components/billing/v2/FreePlanUsage.tsx | 2 +- apps/webapp/app/components/code/CodeBlock.tsx | 2 +- .../components/navigation/AccountSideMenu.tsx | 4 +- .../app/components/navigation/SideMenu.tsx | 309 +++++++++++------- .../components/navigation/SideMenuItem.tsx | 37 +-- .../components/primitives/AppliedFilter.tsx | 5 +- .../app/components/primitives/Buttons.tsx | 21 +- .../app/components/primitives/Dialog.tsx | 2 +- .../app/components/primitives/InfoPanel.tsx | 8 +- .../app/components/primitives/Input.tsx | 2 +- .../app/components/primitives/PageHeader.tsx | 2 +- .../app/components/primitives/Popover.tsx | 48 ++- .../app/components/primitives/RadioButton.tsx | 10 +- .../app/components/primitives/Resizable.tsx | 2 +- .../primitives/SegmentedControl.tsx | 5 +- .../app/components/primitives/Select.tsx | 16 +- .../app/components/primitives/Switch.tsx | 8 +- .../app/components/primitives/Table.tsx | 6 +- .../webapp/app/components/primitives/Tabs.tsx | 4 +- .../app/components/primitives/TextArea.tsx | 2 +- .../app/components/primitives/Tooltip.tsx | 6 +- .../app/components/runs/v3/RunFilters.tsx | 12 +- .../app/components/runs/v3/RunInspector.tsx | 4 +- .../app/components/runs/v3/SpanInspector.tsx | 2 +- .../route.tsx | 18 +- .../route.tsx | 18 +- apps/webapp/app/routes/resources.feedback.ts | 2 +- .../route.tsx | 4 +- apps/webapp/tailwind.config.js | 17 +- 30 files changed, 452 insertions(+), 384 deletions(-) diff --git a/apps/webapp/app/components/Feedback.tsx b/apps/webapp/app/components/Feedback.tsx index c5e918610..3c9b38975 100644 --- a/apps/webapp/app/components/Feedback.tsx +++ b/apps/webapp/app/components/Feedback.tsx @@ -1,31 +1,23 @@ import { conform, useForm } from "@conform-to/react"; import { parse } from "@conform-to/zod"; -import { BookOpenIcon } from "@heroicons/react/20/solid"; -import { - CalendarDaysIcon, - ChevronRightIcon, - EnvelopeIcon, - LifebuoyIcon, - LightBulbIcon, -} from "@heroicons/react/24/solid"; +import { EnvelopeIcon, LightBulbIcon } from "@heroicons/react/24/solid"; import { Form, useActionData, useLocation, useNavigation } from "@remix-run/react"; -import { DiscordIcon } from "@trigger.dev/companyicons"; -import { ActivityIcon } from "lucide-react"; -import { type ReactNode, useState } from "react"; +import { type ReactNode, useState, useEffect } from "react"; import { type FeedbackType, feedbackTypeLabel, schema } from "~/routes/resources.feedback"; -import { cn } from "~/utils/cn"; -import { docsTroubleshootingPath } from "~/utils/pathBuilder"; -import { Button, LinkButton } from "./primitives/Buttons"; +import { Button } from "./primitives/Buttons"; +import { Dialog, DialogContent, DialogHeader, DialogTrigger } from "./primitives/Dialog"; import { Fieldset } from "./primitives/Fieldset"; import { FormButtons } from "./primitives/FormButtons"; import { FormError } from "./primitives/FormError"; -import { Header1 } from "./primitives/Headers"; +import { Icon } from "./primitives/Icon"; +import { InfoPanel } from "./primitives/InfoPanel"; import { InputGroup } from "./primitives/InputGroup"; import { Label } from "./primitives/Label"; import { Paragraph } from "./primitives/Paragraph"; import { Select, SelectItem } from "./primitives/Select"; -import { Sheet, SheetBody, SheetContent, SheetTrigger } from "./primitives/Sheet"; import { TextArea } from "./primitives/TextArea"; +import { InformationCircleIcon } from "@heroicons/react/20/solid"; +import { TextLink } from "./primitives/TextLink"; type FeedbackProps = { button: ReactNode; @@ -37,161 +29,111 @@ export function Feedback({ button, defaultValue = "bug" }: FeedbackProps) { const location = useLocation(); const lastSubmission = useActionData(); const navigation = useNavigation(); + const [type, setType] = useState(defaultValue); const [form, { path, feedbackType, message }] = useForm({ id: "accept-invite", - // TODO: type this lastSubmission: lastSubmission as any, onValidate({ formData }) { return parse(formData, { schema }); }, + shouldRevalidate: "onInput", }); - if ( - open && - navigation.formAction === "/resources/feedback" && - form.error === undefined && - form.errors.length === 0 - ) { - setOpen(false); - } + useEffect(() => { + if ( + navigation.formAction === "/resources/feedback" && + navigation.state === "loading" && + form.error === undefined && + form.errors.length === 0 + ) { + setOpen(false); + } + }, [navigation, form]); return ( - - {button} - - - } - to="https://trigger.dev/discord" - className="hover:border-text-link" - > - The quickest way to get answers from the Trigger.dev community. - - } - to="https://cal.com/team/triggerdotdev/founders-call" - className="hover:border-green-500" - > - Have a question or want to chat? Book a time to talk with us. - - } - to="https://feedback.trigger.dev/" - className="hover:border-sun-400" - > - Have an idea for a new feature or improvement? Let us know! - - } - > - - If you're having trouble, check out our troubleshooting guide or the Trigger.dev - Status page. + + {button} + + Contact us +
+
+ + + How can we help? We read every message and will respond as quickly as we can. -
- - Troubleshooting Docs - - - Trigger.dev Status - -
- - } - > - We read every message and respond quickly. -
-
- - - + + {type === "feature" && ( + - {Object.entries(feedbackTypeLabel).map(([name, title]) => ( - - {title} - - ))} - - {feedbackType.error} - - - -