Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
9f05851
Remove ide-desktop/icons generator, commit generated files to the repo.
vitvakatu Sep 22, 2025
e8078b3
Remove unused IPC channels
vitvakatu Sep 23, 2025
75fda27
Simplify logging
vitvakatu Sep 22, 2025
e2741e3
Remove vibrancy effect support
vitvakatu Sep 23, 2025
6478f78
Cut down unused config parameters
vitvakatu Sep 24, 2025
9c5d4cd
Remove unused performance options
vitvakatu Sep 24, 2025
c26dd3a
Remove config.json
vitvakatu Sep 24, 2025
10f6cf3
Get rid of config groups merge functionality
vitvakatu Sep 24, 2025
92212ab
Remove custom help
vitvakatu Sep 24, 2025
12ca79d
Use commander.js for cli parsing
vitvakatu Sep 25, 2025
c81cf88
Experimenting with cli config
vitvakatu Sep 25, 2025
839a6e9
Nuke HelpScreen
vitvakatu Sep 25, 2025
f180115
Massive refactoring of options stuff using zod-derived schema
vitvakatu Sep 25, 2025
3f17f1d
refactoring with zod
vitvakatu Sep 25, 2025
db7d413
refactorings
vitvakatu Sep 26, 2025
50f61fe
Removing unnecessary stuff
vitvakatu Sep 26, 2025
aecdb12
Move ide-desktop/client one level up
vitvakatu Sep 26, 2025
6f2c05e
Remove debug logs
vitvakatu Sep 26, 2025
29cce14
Try using .icns icon for linux builds
vitvakatu Sep 26, 2025
5c7927b
Merge develop
vitvakatu Sep 28, 2025
7a21c5d
Keep CLI option description short for readability
vitvakatu Sep 28, 2025
a00ff5a
Remove unused dependencies
vitvakatu Sep 28, 2025
90fb0d4
Change log format & remove unused dependencies
vitvakatu Sep 28, 2025
e330446
Merge develop
vitvakatu Sep 29, 2025
d3ea8f5
Fix CI tests
vitvakatu Sep 29, 2025
8bac889
Use default viewport size in package tests as we removed window.size …
vitvakatu Sep 29, 2025
ceea71b
Try fixing windows build
vitvakatu Sep 29, 2025
2e42ea0
Fix
vitvakatu Sep 29, 2025
311b9f9
Reexport fileAssociations constants
vitvakatu Sep 30, 2025
b728211
Handle console.info in logger
vitvakatu Sep 30, 2025
518d231
Remove stale ide-desktop package from pnpm-workspace
vitvakatu Sep 30, 2025
cf11b57
Rename client → electron-client
vitvakatu Sep 30, 2025
db7e247
Deduplicate env.d.ts and globals.d.ts
vitvakatu Oct 1, 2025
cf33edf
Fix linter and tests, I guess?
vitvakatu Oct 2, 2025
f866114
Run prettier
vitvakatu Oct 2, 2025
0e744df
Do not download eslint cache when CI: clean build label is used
vitvakatu Oct 3, 2025
f295643
Try reverting viewport size in tests
vitvakatu Oct 3, 2025
cf0a51f
Debugging linux CI crashes
vitvakatu Oct 3, 2025
a6b3c9a
Log chromium options
vitvakatu Oct 3, 2025
2b53383
Chrome flags go brrrrrrr
vitvakatu Oct 3, 2025
495b1a9
Enable new project manager
vitvakatu Oct 3, 2025
0f83049
Back out "Enable new project manager"
vitvakatu Oct 3, 2025
6cd8afb
Disable chrome logging
vitvakatu Oct 3, 2025
768e215
remove disable-dev-shm-usage flag
vitvakatu Oct 6, 2025
f61d25e
Using only disable-dev-shm-usage
vitvakatu Oct 6, 2025
b6502b1
Bring back chrome options from develop, rollback changes for debug
vitvakatu Oct 6, 2025
6682b87
Try removing excess chrome options
vitvakatu Oct 6, 2025
8c05643
Bring back ignore-gpu-blocklist
vitvakatu Oct 6, 2025
06d840b
Add changelog entry
vitvakatu Oct 7, 2025
a9246dc
Reenable backgroundThrottling
vitvakatu Oct 7, 2025
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
13 changes: 1 addition & 12 deletions .bazelignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,7 @@
node_modules
app/gui/node_modules
app/common/node_modules
app/ide-desktop/client/node_modules
app/ide-desktop/icons/node_modules
app/ide-desktop/lib/assets/node_modules
app/ide-desktop/lib/client/node_modules
app/ide-desktop/lib/common/node_modules
app/ide-desktop/lib/content-config/node_modules
app/ide-desktop/lib/dashboard/node_modules
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/electron-client/node_modules
app/lang-markdown/node_modules
app/lezer-markdown/node_modules
app/project-manager-shim/node_modules
Expand All @@ -23,7 +13,6 @@ app/ydoc-server-nodejs/node_modules
app/ydoc-server-polyglot/node_modules
app/ydoc-shared/node_modules
app/ydoc-shared/parser-codegen/node_modules
lib/js/runner/node_modules

#
.bloop
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/gui-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ jobs:
run: pnpm install --frozen-lockfile

- uses: actions/cache/restore@v4
if: "${{ !(contains(github.event.pull_request.labels.*.name, 'CI: Clean build required')) }}"
name: Download cache
id: cache
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ide-packaging-optional.yml
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ jobs:
name: ide-macos
path: dist/ide/enso-*.dmg
- name: Prepare Package Tests
run: 'mkdir -p app/ide-desktop/client/playwright/.auth && touch app/ide-desktop/client/playwright/.auth/user.json && chmod 600 app/ide-desktop/client/playwright/.auth/user.json && echo "{\"user\": \"$ENSO_TEST_USER\",\"password\":\"$ENSO_TEST_USER_PASSWORD\"}" > app/ide-desktop/client/playwright/.auth/user.json'
run: 'mkdir -p app/electron-client/playwright/.auth && touch app/electron-client/playwright/.auth/user.json && chmod 600 app/electron-client/playwright/.auth/user.json && echo "{\"user\": \"$ENSO_TEST_USER\",\"password\":\"$ENSO_TEST_USER_PASSWORD\"}" > app/electron-client/playwright/.auth/user.json'
shell: bash
env:
ENSO_TEST_USER: ${{ secrets.ENSO_CLOUD_TEST_ACCOUNT_USERNAME }}
Expand All @@ -233,7 +233,7 @@ jobs:
with:
compression-level: 0
name: test-traces-macos-amd64
path: app/ide-desktop/client/test-traces
path: app/electron-client/test-traces
- if: always()
name: Remove Credentials File
run: rm -f $HOME/.enso/credentials
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ide-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ jobs:
name: ide-linux
path: dist/ide/enso-*.AppImage
- name: Prepare Package Tests
run: 'mkdir -p app/ide-desktop/client/playwright/.auth && touch app/ide-desktop/client/playwright/.auth/user.json && chmod 600 app/ide-desktop/client/playwright/.auth/user.json && echo "{\"user\": \"$ENSO_TEST_USER\",\"password\":\"$ENSO_TEST_USER_PASSWORD\"}" > app/ide-desktop/client/playwright/.auth/user.json'
run: 'mkdir -p app/electron-client/playwright/.auth && touch app/electron-client/playwright/.auth/user.json && chmod 600 app/electron-client/playwright/.auth/user.json && echo "{\"user\": \"$ENSO_TEST_USER\",\"password\":\"$ENSO_TEST_USER_PASSWORD\"}" > app/electron-client/playwright/.auth/user.json'
shell: bash
env:
ENSO_TEST_USER: ${{ secrets.ENSO_CLOUD_TEST_ACCOUNT_USERNAME }}
Expand All @@ -361,7 +361,7 @@ jobs:
with:
compression-level: 0
name: test-traces-linux-amd64
path: app/ide-desktop/client/test-traces
path: app/electron-client/test-traces
- if: always()
name: Remove Credentials File
run: rm -f $HOME/.enso/credentials
Expand Down Expand Up @@ -449,7 +449,7 @@ jobs:
name: ide-windows
path: dist/ide/enso-*.exe
- name: Prepare Package Tests
run: 'mkdir -p app/ide-desktop/client/playwright/.auth && touch app/ide-desktop/client/playwright/.auth/user.json && chmod 600 app/ide-desktop/client/playwright/.auth/user.json && echo "{\"user\": \"$ENSO_TEST_USER\",\"password\":\"$ENSO_TEST_USER_PASSWORD\"}" > app/ide-desktop/client/playwright/.auth/user.json'
run: 'mkdir -p app/electron-client/playwright/.auth && touch app/electron-client/playwright/.auth/user.json && chmod 600 app/electron-client/playwright/.auth/user.json && echo "{\"user\": \"$ENSO_TEST_USER\",\"password\":\"$ENSO_TEST_USER_PASSWORD\"}" > app/electron-client/playwright/.auth/user.json'
shell: bash
env:
ENSO_TEST_USER: ${{ secrets.ENSO_CLOUD_TEST_ACCOUNT_USERNAME }}
Expand All @@ -466,7 +466,7 @@ jobs:
with:
compression-level: 0
name: test-traces-windows-amd64
path: app/ide-desktop/client/test-traces
path: app/electron-client/test-traces
- if: always()
name: Remove Credentials File
run: rm -f $HOME/.enso/credentials
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- [When connecting to port a value with additional type, a necessary type cast
is included][14028]
- [Function docs in autocomplete in table expressions][14059]
- [Many CLI arguments removed][14069]

[13685]: https://github.com/enso-org/enso/pull/13685
[13658]: https://github.com/enso-org/enso/pull/13658
Expand All @@ -24,6 +25,7 @@
[14028]: https://github.com/enso-org/enso/pull/14028
[13976]: https://github.com/enso-org/enso/pull/13976
[14059]: https://github.com/enso-org/enso/pull/14059
[14069]: https://github.com/enso-org/enso/pull/14069

#### Enso Standard Library

Expand Down
5 changes: 2 additions & 3 deletions app/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
"exports": {
".": {
"source": "./src/index.ts",
"types": "./dist/index.d.ts",
"types": "./src/index.ts",
"import": "./dist/index.js"
},
"./src/config.json": "./src/config.json",
"./src/*": {
"source": "./src/*.ts",
"types": "./dist/*.d.ts",
"types": "./src/*.ts",
"import": "./dist/*.js"
}
},
Expand All @@ -32,7 +32,6 @@
"@tanstack/vue-query": "5.59.20",
"@types/node": "catalog:",
"is-network-error": "^1.1.0",
"lib0": "^0.2.99",
"vue": "*"
},
"devDependencies": {
Expand Down
194 changes: 194 additions & 0 deletions app/common/src/options.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
/** @file Shared application options schema and helpers. */

import { z } from 'zod'

const DEFAULT_PROFILING_TIME = 120
const DEFAULT_PORT = 8080

/** Schema for app-wide configuration options. */
export const OptionsSchema = z.object({
version: z.boolean().default(false),
displayWindow: z.boolean().default(true),
useServer: z.boolean().default(true),
engineEnabled: z.boolean().default(true),
useJvm: z.boolean().default(false),
startup: z
.object({
project: z.string().default(''),
displayedProjectName: z.string().default(''),
})
.default({}),
authentication: z
.object({
enabled: z.boolean().default(true),
email: z.string().default(''),
})
.default({}),
server: z
.object({
port: z.number().int().default(DEFAULT_PORT),
})
.default({}),
engine: z
.object({
projectManagerPath: z.string().default(''),
projectManagerUrl: z.string().default(''),
ydocUrl: z.string().default(''),
})
.default({}),
debug: z
.object({
info: z.boolean().default(false),
verbose: z.boolean().default(false),
devTools: z.boolean().default(false),
profile: z.boolean().default(false),
profileTime: z.number().int().default(DEFAULT_PROFILING_TIME),
})
.default({}),
})

/** Global configuration of Enso Studio, parsed from CLI arguments and passed to web application via URL params. */
export type Options = z.infer<typeof OptionsSchema>

/** Default values for all configuration options. */
export function defaultOptions(): Options {
return OptionsSchema.parse({})
}

/**
* Dotted keys which should be synced to the web application via URL params.
* Other options are only used by Electron and not passed to the web application.
*/
export const PASS_TO_WEB: ReadonlySet<string> = new Set([
'startup.project',
'startup.displayedProjectName',
'authentication.enabled',
'authentication.email',
'engine.projectManagerUrl',
'engine.ydocUrl',
])

/** Possible values for options. */
export type OptionValue = string | number | boolean

const phantomKey = Symbol('flattened')
type Flat<T> = Record<string, OptionValue> & { readonly [phantomKey]?: T }

/** Flatten a nested object into a dotted-key record. */
export function flattenObject<T extends object>(obj: T, prefix = ''): Flat<T> {
const out: Flat<T> = {}
if (obj != null) {
for (const [k, v] of Object.entries(obj)) {
const key = prefix ? `${prefix}.${k}` : k
if (v != null && typeof v === 'object' && !Array.isArray(v)) {
Object.assign(out, flattenObject(v, key))
} else {
out[key] = v
}
}
}
return out
}

/** Turn a flat dotted-record into a nested object. */
export function unflattenObject<T extends object>(flat: Flat<T>): T {
const out: any = {}
for (const [k, v] of Object.entries(flat)) {
const pathSegments = k.split('.')
let cur = out
for (const segment of pathSegments.slice(0, -1)) {
cur[segment] ??= {}
cur = cur[segment]
}
const last = pathSegments[pathSegments.length - 1]!
cur[last] = v
}
return out as T
}

/** Build URLSearchParams for non-default pass-to-web options. */
export function buildWebAppURLSearchParamsFromArgs(args: Options): URLSearchParams {
const params = new URLSearchParams()
const entries = collectWebAppOptionsFromArgs(args)
Object.entries(entries).forEach(([key, val]) => params.append(key, String(val)))
return params
}

/** Collect non-default values of pass-to-web options from parsed args. */
function collectWebAppOptionsFromArgs(options: Options): Record<string, string | number | boolean> {
const result: Record<string, string | number | boolean> = {}
const defaults = defaultOptions()
const flatDefaults = flattenObject(defaults)
const flatOptions = flattenObject(options)
for (const key of PASS_TO_WEB) {
const value = flatOptions[key]
if (value == null)
throw new Error(`Option ${key} not found, but needs to be passed to web application`)
const def = flatDefaults[key]
if (value != null && JSON.stringify(value) !== JSON.stringify(def)) {
result[key] = value
}
}
return result
}

/** Parse pass-to-web options from URLSearchParams. For missing values, defaults are used. */
export function parseWebAppOptionsFromSearchParams(params: URLSearchParams): Options {
const out = flattenObject(defaultOptions())
for (const key of PASS_TO_WEB) {
const value = params.get(key)
if (value == null) continue
const def = out[key]
switch (typeof def) {
case 'boolean': {
const b = coerceBoolean(value)
if (b != null) {
out[key] = b
} else {
console.warn(`Invalid boolean value for option ${key}: ${value}, using default ${def}.`)
}
break
}
case 'number': {
const n = Number(value)
if (!Number.isNaN(n)) {
out[key] = n
} else {
console.warn(`Invalid number value for option ${key}: ${value}, using default ${def}.`)
}
break
}
case 'string': {
out[key] = value
break
}
default:
throw new Error(`Invalid option type for option ${key}: ${typeof def}.`)
}
}
return unflattenObject<Options>(out)
}

/**
* Coerce a string to a boolean.
*
* true, 1, yes, enabled → true
* false, 0, no, disabled → false
* anything else → undefined
*/
function coerceBoolean(v: string): boolean | undefined {
switch (v.toLowerCase()) {
case 'true':
case '1':
case 'yes':
case 'enabled':
return true
case 'false':
case '0':
case 'no':
case 'disabled':
return false
default:
return undefined
}
}
5 changes: 2 additions & 3 deletions app/common/src/services/Backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1757,7 +1757,6 @@ export default abstract class Backend {

/** Create a {@link LocalBackend}. */
constructor(
private readonly logger: Logger,
protected getText: GetText,
private readonly client: HttpClient,
) {}
Expand All @@ -1780,7 +1779,7 @@ export default abstract class Backend {
...replacements: Replacements[K]
): Promise<never> {
if (textId instanceof NetworkError) {
this.logger.error(textId.message)
console.error(textId.message)

throw textId
}
Expand All @@ -1791,7 +1790,7 @@ export default abstract class Backend {
: await ((): Promise<Error> => response.json())()

const message = `${this.getText(textId, ...replacements)}: ${error.message}.`
this.logger.error(message)
console.error(message)

const status = response?.status

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ ts_config(
name = "tsconfig",
src = "tsconfig.json",
visibility = [":__subpackages__"],
deps = ["//:tsconfig"],
)

ts_project(
Expand All @@ -18,13 +19,13 @@ ts_project(
declaration = True,
resolve_json_module = True,
source_map = True,
tsconfig = "//app/ide-desktop/lib/project-manager-shim:tsconfig",
tsconfig = "//app/project-manager-shim:tsconfig",
validate = select({
"@platforms//os:windows": False,
"//conditions:default": True,
}),
visibility = ["//visibility:public"],
deps = ["//app/ide-desktop:tsconfig"] + npm_link_targets(),
deps = ["//:tsconfig"] + npm_link_targets(),
)

js_library(
Expand Down
Binary file added app/electron-client/assets/icons/icon.icns
Binary file not shown.
Binary file added app/electron-client/assets/icons/icon.ico
Binary file not shown.
Loading
Loading