Commit 67757f3
Yj/fix/optimize 07 28 (#4063)
* feat: 切断 currentPageTabRouteKey 的无关重渲染
处理一级页签切换会更新全局 currentPageTabRouteKey
* fix: 修复ConfigPrivateDomain ref 未挂载就调用
* fix: 优化HTTPFlowTable + MITM 推送
* feat: 组件懒加载
* perf(mitm): 优化交互式劫持性能,减少弱CPU下页面卡顿
- MITMManual: 将 currentOrder、intervalTime 从 state 改为 ref,避免每条流的 setState 触发重渲染
- MITMHijackedContent: 对 hasNewData、tableTotal、tableSelectNum 添加 500ms 节流,合并高流量下的频繁更新
- MITMPluginHijackContent: 轮询间隔从 1s 延长至 3s,且仅在视口可见时轮询,减少 IPC 调用
fix: -
* perf(mitm): 优化 MITM 模块减少不必要的重复渲染
- 提取内联函数与对象为 useMemo/useMemoizedFn,避免每次渲染创建新引用
- 将仅在回调中读取的 state 转为 ref(originalRules、advancedValue 等)
- 修复 useEffect 缺失依赖数组导致的每次渲染执行
- 使用模块级常量替代重复创建的 new Map()
* perf(mitm): 优化弱CPU下的渲染性能减少页面卡顿
- TableVirtualResize: ResizeObserver 用 useRef 创建一次,避免每次渲染创建新实例导致内存泄漏
- MITMManual: 只对新增/更新的行计算 cellClassName,提取 setLoading 为稳定引用
- MITMPage: useSortedArrayMemo 改用 ref 缓存上次序列化 key,避免重复 spread + sort + stringify
- MITMPluginHijackContent: 用 ref 缓存插件名 key,只在插件名集合变化时重建 hooksItem
* fix: MITMRule合并visible与优化项
* perf(layout): 切断切页 routeKey 订阅,隔离 PageBodyItem 重渲染
避免一级页签切换时触发隐藏重页面与 SubTabList 的无意义更新,降低 Win7 云桌面切页主线程阻塞。
* perf(layout): 集中 SubTab 全局监听,隔离隐藏页切页副作用
将 EventBus/IPC 监听合并为单点注册,SubTabs 聚焦与滚动仅在激活页执行,降低切页时重复绑定与无效副作用开销。
* perf(layout): 隔离重页面渲染边界,减少切页子树更新
拆分 PageBodyContent、以 pageCacheLength 替代 pageCache 透传,并为 RenderSubPage 增加 memo 边界,避免隐藏页参与 reconciliation。
* perf(heavy-pages): 优化 History/MITM/WebFuzzer 大数据组件切页开销
缓存 HTTPFlowsFieldGroup IPC,WebFuzzer 排序 memo 化,MITM 日志表按 viewport gate,插件组虚拟列表。
* perf(layout): 延后切页非首帧任务,缩短同步渲染路径
封装 scheduleIdleTask,将切页日志、页签缓存写入与 focus/滚动同步移出首帧。
* perf: 减少 HTTPHistory 组件多余渲染与内联函数创建
- 提取静态样式常量 fullSizeStyle/loadingFallbackStyle
- onTreeResize、onSelectNodesKeys 等内联箭头提取为 useMemoizedFn
- 移除仅作 trigger 传递的未使用 state(onlyShowFirstNode/secondNodeVisible)
- historyId 改为 useRef 避免无意义的 state 初始化
* perf: 优化 HTTPFlowTable 与 MITM 页面性能,减少不必要 state 刷新
- 将仅在回调中读取、不在 JSX/依赖中使用的 state 改为 ref(bodyLengthUnit、whiteFilter、curRules、queryparamsStr 等)
- 移除无效的 dead state(MITMRule 的 selectedRows、HTTPFlowTable 的 tagSearchVal)
- 提取纯函数与空回调至模块级常量,避免组件每次渲染创建新引用
- 提取 onRowContextMenu 为 useMemoizedFn,防止破坏 TableVirtualResize 的 React.memo
* perf(layout): 优化 layout 非渲染 state,修复远程连接 stale
- 修复 FuncDomain dynamicConnect:移除 mount 快照 useState,直接读 yakitDynamicStatus store,避免远程菜单/头像样式不更新
- 不参与渲染的 state 改为 ref:yakitIntranetFilePath、delRunNodeItem、yaklangKillBuildInEngine
- 删除 FuncDomain 未使用的 screenCapLoading
- useEngineConsole / useMcp:stream token 改 ref + 手动重建订阅,避免 UILayout/FuncDomain 无效重渲染
- useMcp:useMemo/useMemoizedFn 稳定返回值,减少 useSyncYakMcpStream 无效 store 同步
* perf(pages/layout): 优化 pages/layout 非渲染 state(阶段 1)
- HeardMenu:修复 isExpand 同步 defaultExpand;删除 width/fileName/refreshTrigger 死 state;resize 直接调 toMove
- MainOperatorContent:bugUrl/system/closeGroupTip 改 ref,减少 Tab 区域无效重渲染
- ExtraMenu:HAR 导入 token 改 ref
- BatchAddNewGroup:groupId 改 ref
- MenuDNSLog:lastRecords 从 records 派生,减少轮询时重复 setState
* perf(TableVirtualResize): 优化弱 CPU 下 hover/选中/滚动渲染开销(P0+P1)
针对 MITM 等大表场景,在不改变交互逻辑的前提下减少无效重渲染与 O(n) 重复计算。
P0 - hover memo 修复:
- areCellRenderPropsEqual 比较本 cell 是否 hover,而非 mouseCellId 任意变化
- 鼠标移过表格时仅旧行+新行 cell 更新,避免全表可见 cell 重渲染
P0 - 选中态 Set 查找:
- 预构建 selectedRowKeysSet / selectedRowsKeySet
- batchActive、checkbox checked 用 Set.has 替代 findIndex
P1 - ColRender 精细 memo:
- areColRenderPropsEqual 忽略 filters/loading 等无关父 state
- 不比较 scrollBottom,纵向滚动不连带重渲染各列
P1 - scroll setState 收敛:
- 函数式 setScroll,避免闭包 stale
- shouldUpdateScrollHorizontalState:固定列阴影仅边缘滚动时更新
- shouldUpdateScrollBottomState:scrollBottom 按区间更新,减少底部分页区连带渲染
备注:文件内已补充中文注释说明各优化点;行为与 API 不变。
* refactor: HTTPFlowTable renderTitle减少依赖项( 已经用useCallback包住的函数 )
* perf(fuzzer): WebFuzzer Tab 懒加载并保活切换状态
左侧配置/规则/AI、热加载、API 文档改为按需加载,各自 Suspense,首次打开后 keepAlive 用 visible 隐藏以免丢会话;序列/并发懒加载并用 keepType 避免切回配置时冲掉运行态;PageItem 独立出口避免与 RenderFuzzerSequence 懒加载纠缠。
Co-authored-by: Cursor <cursoragent@cursor.com>
* perf(fuzzer): 懒加载 HotCodeTemplate,避免 HotPatch 进主 chunk
工具栏模板入口改为 React.lazy,并用悬停/点击后再挂载,避免一进 Fuzzer 页就同步拉入整份 HTTPFuzzerHotPatch。
Co-authored-by: Cursor <cursoragent@cursor.com>
* perf(fuzzer): 减小 WebFuzzer 首包,按需加载重模块
* perf(fuzzer): 继续按需加载 History/Matcher 等重模块
* perf(fuzzer): 多 Tab 不可见时暂停结果刷新并卸预览 Monaco
后台 Tab 结果仍写入 ref,切回可见再 flush;结果表预览编辑器仅在 inViewport 时挂载,减轻多开卡顿。
Co-authored-by: Cursor <cursoragent@cursor.com>
* perf(fuzzer): pause hidden size measure and cut table derive cost
Hide inactive WebFuzzer ResizeObservers, skip default full sort/copy, and cache keyword ResponseRaw decode.
Co-authored-by: Cursor <cursoragent@cursor.com>
* perf(fuzzer): isolate render from result stream
Throttle streaming firstResponse, stabilize Monaco props, drop full arrays from toolbar, and keep response search draft local.
Co-authored-by: Cursor <cursoragent@cursor.com>
* style: apply prettier formatting [skip ci]
---------
Co-authored-by: HJH <75428400+hjhke@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>1 parent 416f651 commit 67757f3
61 files changed
Lines changed: 2945 additions & 2127 deletions
File tree
- app/renderer/src/main/src
- components
- ConfigPrivateDomain
- HTTPFlowTable
- TableVirtualResize
- layout
- hooks
- useEngineConsole
- useMcp
- hook/useVirtualTableHook
- pages
- ai-agent
- aiChatWelcome/FreeDialogFileList
- aiModelList
- aiModelSelect
- components
- aiMilkdownInput/aiCodeBlock
- aiReportFinishCard
- forgeName
- historyChat
- fingerprintManage
- fuzzer
- FuzzerSequence
- WebFuzzerApiDoc
- WebFuzzerNewEditor
- WebFuzzerPage
- components/HTTPFuzzerPageTable
- hTTPHistoryAnalysis
- HTTPHistory
- layout
- HeardMenu
- mainOperatorContent
- PageItem
- renderSubPage
- publicMenu
- mitm
- MITMManual
- MITMRule
- MITMServerHijacking
- MITMServerStartForm
- risks/YakitRiskTable
- ruleManagement
- routes
- utils
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | | - | |
| 213 | + | |
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
242 | | - | |
| 242 | + | |
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
452 | 453 | | |
453 | 454 | | |
454 | 455 | | |
455 | | - | |
456 | | - | |
457 | | - | |
| 456 | + | |
| 457 | + | |
458 | 458 | | |
459 | 459 | | |
460 | 460 | | |
| |||
Lines changed: 212 additions & 141 deletions
Large diffs are not rendered by default.
Lines changed: 13 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
| 5 | + | |
8 | 6 | | |
9 | 7 | | |
10 | 8 | | |
11 | 9 | | |
12 | 10 | | |
13 | | - | |
14 | | - | |
15 | | - | |
| 11 | + | |
| 12 | + | |
16 | 13 | | |
17 | 14 | | |
18 | 15 | | |
| |||
25 | 22 | | |
26 | 23 | | |
27 | 24 | | |
28 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
29 | 35 | | |
30 | 36 | | |
31 | 37 | | |
| |||
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
701 | 701 | | |
702 | 702 | | |
703 | 703 | | |
704 | | - | |
| 704 | + | |
| 705 | + | |
705 | 706 | | |
706 | 707 | | |
707 | 708 | | |
| |||
850 | 851 | | |
851 | 852 | | |
852 | 853 | | |
853 | | - | |
| 854 | + | |
854 | 855 | | |
855 | 856 | | |
856 | 857 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
| 3 | + | |
| 4 | + | |
11 | 5 | | |
12 | 6 | | |
13 | 7 | | |
| |||
97 | 91 | | |
98 | 92 | | |
99 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
223 | 232 | | |
224 | 233 | | |
225 | 234 | | |
| |||
288 | 297 | | |
289 | 298 | | |
290 | 299 | | |
291 | | - | |
292 | | - | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
293 | 309 | | |
294 | 310 | | |
295 | 311 | | |
| |||
311 | 327 | | |
312 | 328 | | |
313 | 329 | | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
| 330 | + | |
318 | 331 | | |
319 | 332 | | |
320 | 333 | | |
| |||
331 | 344 | | |
332 | 345 | | |
333 | 346 | | |
334 | | - | |
| 347 | + | |
335 | 348 | | |
336 | 349 | | |
337 | 350 | | |
| |||
346 | 359 | | |
347 | 360 | | |
348 | 361 | | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
| 362 | + | |
353 | 363 | | |
354 | 364 | | |
355 | 365 | | |
| |||
358 | 368 | | |
359 | 369 | | |
360 | 370 | | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
| 371 | + | |
365 | 372 | | |
366 | 373 | | |
367 | 374 | | |
| |||
470 | 477 | | |
471 | 478 | | |
472 | 479 | | |
| 480 | + | |
| 481 | + | |
473 | 482 | | |
474 | 483 | | |
475 | 484 | | |
| |||
510 | 519 | | |
511 | 520 | | |
512 | 521 | | |
| 522 | + | |
513 | 523 | | |
514 | 524 | | |
515 | 525 | | |
516 | | - | |
| 526 | + | |
| 527 | + | |
517 | 528 | | |
518 | 529 | | |
519 | | - | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
520 | 533 | | |
521 | 534 | | |
522 | 535 | | |
| |||
570 | 583 | | |
571 | 584 | | |
572 | 585 | | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
573 | 590 | | |
574 | 591 | | |
575 | 592 | | |
| |||
601 | 618 | | |
602 | 619 | | |
603 | 620 | | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
604 | 636 | | |
605 | 637 | | |
606 | 638 | | |
| |||
614 | 646 | | |
615 | 647 | | |
616 | 648 | | |
617 | | - | |
| 649 | + | |
618 | 650 | | |
619 | 651 | | |
620 | 652 | | |
| |||
631 | 663 | | |
632 | 664 | | |
633 | 665 | | |
634 | | - | |
635 | | - | |
636 | | - | |
| 666 | + | |
637 | 667 | | |
638 | 668 | | |
639 | 669 | | |
| |||
662 | 692 | | |
663 | 693 | | |
664 | 694 | | |
665 | | - | |
| 695 | + | |
666 | 696 | | |
667 | | - | |
668 | | - | |
669 | | - | |
670 | | - | |
671 | | - | |
672 | | - | |
673 | | - | |
674 | | - | |
675 | | - | |
676 | | - | |
677 | | - | |
678 | | - | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
679 | 711 | | |
680 | 712 | | |
681 | 713 | | |
682 | 714 | | |
683 | 715 | | |
684 | | - | |
685 | | - | |
686 | | - | |
687 | | - | |
688 | | - | |
689 | | - | |
690 | | - | |
691 | | - | |
| 716 | + | |
| 717 | + | |
692 | 718 | | |
693 | 719 | | |
694 | 720 | | |
| |||
962 | 988 | | |
963 | 989 | | |
964 | 990 | | |
965 | | - | |
| 991 | + | |
966 | 992 | | |
967 | | - | |
968 | | - | |
969 | | - | |
970 | | - | |
971 | | - | |
972 | | - | |
| 993 | + | |
| 994 | + | |
973 | 995 | | |
974 | 996 | | |
975 | 997 | | |
| |||
995 | 1017 | | |
996 | 1018 | | |
997 | 1019 | | |
998 | | - | |
| 1020 | + | |
999 | 1021 | | |
1000 | 1022 | | |
1001 | 1023 | | |
| |||
0 commit comments