feat: 模组全维度独立,消除全局 DOM/Portal/存储污染

- jieya-ibp/welltrust-qap ThemeContext 改为作用域容器承载 CSS 变量与背景色,不再写 document
- 删除 order-cost CostCockpit 对 documentElement 的死变量写入
- bomx Drawer createPortal 挂载点内移到 .bomx-app,移除 document.body 兜底
- knowledge-graph 拖拽 cursor 改为根容器 ref
- 新增 check-module-independence 门禁并接入 build
- SOP 与融合技能文档补充「模组完全独立互不影响」章节

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com>
This commit is contained in:
dongsk
2026-10-19 09:10:30 +08:00
co-authored by Claude Sonnet 4.6 noreply@anthropic.com>
parent 9c45aedbe8
commit 8699798ea5
14 changed files with 683 additions and 74 deletions
@@ -32,6 +32,7 @@ export default function KnowledgeGraphHome() {
const [sideTab, setSideTab] = useState<SideTab>('stats');
const [sidebarWidth, setSidebarWidth] = useState(320);
const isDragging = useRef(false);
const rootRef = useRef<HTMLDivElement>(null);
const handleNodeSelect = (node: SelectedNode | null) => setSelectedNode(node);
const handleMaterialSelect = (mat: Material | null) => {
@@ -46,8 +47,8 @@ export default function KnowledgeGraphHome() {
isDragging.current = true;
const startX = e.clientX;
const startWidth = sidebarWidth;
document.body.style.cursor = 'col-resize';
document.body.style.userSelect = 'none';
rootRef.current?.style.setProperty('cursor', 'col-resize');
rootRef.current?.style.setProperty('userSelect', 'none');
const onMouseMove = (ev: MouseEvent) => {
if (!isDragging.current) return;
@@ -57,8 +58,8 @@ export default function KnowledgeGraphHome() {
};
const onMouseUp = () => {
isDragging.current = false;
document.body.style.cursor = '';
document.body.style.userSelect = '';
rootRef.current?.style.setProperty('cursor', '');
rootRef.current?.style.setProperty('userSelect', '');
document.removeEventListener('mousemove', onMouseMove);
document.removeEventListener('mouseup', onMouseUp);
};
@@ -69,7 +70,7 @@ export default function KnowledgeGraphHome() {
const viewLabels: Record<ViewMode, string> = { category: '按分类', project: '按项目', aging: '按账龄' };
return (
<div className="flex h-screen w-screen overflow-hidden" style={{ backgroundColor:'#f5f5f7' }}>
<div ref={rootRef} className="flex h-screen w-screen overflow-hidden" style={{ backgroundColor:'#f5f5f7' }}>
{/* Sidebar */}
<aside className="flex-shrink-0 flex flex-col sidebar-bg" style={{ width:sidebarWidth, borderRight:'none' }}>
{/* Logo header */}