chore(console): 删除全仓零引用的 SystemObjectViewPage + systemObjects (#3672) - #3699
Merged
Merged
Conversation
…cts dead code (#3672) Both files have zero references anywhere in the repo: their only two exported symbols (SystemObjectViewPage, systemObjects) are referenced solely from within the two files themselves. Every other page in apps/console/src/pages/system/ has at least one live importer. Beyond being unreachable, systemObjects.ts embeds a stale hand-copy of framework object names — sys_org (framework: sys_organization) and sys_permission (framework split it into sys_capability and sys_permission_set) do not exist — so the shell could not be wired up as-is. Keeping them only misleads the next reader into treating them as a ready-made page to plug in. Verified: apps/console type-check, 27 test files / 245 tests, and build all green after removal. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GTRjn8xBqp75dk7kFupVRt
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
yinlianghui
marked this pull request as ready for review
August 7, 2026 22:07
This was referenced Aug 7, 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.
Fixes #3672
按 issue 裁决 enforce-or-remove → remove 执行:删除
apps/console/src/pages/system/下两个零引用文件。删除清单
apps/console/src/pages/system/SystemObjectViewPage.tsxSystemObjectViewPageapps/console/src/pages/system/systemObjects.tssystemObjects合计 227 行删除,无其他文件改动。
apps/console/src下不存在任何 barrel/index 文件(find . -name 'index.ts*'零结果),故无孤立导出行需要清理。引用面测量(删除前提)
对两个文件名与其全部导出符号做全仓 grep(不限文件类型,排除
node_modules/dist/.git),命中仅落在:ROADMAP.md:831、CHANGELOG.md:595—— 散文/历史记录,非代码引用。第三处代码引用:零。同时确认无动态引用面 ——
apps/console/src内无import.meta.glob,无按路径字符串装配的路由,system-page-testid 也只出现在被删文件自身(无 e2e 依赖)。同目录邻居作对照,可见"零"是这两个文件独有的:
pages/system/文件SystemHubPage.tsxProfilePage.tsxAuditLogPage.tsxAppContent.tsxlazy + Route)AppManagementPage.tsx/ApprovalsInboxPage.tsx/AiPendingActionsPage.tsxSystemObjectViewPage.tsxsystemObjects.ts对象名脱节(为什么不是"接上就能用")
对
../objectstack逐名核对(grep -rlw,packages/):systemObjects.ts里的名字sys_usersys_positionsys_audit_logsys_orgsys_organization,90)sys_permissionplugin-security/src/objects/sys-capability.object.ts的 docblock,写明"Namedsys_capability(notsys_permission…)";框架实为sys_capability(25)+sys_permission_set(84)即这份对象定义是一份过期手抄,直接接回路由只会渲染出空/报错的 ObjectView。
验证
删除卡的"复活断肢看变红"在结构上不成立 —— 文件本就不可达,放回去不改变任何产物。故改用两侧都做的方式:一边测量引用面(上表),一边对检测手段本身做阳性对照,证明绿是"确实没有",而不是"探测器根本没看这块地方"。
阳性对照:临时新建一个
apps/console/src/__positive_control__.tsimport 这两个已删模块,type-check 按预期变红,随后删除该临时文件、type-check 复绿:这说明 tsc 的模块解析确实覆盖
pages/system/,因此下面的全绿是有效的"不存在引用"证据(该临时文件未进入任何提交,工作树已核验干净)。三项全绿(均在共享 verify 锁下、
--max-old-space-size=4096、--maxWorkers=2):发布物影响:零(changeset 判断)
@object-ui/console是发布包,但本次删除对产物是零 delta,故按 AGENTS.md(功能改进才需 changeset)与 #3681 的框架倾向不加 changeset:files中的 plugin 入口由tsconfig.plugin.json编译,其include只有["plugin.ts"]—— 被删文件从未进入该产物;dist是 vite 从 entry 图可达性打包,零 importer 即从未进图。构建后 grep 佐证:dist/assets/AuditLogPage-*.js能搜到活页面的文案(证明 dist 确实携带页面级字符串、grep 手段有效),而被删文件独有的not found in metadata definitions、All Organizations在 dist 中无命中。未越界的两处遗留(留给分诊,本 PR 不碰)
ROADMAP.md:831的已勾选项- [x] Shared SystemObjectViewPage component …与CHANGELOG.md:595的历史条目仍提及本次删除的组件。CHANGELOG 是历史记录不应改写;ROADMAP 那一行的历史化标注属派发单文件面之外,单独记录,未在本 PR 中修改。一处与 issue 正文不符的史实(不影响结论)
issue 称二者"自 cccdf84(2026-04)起零引用"。该归因无法从
main的历史验证:origin/main已在30ac2e1ee(2026-08-03)处被重新扎根,全部历史仅 203 个 commit,cccdf84d7与36674075f都不是main的祖先(仅存在于其他远端分支)。相应地,issue 说 cccdf84 删掉的五个薄壳中的AuditLogPage.tsx今天仍在main上 —— 但它是一份独立手写的只读审计页(直接fetchREST,不经 ObjectView),与被删的两个文件零交集,已逐一核实。结论不变:删除的依据是当前
origin/main上实测的零引用 + 对象名脱节,而非那条历史归因;上述差异仅更正史实叙述。Generated by Claude Code