Skip to content
Open
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
253 changes: 17 additions & 236 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"@fontsource-variable/geist": "^5.3.0",
"@fontsource-variable/geist-mono": "^5.3.0",
"@fontsource-variable/public-sans": "^5.3.0",
"@parallelworks/ai-chat": "0.5.0",
"@parallelworks/ui": "^0.17.0",
"@parallelworks/ui": "^0.20.0",
"@parallelworks/workflow-parser": "^0.6.0",
"formik": "^2.4.9",
"react": "^19.2.8",
"react-dom": "^19.2.8",
Expand Down
2 changes: 1 addition & 1 deletion web/src/adapter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ChatAdapter, ModelsList, StreamCompletion } from '@parallelworks/ai-chat'
import type { ChatAdapter, ModelsList, StreamCompletion } from '@parallelworks/ui/ai'
import { getLabelScope, getPersona } from './labelScope'
import { fetchModels } from './api'

Expand Down
2 changes: 1 addition & 1 deletion web/src/components/ChatsManager.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useMemo, useRef, useState } from 'react'
import { useChat } from '@parallelworks/ai-chat'
import { useChat } from '@parallelworks/ui/ai'
import { deleteConversations, isOwnConversation } from '../adapter'

/**
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/ConversationScrubber.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react'
import { useChat } from '@parallelworks/ai-chat'
import { useChat } from '@parallelworks/ui/ai'

/**
* A rail of ticks along the bottom of the thread, one per message, so a
Expand Down
6 changes: 3 additions & 3 deletions web/src/components/DagViewer.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useEffect, useRef, useState } from 'react'
import { DependencyGraphPreview } from '@parallelworks/ui/workflow'
import { Suspense, useEffect, useRef, useState } from 'react'
import { DependencyGraphPreview } from '@parallelworks/ui/graph'

interface DagData {
name: string
Expand Down Expand Up @@ -175,7 +175,7 @@ export function DagViewer({ workflow, path }: { workflow?: string; path?: string
{/* The platform's own graph. Its run view (per-step status icons)
needs an actual run; a definition renders as job cards, which
is what ACTIVATE shows for a workflow too. */}
<DependencyGraphPreview yml={dag.yaml} removeBorder />
<Suspense fallback={null}><DependencyGraphPreview yml={dag.yaml} removeBorder /></Suspense>
</div>
) : (
<div className="dag-canvas own-dag">
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/NextUp.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useChat } from '@parallelworks/ai-chat'
import { useChat } from '@parallelworks/ui/ai'
import { useEffect, useRef, useState } from 'react'

/**
Expand Down
10 changes: 5 additions & 5 deletions web/src/layers.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/*
* Cascade layer order, declared before any stylesheet loads.
*
* The package stylesheets nest their rules in the pw-ui and pw-ai-chat
* layers, except one: the compiled ui stylesheet (0.16) also emits a
* top-level `base` layer that gives every input and textarea a border,
* padding, and background. Declared after the package layers, it
* The UI package's stylesheet nests its rules in the pw-ui layer, but the
* compiled build also emits a top-level `base` layer that gives every
* input and textarea a border, padding, and background. Declared after the
* package layer, it
* outranked their utilities, so the chat composer grew a second border
* and the conversation search lost the padding that clears its icon.
* Naming `base` first makes it the lowest layer. The Studio's own inputs
* all carry their own classes and are unaffected.
*/
@layer base, pw-ui, pw-ai-chat;
@layer base, pw-ui;
17 changes: 11 additions & 6 deletions web/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,33 @@
import './install'
import React from 'react'
import ReactDOM from 'react-dom/client'
import { UIProvider } from '@parallelworks/ui'
import App from './App'
import { rememberHashChanges, restoreLastHash } from './lastLocation'
import { applyRememberedFavicon } from './config'
import '@fontsource-variable/public-sans'
import '@fontsource-variable/geist-mono'
// Two packages ship their own Tailwind build, and their utilities collide at
// equal specificity, so whichever loads last wins. The chat package must come
// second: its responsive variants (a two-column starter grid, for one) were
// being overridden by the UI package's base utilities. Ours loads last of all.
// The UI package's prebuilt stylesheet (chat rules included) loads before
// ours, so ours wins at equal specificity.
import './layers.css'
import '@parallelworks/ui/styles.css'
import '@parallelworks/ui/theme.css'
import '@parallelworks/ai-chat/styles.css'
import './styles.css'

// Before the first render: components read the hash while initializing.
restoreLastHash()
rememberHashChanges()
applyRememberedFavicon()

// The workflow parser (and its WebAssembly) loads only once a workflow form
// or graph first renders.
const loadWorkflowEngine = () =>
import('@parallelworks/workflow-parser').then(m => m.createWorkflowEngine())

ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<App />
<UIProvider engine={loadWorkflowEngine}>
<App />
</UIProvider>
</React.StrictMode>,
)
2 changes: 1 addition & 1 deletion web/src/views/ChatView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { VoiceOverlay } from '../components/VoiceOverlay'
import { rememberHash } from '../lastLocation'
import {
ChatProvider, ChatLayout, ChatThread, ChatEmptyState, AttachmentManager, useChat,
} from '@parallelworks/ai-chat'
} from '@parallelworks/ui/ai'
import { ChatsManager } from '../components/ChatsManager'
import { ManageChatsRailItem } from '../components/ManageChatsRailItem'
import { createStudioAdapter, getChatListFilter, setChatListFilter, setViewerUsername } from '../adapter'
Expand Down
8 changes: 5 additions & 3 deletions web/src/views/WorkflowsView.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useEffect, useMemo, useRef, useState } from 'react'
import { Suspense, useEffect, useMemo, useRef, useState } from 'react'
import type { FormikProps, FormikValues } from 'formik'
import { DynamicForm, initializeValues } from '@parallelworks/ui/form'
import { useWorkflowFields, forgetPlatformData } from '../components/WorkflowFields'
Expand Down Expand Up @@ -162,8 +162,10 @@ function WorkflowRunner({ name, kind, title, onBack, onLaunched }: { name: strin
)}
<div className="wf-form">
{doc.form && Object.keys(doc.form).length
? <DynamicForm key={`${name}:${preset}`} formJSONs={doc.form} initialValues={initial} formikRef={formik}
fields={fields} workflowForm labelPosition="left" contextKey={preset || 'defaults'} />
? <Suspense fallback={<p className="muted">Loading form…</p>}>
<DynamicForm key={`${name}:${preset}`} formJSONs={doc.form} initialValues={initial} formikRef={formik}
fields={fields} workflowForm labelPosition="left" contextKey={preset || 'defaults'} />
</Suspense>
: <p className="muted">This workflow takes no inputs.</p>}
</div>
<div className="query-actions wf-actions">
Expand Down
Loading