Skip to content

Commit 638ccdb

Browse files
author
Martha King
committed
Merge branch 'develop' into wip/mk/numeric-formatting
2 parents 0e5cfa7 + 725e6b2 commit 638ccdb

File tree

93 files changed

+9803
-1454
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+9803
-1454
lines changed

.bazelignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ app/ide-desktop/lib/esbuild-plugin-copy-directories/node_modules
1313
app/ide-desktop/lib/icons/node_modules
1414
app/ide-desktop/lib/ts-plugin-namespace-auto-import/node_modules
1515
app/ide-desktop/node_modules
16+
app/lang-markdown/node_modules
17+
app/lezer-markdown/node_modules
1618
app/rust-ffi/node_modules
1719
app/ydoc-server/node_modules
1820
app/ydoc-server-nodejs/node_modules
@@ -33,4 +35,4 @@ build-cache
3335
.dist
3436
target
3537
build
36-
.git
38+
.git

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ maven_install.json
5050

5151
# Git-subtree, upstream doesn't use prettier
5252
app/lang-markdown
53+
app/lezer-markdown
5354

5455
# Engine Builds can leave these nested working copies.
5556
# TODO [mwu]: Adjust Engine build to not leave them.

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@
213213
[11695]: https://github.com/enso-org/enso/pull/11695
214214
[11715]: https://github.com/enso-org/enso/pull/11715
215215
[11753]: https://github.com/enso-org/enso/pull/11753
216+
[11755]: https://github.com/enso-org/enso/pull/11755
216217
[11761]: https://github.com/enso-org/enso/pull/11761
217218
[11768]: https://github.com/enso-org/enso/pull/11768
218219
[11810]: https://github.com/enso-org/enso/pull/11810
@@ -236,6 +237,8 @@
236237
- [The reload button clears the HTTP cache.][11673]
237238
- [SQL Server Support for Aggregate][11811]
238239
- [Added `Download_Mode` parameter to `Data.download`.][12017]
240+
- [Added `Table.geo_distance` to calculate the distance between two
241+
points.][12393]
239242

240243
[11235]: https://github.com/enso-org/enso/pull/11235
241244
[11255]: https://github.com/enso-org/enso/pull/11255
@@ -248,6 +251,7 @@
248251
[11673]: https://github.com/enso-org/enso/pull/11673
249252
[11811]: https://github.com/enso-org/enso/pull/11811
250253
[12017]: https://github.com/enso-org/enso/pull/12017
254+
[12393]: https://github.com/enso-org/enso/pull/12393
251255

252256
#### Enso Language & Runtime
253257

app/gui/integration-test/dashboard/actions/DrivePageActions.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import EditorPageActions from './EditorPageActions'
88
import { goToPageActions, type GoToPageActions } from './goToPageActions'
99
import NewDataLinkModalActions from './NewDataLinkModalActions'
1010
import PageActions from './PageActions'
11-
import StartModalActions from './StartModalActions'
1211

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

@@ -368,20 +367,6 @@ export default class DrivePageActions<Context> extends PageActions<Context> {
368367
}
369368
}
370369

371-
/** Open the "start" modal. */
372-
openStartModal() {
373-
return this.step('Open "start" modal', (page) =>
374-
page.getByText(TEXT.startWithATemplate).click(),
375-
).into(StartModalActions<Context>)
376-
}
377-
378-
/** Expect the "start" modal to be visible. */
379-
expectStartModal() {
380-
return this.into(StartModalActions<Context>).withStartModal(async (startModal) => {
381-
await expect(startModal).toBeVisible()
382-
})
383-
}
384-
385370
/** Clear trash. */
386371
clearTrash() {
387372
return this.step('Clear trash', async (page) => {

app/gui/integration-test/dashboard/actions/StartModalActions.ts

Lines changed: 0 additions & 61 deletions
This file was deleted.

app/gui/integration-test/dashboard/actions/index.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import {
1717
import DrivePageActions from './DrivePageActions'
1818
import LATEST_GITHUB_RELEASES from './latestGithubReleases.json' with { type: 'json' }
1919
import LoginPageActions from './LoginPageActions'
20-
import StartModalActions from './StartModalActions'
2120

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

158+
export interface MockAllAndLoginParams extends MockParams {}
159+
159160
/** Set up all mocks, and log in with dummy credentials. */
160-
export function mockAllAndLogin({ page, setupAPI }: MockParams) {
161+
export function mockAllAndLogin({ page, setupAPI }: MockAllAndLoginParams) {
161162
const actions = mockAll({ page, setupAPI })
163+
162164
return actions
163165
.step('Login', (page) => login({ page }))
164166
.step('Wait for dashboard to load', waitForDashboardToLoad)
165-
.step('Check if start modal is shown', async (page) => {
166-
// @ts-expect-error This is the only place in which the private member `.context`
167-
// should be accessed.
168-
const context = actions.context
169-
await new StartModalActions(page, context).close()
170-
})
171167
.into(DrivePageActions<Context>)
172168
}
173169

app/gui/integration-test/dashboard/assetPanel.spec.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,6 @@ function locateAssetPanelDescription(page: Page) {
1919
return locateAssetPanel(page).getByTestId('asset-panel-description')
2020
}
2121

22-
/** Find asset permissions in an asset panel. */
23-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
24-
function locateAssetPanelPermissions(page: Page) {
25-
// This has no identifying features.
26-
return locateAssetPanel(page).getByTestId('asset-panel-permissions').getByRole('button')
27-
}
28-
2922
/** An example description for the asset selected in the asset panel. */
3023
const DESCRIPTION = 'foo bar'
3124
/** An example owner username for the asset selected in the asset panel. */

app/gui/integration-test/dashboard/createAsset.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ test('create folder', ({ page }) =>
2424
test('create project', ({ page }) =>
2525
mockAllAndLogin({ page })
2626
.newEmptyProject()
27-
// FIXME[sb]: https://github.com/enso-org/cloud-v2/issues/1615
28-
// Uncomment once cloud execution in the browser is re-enabled.
2927
.waitForEditorToLoad()
3028
.goToPage.drive()
3129
.driveTable.withRows((rows) => expect(rows).toHaveCount(1)))

app/gui/integration-test/dashboard/delete.spec.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,6 @@ test('clear trash', ({ page }) =>
8383
.clearTrash()
8484
.driveTable.expectTrashPlaceholderRow()
8585
.goToCategory.cloud()
86-
.expectStartModal()
87-
.withStartModal(async (startModal) => {
88-
await expect(startModal).toBeVisible()
89-
})
90-
.close()
9186
.driveTable.withRows(async (rows) => {
9287
await expect(rows).toHaveCount(0)
9388
}))

app/gui/integration-test/dashboard/loginLogout.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ test.use({ storageState: { cookies: [], origins: [] } })
2020
test('login and logout', ({ page }) =>
2121
mockAll({ page })
2222
.login()
23-
.expectStartModal()
24-
.close()
2523
.withDriveView(async (driveView) => {
2624
await expect(driveView).toBeVisible()
2725
})

app/gui/integration-test/dashboard/startModal.spec.ts

Lines changed: 0 additions & 31 deletions
This file was deleted.

app/gui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"@aws-amplify/core": "5.8.5",
5454
"@babel/parser": "^7.26.3",
5555
"@codemirror/commands": "^6.7.1",
56-
"@codemirror/lang-markdown": "^6.3.1",
56+
"@codemirror/lang-markdown": "workspace:*",
5757
"@codemirror/language": "^6.10.8",
5858
"@codemirror/lint": "^6.8.4",
5959
"@codemirror/search": "^6.5.8",

app/gui/src/dashboard/components/AriaComponents/Inputs/ComboBox/ComboBox.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ import { forwardRef } from '#/utilities/react'
1515
import type { VariantProps } from '#/utilities/tailwindVariants'
1616
import { tv } from '#/utilities/tailwindVariants'
1717
import {
18+
BasicInput,
1819
Button,
1920
Form,
2021
Popover,
2122
Text,
22-
UncontrolledInput,
2323
type FieldComponentProps,
2424
type FieldPath,
2525
type FieldProps,
@@ -164,7 +164,7 @@ export const ComboBox = forwardRef(function ComboBox<
164164
>
165165
<div ref={popoverTriggerRef} className={styles.inputContainer()}>
166166
<Button variant="icon" icon={ArrowIcon} className="rotate-90" />
167-
<UncontrolledInput
167+
<BasicInput
168168
name={name}
169169
placeholder={placeholder}
170170
addonStart={addonStart}

app/gui/src/dashboard/components/AriaComponents/Inputs/Input/Input.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,19 @@ export const Input = forwardRef(function Input<
139139
name={name}
140140
data-testid={testId}
141141
>
142-
<UncontrolledInput
143-
{...aria.mergeProps<UncontrolledInputProps>()(
142+
<BasicInput
143+
{...aria.mergeProps<BasicInputProps>()(
144144
{
145145
className: (classNameStates) =>
146146
classes.textArea({ className: computedClassName(classNameStates) }),
147147
type,
148148
name,
149149
isInvalid: invalid,
150150
isDisabled: disabled,
151+
variant,
152+
size,
153+
rounded,
154+
variants,
151155
},
152156
omit(inputProps, 'isInvalid', 'isRequired', 'isDisabled'),
153157
omit(fieldProps, 'isInvalid', 'isRequired', 'isDisabled', 'invalid'),
@@ -160,8 +164,8 @@ export const Input = forwardRef(function Input<
160164
)
161165
})
162166

163-
/** Props for an {@link UncontrolledInput}. */
164-
export interface UncontrolledInputProps
167+
/** Props for an {@link BasicInput}. */
168+
export interface BasicInputProps
165169
extends Omit<aria.InputProps, 'children' | 'size'>,
166170
Omit<VariantProps<typeof INPUT_STYLES>, 'disabled' | 'invalid'>,
167171
TestIdProps {
@@ -178,8 +182,8 @@ export interface UncontrolledInputProps
178182
}
179183

180184
/** An input without a {@link Form.Field}. */
181-
export const UncontrolledInput = forwardRef(function UncontrolledInput(
182-
props: UncontrolledInputProps,
185+
export const BasicInput = forwardRef(function BasicInput(
186+
props: BasicInputProps,
183187
ref?: Ref<HTMLInputElement>,
184188
) {
185189
const {

app/gui/src/dashboard/components/ErrorBoundary.tsx

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ import * as textProvider from '#/providers/TextProvider'
1313
import * as ariaComponents from '#/components/AriaComponents'
1414
import * as result from '#/components/Result'
1515

16+
import { Button, Text, type SvgUseIcon } from '#/components/AriaComponents'
1617
import { useEventCallback } from '#/hooks/eventCallbackHooks'
1718
import * as errorUtils from '#/utilities/error'
1819
import { OfflineError } from '#/utilities/HttpClient'
1920
import type { FallbackProps } from 'react-error-boundary'
21+
import { Icon } from './Icon'
2022
import SvgMask from './SvgMask'
2123

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

206+
/** Props for an {@link InlineErrorDisplay}. */
207+
export interface InlineErrorDisplayProps extends Omit<ErrorDisplayProps, 'status' | 'subtitle'> {}
208+
209+
/** Displays an error inline. */
210+
export function InlineErrorDisplay(props: InlineErrorDisplayProps) {
211+
const { error, resetErrorBoundary, onBeforeFallbackShown, title, resetQueries = () => {} } = props
212+
213+
const { getText } = textProvider.useText()
214+
215+
const render = onBeforeFallbackShown?.({ error, resetErrorBoundary, resetQueries })
216+
217+
const onReset = useEventCallback(() => {
218+
resetErrorBoundary()
219+
})
220+
221+
const finalTitle = title ?? getText('somethingWentWrong')
222+
const finalIcon: SvgUseIcon = 'error'
223+
224+
const defaultRender = (
225+
<div className="flex items-center gap-1">
226+
<Icon icon={finalIcon} />
227+
<Text>{finalTitle}</Text>
228+
<Button variant="outline" size="xsmall" onPress={onReset} className="ml-3">
229+
{getText('tryAgain')}
230+
</Button>
231+
</div>
232+
)
233+
234+
return <>{render ?? defaultRender}</>
235+
}
236+
204237
export { useErrorBoundary, withErrorBoundary } from 'react-error-boundary'

0 commit comments

Comments
 (0)