Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix(web): align tour trigger DOM order (#39654)

yyhf68cabe22672
diff --git a/web/app/components/main-nav/__tests__/index.spec.tsx b/web/app/components/main-nav/__tests__/index.spec.tsx
index 4a30a3edbd0..372dafc0beb 100644
--- a/web/app/components/main-nav/__tests__/index.spec.tsx
+++ b/web/app/components/main-nav/__tests__/index.spec.tsx
@@ -655,6 +655,21 @@ describe('MainNav', () => {
expect(helpButton.parentElement).toHaveClass('shrink-0', 'rounded-full', 'p-1')
})
+ it('orders the Step-by-step Tour before the account and help actions', async () => {
+ localStorage.setItem(STEP_BY_STEP_TOUR_SHELL_MODE_STORAGE_KEY, 'collapsed')
+
+ renderMainNav()
+
+ const tourTrigger = await screen.findByRole('button', { name: 'Open step-by-step tour' })
+ const accountButton = screen.getByRole('button', { name: 'common.account.account' })
+ const helpButton = screen.getByRole('button', { name: 'common.mainNav.help.openMenu' })
+
+ expect(tourTrigger.compareDocumentPosition(accountButton)).toBe(
+ Node.DOCUMENT_POSITION_FOLLOWING,
+ )
+ expect(accountButton.compareDocumentPosition(helpButton)).toBe(Node.DOCUMENT_POSITION_FOLLOWING)
+ })
+
it('keeps the global navigation account section expanded on home routes', () => {
localStorage.setItem(DETAIL_SIDEBAR_STORAGE_KEY, 'collapse')
mockPathname = '/'
diff --git a/web/app/components/main-nav/index.tsx b/web/app/components/main-nav/index.tsx
index ee077f1d8ac..90932c841b6 100644
--- a/web/app/components/main-nav/index.tsx
+++ b/web/app/components/main-nav/index.tsx
@@ -133,6 +133,7 @@ export function MainNav({ className }: MainNavProps) {
)}
</div>
<div className="relative w-60 shrink-0">
+ <StepByStepTourMount className="absolute -top-7 left-2.5 h-8 w-[183px] overflow-visible" />
<div className="flex w-60 items-center justify-between bg-gradient-to-b from-background-body-transparent to-background-body to-50% py-3 pr-1 pl-3 backdrop-blur-[2px]">
<div className="flex min-w-0 items-center gap-1 overflow-hidden">
<AccountSection />
@@ -141,7 +142,6 @@ export function MainNav({ className }: MainNavProps) {
<HelpMenu />
</div>
</div>
- <StepByStepTourMount className="absolute -top-7 left-2.5 h-8 w-[183px] overflow-visible" />
</div>
</aside>
)