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
2 changes: 1 addition & 1 deletion api/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "api"
version = "0.94.2"
version = "0.94.3"
description = "Agenta API"
authors = [
{ name = "Mahmoud Mabrouk", email = "mahmoud@agenta.ai" },
Expand Down
2 changes: 1 addition & 1 deletion sdk/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "agenta"
version = "0.94.2"
version = "0.94.3"
description = "The SDK for agenta is an open-source LLMOps platform."
readme = "README.md"
authors = [
Expand Down
2 changes: 1 addition & 1 deletion services/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "services"
version = "0.94.2"
version = "0.94.3"
description = "Agenta Services (Chat & Completion)"
authors = [
"Mahmoud Mabrouk <mahmoud@agenta.ai>",
Expand Down
2 changes: 1 addition & 1 deletion web/ee/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@agenta/ee",
"version": "0.94.2",
"version": "0.94.3",
"private": true,
"engines": {
"node": ">=18"
Expand Down
2 changes: 1 addition & 1 deletion web/oss/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@agenta/oss",
"version": "0.94.2",
"version": "0.94.3",
"private": true,
"engines": {
"node": ">=18"
Expand Down
2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "agenta-web",
"version": "0.94.2",
"version": "0.94.3",
"workspaces": [
"ee",
"oss",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
* Supports version info, changes summary, and diff view via adapter.
*/

import {lazy, Suspense} from "react"
import {useState, useEffect} from "react"

import {formatCount} from "@agenta/shared/utils"
import {VersionBadge} from "@agenta/ui/components/presentational"
import {DiffView} from "@agenta/ui/editor"
import {cn, textColors} from "@agenta/ui/styles"
import {Input, Alert, Typography, Skeleton, Radio} from "antd"
import {Input, Alert, Typography, Radio} from "antd"
import {useAtomValue, useSetAtom} from "jotai"

import {
Expand All @@ -23,7 +24,7 @@ import {
} from "../state"

// Lazy load DiffView to avoid bundling Lexical editor in _app chunk
const DiffView = lazy(() => import("@agenta/ui/editor").then((mod) => ({default: mod.DiffView})))
// const DiffView = dynamic(() => import("@agenta/ui/editor").then((mod) => ({default: mod.DiffView})))

const {TextArea} = Input
const {Text} = Typography
Expand Down Expand Up @@ -74,6 +75,19 @@ export function EntityCommitContent({
const context = useAtomValue(commitModalContextAtom)
const setMessage = useSetAtom(setCommitMessageAtom)

// Defer DiffView mounting until after the first paint so the modal
// shell and form appear immediately without being blocked by Lexical
// editor creation + DOM reconciliation.
const [_, setDiffReady] = useState(false)
useEffect(() => {
if (!context?.diffData?.original || !context?.diffData?.modified) {
setDiffReady(false)
return
}
const id = requestAnimationFrame(() => setDiffReady(true))
return () => cancelAnimationFrame(id)
}, [context?.diffData?.original, context?.diffData?.modified])

// Build changes description from context
const changesDescription: string[] = []
if (context?.changesSummary) {
Expand Down Expand Up @@ -253,7 +267,7 @@ export function EntityCommitContent({
)}
</div>

{/* Diff view section (if diff data available) */}
{/* Diff view section — deferred until after first paint to avoid blocking the modal */}
{hasDiffData && (
<div className="flex min-w-0 flex-1 flex-col overflow-hidden rounded-lg border border-zinc-2 bg-zinc-1">
<div className="flex items-center justify-between border-b border-zinc-2 bg-zinc-1 px-3 py-2 shrink-0">
Expand All @@ -270,23 +284,30 @@ export function EntityCommitContent({
</Text>
</div>
<div className="flex-1 overflow-auto">
<Suspense
fallback={
<div className="p-4">
<Skeleton active paragraph={{rows: 8}} />
</div>
}
>
<DiffView
key={`${context.diffData?.original.length}-${context.diffData?.modified.length}`}
original={context.diffData?.original ?? ""}
modified={context.diffData?.modified ?? ""}
language={context.diffData?.language === "yaml" ? "yaml" : "json"}
className="h-full"
showErrors
enableFolding
/>
</Suspense>
<DiffView
key={`${context.diffData?.original.length}-${context.diffData?.modified.length}`}
original={context.diffData?.original ?? ""}
modified={context.diffData?.modified ?? ""}
language={context.diffData?.language === "yaml" ? "yaml" : "json"}
className="h-full"
showErrors
enableFolding
computeOnMountOnly
/>
{/* {diffReady ? (
<Suspense
fallback={
<div className="p-4">
<Skeleton active paragraph={{rows: 8}} />
</div>
}
>
</Suspense>
) : (
<div className="p-4">
<Skeleton active paragraph={{rows: 8}} />
</div>
)} */}
</div>
</div>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ export interface InitialContentPayload {
preventDefault: () => void
/** Whether default handling has been prevented */
isDefaultPrevented: () => boolean
/** Optional: Original content for diff computation */
originalContent?: string
/** Optional: Modified content for diff computation */
modifiedContent?: string
/** Optional: Flag to indicate this is a diff request */
isDiffRequest?: boolean
/** Optional: Force update even if editor has focus (for undo/redo) */
forceUpdate?: boolean
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
}

&:global(.diff-modified) {
background-color: rgba(99, 102, 241, 0.06);
background-color: rgba(99, 102, 241, 0.12);
border-left: 3px solid #6366f1;
padding-left: 8px;
position: relative;
Expand Down
Loading
Loading