From 7ce751ffe8a6431be2d4194e5bf0c3185cc8584d Mon Sep 17 00:00:00 2001 From: Joel Date: Mon, 24 Aug 2026 07:53:31 +0000 Subject: [PATCH] chore: show full agent save time on hover (#41148) Co-authored-by: yyh <92089059+lyzno1@users.noreply.github.com> --- .../orchestrate/__tests__/publish-bar.spec.tsx | 13 +++++++++++++ .../components/orchestrate/publish-bar/index.tsx | 6 +++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/web/features/agent-v2/agent-detail/configure/components/orchestrate/__tests__/publish-bar.spec.tsx b/web/features/agent-v2/agent-detail/configure/components/orchestrate/__tests__/publish-bar.spec.tsx index 93bd49021a4..e9b29f61a07 100644 --- a/web/features/agent-v2/agent-detail/configure/components/orchestrate/__tests__/publish-bar.spec.tsx +++ b/web/features/agent-v2/agent-detail/configure/components/orchestrate/__tests__/publish-bar.spec.tsx @@ -6,6 +6,7 @@ import type { ComponentProps } from 'react' import type { Mock } from 'vite-plus/test' import { QueryClient, QueryClientProvider } from '@tanstack/react-query' import { act, fireEvent, render, screen, waitFor, within } from '@testing-library/react' +import userEvent from '@testing-library/user-event' import { createStore, Provider as JotaiProvider } from 'jotai' import { defaultAgentSoulConfigFormState } from '@/features/agent-v2/agent-composer/form-state' import { @@ -421,6 +422,18 @@ describe('AgentConfigurePublishBar', () => { expect(mockFormatTimeFromNow).toHaveBeenCalledWith(1710000100000) }) + it('should show the complete saved time in a tooltip on hover', async () => { + const user = userEvent.setup() + renderPublishBar({ draftSavedAt: 1710000100000 }) + + const savedTime = screen.getByText(/agentV2\.agentDetail\.configure\.publishBar\.savedAt/) + await user.hover(savedTime) + + await waitFor(() => { + expect(screen.getAllByText(savedTime.textContent ?? '')).toHaveLength(2) + }) + }) + it('should render published state from the active snapshot and disable publish logic', () => { const { onPublish } = renderPublishBar({ activeConfigIsPublished: true, diff --git a/web/features/agent-v2/agent-detail/configure/components/orchestrate/publish-bar/index.tsx b/web/features/agent-v2/agent-detail/configure/components/orchestrate/publish-bar/index.tsx index 065cf28a5b8..d1fcfb76586 100644 --- a/web/features/agent-v2/agent-detail/configure/components/orchestrate/publish-bar/index.tsx +++ b/web/features/agent-v2/agent-detail/configure/components/orchestrate/publish-bar/index.tsx @@ -11,6 +11,7 @@ import { Collapsible, CollapsiblePanel } from '@langgenius/dify-ui/collapsible' import { Kbd, KbdGroup } from '@langgenius/dify-ui/kbd' import { StatusDot } from '@langgenius/dify-ui/status-dot' import { toast } from '@langgenius/dify-ui/toast' +import { Tooltip, TooltipContent, TooltipTrigger } from '@langgenius/dify-ui/tooltip' import { formatForDisplay, useHotkey } from '@tanstack/react-hotkeys' import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query' import { useAtomValue } from 'jotai' @@ -379,7 +380,10 @@ function PublishBarActions({ ยท - {metaLabel} + + {metaLabel}} /> + {metaLabel} +