Skip to content

Commit

Permalink
Merge branch 'develop' into wip/mk/numeric-formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
marthasharkey committed Mar 4, 2025
2 parents 0e5cfa7 + 725e6b2 commit 638ccdb
Show file tree
Hide file tree
Showing 93 changed files with 9,803 additions and 1,454 deletions.
4 changes: 3 additions & 1 deletion .bazelignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ app/ide-desktop/lib/esbuild-plugin-copy-directories/node_modules
app/ide-desktop/lib/icons/node_modules
app/ide-desktop/lib/ts-plugin-namespace-auto-import/node_modules
app/ide-desktop/node_modules
app/lang-markdown/node_modules
app/lezer-markdown/node_modules
app/rust-ffi/node_modules
app/ydoc-server/node_modules
app/ydoc-server-nodejs/node_modules
Expand All @@ -33,4 +35,4 @@ build-cache
.dist
target
build
.git
.git
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ maven_install.json

# Git-subtree, upstream doesn't use prettier
app/lang-markdown
app/lezer-markdown

# Engine Builds can leave these nested working copies.
# TODO [mwu]: Adjust Engine build to not leave them.
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@
[11695]: https://github.com/enso-org/enso/pull/11695
[11715]: https://github.com/enso-org/enso/pull/11715
[11753]: https://github.com/enso-org/enso/pull/11753
[11755]: https://github.com/enso-org/enso/pull/11755
[11761]: https://github.com/enso-org/enso/pull/11761
[11768]: https://github.com/enso-org/enso/pull/11768
[11810]: https://github.com/enso-org/enso/pull/11810
Expand All @@ -236,6 +237,8 @@
- [The reload button clears the HTTP cache.][11673]
- [SQL Server Support for Aggregate][11811]
- [Added `Download_Mode` parameter to `Data.download`.][12017]
- [Added `Table.geo_distance` to calculate the distance between two
points.][12393]

[11235]: https://github.com/enso-org/enso/pull/11235
[11255]: https://github.com/enso-org/enso/pull/11255
Expand All @@ -248,6 +251,7 @@
[11673]: https://github.com/enso-org/enso/pull/11673
[11811]: https://github.com/enso-org/enso/pull/11811
[12017]: https://github.com/enso-org/enso/pull/12017
[12393]: https://github.com/enso-org/enso/pull/12393

#### Enso Language & Runtime

Expand Down
15 changes: 0 additions & 15 deletions app/gui/integration-test/dashboard/actions/DrivePageActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import EditorPageActions from './EditorPageActions'
import { goToPageActions, type GoToPageActions } from './goToPageActions'
import NewDataLinkModalActions from './NewDataLinkModalActions'
import PageActions from './PageActions'
import StartModalActions from './StartModalActions'

const ASSET_ROW_SAFE_POSITION = { x: 150, y: 16 }

Expand Down Expand Up @@ -368,20 +367,6 @@ export default class DrivePageActions<Context> extends PageActions<Context> {
}
}

/** Open the "start" modal. */
openStartModal() {
return this.step('Open "start" modal', (page) =>
page.getByText(TEXT.startWithATemplate).click(),
).into(StartModalActions<Context>)
}

/** Expect the "start" modal to be visible. */
expectStartModal() {
return this.into(StartModalActions<Context>).withStartModal(async (startModal) => {
await expect(startModal).toBeVisible()
})
}

/** Clear trash. */
clearTrash() {
return this.step('Clear trash', async (page) => {
Expand Down
61 changes: 0 additions & 61 deletions app/gui/integration-test/dashboard/actions/StartModalActions.ts

This file was deleted.

12 changes: 4 additions & 8 deletions app/gui/integration-test/dashboard/actions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
import DrivePageActions from './DrivePageActions'
import LATEST_GITHUB_RELEASES from './latestGithubReleases.json' with { type: 'json' }
import LoginPageActions from './LoginPageActions'
import StartModalActions from './StartModalActions'

/** An example password that does not meet validation requirements. */
export const INVALID_PASSWORD = 'password'
Expand Down Expand Up @@ -156,18 +155,15 @@ export function mockAll({ page, setupAPI }: MockParams) {
})
}

export interface MockAllAndLoginParams extends MockParams {}

/** Set up all mocks, and log in with dummy credentials. */
export function mockAllAndLogin({ page, setupAPI }: MockParams) {
export function mockAllAndLogin({ page, setupAPI }: MockAllAndLoginParams) {
const actions = mockAll({ page, setupAPI })

return actions
.step('Login', (page) => login({ page }))
.step('Wait for dashboard to load', waitForDashboardToLoad)
.step('Check if start modal is shown', async (page) => {
// @ts-expect-error This is the only place in which the private member `.context`
// should be accessed.
const context = actions.context
await new StartModalActions(page, context).close()
})
.into(DrivePageActions<Context>)
}

Expand Down
7 changes: 0 additions & 7 deletions app/gui/integration-test/dashboard/assetPanel.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@ function locateAssetPanelDescription(page: Page) {
return locateAssetPanel(page).getByTestId('asset-panel-description')
}

/** Find asset permissions in an asset panel. */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
function locateAssetPanelPermissions(page: Page) {
// This has no identifying features.
return locateAssetPanel(page).getByTestId('asset-panel-permissions').getByRole('button')
}

/** An example description for the asset selected in the asset panel. */
const DESCRIPTION = 'foo bar'
/** An example owner username for the asset selected in the asset panel. */
Expand Down
2 changes: 0 additions & 2 deletions app/gui/integration-test/dashboard/createAsset.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ test('create folder', ({ page }) =>
test('create project', ({ page }) =>
mockAllAndLogin({ page })
.newEmptyProject()
// FIXME[sb]: https://github.com/enso-org/cloud-v2/issues/1615
// Uncomment once cloud execution in the browser is re-enabled.
.waitForEditorToLoad()
.goToPage.drive()
.driveTable.withRows((rows) => expect(rows).toHaveCount(1)))
Expand Down
5 changes: 0 additions & 5 deletions app/gui/integration-test/dashboard/delete.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,6 @@ test('clear trash', ({ page }) =>
.clearTrash()
.driveTable.expectTrashPlaceholderRow()
.goToCategory.cloud()
.expectStartModal()
.withStartModal(async (startModal) => {
await expect(startModal).toBeVisible()
})
.close()
.driveTable.withRows(async (rows) => {
await expect(rows).toHaveCount(0)
}))
2 changes: 0 additions & 2 deletions app/gui/integration-test/dashboard/loginLogout.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ test.use({ storageState: { cookies: [], origins: [] } })
test('login and logout', ({ page }) =>
mockAll({ page })
.login()
.expectStartModal()
.close()
.withDriveView(async (driveView) => {
await expect(driveView).toBeVisible()
})
Expand Down
31 changes: 0 additions & 31 deletions app/gui/integration-test/dashboard/startModal.spec.ts

This file was deleted.

2 changes: 1 addition & 1 deletion app/gui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"@aws-amplify/core": "5.8.5",
"@babel/parser": "^7.26.3",
"@codemirror/commands": "^6.7.1",
"@codemirror/lang-markdown": "^6.3.1",
"@codemirror/lang-markdown": "workspace:*",
"@codemirror/language": "^6.10.8",
"@codemirror/lint": "^6.8.4",
"@codemirror/search": "^6.5.8",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ import { forwardRef } from '#/utilities/react'
import type { VariantProps } from '#/utilities/tailwindVariants'
import { tv } from '#/utilities/tailwindVariants'
import {
BasicInput,
Button,
Form,
Popover,
Text,
UncontrolledInput,
type FieldComponentProps,
type FieldPath,
type FieldProps,
Expand Down Expand Up @@ -164,7 +164,7 @@ export const ComboBox = forwardRef(function ComboBox<
>
<div ref={popoverTriggerRef} className={styles.inputContainer()}>
<Button variant="icon" icon={ArrowIcon} className="rotate-90" />
<UncontrolledInput
<BasicInput
name={name}
placeholder={placeholder}
addonStart={addonStart}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,19 @@ export const Input = forwardRef(function Input<
name={name}
data-testid={testId}
>
<UncontrolledInput
{...aria.mergeProps<UncontrolledInputProps>()(
<BasicInput
{...aria.mergeProps<BasicInputProps>()(
{
className: (classNameStates) =>
classes.textArea({ className: computedClassName(classNameStates) }),
type,
name,
isInvalid: invalid,
isDisabled: disabled,
variant,
size,
rounded,
variants,
},
omit(inputProps, 'isInvalid', 'isRequired', 'isDisabled'),
omit(fieldProps, 'isInvalid', 'isRequired', 'isDisabled', 'invalid'),
Expand All @@ -160,8 +164,8 @@ export const Input = forwardRef(function Input<
)
})

/** Props for an {@link UncontrolledInput}. */
export interface UncontrolledInputProps
/** Props for an {@link BasicInput}. */
export interface BasicInputProps
extends Omit<aria.InputProps, 'children' | 'size'>,
Omit<VariantProps<typeof INPUT_STYLES>, 'disabled' | 'invalid'>,
TestIdProps {
Expand All @@ -178,8 +182,8 @@ export interface UncontrolledInputProps
}

/** An input without a {@link Form.Field}. */
export const UncontrolledInput = forwardRef(function UncontrolledInput(
props: UncontrolledInputProps,
export const BasicInput = forwardRef(function BasicInput(
props: BasicInputProps,
ref?: Ref<HTMLInputElement>,
) {
const {
Expand Down
33 changes: 33 additions & 0 deletions app/gui/src/dashboard/components/ErrorBoundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ import * as textProvider from '#/providers/TextProvider'
import * as ariaComponents from '#/components/AriaComponents'
import * as result from '#/components/Result'

import { Button, Text, type SvgUseIcon } from '#/components/AriaComponents'
import { useEventCallback } from '#/hooks/eventCallbackHooks'
import * as errorUtils from '#/utilities/error'
import { OfflineError } from '#/utilities/HttpClient'
import type { FallbackProps } from 'react-error-boundary'
import { Icon } from './Icon'
import SvgMask from './SvgMask'

// =====================
Expand Down Expand Up @@ -201,4 +203,35 @@ export function ErrorDisplay(props: ErrorDisplayProps): React.JSX.Element {
return <>{render ?? defaultRender}</>
}

/** Props for an {@link InlineErrorDisplay}. */
export interface InlineErrorDisplayProps extends Omit<ErrorDisplayProps, 'status' | 'subtitle'> {}

/** Displays an error inline. */
export function InlineErrorDisplay(props: InlineErrorDisplayProps) {
const { error, resetErrorBoundary, onBeforeFallbackShown, title, resetQueries = () => {} } = props

const { getText } = textProvider.useText()

const render = onBeforeFallbackShown?.({ error, resetErrorBoundary, resetQueries })

const onReset = useEventCallback(() => {
resetErrorBoundary()
})

const finalTitle = title ?? getText('somethingWentWrong')
const finalIcon: SvgUseIcon = 'error'

const defaultRender = (
<div className="flex items-center gap-1">
<Icon icon={finalIcon} />
<Text>{finalTitle}</Text>
<Button variant="outline" size="xsmall" onPress={onReset} className="ml-3">
{getText('tryAgain')}
</Button>
</div>
)

return <>{render ?? defaultRender}</>
}

export { useErrorBoundary, withErrorBoundary } from 'react-error-boundary'
Loading

0 comments on commit 638ccdb

Please sign in to comment.