From 1942e97db54e9d636fcc5db1cf377d423dd83ae4 Mon Sep 17 00:00:00 2001 From: Kyrylo Shmidt Date: Wed, 13 Aug 2025 10:25:40 +0200 Subject: [PATCH 1/5] Add agent summaries --- src/components/Admin/Environments/index.tsx | 2 +- .../IncidentMetaData/index.tsx | 2 +- .../IncidentSummary.stories.tsx | 42 +++++++++++++++++ .../IncidentSummaryRecord/index.tsx | 17 +++++++ .../IncidentSummaryRecord/styles.ts | 45 +++++++++++++++++++ .../IncidentSummaryRecord/types.ts | 5 +++ .../IncidentDetails/IncidentSummary/index.tsx | 16 +++++++ .../IncidentDetails/IncidentSummary/styles.ts | 7 +++ .../IncidentDetails/IncidentSummary/types.ts | 5 +++ .../Agentic/IncidentDetails/index.tsx | 13 +++--- .../Agentic/IncidentDetails/styles.ts | 4 +- .../NewErrorCard/OccurrenceChart/index.tsx | 2 +- .../common/CommitInfos/index.tsx | 2 +- .../LiveView/DotTooltipContent/index.tsx | 2 +- .../RecentActivity/LiveView/index.tsx | 2 +- src/redux/services/types.ts | 8 ++++ 16 files changed, 160 insertions(+), 14 deletions(-) create mode 100644 src/components/Agentic/IncidentDetails/IncidentSummary/IncidentSummary.stories.tsx create mode 100644 src/components/Agentic/IncidentDetails/IncidentSummary/IncidentSummaryRecord/index.tsx create mode 100644 src/components/Agentic/IncidentDetails/IncidentSummary/IncidentSummaryRecord/styles.ts create mode 100644 src/components/Agentic/IncidentDetails/IncidentSummary/IncidentSummaryRecord/types.ts create mode 100644 src/components/Agentic/IncidentDetails/IncidentSummary/index.tsx create mode 100644 src/components/Agentic/IncidentDetails/IncidentSummary/styles.ts create mode 100644 src/components/Agentic/IncidentDetails/IncidentSummary/types.ts diff --git a/src/components/Admin/Environments/index.tsx b/src/components/Admin/Environments/index.tsx index 053809e54..e4ea90822 100644 --- a/src/components/Admin/Environments/index.tsx +++ b/src/components/Admin/Environments/index.tsx @@ -92,7 +92,7 @@ export const Environments = () => { cell: (info) => { const value = info.getValue(); const dateString = value - ? format(value, "MMM d, yyyy h:mm aaa") + ? format(value, "MMM d, y h:mm aaa") : ""; return ( diff --git a/src/components/Agentic/IncidentDetails/IncidentMetaData/index.tsx b/src/components/Agentic/IncidentDetails/IncidentMetaData/index.tsx index 5d0ff676b..1a207c081 100644 --- a/src/components/Agentic/IncidentDetails/IncidentMetaData/index.tsx +++ b/src/components/Agentic/IncidentDetails/IncidentMetaData/index.tsx @@ -20,7 +20,7 @@ import { Divider } from "./Divider"; import { IdeToolbar } from "./IdeToolbar"; import * as s from "./styles"; -const DATE_FORMAT = "dd MMM, yyyy HH:mm"; +const DATE_FORMAT = "dd MMM, y HH:mm"; const SERVICE_TAGS_TO_SHOW = 2; const REFRESH_INTERVAL = 10 * 1000; // in milliseconds diff --git a/src/components/Agentic/IncidentDetails/IncidentSummary/IncidentSummary.stories.tsx b/src/components/Agentic/IncidentDetails/IncidentSummary/IncidentSummary.stories.tsx new file mode 100644 index 000000000..e347656da --- /dev/null +++ b/src/components/Agentic/IncidentDetails/IncidentSummary/IncidentSummary.stories.tsx @@ -0,0 +1,42 @@ +import type { Meta, StoryObj } from "@storybook/react-webpack5"; +import { IncidentSummary } from "."; + +// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction +const meta: Meta = { + title: "Agentic/IncidentDetails/IncidentSummary/IncidentSummary", + component: IncidentSummary, + parameters: { + // More on how to position stories at: https://storybook.js.org/docs/react/configure/story-layout + layout: "fullscreen" + } +}; + +export default meta; + +type Story = StoryObj; + +// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args +export const Default: Story = { + args: { + records: [ + { + id: "1", + agent_display_name: "triager", + timestamp: "2023-10-01T12:00:00Z", + text: "Lorem ipsum dolor sit amet" + }, + { + id: "2", + agent_display_name: "code resolver", + timestamp: "2023-10-01T12:00:00Z", + text: "Lorem ipsum dolor sit amet consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." + }, + { + id: "3", + agent_display_name: "infra resolver", + timestamp: "2023-10-01T12:00:00Z", + text: "Lorem ipsum dolor sit amet" + } + ] + } +}; diff --git a/src/components/Agentic/IncidentDetails/IncidentSummary/IncidentSummaryRecord/index.tsx b/src/components/Agentic/IncidentDetails/IncidentSummary/IncidentSummaryRecord/index.tsx new file mode 100644 index 000000000..fc4a07aa2 --- /dev/null +++ b/src/components/Agentic/IncidentDetails/IncidentSummary/IncidentSummaryRecord/index.tsx @@ -0,0 +1,17 @@ +import { format } from "date-fns"; +import * as s from "./styles"; +import type { IncidentSummaryRecordProps } from "./types"; + +export const IncidentSummaryRecord = ({ + agent, + datetime, + text +}: IncidentSummaryRecordProps) => ( + + + {agent} + {format(datetime, "h:mm a, LLLL d y")} + + {text} + +); diff --git a/src/components/Agentic/IncidentDetails/IncidentSummary/IncidentSummaryRecord/styles.ts b/src/components/Agentic/IncidentDetails/IncidentSummary/IncidentSummaryRecord/styles.ts new file mode 100644 index 000000000..3aa07e8f7 --- /dev/null +++ b/src/components/Agentic/IncidentDetails/IncidentSummary/IncidentSummaryRecord/styles.ts @@ -0,0 +1,45 @@ +import styled from "styled-components"; +import { + bodyRegularTypography, + subheading1RegularTypography +} from "../../../../common/App/typographies"; + +export const Container = styled.div` + display: flex; + flex-direction: column; + gap: 12px; + padding: 12px 16px; + border-bottom: 1px solid + ${({ theme }) => theme.colors.v3.surface.sidePanelHeader}; + + &:nth-child(even) { + background: ${({ theme }) => theme.colors.v3.surface.primaryLight}; + } + + &:last-child { + border-bottom: none; + } +`; + +export const Header = styled.div` + ${bodyRegularTypography} + + display: flex; + justify-content: space-between; + align-items: center; +`; + +export const Agent = styled.span` + text-transform: capitalize; + color: ${({ theme }) => theme.colors.v3.text.primary}; +`; + +export const DateTime = styled.span` + color: ${({ theme }) => theme.colors.v3.text.secondary}; +`; + +export const Text = styled.span` + ${subheading1RegularTypography} + + color: ${({ theme }) => theme.colors.v3.text.primary}; +`; diff --git a/src/components/Agentic/IncidentDetails/IncidentSummary/IncidentSummaryRecord/types.ts b/src/components/Agentic/IncidentDetails/IncidentSummary/IncidentSummaryRecord/types.ts new file mode 100644 index 000000000..da5701486 --- /dev/null +++ b/src/components/Agentic/IncidentDetails/IncidentSummary/IncidentSummaryRecord/types.ts @@ -0,0 +1,5 @@ +export interface IncidentSummaryRecordProps { + agent: string; + datetime: string; + text: string; +} diff --git a/src/components/Agentic/IncidentDetails/IncidentSummary/index.tsx b/src/components/Agentic/IncidentDetails/IncidentSummary/index.tsx new file mode 100644 index 000000000..708a2efdf --- /dev/null +++ b/src/components/Agentic/IncidentDetails/IncidentSummary/index.tsx @@ -0,0 +1,16 @@ +import { IncidentSummaryRecord } from "./IncidentSummaryRecord"; +import * as s from "./styles"; +import type { IncidentSummaryProps } from "./types"; + +export const IncidentSummary = ({ records }: IncidentSummaryProps) => ( + + {records.map((record) => ( + + ))} + +); diff --git a/src/components/Agentic/IncidentDetails/IncidentSummary/styles.ts b/src/components/Agentic/IncidentDetails/IncidentSummary/styles.ts new file mode 100644 index 000000000..04015e7b9 --- /dev/null +++ b/src/components/Agentic/IncidentDetails/IncidentSummary/styles.ts @@ -0,0 +1,7 @@ +import styled from "styled-components"; + +export const Container = styled.div` + display: flex; + flex-direction: column; + border: 1px solid ${({ theme }) => theme.colors.v3.surface.sidePanelHeader}; +`; diff --git a/src/components/Agentic/IncidentDetails/IncidentSummary/types.ts b/src/components/Agentic/IncidentDetails/IncidentSummary/types.ts new file mode 100644 index 000000000..e464ec16d --- /dev/null +++ b/src/components/Agentic/IncidentDetails/IncidentSummary/types.ts @@ -0,0 +1,5 @@ +import type { IncidentSummaryRecord } from "../../../../redux/services/types"; + +export interface IncidentSummaryProps { + records: IncidentSummaryRecord[]; +} diff --git a/src/components/Agentic/IncidentDetails/index.tsx b/src/components/Agentic/IncidentDetails/index.tsx index e69654823..6592149d1 100644 --- a/src/components/Agentic/IncidentDetails/index.tsx +++ b/src/components/Agentic/IncidentDetails/index.tsx @@ -24,6 +24,7 @@ import { AdditionalInfo } from "./AdditionalInfo"; import { AgentSummary } from "./AgentSummary"; import { IncidentAgentChat } from "./IncidentAgentChat"; import { IncidentMetaData } from "./IncidentMetaData"; +import { IncidentSummary } from "./IncidentSummary"; import * as s from "./styles"; import type { AgentViewMode } from "./types"; @@ -147,8 +148,8 @@ export const IncidentDetails = () => { const incidentStatus = incidentData?.description; - const isAgentChatEnabled = agentsData?.agents.find( - (agent) => agent.name === `${agentId}_chat` + const isAgentChatEnabled = Boolean( + agentsData?.agents.find((agent) => agent.name === `${agentId}_chat`) ); if (!incidentData && isLoading) { @@ -239,9 +240,11 @@ export const IncidentDetails = () => { ) ) : ( - - {incidentData?.summary} - + + + )} diff --git a/src/components/Agentic/IncidentDetails/styles.ts b/src/components/Agentic/IncidentDetails/styles.ts index a436aca29..e989a796c 100644 --- a/src/components/Agentic/IncidentDetails/styles.ts +++ b/src/components/Agentic/IncidentDetails/styles.ts @@ -6,7 +6,6 @@ import { import { Toggle } from "../../common/v3/Toggle"; import { OptionButton } from "../../common/v3/Toggle/styles"; import type { ToggleProps } from "../../common/v3/Toggle/types"; -import { textStyles } from "../common/AgentEventsList/AgentEvent/TypingMarkdown/MarkdownRenderer/styles"; import type { AgentViewMode, BreadcrumbProps } from "./types"; export const Container = styled.div` @@ -153,8 +152,7 @@ export const StatusBarText = styled.span` white-space: nowrap; `; -export const IncidentSummaryText = styled.div` - ${textStyles} +export const IncidentSummaryContainer = styled.div` flex-grow: 1; overflow: auto; `; diff --git a/src/components/Errors/NewErrorCard/OccurrenceChart/index.tsx b/src/components/Errors/NewErrorCard/OccurrenceChart/index.tsx index ee5fea5db..026f9d33a 100644 --- a/src/components/Errors/NewErrorCard/OccurrenceChart/index.tsx +++ b/src/components/Errors/NewErrorCard/OccurrenceChart/index.tsx @@ -157,7 +157,7 @@ export const OccurrenceChart = ({ return ( Occurrences: {value} - {format(date, "MM/dd/yyyy")} + {format(date, "MM/dd/y")} ); }} diff --git a/src/components/Insights/InsightTicketRenderer/insightTickets/common/CommitInfos/index.tsx b/src/components/Insights/InsightTicketRenderer/insightTickets/common/CommitInfos/index.tsx index 4f364dcdd..72d9636db 100644 --- a/src/components/Insights/InsightTicketRenderer/insightTickets/common/CommitInfos/index.tsx +++ b/src/components/Insights/InsightTicketRenderer/insightTickets/common/CommitInfos/index.tsx @@ -62,7 +62,7 @@ export const CommitInfos = ({ insight, commitInfos }: CommitInfosProps) => {
{x.label}
{renderCommit(commitInfos, x.id)}
- {x.dateTime &&
{format(x.dateTime, "MM/dd/yyyy HH:mm")}
} + {x.dateTime &&
{format(x.dateTime, "MM/dd/y HH:mm")}
}
)), (i) => ( diff --git a/src/components/RecentActivity/LiveView/DotTooltipContent/index.tsx b/src/components/RecentActivity/LiveView/DotTooltipContent/index.tsx index 1300de5e9..8b36c2503 100644 --- a/src/components/RecentActivity/LiveView/DotTooltipContent/index.tsx +++ b/src/components/RecentActivity/LiveView/DotTooltipContent/index.tsx @@ -15,7 +15,7 @@ export const DotTooltipContent = ({ {format(date, "HH:mm:ss.SSS")} - {format(date, "MM/dd/yyyy")} + {format(date, "MM/dd/y")} {getDurationString(data.duration)} diff --git a/src/components/RecentActivity/LiveView/index.tsx b/src/components/RecentActivity/LiveView/index.tsx index e7650b98a..ae0535391 100644 --- a/src/components/RecentActivity/LiveView/index.tsx +++ b/src/components/RecentActivity/LiveView/index.tsx @@ -138,7 +138,7 @@ const getMaxDurationRecord = ( ); const formatXAxisDate = (dateTime: number): string => - format(dateTime, "HH:mm MM/dd/yyyy"); + format(dateTime, "HH:mm MM/dd/y"); export const LiveView = ({ data, onClose }: LiveViewProps) => { const theme = useTheme(); diff --git a/src/redux/services/types.ts b/src/redux/services/types.ts index 358483736..a6276705f 100644 --- a/src/redux/services/types.ts +++ b/src/redux/services/types.ts @@ -1165,11 +1165,19 @@ export interface StatusData { status_info: ErrorStatusInfo | null; } +export interface IncidentSummaryRecord { + id: string; + agent_display_name: string; + timestamp: string; + text: string; +} + export interface GetIncidentResponse { id: string; name: string; description: string; summary: string; + summary_timeline: IncidentSummaryRecord[]; status: IncidentStatus; related_issues: GenericIncidentIssue[]; related_artifacts: IncidentArtifact[]; From 68ace3f67bb8b6650ab14c5f215aa97bdaf1e686 Mon Sep 17 00:00:00 2001 From: Kyrylo Shmidt Date: Wed, 13 Aug 2025 10:28:08 +0200 Subject: [PATCH 2/5] Update styles --- .../IncidentSummary/IncidentSummaryRecord/styles.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/Agentic/IncidentDetails/IncidentSummary/IncidentSummaryRecord/styles.ts b/src/components/Agentic/IncidentDetails/IncidentSummary/IncidentSummaryRecord/styles.ts index 3aa07e8f7..c0d6e5da0 100644 --- a/src/components/Agentic/IncidentDetails/IncidentSummary/IncidentSummaryRecord/styles.ts +++ b/src/components/Agentic/IncidentDetails/IncidentSummary/IncidentSummaryRecord/styles.ts @@ -30,7 +30,6 @@ export const Header = styled.div` `; export const Agent = styled.span` - text-transform: capitalize; color: ${({ theme }) => theme.colors.v3.text.primary}; `; From 081a3d64d1c4c8dca2137874ba72e057ddbd0cba Mon Sep 17 00:00:00 2001 From: Kyrylo Shmidt Date: Wed, 13 Aug 2025 10:35:03 +0200 Subject: [PATCH 3/5] Fix stories --- .../IncidentSummary.stories.tsx | 22 ++----------------- .../IncidentSummary/mockData.ts | 22 +++++++++++++++++++ .../Agentic/IncidentDetails/mockData.ts | 2 ++ 3 files changed, 26 insertions(+), 20 deletions(-) create mode 100644 src/components/Agentic/IncidentDetails/IncidentSummary/mockData.ts diff --git a/src/components/Agentic/IncidentDetails/IncidentSummary/IncidentSummary.stories.tsx b/src/components/Agentic/IncidentDetails/IncidentSummary/IncidentSummary.stories.tsx index e347656da..23cb1cfb4 100644 --- a/src/components/Agentic/IncidentDetails/IncidentSummary/IncidentSummary.stories.tsx +++ b/src/components/Agentic/IncidentDetails/IncidentSummary/IncidentSummary.stories.tsx @@ -1,5 +1,6 @@ import type { Meta, StoryObj } from "@storybook/react-webpack5"; import { IncidentSummary } from "."; +import { mockedIncidentSummaryRecords } from "./mockData"; // More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction const meta: Meta = { @@ -18,25 +19,6 @@ type Story = StoryObj; // More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args export const Default: Story = { args: { - records: [ - { - id: "1", - agent_display_name: "triager", - timestamp: "2023-10-01T12:00:00Z", - text: "Lorem ipsum dolor sit amet" - }, - { - id: "2", - agent_display_name: "code resolver", - timestamp: "2023-10-01T12:00:00Z", - text: "Lorem ipsum dolor sit amet consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." - }, - { - id: "3", - agent_display_name: "infra resolver", - timestamp: "2023-10-01T12:00:00Z", - text: "Lorem ipsum dolor sit amet" - } - ] + records: mockedIncidentSummaryRecords } }; diff --git a/src/components/Agentic/IncidentDetails/IncidentSummary/mockData.ts b/src/components/Agentic/IncidentDetails/IncidentSummary/mockData.ts new file mode 100644 index 000000000..34592f565 --- /dev/null +++ b/src/components/Agentic/IncidentDetails/IncidentSummary/mockData.ts @@ -0,0 +1,22 @@ +import type { IncidentSummaryRecord } from "../../../../redux/services/types"; + +export const mockedIncidentSummaryRecords: IncidentSummaryRecord[] = [ + { + id: "1", + agent_display_name: "triager", + timestamp: "2023-10-01T12:00:00Z", + text: "Lorem ipsum dolor sit amet" + }, + { + id: "2", + agent_display_name: "code resolver", + timestamp: "2023-10-01T12:00:00Z", + text: "Lorem ipsum dolor sit amet consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." + }, + { + id: "3", + agent_display_name: "infra resolver", + timestamp: "2023-10-01T12:00:00Z", + text: "Lorem ipsum dolor sit amet" + } +]; diff --git a/src/components/Agentic/IncidentDetails/mockData.ts b/src/components/Agentic/IncidentDetails/mockData.ts index a0e3ec863..6befc3b22 100644 --- a/src/components/Agentic/IncidentDetails/mockData.ts +++ b/src/components/Agentic/IncidentDetails/mockData.ts @@ -1,6 +1,7 @@ import { type GetIncidentResponse } from "../../../redux/services/types"; import { mockedArtifacts } from "./AdditionalInfo/Artifacts/mockData"; import { mockedIncidentIssues } from "./AdditionalInfo/RelatedIssues/mockData"; +import { mockedIncidentSummaryRecords } from "./IncidentSummary/mockData"; export const mockedIncident: GetIncidentResponse = { id: "incident-123", @@ -9,6 +10,7 @@ export const mockedIncident: GetIncidentResponse = { status: "active", affected_services: ["service-1", "service-2", "service-3", "service-4"], summary: "This is a summary of the incident.", + summary_timeline: mockedIncidentSummaryRecords, related_issues: mockedIncidentIssues, related_artifacts: mockedArtifacts, status_details: { From 7842cf6591b25ba88d74f4fd83f11e41c65fe376 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 14 Aug 2025 09:21:01 +0000 Subject: [PATCH 4/5] Bump version to 16.8.0-alpha.0 [skip ci] --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index bbced304c..9d9316bb2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "digma-ui", - "version": "16.7.1", + "version": "16.8.0-alpha.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "digma-ui", - "version": "16.7.1", + "version": "16.8.0-alpha.0", "license": "MIT", "dependencies": { "@codemirror/lang-json": "^6.0.2", diff --git a/package.json b/package.json index 13aae6d86..0e6b0a9af 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "digma-ui", - "version": "16.7.1", + "version": "16.8.0-alpha.0", "description": "Digma UI", "scripts": { "lint:eslint": "eslint --cache .", From ee27658c48fda52cb2d1f81ec99a6a4502490c91 Mon Sep 17 00:00:00 2001 From: Kyrylo Shmidt Date: Thu, 14 Aug 2025 16:49:17 +0200 Subject: [PATCH 5/5] Update types --- .../IncidentDetails/IncidentSummary/index.tsx | 2 +- .../IncidentDetails/IncidentSummary/mockData.ts | 12 ++++++------ src/redux/services/types.ts | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/Agentic/IncidentDetails/IncidentSummary/index.tsx b/src/components/Agentic/IncidentDetails/IncidentSummary/index.tsx index 708a2efdf..52b467592 100644 --- a/src/components/Agentic/IncidentDetails/IncidentSummary/index.tsx +++ b/src/components/Agentic/IncidentDetails/IncidentSummary/index.tsx @@ -6,7 +6,7 @@ export const IncidentSummary = ({ records }: IncidentSummaryProps) => ( {records.map((record) => (