Repository navigation
Conversation
Unmount placeholder skeletons in inactive background tabs to avoid hundreds of continuous CSS keyframe animations running at idle. Addresses poco-ai#1049
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.
摘要
解决 #1049 中反映的空闲状态持续 10%~20% CPU 占用问题:对工作区非活跃且未保活的后台标签页卸载骨架屏,避免后台运行大量持续的 CSS keyframe 动画。
Addresses #1049
类型
场景
!tab.loaded)以及被 LRU 换出的 Markdown 标签页,会在后台渲染<TabLoadingSkeleton />。.library-shimmer(background-position无限平移)的元素。因为 Dockview 采用 DOM 保活(renderer: 'always'),多标签下会有数百个不可见元素在后台以 60 FPS 驱动主线程 CSS 动画与重绘,导致 WebKitWebProcess 在静止状态下持续占用 10%~20%+ CPU(建议优化在Linux/CachyOS上的性能 #1049)。src/components/workspace/doc-view.tsx中为!tab.loaded、texCompiling和markdown分支增加!active && !keepMounted判断,处于后台时直接返回null(与其他 PDF / Text / HTML 视图策略一致),仅在前台需要显示加载时才挂载骨架屏,内容加载完毕即销毁。截图(UI / 功能改动必填)
解决 #1049 的性能问题(静止状态 CPU 占用由 ~20% 降至 0%)。本次改动为后台 Tab 渲染门控优化,前台视觉布局无变化。
Demo(feat 必填)
不适用
自查清单
--no-verify)pnpm lint/pnpm typecheck/pnpm test;Rustcargo fmt --check/cargo clippy/cargo testt()并同步zh-CN翻译(如涉及文案)