diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 31095c4..6a478d1 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -26,9 +26,3 @@ jobs: run: npx playwright test env: BASE_URL: ${{ github.event.deployment_status.target_url }} - - uses: actions/upload-artifact@v3 - if: always() - with: - name: test-results - path: test-results/ - retention-days: 30 diff --git a/app/components/AsciidocBlocks/Document.tsx b/app/components/AsciidocBlocks/Document.tsx index de189fb..3799a65 100644 --- a/app/components/AsciidocBlocks/Document.tsx +++ b/app/components/AsciidocBlocks/Document.tsx @@ -7,6 +7,8 @@ */ import { Content, type DocumentBlock } from '@oxide/react-asciidoc' +// add styles for main +// max-w-full flex-shrink overflow-hidden 800:overflow-visible 800:pr-10 1200:w-[calc(100%-var(--toc-width))] 1200:pr-16 print:p-0 const CustomDocument = ({ document }: { document: DocumentBlock }) => (
(
) -export { CustomDocument } +const MinimalDocument = ({ document }: { document: DocumentBlock }) => ( +
+ +
+) + +export { CustomDocument, MinimalDocument } diff --git a/app/components/Dropdown.tsx b/app/components/Dropdown.tsx index 5ac6dac..d68a13d 100644 --- a/app/components/Dropdown.tsx +++ b/app/components/Dropdown.tsx @@ -19,18 +19,18 @@ export const dropdownInnerStyles = `focus:outline-0 focus:bg-hover px-3 py-2 pr- export const DropdownItem = ({ children, - classNames, + className, onSelect, }: { children: ReactNode | string - classNames?: string + className?: string onSelect?: () => void }) => ( ( - + {children} @@ -88,18 +88,18 @@ export const DropdownLink = ({ export const DropdownMenu = ({ children, - classNames, + className, align = 'end', }: { children: React.ReactNode - classNames?: string + className?: string align?: 'end' | 'start' | 'center' | undefined }) => ( *:last-child]:border-b-0', - classNames, + className, )} align={align} > @@ -110,16 +110,16 @@ export const DropdownMenu = ({ export const DropdownSubMenu = ({ children, - classNames, + className, }: { children: JSX.Element[] - classNames?: string + className?: string }) => ( *:last-child]:border-b-0', - classNames, + className, )} > {children} diff --git a/app/components/ErrorPage.tsx b/app/components/ErrorPage.tsx new file mode 100644 index 0000000..827e57b --- /dev/null +++ b/app/components/ErrorPage.tsx @@ -0,0 +1,48 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * Copyright Oxide Computer Company + */ +import { Error12Icon, PrevArrow12Icon } from '@oxide/design-system/icons/react' +import { Link } from '@remix-run/react' +import type { ReactNode } from 'react' + +const GradientBackground = () => ( +
+) + +type Props = { children: ReactNode; backLink?: string } + +export function ErrorPage({ children, backLink }: Props) { + return ( +
+ +
+ + + Back + +
+
+
+
+ +
+ +
{children}
+
+
+ ) +} diff --git a/app/components/Header.tsx b/app/components/Header.tsx index fec4062..bd4c13d 100644 --- a/app/components/Header.tsx +++ b/app/components/Header.tsx @@ -10,12 +10,13 @@ import { buttonStyle } from '@oxide/design-system' import * as Dropdown from '@radix-ui/react-dropdown-menu' import { Link, useFetcher } from '@remix-run/react' import { useCallback, useState } from 'react' +import { useHotkeys } from 'react-hotkeys-hook' import Icon from '~/components/Icon' import NewRfdButton from '~/components/NewRfdButton' -import { useKey } from '~/hooks/use-key' import { useRootLoaderData } from '~/root' import type { RfdItem, RfdListItem } from '~/services/rfd.server' +import { userIsInternal } from '~/utils/rfdApi' import { DropdownItem, DropdownMenu } from './Dropdown' import { PublicBanner } from './PublicBanner' @@ -53,7 +54,9 @@ export default function Header({ currentRfd }: { currentRfd?: RfdItem }) { return false // Returning false prevents default behaviour in Firefox }, [open]) - useKey('mod+k', toggleSearchMenu) + useHotkeys('mod+k', toggleSearchMenu) + + const isInternal = userIsInternal(user) return (
@@ -79,6 +82,14 @@ export default function Header({ currentRfd }: { currentRfd?: RfdItem }) { setOpen(false)} /> + {user && isInternal && ( + + + + )} {user ? ( diff --git a/app/components/Layout.tsx b/app/components/Layout.tsx new file mode 100644 index 0000000..ec2fac2 --- /dev/null +++ b/app/components/Layout.tsx @@ -0,0 +1,43 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * Copyright Oxide Computer Company + */ +import { Links, Meta, Scripts, ScrollRestoration, useLocation } from '@remix-run/react' +import cn from 'classnames' + +export const Layout = ({ + children, + theme, +}: { + children: React.ReactNode + theme?: string +}) => { + const location = useLocation() + const bodyClass = location.pathname.startsWith('/notes') ? 'note' : 'rfd' + + return ( + + + + + + + + + + {/* Use plausible analytics only on Vercel */} + {process.env.NODE_ENV === 'production' && ( +