Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
06380f2
docs: add design for testset creation from annotation queue
claude May 4, 2026
f3fa2eb
docs: update RFC — atom-based testset selection, reuse EntityCommitModal
claude May 4, 2026
80d4e08
docs: fix trace→testset column mapping in RFC
ashrafchowdury May 4, 2026
eb81020
docs: fix three gaps in RFC — annotation query, scope label, selectio…
ashrafchowdury May 4, 2026
f1894f5
fix
ashrafchowdury May 4, 2026
06448be
uodated the casecade variant to have deselect function
ashrafchowdury May 4, 2026
f1d301f
updated the element placement
ashrafchowdury May 4, 2026
97c507e
update view
ashrafchowdury May 4, 2026
ee683a1
updated the main view ui and comit modal
ashrafchowdury May 4, 2026
7a083c4
added the mechanisam for adding the testset
ashrafchowdury May 5, 2026
077e9fe
fix annotation table evaluator render and testset outputs unification
ashrafchowdury May 5, 2026
85329ce
fix
ashrafchowdury May 5, 2026
7bea0bc
Merge branch 'main' into feat/frontend-annotation-queue-testset
ashrafchowdury May 5, 2026
dceaef4
cleanup
ashrafchowdury May 5, 2026
91b823e
cleanup
ashrafchowdury May 6, 2026
077deb8
Merge branch 'main' into feat/frontend-annotation-queue-testset
ashrafchowdury May 6, 2026
5e471f0
revert
ashrafchowdury May 6, 2026
f79a470
remove doted column created path for testset
ashrafchowdury May 6, 2026
842007f
cleanup and fixes
ashrafchowdury May 6, 2026
1ef6d36
added keyboard shortcut keys on the ui for better understanding
ashrafchowdury May 6, 2026
f49aa3a
cleanup and fix retrivel for the annotated scenario on the table view
ashrafchowdury May 6, 2026
a08ab76
feat: updated the toast message component to support link and link-te…
ashrafchowdury May 6, 2026
692de32
- fix message strcture issue
ashrafchowdury May 7, 2026
0f31316
disabled testset button when we added annotation value but didn't not…
ashrafchowdury May 7, 2026
f6a84dd
fixed table messages and input rendering issues
ashrafchowdury May 7, 2026
e2fddee
improved the logics
ashrafchowdury May 7, 2026
72a1e43
Merge branch 'main' into feat/frontend-annotation-queue-testset
ashrafchowdury May 7, 2026
88b80fa
fix
ashrafchowdury May 7, 2026
7a648d5
fix scroll issue
ashrafchowdury May 7, 2026
1126d59
fix tool columns building for testsets
ashrafchowdury May 7, 2026
4b9bb1d
Merge branch 'main' into feat/frontend-annotation-queue-testset
ashrafchowdury May 8, 2026
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
26 changes: 6 additions & 20 deletions web/oss/src/components/DrillInView/TraceSpanDrillInView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import {
} from "./decodedJsonHelpers"
import type {DrillInContentProps} from "./DrillInContent"
import {EntityDrillInView} from "./EntityDrillInView"
import {getDefaultJsonViewMode} from "./viewModes"
const ImagePreview = dynamic(() => import("@agenta/ui").then((mod) => mod.ImagePreview), {
ssr: false,
})
Expand Down Expand Up @@ -113,9 +114,9 @@ type RawSpanViewMode = "json" | "yaml"
* Summary:
* - `json` / `yaml`: faithful — data as stored, no cleanup.
* - `decoded-json`: JSON editor, cleaned (unwrap nested stringified JSON,
* decode escaped newlines). Default for non-message data.
* decode escaped newlines).
* - `beautified-json`: custom component tree (chat bubbles, per-key fields,
* envelope unwrap, noise stripping). Default for `viewModePreset="message"`.
* envelope unwrap, noise stripping). Default for structured JSON data.
* - `text` / `markdown`: prose editor.
*/
type RawSpanDisplayMode = RawSpanViewMode | "decoded-json" | "beautified-json" | "text" | "markdown"
Expand All @@ -129,15 +130,6 @@ const RAW_SPAN_VIEW_MODE_LABELS: Record<RawSpanDisplayMode, string> = {
markdown: "Markdown",
}

const getDefaultRawSpanViewMode = (
availableModes: RawSpanDisplayMode[],
{preferBeautified = false}: {preferBeautified?: boolean} = {},
): RawSpanDisplayMode => {
if (preferBeautified && availableModes.includes("beautified-json")) return "beautified-json"
if (availableModes.includes("decoded-json")) return "decoded-json"
return availableModes[0] ?? "json"
}

// Value-simplification and beautified rendering live in ./BeautifiedJsonView.

const LanguageAwareViewer = ({
Expand Down Expand Up @@ -394,9 +386,7 @@ export const TraceSpanDrillInView = memo(
return ["json", "yaml", "decoded-json", "beautified-json"] as RawSpanDisplayMode[]
}, [viewModePreset, isStringValue, hasStructuredValue, parsedStructuredString])
const [viewMode, setViewMode] = useState<RawSpanDisplayMode>(() =>
getDefaultRawSpanViewMode(availableViewModes, {
preferBeautified: viewModePreset === "message",
}),
getDefaultJsonViewMode(availableViewModes),
)

const isCodeMode = viewMode === "json" || viewMode === "yaml" || viewMode === "decoded-json"
Expand Down Expand Up @@ -441,13 +431,9 @@ export const TraceSpanDrillInView = memo(

useEffect(() => {
if (!availableViewModes.includes(viewMode)) {
setViewMode(
getDefaultRawSpanViewMode(availableViewModes, {
preferBeautified: viewModePreset === "message",
}),
)
setViewMode(getDefaultJsonViewMode(availableViewModes))
}
}, [availableViewModes, viewMode, viewModePreset])
}, [availableViewModes, viewMode])

useEffect(() => {
closeSearch()
Expand Down
12 changes: 5 additions & 7 deletions web/oss/src/components/DrillInView/VIEW_MODES.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ out as a YAML string containing stringified JSON. Intended for readability only.

### `decoded-json` — Decoded

**This is the default for non-message data.** Same JSON code editor as `json`,
but the source is passed through the pipeline in
Same JSON code editor as `json`, but the source is passed through the pipeline in
[decodedJsonHelpers.ts](./decodedJsonHelpers.ts) before pretty-printing:

1. If the raw value is a string, use its structure-parsed form —
Expand Down Expand Up @@ -70,9 +69,9 @@ is now `decoded-json`. Do not reintroduce the old name.

### `beautified-json` — Reshaped

**This is the default for `viewModePreset="message"`.** Not JSON at all —
renders via [BeautifiedJsonView](./BeautifiedJsonView.tsx), which uses a
custom React layout:
**This is the default for structured JSON data.** Not JSON at all — renders via
[BeautifiedJsonView](./BeautifiedJsonView.tsx), which uses a custom React
layout:

- Chat-like arrays and single messages → chat bubbles (role label + content
editor with markdown support).
Expand Down Expand Up @@ -103,8 +102,7 @@ string is markdown-formatted (headings, lists, code fences).

Both panels use the same default-selection logic:

- If `viewModePreset === "message"` and `beautified-json` is available,
default to `beautified-json`.
- If `beautified-json` is available, default to `beautified-json`.
- Otherwise, if `decoded-json` is available, default to `decoded-json`.
- Otherwise the first available mode wins (in practice `text` for plain
strings that do not parse as JSON).
Expand Down
10 changes: 10 additions & 0 deletions web/oss/src/components/DrillInView/viewModes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export const getDefaultJsonViewMode = <TMode extends string>(
availableModes: readonly TMode[],
): TMode => {
const hasMode = (mode: string): mode is TMode => availableModes.includes(mode as TMode)

if (hasMode("beautified-json")) return "beautified-json"
if (hasMode("decoded-json")) return "decoded-json"

return (availableModes[0] ?? "json") as TMode
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
normalizeEscapedLineBreaks,
parseStructuredJson,
} from "@/oss/components/DrillInView/decodedJsonHelpers"
import {getDefaultJsonViewMode} from "@/oss/components/DrillInView/viewModes"
import EnhancedButton from "@/oss/components/EnhancedUIs/Button"
import {copyToClipboard} from "@/oss/lib/helpers/copyToClipboard"
import {getStringOrJson, sanitizeDataWithBlobUrls} from "@/oss/lib/helpers/utils"
Expand Down Expand Up @@ -64,9 +65,9 @@ type AccordionTreePanelProps = {
* Summary:
* - `json` / `yaml`: faithful — data as stored, no cleanup.
* - `decoded-json`: JSON editor, cleaned (unwrap nested stringified JSON,
* decode escaped newlines). Default for non-message data.
* decode escaped newlines).
* - `beautified-json`: custom component tree (chat bubbles, per-key fields,
* envelope unwrap, noise stripping). Default for `viewModePreset="message"`.
* envelope unwrap, noise stripping). Default for structured JSON data.
* - `text` / `markdown`: prose editor.
*/
type PanelViewMode = "json" | "yaml" | "decoded-json" | "beautified-json" | "text" | "markdown"
Expand All @@ -80,15 +81,6 @@ const PANEL_VIEW_MODE_LABELS: Record<PanelViewMode, string> = {
markdown: "Markdown",
}

const getDefaultPanelViewMode = (
availableModes: PanelViewMode[],
{preferBeautified = false}: {preferBeautified?: boolean} = {},
): PanelViewMode => {
if (preferBeautified && availableModes.includes("beautified-json")) return "beautified-json"
if (availableModes.includes("decoded-json")) return "decoded-json"
return availableModes[0] ?? "json"
}

const useStyles = createUseStyles((theme: JSSTheme) => ({
collapseContainer: ({bgColor}: {bgColor?: string}) => ({
backgroundColor: "unset",
Expand Down Expand Up @@ -336,20 +328,14 @@ const AccordionTreePanel = ({
return ["json", "yaml", "decoded-json", "beautified-json"]
}, [viewModePreset, isStringValue, hasStructuredValue, parsedStructuredString])
const [panelViewMode, setPanelViewMode] = useState<PanelViewMode>(() =>
getDefaultPanelViewMode(availableViewModes, {
preferBeautified: viewModePreset === "message",
}),
getDefaultJsonViewMode(availableViewModes),
)

useEffect(() => {
if (!availableViewModes.includes(panelViewMode)) {
setPanelViewMode(
getDefaultPanelViewMode(availableViewModes, {
preferBeautified: viewModePreset === "message",
}),
)
setPanelViewMode(getDefaultJsonViewMode(availableViewModes))
}
}, [availableViewModes, panelViewMode, viewModePreset])
}, [availableViewModes, panelViewMode])

const isCodeMode =
panelViewMode === "json" || panelViewMode === "yaml" || panelViewMode === "decoded-json"
Expand Down
Loading
Loading