@sanity/ailf-studio 0.1.20 → 0.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +342 -241
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2834,7 +2834,7 @@ import {
2834
2834
  TabPanel as TabPanel2,
2835
2835
  Text as Text29
2836
2836
  } from "@sanity/ui";
2837
- import { useCallback as useCallback19 } from "react";
2837
+ import { useCallback as useCallback20 } from "react";
2838
2838
  import { useRouter as useRouter3 } from "sanity/router";
2839
2839
 
2840
2840
  // src/components/ComparisonView.tsx
@@ -3505,7 +3505,7 @@ function formatOption(r) {
3505
3505
 
3506
3506
  // src/components/LatestReports.tsx
3507
3507
  import { Button, Card as Card7, Flex as Flex10, Stack as Stack10, Text as Text14 } from "@sanity/ui";
3508
- import { useCallback as useCallback9, useEffect as useEffect4, useMemo as useMemo4, useState as useState4 } from "react";
3508
+ import { useCallback as useCallback10, useEffect as useEffect5, useMemo as useMemo4, useState as useState5 } from "react";
3509
3509
  import { useClient as useClient4 } from "sanity";
3510
3510
  import { useRouter } from "sanity/router";
3511
3511
 
@@ -3518,7 +3518,8 @@ var BAR_STYLE = {
3518
3518
  alignItems: "center",
3519
3519
  background: "var(--card-bg-color)",
3520
3520
  display: "flex",
3521
- gap: 12,
3521
+ flexWrap: "wrap",
3522
+ gap: 8,
3522
3523
  padding: "8px 12px"
3523
3524
  };
3524
3525
  var PILL_GROUP_STYLE = {
@@ -3575,7 +3576,7 @@ function FilterBar({
3575
3576
  [onQueryChange]
3576
3577
  );
3577
3578
  return /* @__PURE__ */ jsxs11("div", { style: BAR_STYLE, children: [
3578
- /* @__PURE__ */ jsx13("div", { style: { maxWidth: 320, minWidth: 180, flex: "0 1 320px" }, children: /* @__PURE__ */ jsx13(
3579
+ /* @__PURE__ */ jsx13("div", { style: { maxWidth: 320, minWidth: 140, flex: "1 1 200px" }, children: /* @__PURE__ */ jsx13(
3579
3580
  TextInput,
3580
3581
  {
3581
3582
  fontSize: 2,
@@ -3612,7 +3613,7 @@ function FilterBar({
3612
3613
  value: trigger
3613
3614
  }
3614
3615
  ),
3615
- /* @__PURE__ */ jsx13("div", { style: { flex: 1 } }),
3616
+ /* @__PURE__ */ jsx13("div", { style: { flex: "1 0 0px" } }),
3616
3617
  hasActiveFilters && /* @__PURE__ */ jsxs11(
3617
3618
  "button",
3618
3619
  {
@@ -3759,8 +3760,50 @@ import {
3759
3760
  Stack as Stack9,
3760
3761
  Text as Text13
3761
3762
  } from "@sanity/ui";
3763
+
3764
+ // src/components/report-table/useContainerWidth.ts
3765
+ import { useCallback as useCallback8, useEffect as useEffect4, useRef as useRef3, useState as useState4 } from "react";
3766
+ var FULL_MIN = 900;
3767
+ var COMPACT_MIN = 600;
3768
+ function getTier(width) {
3769
+ if (width >= FULL_MIN) return "full";
3770
+ if (width >= COMPACT_MIN) return "compact";
3771
+ return "narrow";
3772
+ }
3773
+ function useContainerWidth() {
3774
+ const [width, setWidth] = useState4(1200);
3775
+ const observerRef = useRef3(null);
3776
+ const elementRef = useRef3(null);
3777
+ const ref = useCallback8((node) => {
3778
+ if (observerRef.current) {
3779
+ observerRef.current.disconnect();
3780
+ observerRef.current = null;
3781
+ }
3782
+ elementRef.current = node;
3783
+ if (node) {
3784
+ setWidth(node.getBoundingClientRect().width);
3785
+ const observer = new ResizeObserver((entries) => {
3786
+ for (const entry of entries) {
3787
+ setWidth(entry.contentRect.width);
3788
+ }
3789
+ });
3790
+ observer.observe(node);
3791
+ observerRef.current = observer;
3792
+ }
3793
+ }, []);
3794
+ useEffect4(() => {
3795
+ return () => {
3796
+ if (observerRef.current) {
3797
+ observerRef.current.disconnect();
3798
+ }
3799
+ };
3800
+ }, []);
3801
+ return { ref, tier: getTier(width), width };
3802
+ }
3803
+
3804
+ // src/components/report-table/ReportTable.tsx
3762
3805
  import { ClockIcon, TrendUpwardIcon } from "@sanity/icons";
3763
- import { useCallback as useCallback8 } from "react";
3806
+ import { useCallback as useCallback9 } from "react";
3764
3807
 
3765
3808
  // src/components/report-card/types.ts
3766
3809
  function formatCardDate(iso) {
@@ -3804,22 +3847,10 @@ var SCORE_COLORS = {
3804
3847
  "needs-work": { bg: "rgba(230, 126, 34, 0.15)", fg: "#e67e22" },
3805
3848
  critical: { bg: "rgba(231, 76, 60, 0.15)", fg: "#e74c3c" }
3806
3849
  };
3807
- var GRID_COLUMNS = "72px 1fr 130px 100px 100px 100px";
3808
- var HEADER_STYLE = {
3809
- borderBottom: "1px solid var(--card-border-color)",
3810
- display: "grid",
3811
- gap: "0 16px",
3812
- gridTemplateColumns: GRID_COLUMNS,
3813
- padding: "12px 12px 8px"
3814
- };
3815
- var ROW_STYLE = {
3816
- alignItems: "start",
3817
- borderBottom: "1px solid var(--card-border-color)",
3818
- cursor: "pointer",
3819
- display: "grid",
3820
- gap: "0 16px",
3821
- gridTemplateColumns: GRID_COLUMNS,
3822
- padding: "14px 12px"
3850
+ var GRID = {
3851
+ full: "72px 1fr 130px 100px 100px 100px",
3852
+ compact: "56px 1fr 110px",
3853
+ narrow: "48px 1fr"
3823
3854
  };
3824
3855
  var TABLE_HOVER_STYLES = `
3825
3856
  .ailf-row:hover { background: var(--card-muted-bg-color); }
@@ -3830,47 +3861,63 @@ function ReportTable({
3830
3861
  sort,
3831
3862
  onSortChange
3832
3863
  }) {
3864
+ const { ref, tier } = useContainerWidth();
3833
3865
  return /* @__PURE__ */ jsxs12(Fragment4, { children: [
3834
3866
  /* @__PURE__ */ jsx15("style", { children: TABLE_HOVER_STYLES }),
3835
- /* @__PURE__ */ jsxs12("div", { children: [
3836
- /* @__PURE__ */ jsxs12("div", { style: HEADER_STYLE, children: [
3837
- /* @__PURE__ */ jsx15("div", {}),
3838
- /* @__PURE__ */ jsx15(
3839
- ColHeader,
3840
- {
3841
- active: sort.field === "name",
3842
- direction: sort.direction,
3843
- label: "Report",
3844
- onClick: () => onSortChange("name")
3845
- }
3846
- ),
3847
- /* @__PURE__ */ jsx15(
3848
- ColHeader,
3849
- {
3850
- active: sort.field === "score",
3851
- direction: sort.direction,
3852
- label: "Change",
3853
- onClick: () => onSortChange("score")
3854
- }
3855
- ),
3856
- /* @__PURE__ */ jsx15(ColHeader, { label: "Mode" }),
3857
- /* @__PURE__ */ jsx15(ColHeader, { label: "Trigger" }),
3858
- /* @__PURE__ */ jsx15(
3859
- ColHeader,
3860
- {
3861
- active: sort.field === "date",
3862
- direction: sort.direction,
3863
- label: "Time",
3864
- onClick: () => onSortChange("date"),
3865
- align: "right"
3866
- }
3867
- )
3868
- ] }),
3867
+ /* @__PURE__ */ jsxs12("div", { ref, children: [
3868
+ /* @__PURE__ */ jsxs12(
3869
+ "div",
3870
+ {
3871
+ style: {
3872
+ borderBottom: "1px solid var(--card-border-color)",
3873
+ display: "grid",
3874
+ gap: "0 16px",
3875
+ gridTemplateColumns: GRID[tier],
3876
+ padding: "12px 12px 8px"
3877
+ },
3878
+ children: [
3879
+ /* @__PURE__ */ jsx15("div", {}),
3880
+ /* @__PURE__ */ jsx15(
3881
+ ColHeader,
3882
+ {
3883
+ active: sort.field === "name",
3884
+ direction: sort.direction,
3885
+ label: "Report",
3886
+ onClick: () => onSortChange("name")
3887
+ }
3888
+ ),
3889
+ tier !== "narrow" && /* @__PURE__ */ jsx15(
3890
+ ColHeader,
3891
+ {
3892
+ active: sort.field === "score",
3893
+ direction: sort.direction,
3894
+ label: "Change",
3895
+ onClick: () => onSortChange("score")
3896
+ }
3897
+ ),
3898
+ tier === "full" && /* @__PURE__ */ jsxs12(Fragment4, { children: [
3899
+ /* @__PURE__ */ jsx15(ColHeader, { label: "Mode" }),
3900
+ /* @__PURE__ */ jsx15(ColHeader, { label: "Trigger" }),
3901
+ /* @__PURE__ */ jsx15(
3902
+ ColHeader,
3903
+ {
3904
+ active: sort.field === "date",
3905
+ direction: sort.direction,
3906
+ label: "Time",
3907
+ onClick: () => onSortChange("date"),
3908
+ align: "right"
3909
+ }
3910
+ )
3911
+ ] })
3912
+ ]
3913
+ }
3914
+ ),
3869
3915
  reports.map((report) => /* @__PURE__ */ jsx15(
3870
3916
  ReportRow,
3871
3917
  {
3872
3918
  onSelect: onSelectReport,
3873
- report
3919
+ report,
3920
+ tier
3874
3921
  },
3875
3922
  report._id
3876
3923
  ))
@@ -3879,9 +3926,10 @@ function ReportTable({
3879
3926
  }
3880
3927
  function ReportRow({
3881
3928
  report,
3882
- onSelect
3929
+ onSelect,
3930
+ tier
3883
3931
  }) {
3884
- const handleClick = useCallback8(() => {
3932
+ const handleClick = useCallback9(() => {
3885
3933
  onSelect(report.reportId);
3886
3934
  }, [onSelect, report.reportId]);
3887
3935
  const rounded = Math.round(report.overall);
@@ -3895,123 +3943,176 @@ function ReportRow({
3895
3943
  const hasAreas = report.areas && report.areas.length > 0;
3896
3944
  const hasDocs = report.targetDocuments && report.targetDocuments.length > 0;
3897
3945
  const git = report.git;
3898
- return /* @__PURE__ */ jsxs12("div", { className: "ailf-row", onClick: handleClick, style: ROW_STYLE, children: [
3899
- /* @__PURE__ */ jsx15(Flex9, { align: "center", justify: "center", style: { paddingTop: 2 }, children: /* @__PURE__ */ jsx15(
3900
- "div",
3901
- {
3902
- style: {
3903
- alignItems: "center",
3904
- background: colors.bg,
3905
- border: `1px solid ${colors.fg}40`,
3906
- borderRadius: 8,
3907
- color: colors.fg,
3908
- display: "flex",
3909
- fontSize: 22,
3910
- fontWeight: 700,
3911
- height: 48,
3912
- justifyContent: "center",
3913
- lineHeight: 1,
3914
- width: 56
3915
- },
3916
- children: rounded
3917
- }
3918
- ) }),
3919
- /* @__PURE__ */ jsxs12(Stack9, { space: 2, children: [
3920
- /* @__PURE__ */ jsxs12(Flex9, { align: "center", gap: 2, wrap: "wrap", children: [
3921
- /* @__PURE__ */ jsx15(Text13, { size: 3, weight: "semibold", children: report.tag ?? formatCardDate(report.completedAt) }),
3922
- git && /* @__PURE__ */ jsxs12(Flex9, { align: "center", gap: 2, children: [
3923
- /* @__PURE__ */ jsxs12(Inline, { space: 1, children: [
3924
- /* @__PURE__ */ jsx15(GitBranchIcon, { style: { opacity: 0.6 } }),
3925
- /* @__PURE__ */ jsx15(Code, { size: 2, children: git.branch })
3926
- ] }),
3927
- git.prNumber && /* @__PURE__ */ jsxs12(Text13, { muted: true, size: 2, children: [
3928
- "#",
3929
- git.prNumber
3930
- ] }),
3931
- /* @__PURE__ */ jsx15(Code, { size: 1, style: { opacity: 0.5 }, children: git.sha.slice(0, 7) })
3932
- ] })
3933
- ] }),
3934
- /* @__PURE__ */ jsxs12(Flex9, { align: "center", gap: 2, wrap: "wrap", children: [
3935
- report.source && /* @__PURE__ */ jsx15(
3936
- Badge4,
3946
+ const isSmall = tier !== "full";
3947
+ const scoreSize = isSmall ? 40 : 48;
3948
+ const scoreWidth = isSmall ? 44 : 56;
3949
+ const scoreFontSize = isSmall ? 18 : 22;
3950
+ return /* @__PURE__ */ jsxs12(
3951
+ "div",
3952
+ {
3953
+ className: "ailf-row",
3954
+ onClick: handleClick,
3955
+ style: {
3956
+ alignItems: "start",
3957
+ borderBottom: "1px solid var(--card-border-color)",
3958
+ cursor: "pointer",
3959
+ display: "grid",
3960
+ gap: "0 16px",
3961
+ gridTemplateColumns: GRID[tier],
3962
+ padding: isSmall ? "10px 8px" : "14px 12px"
3963
+ },
3964
+ children: [
3965
+ /* @__PURE__ */ jsx15(Flex9, { align: "center", justify: "center", style: { paddingTop: 2 }, children: /* @__PURE__ */ jsx15(
3966
+ "div",
3937
3967
  {
3938
- fontSize: 1,
3939
- padding: 1,
3940
- radius: 1,
3941
- tone: SOURCE_TONE[report.source] ?? "default",
3942
- children: report.source
3968
+ style: {
3969
+ alignItems: "center",
3970
+ background: colors.bg,
3971
+ border: `1px solid ${colors.fg}40`,
3972
+ borderRadius: isSmall ? 6 : 8,
3973
+ color: colors.fg,
3974
+ display: "flex",
3975
+ fontSize: scoreFontSize,
3976
+ fontWeight: 700,
3977
+ height: scoreSize,
3978
+ justifyContent: "center",
3979
+ lineHeight: 1,
3980
+ width: scoreWidth
3981
+ },
3982
+ children: rounded
3943
3983
  }
3944
- ),
3945
- report.models?.map((model) => /* @__PURE__ */ jsx15(
3946
- Badge4,
3947
- {
3948
- fontSize: 1,
3949
- padding: 1,
3950
- radius: 1,
3951
- tone: "default",
3952
- children: model
3953
- },
3954
- model
3955
- )),
3956
- report.perspective && /* @__PURE__ */ jsx15(OutlineBadge, { tone: "cyan", children: report.perspective }),
3957
- report.durationMs != null && report.durationMs > 0 && /* @__PURE__ */ jsxs12(Flex9, { align: "center", gap: 1, children: [
3958
- /* @__PURE__ */ jsx15(ClockIcon, { style: { fontSize: 13, opacity: 0.5 } }),
3959
- /* @__PURE__ */ jsx15(Text13, { muted: true, size: 1, children: formatDuration(report.durationMs) })
3960
- ] })
3961
- ] }),
3962
- (hasAreas || hasDocs) && /* @__PURE__ */ jsxs12(Flex9, { gap: 2, wrap: "wrap", children: [
3963
- hasAreas && report.areas.map((area) => /* @__PURE__ */ jsx15(OutlineBadge, { tone: "purple", children: area }, `a-${area}`)),
3964
- hasDocs && report.targetDocuments.map((doc) => /* @__PURE__ */ jsx15(OutlineBadge, { tone: "positive", children: doc }, `d-${doc}`))
3965
- ] })
3966
- ] }),
3967
- /* @__PURE__ */ jsxs12(
3968
- Flex9,
3969
- {
3970
- align: "flex-start",
3971
- direction: "column",
3972
- gap: 2,
3973
- style: { paddingTop: 2 },
3974
- children: [
3975
- hasDelta && /* @__PURE__ */ jsxs12(Flex9, { align: "center", gap: 1, children: [
3976
- /* @__PURE__ */ jsx15(
3977
- TrendUpwardIcon,
3984
+ ) }),
3985
+ /* @__PURE__ */ jsxs12(Stack9, { space: 2, children: [
3986
+ /* @__PURE__ */ jsxs12(Flex9, { align: "center", gap: 2, wrap: "wrap", children: [
3987
+ /* @__PURE__ */ jsx15(Text13, { size: isSmall ? 2 : 3, weight: "semibold", children: report.tag ?? formatCardDate(report.completedAt) }),
3988
+ git && /* @__PURE__ */ jsxs12(Flex9, { align: "center", gap: 2, children: [
3989
+ /* @__PURE__ */ jsxs12(Inline, { space: 1, children: [
3990
+ /* @__PURE__ */ jsx15(GitBranchIcon, { style: { opacity: 0.6 } }),
3991
+ /* @__PURE__ */ jsx15(Code, { size: isSmall ? 1 : 2, children: git.branch })
3992
+ ] }),
3993
+ git.prNumber && /* @__PURE__ */ jsxs12(Text13, { muted: true, size: isSmall ? 1 : 2, children: [
3994
+ "#",
3995
+ git.prNumber
3996
+ ] }),
3997
+ tier === "full" && /* @__PURE__ */ jsx15(Code, { size: 1, style: { opacity: 0.5 }, children: git.sha.slice(0, 7) })
3998
+ ] })
3999
+ ] }),
4000
+ /* @__PURE__ */ jsxs12(Flex9, { align: "center", gap: 2, wrap: "wrap", children: [
4001
+ report.source && /* @__PURE__ */ jsx15(
4002
+ Badge4,
3978
4003
  {
3979
- style: {
3980
- color: deltaUp ? "var(--card-badge-positive-dot-color)" : "var(--card-badge-critical-dot-color)",
3981
- fontSize: 17,
3982
- transform: deltaUp ? void 0 : "scaleY(-1)"
3983
- }
4004
+ fontSize: isSmall ? 0 : 1,
4005
+ padding: 1,
4006
+ radius: 1,
4007
+ tone: SOURCE_TONE[report.source] ?? "default",
4008
+ children: report.source
3984
4009
  }
3985
4010
  ),
3986
- /* @__PURE__ */ jsxs12(
3987
- Text13,
4011
+ report.models?.map((model) => /* @__PURE__ */ jsx15(
4012
+ Badge4,
3988
4013
  {
3989
- size: 3,
3990
- style: {
3991
- color: deltaUp ? "var(--card-badge-positive-dot-color)" : "var(--card-badge-critical-dot-color)",
3992
- fontWeight: 600
3993
- },
3994
- children: [
3995
- deltaUp ? "+" : "",
3996
- Math.round(delta)
3997
- ]
3998
- }
3999
- )
4014
+ fontSize: isSmall ? 0 : 1,
4015
+ padding: 1,
4016
+ radius: 1,
4017
+ tone: "default",
4018
+ children: model
4019
+ },
4020
+ model
4021
+ )),
4022
+ report.perspective && /* @__PURE__ */ jsx15(OutlineBadge, { tone: "cyan", children: report.perspective }),
4023
+ report.durationMs != null && report.durationMs > 0 && /* @__PURE__ */ jsxs12(Flex9, { align: "center", gap: 1, children: [
4024
+ /* @__PURE__ */ jsx15(ClockIcon, { style: { fontSize: 13, opacity: 0.5 } }),
4025
+ /* @__PURE__ */ jsx15(Text13, { muted: true, size: isSmall ? 0 : 1, children: formatDuration(report.durationMs) })
4026
+ ] })
4000
4027
  ] }),
4001
- improvedCount > 0 && /* @__PURE__ */ jsxs12(OutlineBadge, { tone: "positive", children: [
4002
- improvedCount,
4003
- " improved"
4028
+ (hasAreas || hasDocs) && /* @__PURE__ */ jsxs12(Flex9, { gap: 2, wrap: "wrap", children: [
4029
+ hasAreas && report.areas.map((area) => /* @__PURE__ */ jsx15(OutlineBadge, { tone: "purple", children: area }, `a-${area}`)),
4030
+ hasDocs && report.targetDocuments.map((doc) => /* @__PURE__ */ jsx15(OutlineBadge, { tone: "positive", children: doc }, `d-${doc}`))
4004
4031
  ] }),
4005
- regressedCount > 0 && /* @__PURE__ */ jsxs12(OutlineBadge, { tone: "critical", children: [
4006
- regressedCount,
4007
- " regressed"
4032
+ isSmall && /* @__PURE__ */ jsxs12(Flex9, { align: "center", gap: 2, wrap: "wrap", children: [
4033
+ /* @__PURE__ */ jsx15(OutlineBadge, { tone: MODE_TONE[report.mode] ?? "default", children: report.mode }),
4034
+ report.trigger && /* @__PURE__ */ jsx15(OutlineBadge, { tone: TRIGGER_TONE[report.trigger] ?? "default", children: report.trigger }),
4035
+ /* @__PURE__ */ jsx15(
4036
+ Text13,
4037
+ {
4038
+ muted: true,
4039
+ size: 0,
4040
+ title: new Date(report.completedAt).toISOString(),
4041
+ children: formatRelativeTime(report.completedAt)
4042
+ }
4043
+ ),
4044
+ tier === "narrow" && hasDelta && /* @__PURE__ */ jsx15(DeltaInline, { delta, deltaUp }),
4045
+ tier === "narrow" && improvedCount > 0 && /* @__PURE__ */ jsxs12(OutlineBadge, { tone: "positive", children: [
4046
+ improvedCount,
4047
+ " improved"
4048
+ ] }),
4049
+ tier === "narrow" && regressedCount > 0 && /* @__PURE__ */ jsxs12(OutlineBadge, { tone: "critical", children: [
4050
+ regressedCount,
4051
+ " regressed"
4052
+ ] })
4008
4053
  ] })
4009
- ]
4054
+ ] }),
4055
+ tier !== "narrow" && /* @__PURE__ */ jsxs12(
4056
+ Flex9,
4057
+ {
4058
+ align: "flex-start",
4059
+ direction: "column",
4060
+ gap: 2,
4061
+ style: { paddingTop: 2 },
4062
+ children: [
4063
+ hasDelta && /* @__PURE__ */ jsx15(DeltaInline, { delta, deltaUp }),
4064
+ improvedCount > 0 && /* @__PURE__ */ jsxs12(OutlineBadge, { tone: "positive", children: [
4065
+ improvedCount,
4066
+ " improved"
4067
+ ] }),
4068
+ regressedCount > 0 && /* @__PURE__ */ jsxs12(OutlineBadge, { tone: "critical", children: [
4069
+ regressedCount,
4070
+ " regressed"
4071
+ ] })
4072
+ ]
4073
+ }
4074
+ ),
4075
+ tier === "full" && /* @__PURE__ */ jsx15("div", { style: { paddingTop: 2 }, children: /* @__PURE__ */ jsx15(OutlineBadge, { tone: MODE_TONE[report.mode] ?? "default", children: report.mode }) }),
4076
+ tier === "full" && /* @__PURE__ */ jsx15("div", { style: { paddingTop: 2 }, children: report.trigger && /* @__PURE__ */ jsx15(OutlineBadge, { tone: TRIGGER_TONE[report.trigger] ?? "default", children: report.trigger }) }),
4077
+ tier === "full" && /* @__PURE__ */ jsx15("div", { style: { paddingTop: 2, textAlign: "right" }, children: /* @__PURE__ */ jsx15(
4078
+ Text13,
4079
+ {
4080
+ muted: true,
4081
+ size: 2,
4082
+ title: new Date(report.completedAt).toISOString(),
4083
+ children: formatRelativeTime(report.completedAt)
4084
+ }
4085
+ ) })
4086
+ ]
4087
+ }
4088
+ );
4089
+ }
4090
+ function DeltaInline({ delta, deltaUp }) {
4091
+ return /* @__PURE__ */ jsxs12(Flex9, { align: "center", gap: 1, children: [
4092
+ /* @__PURE__ */ jsx15(
4093
+ TrendUpwardIcon,
4094
+ {
4095
+ style: {
4096
+ color: deltaUp ? "var(--card-badge-positive-dot-color)" : "var(--card-badge-critical-dot-color)",
4097
+ fontSize: 15,
4098
+ transform: deltaUp ? void 0 : "scaleY(-1)"
4099
+ }
4010
4100
  }
4011
4101
  ),
4012
- /* @__PURE__ */ jsx15("div", { style: { paddingTop: 2 }, children: /* @__PURE__ */ jsx15(OutlineBadge, { tone: MODE_TONE[report.mode] ?? "default", children: report.mode }) }),
4013
- /* @__PURE__ */ jsx15("div", { style: { paddingTop: 2 }, children: report.trigger && /* @__PURE__ */ jsx15(OutlineBadge, { tone: TRIGGER_TONE[report.trigger] ?? "default", children: report.trigger }) }),
4014
- /* @__PURE__ */ jsx15("div", { style: { paddingTop: 2, textAlign: "right" }, children: /* @__PURE__ */ jsx15(Text13, { muted: true, size: 2, title: new Date(report.completedAt).toISOString(), children: formatRelativeTime(report.completedAt) }) })
4102
+ /* @__PURE__ */ jsxs12(
4103
+ Text13,
4104
+ {
4105
+ size: 2,
4106
+ style: {
4107
+ color: deltaUp ? "var(--card-badge-positive-dot-color)" : "var(--card-badge-critical-dot-color)",
4108
+ fontWeight: 600
4109
+ },
4110
+ children: [
4111
+ deltaUp ? "+" : "",
4112
+ Math.round(delta)
4113
+ ]
4114
+ }
4115
+ )
4015
4116
  ] });
4016
4117
  }
4017
4118
  var MODE_TONE = {
@@ -4040,7 +4141,7 @@ function ColHeader({
4040
4141
  onClick,
4041
4142
  align
4042
4143
  }) {
4043
- const handleKeyDown = useCallback8(
4144
+ const handleKeyDown = useCallback9(
4044
4145
  (e) => {
4045
4146
  if (onClick && (e.key === "Enter" || e.key === " ")) {
4046
4147
  e.preventDefault();
@@ -4105,19 +4206,19 @@ function LatestReports({
4105
4206
  const router = useRouter();
4106
4207
  const routerState = router.state;
4107
4208
  const urlParams = routerState._searchParams;
4108
- const [searchQuery, setSearchQuery] = useState4(
4209
+ const [searchQuery, setSearchQuery] = useState5(
4109
4210
  () => readParam(urlParams, "q") ?? ""
4110
4211
  );
4111
- const [mode, setMode] = useState4(
4212
+ const [mode, setMode] = useState5(
4112
4213
  () => readParam(urlParams, "mode")
4113
4214
  );
4114
- const [source, setSource] = useState4(
4215
+ const [source, setSource] = useState5(
4115
4216
  () => readParam(urlParams, "source")
4116
4217
  );
4117
- const [trigger, setTrigger] = useState4(
4218
+ const [trigger, setTrigger] = useState5(
4118
4219
  () => readParam(urlParams, "trigger")
4119
4220
  );
4120
- useEffect4(() => {
4221
+ useEffect5(() => {
4121
4222
  const params = buildSearchParams({
4122
4223
  q: searchQuery,
4123
4224
  mode,
@@ -4126,18 +4227,18 @@ function LatestReports({
4126
4227
  });
4127
4228
  router.navigate({ ...router.state, _searchParams: params });
4128
4229
  }, [searchQuery, mode, source, trigger]);
4129
- const [initialLoading, setInitialLoading] = useState4(true);
4130
- const [loadingMore, setLoadingMore] = useState4(false);
4131
- const [reports, setReports] = useState4([]);
4132
- const [hasMore, setHasMore] = useState4(true);
4133
- const [modes, setModes] = useState4([]);
4134
- const [sources, setSources] = useState4([]);
4135
- const [triggers, setTriggers] = useState4([]);
4136
- const [sort, setSort] = useState4({
4230
+ const [initialLoading, setInitialLoading] = useState5(true);
4231
+ const [loadingMore, setLoadingMore] = useState5(false);
4232
+ const [reports, setReports] = useState5([]);
4233
+ const [hasMore, setHasMore] = useState5(true);
4234
+ const [modes, setModes] = useState5([]);
4235
+ const [sources, setSources] = useState5([]);
4236
+ const [triggers, setTriggers] = useState5([]);
4237
+ const [sort, setSort] = useState5({
4137
4238
  direction: "desc",
4138
4239
  field: "date"
4139
4240
  });
4140
- useEffect4(() => {
4241
+ useEffect5(() => {
4141
4242
  setHasMore(true);
4142
4243
  client.fetch(latestReportsQuery, {
4143
4244
  limit: pageSize,
@@ -4154,7 +4255,7 @@ function LatestReports({
4154
4255
  setInitialLoading(false);
4155
4256
  });
4156
4257
  }, [client, pageSize, mode, source]);
4157
- const handleLoadMore = useCallback9(() => {
4258
+ const handleLoadMore = useCallback10(() => {
4158
4259
  if (loadingMore || !hasMore) return;
4159
4260
  setLoadingMore(true);
4160
4261
  const nextLimit = reports.length + pageSize;
@@ -4171,7 +4272,7 @@ function LatestReports({
4171
4272
  setLoadingMore(false);
4172
4273
  });
4173
4274
  }, [client, hasMore, loadingMore, mode, pageSize, reports.length, source]);
4174
- useEffect4(() => {
4275
+ useEffect5(() => {
4175
4276
  client.fetch(distinctModesQuery).then((data) => setModes((data ?? []).sort())).catch(() => setModes([]));
4176
4277
  client.fetch(distinctSourcesQuery).then((data) => setSources((data ?? []).sort())).catch(() => setSources([]));
4177
4278
  client.fetch(distinctTriggersQuery).then((data) => setTriggers((data ?? []).sort())).catch(() => setTriggers([]));
@@ -4213,12 +4314,12 @@ function LatestReports({
4213
4314
  });
4214
4315
  return result;
4215
4316
  }, [reports, searchQuery, trigger, sort]);
4216
- const handleSortFieldChange = useCallback9((field) => {
4317
+ const handleSortFieldChange = useCallback10((field) => {
4217
4318
  setSort(
4218
4319
  (prev) => prev.field === field ? { ...prev, direction: prev.direction === "asc" ? "desc" : "asc" } : { direction: "desc", field }
4219
4320
  );
4220
4321
  }, []);
4221
- const handleReset = useCallback9(() => {
4322
+ const handleReset = useCallback10(() => {
4222
4323
  setSearchQuery("");
4223
4324
  setMode(null);
4224
4325
  setSource(null);
@@ -4296,15 +4397,15 @@ import {
4296
4397
  Tooltip as Tooltip8
4297
4398
  } from "@sanity/ui";
4298
4399
  import {
4299
- useCallback as useCallback17,
4300
- useEffect as useEffect6,
4400
+ useCallback as useCallback18,
4401
+ useEffect as useEffect7,
4301
4402
  useMemo as useMemo6,
4302
- useState as useState12
4403
+ useState as useState13
4303
4404
  } from "react";
4304
4405
  import { useClient as useClient10 } from "sanity";
4305
4406
 
4306
4407
  // src/components/report-detail/AgentActivitySection.tsx
4307
- import { useMemo as useMemo5, useState as useState5 } from "react";
4408
+ import { useMemo as useMemo5, useState as useState6 } from "react";
4308
4409
  import { HelpCircleIcon as HelpCircleIcon5, SearchIcon as SearchIcon3 } from "@sanity/icons";
4309
4410
  import {
4310
4411
  Badge as Badge5,
@@ -4479,7 +4580,7 @@ function FeatureActivityCard({
4479
4580
  ] }) });
4480
4581
  }
4481
4582
  function SearchQueryList({ queries }) {
4482
- const [filter, setFilter] = useState5("");
4583
+ const [filter, setFilter] = useState6("");
4483
4584
  const filtered = useMemo5(() => {
4484
4585
  if (!filter) return queries;
4485
4586
  const lower = filter.toLowerCase();
@@ -4868,7 +4969,7 @@ function AreaBadgeGroup({
4868
4969
  // src/components/report-detail/LineageCard.tsx
4869
4970
  import { LinkIcon as LinkIcon2 } from "@sanity/icons";
4870
4971
  import { Badge as Badge7, Card as Card13, Flex as Flex13, Stack as Stack15, Text as Text20 } from "@sanity/ui";
4871
- import { useCallback as useCallback10, useEffect as useEffect5, useState as useState6 } from "react";
4972
+ import { useCallback as useCallback11, useEffect as useEffect6, useState as useState7 } from "react";
4872
4973
  import { useClient as useClient5 } from "sanity";
4873
4974
  import { useRouter as useRouter2 } from "sanity/router";
4874
4975
  import { jsx as jsx22, jsxs as jsxs18 } from "react/jsx-runtime";
@@ -4887,8 +4988,8 @@ function LineageCard({ provenance, reportId }) {
4887
4988
  const { lineage } = provenance;
4888
4989
  const router = useRouter2();
4889
4990
  const client = useClient5({ apiVersion: API_VERSION });
4890
- const [spawned, setSpawned] = useState6([]);
4891
- useEffect5(() => {
4991
+ const [spawned, setSpawned] = useState7([]);
4992
+ useEffect6(() => {
4892
4993
  let cancelled = false;
4893
4994
  client.fetch(SPAWNED_REPORTS_QUERY, {
4894
4995
  reportId,
@@ -4935,7 +5036,7 @@ function LineageLink({
4935
5036
  reportId,
4936
5037
  router
4937
5038
  }) {
4938
- const handleClick = useCallback10(() => {
5039
+ const handleClick = useCallback11(() => {
4939
5040
  router.navigate({ reportId });
4940
5041
  }, [reportId, router]);
4941
5042
  return /* @__PURE__ */ jsxs18(Flex13, { align: "center", gap: 2, children: [
@@ -4964,7 +5065,7 @@ function SpawnedReportRow({
4964
5065
  report,
4965
5066
  router
4966
5067
  }) {
4967
- const handleClick = useCallback10(() => {
5068
+ const handleClick = useCallback11(() => {
4968
5069
  router.navigate({ reportId: report.reportId });
4969
5070
  }, [report.reportId, router]);
4970
5071
  const dateLabel = formatShortDate(report.completedAt);
@@ -4999,7 +5100,7 @@ function formatShortDate(iso) {
4999
5100
  }
5000
5101
 
5001
5102
  // src/components/report-detail/JudgmentList.tsx
5002
- import { useState as useState7 } from "react";
5103
+ import { useState as useState8 } from "react";
5003
5104
  import { HelpCircleIcon as HelpCircleIcon6 } from "@sanity/icons";
5004
5105
  import { Badge as Badge8, Box as Box11, Card as Card14, Flex as Flex14, Stack as Stack16, Text as Text21, Tooltip as Tooltip6 } from "@sanity/ui";
5005
5106
 
@@ -5074,7 +5175,7 @@ function JudgmentList({ judgments }) {
5074
5175
  ] }) });
5075
5176
  }
5076
5177
  function JudgmentCard({ judgment }) {
5077
- const [expanded, setExpanded] = useState7(false);
5178
+ const [expanded, setExpanded] = useState8(false);
5078
5179
  const dimLabel = DIMENSION_LABELS[judgment.dimension] ?? judgment.dimension;
5079
5180
  const sep = judgment.taskId.indexOf(" - ");
5080
5181
  const taskName = sep > 0 ? judgment.taskId.substring(sep + 3) : judgment.taskId;
@@ -5131,7 +5232,7 @@ var editLinkStyle = {
5131
5232
  function DocBadge({
5132
5233
  doc
5133
5234
  }) {
5134
- const [hovered, setHovered] = useState7(false);
5235
+ const [hovered, setHovered] = useState8(false);
5135
5236
  const isLinked = Boolean(doc.documentId);
5136
5237
  const tooltipLabel = isLinked ? `Edit "${doc.title || doc.slug}"` : doc.title || doc.slug;
5137
5238
  const badge = /* @__PURE__ */ jsx24(Badge8, { mode: "outline", tone: isLinked && hovered ? "caution" : "primary", children: doc.slug });
@@ -5519,20 +5620,20 @@ import {
5519
5620
  MenuDivider,
5520
5621
  useToast as useToast7
5521
5622
  } from "@sanity/ui";
5522
- import { useCallback as useCallback16, useState as useState11 } from "react";
5623
+ import { useCallback as useCallback17, useState as useState12 } from "react";
5523
5624
  import { useClient as useClient9 } from "sanity";
5524
5625
 
5525
5626
  // src/components/report-detail/report-actions/CopyReportAction.tsx
5526
5627
  import { ClipboardIcon } from "@sanity/icons";
5527
5628
  import { MenuItem, useToast as useToast2 } from "@sanity/ui";
5528
- import { useCallback as useCallback11, useState as useState8 } from "react";
5629
+ import { useCallback as useCallback12, useState as useState9 } from "react";
5529
5630
  import { useClient as useClient6 } from "sanity";
5530
5631
  import { jsx as jsx28 } from "react/jsx-runtime";
5531
5632
  function CopyReportAction({ documentId }) {
5532
5633
  const client = useClient6({ apiVersion: API_VERSION });
5533
5634
  const toast = useToast2();
5534
- const [copying, setCopying] = useState8(false);
5535
- const handleClick = useCallback11(async () => {
5635
+ const [copying, setCopying] = useState9(false);
5636
+ const handleClick = useCallback12(async () => {
5536
5637
  setCopying(true);
5537
5638
  try {
5538
5639
  const doc = await client.fetch(
@@ -5578,11 +5679,11 @@ function CopyReportAction({ documentId }) {
5578
5679
  // src/components/report-detail/report-actions/CopyReportIdAction.tsx
5579
5680
  import { CopyIcon } from "@sanity/icons";
5580
5681
  import { MenuItem as MenuItem2, useToast as useToast3 } from "@sanity/ui";
5581
- import { useCallback as useCallback12 } from "react";
5682
+ import { useCallback as useCallback13 } from "react";
5582
5683
  import { jsx as jsx29 } from "react/jsx-runtime";
5583
5684
  function CopyReportIdAction({ reportId }) {
5584
5685
  const toast = useToast3();
5585
- const handleClick = useCallback12(() => {
5686
+ const handleClick = useCallback13(() => {
5586
5687
  navigator.clipboard.writeText(reportId).then(
5587
5688
  () => {
5588
5689
  toast.push({
@@ -5606,13 +5707,13 @@ function CopyReportIdAction({ reportId }) {
5606
5707
  // src/components/report-detail/report-actions/CopyVisionQueryAction.tsx
5607
5708
  import { SearchIcon as SearchIcon4 } from "@sanity/icons";
5608
5709
  import { MenuItem as MenuItem3, useToast as useToast4 } from "@sanity/ui";
5609
- import { useCallback as useCallback13 } from "react";
5710
+ import { useCallback as useCallback14 } from "react";
5610
5711
  import { jsx as jsx30 } from "react/jsx-runtime";
5611
5712
  function CopyVisionQueryAction({
5612
5713
  reportId
5613
5714
  }) {
5614
5715
  const toast = useToast4();
5615
- const handleClick = useCallback13(() => {
5716
+ const handleClick = useCallback14(() => {
5616
5717
  const query = `*[_type == "ailf.report" && reportId == "${reportId}"][0]`;
5617
5718
  navigator.clipboard.writeText(query).then(
5618
5719
  () => {
@@ -5715,7 +5816,7 @@ function DeleteReportAction({
5715
5816
  // src/components/report-detail/report-actions/DownloadReportAction.tsx
5716
5817
  import { DownloadIcon } from "@sanity/icons";
5717
5818
  import { MenuItem as MenuItem5, useToast as useToast5 } from "@sanity/ui";
5718
- import { useCallback as useCallback14, useState as useState9 } from "react";
5819
+ import { useCallback as useCallback15, useState as useState10 } from "react";
5719
5820
  import { useClient as useClient7 } from "sanity";
5720
5821
  import { jsx as jsx33 } from "react/jsx-runtime";
5721
5822
  function DownloadReportAction({
@@ -5724,8 +5825,8 @@ function DownloadReportAction({
5724
5825
  }) {
5725
5826
  const client = useClient7({ apiVersion: API_VERSION });
5726
5827
  const toast = useToast5();
5727
- const [downloading, setDownloading] = useState9(false);
5728
- const handleClick = useCallback14(async () => {
5828
+ const [downloading, setDownloading] = useState10(false);
5829
+ const handleClick = useCallback15(async () => {
5729
5830
  setDownloading(true);
5730
5831
  try {
5731
5832
  const doc = await client.fetch(
@@ -5779,7 +5880,7 @@ function DownloadReportAction({
5779
5880
  // src/components/report-detail/report-actions/RerunEvaluationAction.tsx
5780
5881
  import { PlayIcon as PlayIcon2 } from "@sanity/icons";
5781
5882
  import { MenuItem as MenuItem6, useToast as useToast6 } from "@sanity/ui";
5782
- import { useCallback as useCallback15, useState as useState10 } from "react";
5883
+ import { useCallback as useCallback16, useState as useState11 } from "react";
5783
5884
  import { useClient as useClient8, useCurrentUser as useCurrentUser2 } from "sanity";
5784
5885
 
5785
5886
  // src/lib/eval-scope.ts
@@ -5834,8 +5935,8 @@ function RerunEvaluationAction({
5834
5935
  const client = useClient8({ apiVersion: API_VERSION });
5835
5936
  const currentUser = useCurrentUser2();
5836
5937
  const toast = useToast6();
5837
- const [requesting, setRequesting] = useState10(false);
5838
- const handleClick = useCallback15(async () => {
5938
+ const [requesting, setRequesting] = useState11(false);
5939
+ const handleClick = useCallback16(async () => {
5839
5940
  setRequesting(true);
5840
5941
  try {
5841
5942
  const scope = extractEvalScope(provenance);
@@ -5883,7 +5984,7 @@ function ReportActions({
5883
5984
  }) {
5884
5985
  const client = useClient9({ apiVersion: API_VERSION });
5885
5986
  const toast = useToast7();
5886
- const handleCopyId = useCallback16(() => {
5987
+ const handleCopyId = useCallback17(() => {
5887
5988
  navigator.clipboard.writeText(reportId).then(
5888
5989
  () => {
5889
5990
  toast.push({
@@ -5901,15 +6002,15 @@ function ReportActions({
5901
6002
  }
5902
6003
  );
5903
6004
  }, [reportId, toast]);
5904
- const [deleteDialogOpen, setDeleteDialogOpen] = useState11(false);
5905
- const [deleting, setDeleting] = useState11(false);
5906
- const handleRequestDelete = useCallback16(() => {
6005
+ const [deleteDialogOpen, setDeleteDialogOpen] = useState12(false);
6006
+ const [deleting, setDeleting] = useState12(false);
6007
+ const handleRequestDelete = useCallback17(() => {
5907
6008
  setDeleteDialogOpen(true);
5908
6009
  }, []);
5909
- const handleDeleteClose = useCallback16(() => {
6010
+ const handleDeleteClose = useCallback17(() => {
5910
6011
  if (!deleting) setDeleteDialogOpen(false);
5911
6012
  }, [deleting]);
5912
- const handleDeleteConfirm = useCallback16(async () => {
6013
+ const handleDeleteConfirm = useCallback17(async () => {
5913
6014
  setDeleting(true);
5914
6015
  try {
5915
6016
  await client.delete(documentId);
@@ -6183,9 +6284,9 @@ function ReportDetail({
6183
6284
  reportId
6184
6285
  }) {
6185
6286
  const client = useClient10({ apiVersion: API_VERSION });
6186
- const [loading, setLoading] = useState12(true);
6187
- const [report, setReport] = useState12(null);
6188
- useEffect6(() => {
6287
+ const [loading, setLoading] = useState13(true);
6288
+ const [report, setReport] = useState13(null);
6289
+ useEffect7(() => {
6189
6290
  let cancelled = false;
6190
6291
  setLoading(true);
6191
6292
  client.fetch(reportDetailQuery, { reportId }).then((data) => {
@@ -6222,7 +6323,7 @@ function ReportDetail({
6222
6323
  if (disabledTabs.has(parsed)) return "overview";
6223
6324
  return tabs.some((t) => t.id === parsed) ? parsed : "overview";
6224
6325
  }, [activeTab, disabledTabs, tabs]);
6225
- const handleTabClick = useCallback17(
6326
+ const handleTabClick = useCallback18(
6226
6327
  (tabId) => {
6227
6328
  onTabChange(tabId === "overview" ? null : tabId);
6228
6329
  },
@@ -6375,7 +6476,7 @@ function getDisabledTabTooltip(tabId, summary) {
6375
6476
 
6376
6477
  // src/components/ScoreTimeline.tsx
6377
6478
  import { Card as Card19, Flex as Flex21, Select as Select2, Stack as Stack23, Text as Text28 } from "@sanity/ui";
6378
- import { useCallback as useCallback18, useEffect as useEffect7, useMemo as useMemo7, useState as useState13 } from "react";
6479
+ import { useCallback as useCallback19, useEffect as useEffect8, useMemo as useMemo7, useState as useState14 } from "react";
6379
6480
  import { useClient as useClient11 } from "sanity";
6380
6481
  import { jsx as jsx39, jsxs as jsxs28 } from "react/jsx-runtime";
6381
6482
  var CHART_HEIGHT = 220;
@@ -6412,10 +6513,10 @@ function scoreForPoint(point, area) {
6412
6513
  }
6413
6514
  function ScoreTimeline({ mode = null, source = null }) {
6414
6515
  const client = useClient11({ apiVersion: API_VERSION });
6415
- const [dataPoints, setDataPoints] = useState13([]);
6416
- const [loading, setLoading] = useState13(true);
6417
- const [rangeDays, setRangeDays] = useState13(30);
6418
- const [selectedArea, setSelectedArea] = useState13(null);
6516
+ const [dataPoints, setDataPoints] = useState14([]);
6517
+ const [loading, setLoading] = useState14(true);
6518
+ const [rangeDays, setRangeDays] = useState14(30);
6519
+ const [selectedArea, setSelectedArea] = useState14(null);
6419
6520
  const areaNames = useMemo7(() => {
6420
6521
  const names = /* @__PURE__ */ new Set();
6421
6522
  for (const dp of dataPoints) {
@@ -6425,7 +6526,7 @@ function ScoreTimeline({ mode = null, source = null }) {
6425
6526
  }
6426
6527
  return Array.from(names).sort();
6427
6528
  }, [dataPoints]);
6428
- const fetchData = useCallback18(async () => {
6529
+ const fetchData = useCallback19(async () => {
6429
6530
  setLoading(true);
6430
6531
  try {
6431
6532
  const startDate = rangeDays ? daysAgo(rangeDays) : "1970-01-01T00:00:00Z";
@@ -6440,7 +6541,7 @@ function ScoreTimeline({ mode = null, source = null }) {
6440
6541
  setLoading(false);
6441
6542
  }
6442
6543
  }, [client, mode, rangeDays, source]);
6443
- useEffect7(() => {
6544
+ useEffect8(() => {
6444
6545
  void fetchData();
6445
6546
  }, [fetchData]);
6446
6547
  const chartPoints = useMemo7(() => {
@@ -6461,14 +6562,14 @@ function ScoreTimeline({ mode = null, source = null }) {
6461
6562
  if (chartPoints.length === 0) return 0;
6462
6563
  return chartPoints.reduce((sum, p) => sum + p.score, 0) / chartPoints.length;
6463
6564
  }, [chartPoints]);
6464
- const handleRangeChange = useCallback18(
6565
+ const handleRangeChange = useCallback19(
6465
6566
  (e) => {
6466
6567
  const val = e.currentTarget.value;
6467
6568
  setRangeDays(val === "all" ? null : Number(val));
6468
6569
  },
6469
6570
  []
6470
6571
  );
6471
- const handleAreaChange = useCallback18(
6572
+ const handleAreaChange = useCallback19(
6472
6573
  (e) => {
6473
6574
  const val = e.currentTarget.value;
6474
6575
  setSelectedArea(val || null);
@@ -6606,7 +6707,7 @@ function Dashboard() {
6606
6707
  const reportId = routerState.reportId ?? null;
6607
6708
  const isDetail = reportId !== null;
6608
6709
  const activeTab = isDetail ? "latest" : VIEW_PARAM_MAP[routerState.view ?? ""] ?? "latest";
6609
- const navigateToTab = useCallback19(
6710
+ const navigateToTab = useCallback20(
6610
6711
  (tab) => {
6611
6712
  if (tab === "latest") {
6612
6713
  router.navigate({});
@@ -6616,13 +6717,13 @@ function Dashboard() {
6616
6717
  },
6617
6718
  [router]
6618
6719
  );
6619
- const handleSelectReport = useCallback19(
6720
+ const handleSelectReport = useCallback20(
6620
6721
  (id) => {
6621
6722
  router.navigate({ reportId: id });
6622
6723
  },
6623
6724
  [router]
6624
6725
  );
6625
- const handleTabChange = useCallback19(
6726
+ const handleTabChange = useCallback20(
6626
6727
  (tab) => {
6627
6728
  if (!routerState.reportId) return;
6628
6729
  if (tab) {
@@ -6633,7 +6734,7 @@ function Dashboard() {
6633
6734
  },
6634
6735
  [router, routerState.reportId]
6635
6736
  );
6636
- const handleBack = useCallback19(() => {
6737
+ const handleBack = useCallback20(() => {
6637
6738
  router.navigate({});
6638
6739
  }, [router]);
6639
6740
  return /* @__PURE__ */ jsx40(Container, { width: 4, children: /* @__PURE__ */ jsxs29(Stack24, { padding: 4, space: 4, children: [
@@ -6706,7 +6807,7 @@ function ailfTool(options = {}) {
6706
6807
  // src/actions/RunEvaluationAction.tsx
6707
6808
  import { BarChartIcon as BarChartIcon2 } from "@sanity/icons";
6708
6809
  import { useToast as useToast8 } from "@sanity/ui";
6709
- import { useCallback as useCallback20, useEffect as useEffect8, useRef as useRef3, useState as useState14 } from "react";
6810
+ import { useCallback as useCallback21, useEffect as useEffect9, useRef as useRef4, useState as useState15 } from "react";
6710
6811
  import {
6711
6812
  getReleaseIdFromReleaseDocumentId as getReleaseIdFromReleaseDocumentId3,
6712
6813
  useClient as useClient12,
@@ -6737,10 +6838,10 @@ function createRunEvaluationAction(options = {}) {
6737
6838
  const projectId = useProjectId2();
6738
6839
  const currentUser = useCurrentUser3();
6739
6840
  const toast = useToast8();
6740
- const [state, setState] = useState14({ status: "loading" });
6741
- const requestedAtRef = useRef3(null);
6841
+ const [state, setState] = useState15({ status: "loading" });
6842
+ const requestedAtRef = useRef4(null);
6742
6843
  const perspectiveId = getReleaseIdFromReleaseDocumentId3(release._id);
6743
- useEffect8(() => {
6844
+ useEffect9(() => {
6744
6845
  let cancelled = false;
6745
6846
  client.fetch(contentImpactQuery, buildReportQueryParams(perspectiveId)).then((results) => {
6746
6847
  if (cancelled) return;
@@ -6763,7 +6864,7 @@ function createRunEvaluationAction(options = {}) {
6763
6864
  cancelled = true;
6764
6865
  };
6765
6866
  }, [client, perspectiveId]);
6766
- useEffect8(() => {
6867
+ useEffect9(() => {
6767
6868
  if (state.status !== "requested" && state.status !== "polling") return;
6768
6869
  const { requestId, startedAt } = state;
6769
6870
  if (state.status === "requested") {
@@ -6813,7 +6914,7 @@ function createRunEvaluationAction(options = {}) {
6813
6914
  }, POLL_INTERVAL_MS2);
6814
6915
  return () => clearInterval(interval);
6815
6916
  }, [client, perspectiveId, state]);
6816
- useEffect8(() => {
6917
+ useEffect9(() => {
6817
6918
  if (state.status !== "error") return;
6818
6919
  const timer = setTimeout(() => {
6819
6920
  client.fetch(contentImpactQuery, buildReportQueryParams(perspectiveId)).then((results) => {
@@ -6833,7 +6934,7 @@ function createRunEvaluationAction(options = {}) {
6833
6934
  }, 15e3);
6834
6935
  return () => clearTimeout(timer);
6835
6936
  }, [client, perspectiveId, state]);
6836
- const handleRequest = useCallback20(async () => {
6937
+ const handleRequest = useCallback21(async () => {
6837
6938
  const releaseTitle = release.metadata?.title ?? perspectiveId ?? "release";
6838
6939
  const tag = `release-${slugify3(releaseTitle)}-${dateStamp3()}`;
6839
6940
  const now = Date.now();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/ailf-studio",
3
- "version": "0.1.20",
3
+ "version": "0.1.21",
4
4
  "description": "AI Literacy Framework — Sanity Studio dashboard plugin",
5
5
  "type": "module",
6
6
  "license": "MIT",