Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dashboard UX improvements #10868

Merged
merged 52 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
7e162ac
Update rust-toolchain hash in Nix
somebody1234 Aug 19, 2024
361990a
Fix styling for JSON Schema Input
somebody1234 Aug 19, 2024
8aed375
Rewrite Dropdown component
somebody1234 Aug 19, 2024
c689194
Move Dropdown `render` prop to `children`
somebody1234 Aug 19, 2024
17b18ac
Make error display fit on screen
somebody1234 Aug 19, 2024
25f2d1b
Switch secret from Modal to Dialog
somebody1234 Aug 19, 2024
f700791
Finish switching Dropdown to react-aria-components
somebody1234 Aug 20, 2024
931b34c
Switch Dropdown to tailwind-variants
somebody1234 Aug 20, 2024
719b1f1
Fix checkmark not showing for Dropdown; fix Dropdown toggle not working
somebody1234 Aug 20, 2024
3941041
Pull in form refactor from Async Execution PR
somebody1234 Aug 20, 2024
6a0d886
Migrate from `React.forwardRef` to generic `forwardRef` wrapper
somebody1234 Aug 20, 2024
a04c1fe
Fix exports
somebody1234 Aug 21, 2024
09f2e22
Update launch.json
somebody1234 Aug 21, 2024
6c45dd6
Update react-aria-components
somebody1234 Aug 21, 2024
6c5dc08
Migrate ActivityLogSettingsSection to DatePicker
somebody1234 Aug 21, 2024
9b1180f
Adjust DatePicker tailwind-variants configuration
somebody1234 Aug 21, 2024
8bb18d7
Fixed size for Activity Log DatePicker
somebody1234 Aug 21, 2024
3ea825e
(Not working) Max date for Activity Log date picker
somebody1234 Aug 21, 2024
48a05b4
Highlight selected dates
somebody1234 Aug 21, 2024
836b43b
Add reset button to DatePicker
somebody1234 Aug 21, 2024
32f9739
Fix lint errors
somebody1234 Aug 21, 2024
4d180a7
Clean up ActivityLogSettingsSection
somebody1234 Aug 21, 2024
bc65e02
Clean up SettingsSidebar
somebody1234 Aug 21, 2024
3619938
Visual adjustments to Settings page
somebody1234 Aug 21, 2024
a5e7fd2
Refactor SidebarTabButton
somebody1234 Aug 21, 2024
f18b592
Refactor AssetsTable column headings
somebody1234 Aug 21, 2024
e48ae22
Adjustments to Dropdown and Dialog styles
somebody1234 Aug 21, 2024
cb2ce01
WIP: Fix mouse toggle for Dropdown
somebody1234 Aug 21, 2024
ca4dc15
Fix errors
somebody1234 Aug 21, 2024
04a358c
Fix dialog sizing
somebody1234 Aug 22, 2024
7cd5596
Fix incorrect type of input props
somebody1234 Aug 22, 2024
b3bc7a4
Address other type errors
somebody1234 Aug 22, 2024
d6a6dbc
Improve Dropdown mouse UX
somebody1234 Aug 22, 2024
2d0daec
Move DatePicker dropdown button to left for consistency with Dropdown
somebody1234 Aug 22, 2024
a21dda8
Fix Navigator2D handler to not move focus away if the event is alread…
somebody1234 Aug 22, 2024
fbfa7a6
Fix Dropdown mouse focus issues
somebody1234 Aug 22, 2024
d13d9f2
Fix width of `integer` JSON Schema input
somebody1234 Aug 22, 2024
76a190c
Fix type error
somebody1234 Aug 22, 2024
85f8bb8
Merge branch 'develop' into wip/sb/rac-dropdown
somebody1234 Aug 22, 2024
7935856
Switch DriveBar to {} imports
somebody1234 Aug 22, 2024
36af0dd
Make "new secret" and "new datalink" forms close modal
somebody1234 Aug 22, 2024
518ccf9
oops wrong prop name
somebody1234 Aug 22, 2024
84c8a6f
Fix selector for Datalink name
somebody1234 Aug 22, 2024
66fa690
Fix locator for Datalink modal
somebody1234 Aug 22, 2024
813279d
Address CR
somebody1234 Aug 23, 2024
4b9af2e
Refactor ConfirmDeleteModal from Modal to Dialog
somebody1234 Aug 23, 2024
664490e
Merge branch 'develop' into wip/sb/rac-dropdown
somebody1234 Aug 28, 2024
d657ad8
Fix E2E tests
somebody1234 Aug 29, 2024
35034d8
Fix "confirm delete" modal
somebody1234 Aug 29, 2024
427f1de
Fix `defaultOpen` for modals
somebody1234 Aug 29, 2024
3ce7de2
Make Drive sidebar scrollable if window is too small
somebody1234 Aug 29, 2024
ef14e29
Merge branch 'develop' into wip/sb/rac-dropdown
somebody1234 Aug 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 24 additions & 24 deletions app/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,88 +5,88 @@
"type": "node",
"request": "launch",
"name": "Dashboard",
"runtimeExecutable": "npm",
"runtimeArgs": ["run", "--workspace=enso-dashboard", "dev"]
"runtimeExecutable": "pnpm",
"runtimeArgs": ["run", "--filter", "enso-dashboard", "dev"]
},
{
"type": "node",
"request": "launch",
"name": "GUI",
"runtimeExecutable": "npm",
"runtimeArgs": ["run", "--workspace=enso-gui2", "dev"]
"runtimeExecutable": "pnpm",
"runtimeArgs": ["dev:gui"]
},
{
"type": "node",
"request": "launch",
"name": "GUI (Storybook)",
"runtimeExecutable": "npm",
"runtimeArgs": ["run", "--workspace=enso-gui2", "story:dev"]
"runtimeExecutable": "pnpm",
"runtimeArgs": ["run", "--filter", "enso-gui2", "story:dev"]
},
{
"type": "node",
"request": "launch",
"name": "Dashboard (Build)",
"runtimeExecutable": "npm",
"runtimeArgs": ["run", "--workspace=enso-gui2", "build:cloud"]
"runtimeExecutable": "pnpm",
"runtimeArgs": ["build:gui"]
},
{
"type": "node",
"request": "launch",
"name": "Dashboard (E2E UI)",
"runtimeExecutable": "npm",
"runtimeArgs": ["run", "--workspace=enso-dashboard", "test:e2e:debug"]
"runtimeExecutable": "pnpm",
"runtimeArgs": ["run", "--filter", "enso-dashboard", "test:e2e:debug"]
},
{
"type": "node",
"request": "launch",
"name": "GUI (E2E UI)",
"runtimeExecutable": "npm",
"runtimeArgs": ["run", "--workspace=enso-gui2", "test:e2e", "--", "--ui"]
"runtimeExecutable": "pnpm",
"runtimeArgs": ["run", "--filter", "enso-gui2", "test:e2e", "--", "--ui"]
},
{
"type": "node",
"request": "launch",
"name": "Dashboard (All tests)",
"runtimeExecutable": "npm",
"runtimeArgs": ["run", "--workspace=enso-dashboard", "test"]
"runtimeExecutable": "pnpm",
"runtimeArgs": ["run", "--filter", "enso-dashboard", "test"]
},
{
"type": "node",
"request": "launch",
"name": "Dashboard (E2E tests)",
"runtimeExecutable": "npm",
"runtimeArgs": ["run", "--workspace=enso-dashboard", "test:e2e"],
"runtimeExecutable": "pnpm",
"runtimeArgs": ["run", "--filter", "enso-dashboard", "test:e2e"],
"outputCapture": "std"
},
{
"type": "node",
"request": "launch",
"name": "Dashboard (Unit tests)",
"runtimeExecutable": "npm",
"runtimeArgs": ["run", "--workspace=enso-dashboard", "test:unit"],
"runtimeExecutable": "pnpm",
"runtimeArgs": ["run", "--filter", "enso-dashboard", "test:unit"],
"outputCapture": "std"
},
{
"type": "node",
"request": "launch",
"name": "GUI (All tests)",
"runtimeExecutable": "npm",
"runtimeArgs": ["run", "--workspace=enso-gui2", "test"]
"runtimeExecutable": "pnpm",
"runtimeArgs": ["run", "--filter", "enso-gui2", "test"]
},
{
"type": "node",
"request": "launch",
"name": "GUI (E2E tests)",
"runtimeExecutable": "npm",
"runtimeArgs": ["run", "--workspace=enso-gui2", "test:e2e"],
"runtimeExecutable": "pnpm",
"runtimeArgs": ["run", "--filter", "enso-gui2", "test:e2e"],
"outputCapture": "std"
},
{
"type": "node",
"request": "launch",
"name": "GUI (Unit tests)",
"runtimeExecutable": "npm",
"runtimeArgs": ["run", "--workspace=enso-gui2", "test:unit", "--", "run"],
"runtimeExecutable": "pnpm",
"runtimeArgs": ["run", "--filter", "enso-gui2", "test:unit", "--", "run"],
"outputCapture": "std"
}
]
Expand Down
11 changes: 6 additions & 5 deletions app/dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"@aws-amplify/auth": "5.6.5",
"@aws-amplify/core": "5.8.5",
"@hookform/resolvers": "^3.4.0",
"@internationalized/date": "^3.5.5",
"@monaco-editor/react": "4.6.0",
"@sentry/react": "^7.74.0",
"@stripe/react-stripe-js": "^2.7.1",
Expand All @@ -40,26 +41,26 @@
"ajv": "^8.12.0",
"clsx": "^2.1.1",
"enso-common": "workspace:*",
"framer-motion": "11.3.0",
"is-network-error": "^1.0.1",
"monaco-editor": "0.48.0",
"react": "^18.3.1",
"react-aria": "^3.33.0",
"react-aria-components": "^1.2.0",
"react-aria": "^3.34.3",
"react-aria-components": "^1.3.3",
"react-dom": "^18.3.1",
"react-error-boundary": "4.0.13",
"react-hook-form": "^7.51.4",
"react-router": "^6.23.1",
"react-router-dom": "^6.23.1",
"react-stately": "^3.31.0",
"react-stately": "^3.32.2",
"react-toastify": "^9.1.3",
"tailwind-merge": "^2.3.0",
"tailwind-variants": "0.2.1",
"tiny-invariant": "^1.3.3",
"ts-results": "^3.3.0",
"validator": "^13.12.0",
"zod": "^3.23.8",
"zustand": "^4.5.4",
"framer-motion": "11.3.0"
"zustand": "^4.5.4"
},
"devDependencies": {
"@fast-check/vitest": "^0.0.8",
Expand Down
8 changes: 0 additions & 8 deletions app/dashboard/src/assets/folder_arrow_double.svg

This file was deleted.

21 changes: 11 additions & 10 deletions app/dashboard/src/components/AriaComponents/Alert/Alert.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
/** @file Alert component. */
import * as React from 'react'
import { type ForwardedRef, type HTMLAttributes, type PropsWithChildren } from 'react'

import * as mergeRefs from '#/utilities/mergeRefs'
import * as twv from '#/utilities/tailwindVariants'
import { mergeRefs } from '#/utilities/mergeRefs'
import { forwardRef } from '#/utilities/react'
import { tv, type VariantProps } from '#/utilities/tailwindVariants'

// =================
// === Constants ===
// =================

export const ALERT_STYLES = twv.tv({
export const ALERT_STYLES = tv({
base: 'flex flex-col items-stretch',
variants: {
fullWidth: { true: 'w-full' },
Expand Down Expand Up @@ -51,14 +52,14 @@ export const ALERT_STYLES = twv.tv({

/** Props for an {@link Alert}. */
export interface AlertProps
extends React.PropsWithChildren,
twv.VariantProps<typeof ALERT_STYLES>,
React.HTMLAttributes<HTMLDivElement> {}
extends PropsWithChildren,
VariantProps<typeof ALERT_STYLES>,
HTMLAttributes<HTMLDivElement> {}

/** Alert component. */
export const Alert = React.forwardRef(function Alert(
export const Alert = forwardRef(function Alert(
props: AlertProps,
ref: React.ForwardedRef<HTMLDivElement>,
ref: ForwardedRef<HTMLDivElement>,
) {
const { children, className, variant, size, rounded, fullWidth, ...containerProps } = props

Expand All @@ -70,7 +71,7 @@ export const Alert = React.forwardRef(function Alert(
return (
<div
className={ALERT_STYLES({ variant, size, className, rounded, fullWidth })}
ref={mergeRefs.mergeRefs(ref, (e) => {
ref={mergeRefs(ref, (e) => {
if (variant === 'error') {
e?.focus()
}
Expand Down
20 changes: 12 additions & 8 deletions app/dashboard/src/components/AriaComponents/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import SvgMask from '#/components/SvgMask'

import * as twv from '#/utilities/tailwindVariants'

import * as text from '../Text'
import { forwardRef } from '#/utilities/react'
import { TEXT_STYLE } from '../Text'

// ==============
// === Button ===
Expand Down Expand Up @@ -106,7 +107,7 @@ export const BUTTON_STYLES = twv.tv({
custom: { base: '', extraClickZone: '', icon: 'h-full' },
hero: { base: 'px-8 py-4 text-lg font-bold', content: 'gap-[0.75em]' },
large: {
base: text.TEXT_STYLE({
base: TEXT_STYLE({
variant: 'body',
color: 'custom',
weight: 'semibold',
Expand All @@ -117,7 +118,7 @@ export const BUTTON_STYLES = twv.tv({
extraClickZone: 'after:inset-[-6px]',
},
medium: {
base: text.TEXT_STYLE({
base: TEXT_STYLE({
variant: 'body',
color: 'custom',
weight: 'semibold',
Expand All @@ -128,7 +129,7 @@ export const BUTTON_STYLES = twv.tv({
extraClickZone: 'after:inset-[-8px]',
},
small: {
base: text.TEXT_STYLE({
base: TEXT_STYLE({
variant: 'body',
color: 'custom',
weight: 'medium',
Expand All @@ -139,7 +140,7 @@ export const BUTTON_STYLES = twv.tv({
extraClickZone: 'after:inset-[-10px]',
},
xsmall: {
base: text.TEXT_STYLE({
base: TEXT_STYLE({
variant: 'body',
color: 'custom',
weight: 'medium',
Expand All @@ -151,7 +152,7 @@ export const BUTTON_STYLES = twv.tv({
extraClickZone: 'after:inset-[-12px]',
},
xxsmall: {
base: text.TEXT_STYLE({
base: TEXT_STYLE({
variant: 'body',
color: 'custom',
className: 'flex px-[3px] pt-[0.5px] pb-[2.5px] leading-[16px]',
Expand All @@ -166,7 +167,7 @@ export const BUTTON_STYLES = twv.tv({
},
iconOnly: {
true: {
base: text.TEXT_STYLE({
base: TEXT_STYLE({
disableLineHeightCompensation: true,
className: 'border-0 outline-offset-[5px]',
}),
Expand Down Expand Up @@ -203,6 +204,9 @@ export const BUTTON_STYLES = twv.tv({
},
ghost:
'text-primary hover:text-primary/80 hover:bg-white focus-visible:text-primary/80 focus-visible:bg-white',
// eslint-disable-next-line @typescript-eslint/naming-convention
'ghost-fading':
'text-primary opacity-80 hover:opacity-100 hover:bg-white focus-visible:bg-white',
submit: 'bg-invite text-white opacity-80 hover:opacity-100',
outline: 'border-primary/40 text-primary hover:border-primary hover:bg-primary/5',
bar: 'border-primary/20 hover:bg-primary/5',
Expand Down Expand Up @@ -282,7 +286,7 @@ export const BUTTON_STYLES = twv.tv({
})

/** A button allows a user to perform an action, with mouse, touch, and keyboard interactions. */
export const Button = React.forwardRef(function Button(
export const Button = forwardRef(function Button(
props: ButtonProps,
ref: React.ForwardedRef<HTMLButtonElement>,
) {
Expand Down
22 changes: 14 additions & 8 deletions app/dashboard/src/components/AriaComponents/Dialog/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ const DIALOG_STYLES = twv.tv({
header: 'px-4 pt-[5px] pb-1.5 min-h-12',
},
},
fitContent: {
true: {
base: 'min-w-max',
content: 'min-w-max',
},
},
hideCloseButton: { true: { closeButton: 'hidden' } },
closeButton: {
normal: { base: '', closeButton: '' },
Expand Down Expand Up @@ -127,6 +133,7 @@ export function Dialog(props: DialogProps) {
testId = 'dialog',
size,
rounded,
fitContent,
...ariaDialogProps
} = props

Expand All @@ -148,14 +155,15 @@ export function Dialog(props: DialogProps) {
const overlayState = React.useRef<aria.OverlayTriggerState | null>(null)
const root = portal.useStrictPortalContext()

const dialogSlots = DIALOG_STYLES({
const styles = DIALOG_STYLES({
className,
type,
rounded,
hideCloseButton,
closeButton,
scrolledToTop: isScrolledToTop,
size,
fitContent,
})

utlities.useInteractOutside({
Expand Down Expand Up @@ -216,25 +224,23 @@ export function Dialog(props: DialogProps) {
element.dataset.testId = testId
}
})}
className={dialogSlots.base()}
className={styles.base()}
{...ariaDialogProps}
>
{(opts) => {
return (
<dialogProvider.DialogProvider value={{ close: opts.close, dialogId }}>
<aria.Header
className={dialogSlots.header({ scrolledToTop: isScrolledToTop })}
>
<aria.Header className={styles.header({ scrolledToTop: isScrolledToTop })}>
<ariaComponents.CloseButton
className={dialogSlots.closeButton()}
className={styles.closeButton()}
onPress={opts.close}
/>

{title != null && (
<ariaComponents.Text.Heading
slot="title"
level={2}
className={dialogSlots.heading()}
className={styles.heading()}
weight="semibold"
>
{title}
Expand All @@ -248,7 +254,7 @@ export function Dialog(props: DialogProps) {
handleScroll(ref.scrollTop)
}
}}
className={dialogSlots.content()}
className={styles.content()}
onScroll={(event) => {
handleScroll(event.currentTarget.scrollTop)
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const POPOVER_STYLES = twv.tv({
true: 'animate-out fade-out placement-bottom:slide-out-to-top-1 placement-top:slide-out-to-bottom-1 placement-left:slide-out-to-right-1 placement-right:slide-out-to-left-1 ease-in duration-150',
},
size: {
auto: { base: 'w-[unset]', dialog: 'p-2.5' },
xsmall: { base: 'max-w-xs', dialog: 'p-2.5' },
small: { base: 'max-w-sm', dialog: 'p-3.5' },
medium: { base: 'max-w-md', dialog: 'p-3.5' },
Expand Down
Loading
Loading