Song/feat/engine link test#3679
Merged
song-xiao-lin merged 5 commits intomasterfrom May 9, 2026
Merged
Conversation
Contributor
PR CI 汇总状态:全部通过
由 pull_request test workflow 自动生成 |
20339a6 to
b669b40
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors parts of the engine-link startup flow/UI while adding Vitest coverage for key startup components.
Changes:
- Centralized the draggable header height into a shared
DragHeaderHeightconstant and applied it across draggable modals and the startup header. - Extracted “safe” yakit status handling into a reusable
useYakitStatushook and adjusted startup linking flow timing/log reset behavior. - Added new Vitest test suites for
LocalEngineandYaklangEngineWatchDog, and removed the unusedHelpDoccomponent.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| app/renderer/engine-link-startup/vitest.config.ts | Tweaks @ alias resolution for the engine-link startup test/build environment. |
| app/renderer/engine-link-startup/src/pages/StartupPage/utils.ts | Adds DragHeaderHeight constant used across startup UI. |
| app/renderer/engine-link-startup/src/pages/StartupPage/index.tsx | Switches to useYakitStatus, refactors link-mode switching timing, and applies draggable header height inline. |
| app/renderer/engine-link-startup/src/pages/StartupPage/index.module.scss | Removes hardcoded header height to defer to the new shared constant via inline style. |
| app/renderer/engine-link-startup/src/pages/StartupPage/components/YaklangEngineWatchDog/test/index.test.tsx | Adds tests for watchdog connection/autostart/keepalive behavior. |
| app/renderer/engine-link-startup/src/pages/StartupPage/components/YakitLoading/index.tsx | Refactors status checks into arrays/memos and simplifies conditional rendering logic. |
| app/renderer/engine-link-startup/src/pages/StartupPage/components/QuestionModal/index.tsx | Uses DragHeaderHeight for draggable bounds instead of a magic number. |
| app/renderer/engine-link-startup/src/pages/StartupPage/components/LocalEngine/index.tsx | Removes unused outputToWelcomeConsole import. |
| app/renderer/engine-link-startup/src/pages/StartupPage/components/LocalEngine/test/index.test.tsx | Adds extensive tests for LocalEngine pre-check/version-check/flow behavior. |
| app/renderer/engine-link-startup/src/pages/StartupPage/components/HelpDoc/index.tsx | Removes HelpDoc component implementation. |
| app/renderer/engine-link-startup/src/pages/StartupPage/components/HelpDoc/HelpDoc.module.scss | Removes styles for the deleted HelpDoc component. |
| app/renderer/engine-link-startup/src/pages/StartupPage/components/DownloadYaklang/index.tsx | Uses DragHeaderHeight for draggable bounds. |
| app/renderer/engine-link-startup/src/pages/StartupPage/components/AgreementContentModal/index.tsx | Uses DragHeaderHeight for draggable bounds. |
| app/renderer/engine-link-startup/src/hooks/useYakitStatus.ts | Introduces useYakitStatus hook to centralize safe status updates. |
Comment on lines
+1
to
+5
| import { useMemoizedFn } from 'ahooks' | ||
| import useGetSetState from './useGetSetState' | ||
| import { YakitStatusType } from '@/pages/StartupPage/types' | ||
|
|
||
| export const useYakitStatus = (breakHandleRef: React.MutableRefObject<boolean>) => { |
Comment on lines
+111
to
+115
| ;(yakitEngine.onStartUpEngineMessage as any).mockReturnValue(() => {}) | ||
|
|
||
| systemInfoDevSpy = vi.spyOn(SystemInfo, 'isDev', 'get') | ||
| isEnpriTraceAgentSpy = vi.spyOn({ isEnpriTraceAgent }, 'isEnpriTraceAgent') | ||
| isCommunityYakitSpy = vi.spyOn({ isCommunityYakit }, 'isCommunityYakit') |
Comment on lines
+113
to
+116
| systemInfoDevSpy = vi.spyOn(SystemInfo, 'isDev', 'get') | ||
| isEnpriTraceAgentSpy = vi.spyOn({ isEnpriTraceAgent }, 'isEnpriTraceAgent') | ||
| isCommunityYakitSpy = vi.spyOn({ isCommunityYakit }, 'isCommunityYakit') | ||
| }) |
luoluoTH
approved these changes
May 9, 2026
EmbraceAn
approved these changes
May 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.