Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
95 changes: 39 additions & 56 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@
},
"devDependencies": {
"@eslint/js": "^9.13.0",
"@playwright/test": "^1.59.1",
"@playwright/test": "^1.63.0",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.2",
"@testing-library/user-event": "^14.6.1",
"@types/dompurify": "^3.0.5",
"@testing-library/react": "^16.3.3",
"@testing-library/user-event": "^14.6.7",
"@types/dompurify": "^3.2.0",
"@types/node": "^25.6.0",
"@types/plotly.js-dist-min": "^2.3.4",
"@types/react": "^18.3.12",
Expand All @@ -71,9 +71,9 @@
"eslint": "^9.13.0",
"eslint-plugin-react-hooks": "^7.1.1",
"fake-indexeddb": "^6.2.5",
"globals": "^17.6.0",
"globals": "^17.13.0",
"jsdom": "^29.1.1",
"prettier": "^3.3.3",
"prettier": "^3.9.9",
"pyodide": "^0.26.4",
"typescript": "^5.6.3",
"typescript-eslint": "^8.59.1",
Expand Down
3 changes: 1 addition & 2 deletions src/actions/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ export interface ActionDescriptor {
/** Toolbar item produced by ``buildToolbarItems``: either an action button
* or a separator marker inserted between groups. */
export type ToolbarItem =
| { kind: "action"; action: ActionDescriptor }
| { kind: "separator" };
{ kind: "action"; action: ActionDescriptor } | { kind: "separator" };

/** Toolbar group ordering, mirroring DataLab desktop's toolbar layout:
* the HDF5 workspace actions (main toolbar) come first, then the
Expand Down
3 changes: 1 addition & 2 deletions src/components/DataSetDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ export function DataSetDialog(props: Props) {
};

const description = (payload.schema as JsonSchema).description as
| string
| undefined;
string | undefined;

return (
<div className="overlay" role="dialog" aria-modal="true">
Expand Down
3 changes: 1 addition & 2 deletions src/components/MacroPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,7 @@ export const MacroPanel = forwardRef<MacroPanelHandle, Props>(
// Open and focus the freshly created macro if the event
// carries an id; otherwise leave the active tab alone.
const detail = (event as CustomEvent).detail as
| { id?: string }
| undefined;
{ id?: string } | undefined;
const newId = detail?.id;
if (newId && full.some((m) => m.id === newId)) {
// Macros created behind our back (AI assistant) carry real
Expand Down
4 changes: 1 addition & 3 deletions src/components/ObjectTree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ export interface ObjectTreeHandle {
}

type EditTarget =
| { kind: "object"; id: string }
| { kind: "group"; id: string }
| null;
{ kind: "object"; id: string } | { kind: "group"; id: string } | null;

/** Visual drop indicator while dragging objects in the tree. */
type DropZone =
Expand Down
3 changes: 1 addition & 2 deletions src/components/ProcessingDataSetDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ export function ProcessingDataSetDialog(props: Props) {
}, [cancel, submitting]);

const description = (payload.schema as JsonSchema).description as
| string
| undefined;
string | undefined;

return (
<div className="overlay" role="dialog" aria-modal="true">
Expand Down
7 changes: 2 additions & 5 deletions src/components/ProfileDefinitionDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ import {
} from "./ProcessingPreview";

export type ProfileFeatureId =
| "line_profile"
| "segment_profile"
| "average_profile";
"line_profile" | "segment_profile" | "average_profile";

interface Props {
title: string;
Expand Down Expand Up @@ -295,8 +293,7 @@ export function ProfileDefinitionDialog(props: Props) {
}, [cancel, submitting]);

const description = (payload.schema as JsonSchema).description as
| string
| undefined;
string | undefined;

const traces = useMemo(() => {
const w = imageData.width;
Expand Down
3 changes: 1 addition & 2 deletions src/components/RoiGridDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ export function RoiGridDialog(props: Props) {
};

const description = (payload.schema as JsonSchema).description as
| string
| undefined;
string | undefined;

return (
<div className="overlay" role="dialog" aria-modal="true">
Expand Down
3 changes: 1 addition & 2 deletions src/runtime/WorkerRuntimeProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ export class WorkerRuntimeProxy {
private mirror: KernelMirror = INITIAL_MIRROR;
private readonly mutationListeners = new Set<(name: string) => void>();
private dialogHandler:
| ((kind: string, payload: unknown) => Promise<unknown>)
| null = null;
((kind: string, payload: unknown) => Promise<unknown>) | null = null;

private readonly readyPromise: Promise<void>;
private resolveReady!: () => void;
Expand Down
27 changes: 7 additions & 20 deletions src/runtime/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,7 @@ export interface FeatureDescriptor {

/** Temporary, non-published result returned by ``preview_feature``. */
export type ProcessingPreviewResult =
| { kind: "signal"; data: SignalData }
| { kind: "image"; data: ImageData };
{ kind: "signal"; data: SignalData } | { kind: "image"; data: ImageData };

/** One entry of the "Processing > Fitting > Interactive fitting" submenu. */
export interface InteractiveFitInfo {
Expand Down Expand Up @@ -304,10 +303,7 @@ export interface PluginExampleSummary {

/** Selection a plugin tool needs (names follow menu select conditions). */
export type PluginToolSelection =
| "none"
| "exactly_one"
| "at_least_one"
| "at_least_two";
"none" | "exactly_one" | "at_least_one" | "at_least_two";

export interface PluginToolSummary {
id: string;
Expand Down Expand Up @@ -439,11 +435,7 @@ export interface PluginRecipeInputIssue {
}

export type PluginRecipeReadinessStatus =
| "no_input"
| "needs_assignment"
| "not_ready"
| "warnings"
| "ready";
"no_input" | "needs_assignment" | "not_ready" | "warnings" | "ready";

export interface PluginRecipeReadiness {
status: PluginRecipeReadinessStatus;
Expand All @@ -454,8 +446,7 @@ export interface PluginRecipeReadiness {

/** Readiness of one recipe, or the error raised while assessing it. */
export type PluginRecipeAssessment =
| PluginRecipeReadiness
| { status: "error"; error: string };
PluginRecipeReadiness | { status: "error"; error: string };

export interface PluginRecipePreparation {
plugin_id: string;
Expand Down Expand Up @@ -1757,8 +1748,7 @@ await micropip.install([${JSON.stringify(SIGIMA_INSTALL_SPEC)}, ${JSON.stringify

/** JS-side callback invoked for every async dialog request from Python. */
private dialogHandler:
| ((kind: string, payload: unknown) => Promise<unknown>)
| null = null;
((kind: string, payload: unknown) => Promise<unknown>) | null = null;

setDialogHandler(
handler: ((kind: string, payload: unknown) => Promise<unknown>) | null,
Expand Down Expand Up @@ -3005,8 +2995,7 @@ await micropip.install([${JSON.stringify(SIGIMA_INSTALL_SPEC)}, ${JSON.stringify
* image's intrinsic ``data_min``/``data_max``). */
async getLutRange(oid: string): Promise<[number, number] | null> {
const result = (await this.callPy("get_lut_range", { oid })) as
| [number, number]
| null;
[number, number] | null;
if (!result || result.length !== 2) return null;
return [Number(result[0]), Number(result[1])];
}
Expand Down Expand Up @@ -3074,9 +3063,7 @@ await micropip.install([${JSON.stringify(SIGIMA_INSTALL_SPEC)}, ${JSON.stringify
* round-trip through Qt DataLab's "Open HDF5 workspace" feature. */
async saveWorkspaceHdf5(): Promise<Uint8Array> {
const result = (await this.callPy("save_workspace_to_bytes")) as
| Uint8Array
| ArrayBuffer
| number[];
Uint8Array | ArrayBuffer | number[];
if (result instanceof Uint8Array) return result;
if (result instanceof ArrayBuffer) return new Uint8Array(result);
return Uint8Array.from(result as number[]);
Expand Down
Loading
Loading