Skip to content

chore(console): 删除全仓零引用的 SystemObjectViewPage + systemObjects (#3672) - #3699

Merged
yinlianghui merged 1 commit into
mainfrom
claude/issue-3672-remove-orphan-system-pages
Aug 7, 2026
Merged

chore(console): 删除全仓零引用的 SystemObjectViewPage + systemObjects (#3672)#3699
yinlianghui merged 1 commit into
mainfrom
claude/issue-3672-remove-orphan-system-pages

Conversation

@yinlianghui

Copy link
Copy Markdown
Collaborator

Fixes #3672

按 issue 裁决 enforce-or-remove → remove 执行:删除 apps/console/src/pages/system/ 下两个零引用文件。

删除清单

文件 行数 导出符号
apps/console/src/pages/system/SystemObjectViewPage.tsx 91 SystemObjectViewPage
apps/console/src/pages/system/systemObjects.ts 136 systemObjects

合计 227 行删除,无其他文件改动apps/console/src 下不存在任何 barrel/index 文件(find . -name 'index.ts*' 零结果),故无孤立导出行需要清理。

引用面测量(删除前提)

对两个文件名与其全部导出符号做全仓 grep(不限文件类型,排除 node_modules/dist/.git),命中仅落在:

  • 两个文件自身;
  • ROADMAP.md:831CHANGELOG.md:595 —— 散文/历史记录,非代码引用。

第三处代码引用:。同时确认无动态引用面 —— apps/console/src 内无 import.meta.glob,无按路径字符串装配的路由,system-page- testid 也只出现在被删文件自身(无 e2e 依赖)。

同目录邻居作对照,可见"零"是这两个文件独有的:

pages/system/ 文件 外部引用数
SystemHubPage.tsx 17
ProfilePage.tsx 3
AuditLogPage.tsx 2(AppContent.tsx lazy + Route)
AppManagementPage.tsx / ApprovalsInboxPage.tsx / AiPendingActionsPage.tsx 各 1
SystemObjectViewPage.tsx 0
systemObjects.ts 0

对象名脱节(为什么不是"接上就能用")

../objectstack 逐名核对(grep -rlw,packages/):

systemObjects.ts 里的名字 框架命中文件数 结论
sys_user 253 存在
sys_position 61 存在
sys_audit_log 62 存在
sys_org 0 不存在(框架为 sys_organization,90)
sys_permission 1 该唯一命中正是 plugin-security/src/objects/sys-capability.object.ts 的 docblock,写明"Named sys_capability (not sys_permission …)";框架实为 sys_capability(25)+ sys_permission_set(84)

即这份对象定义是一份过期手抄,直接接回路由只会渲染出空/报错的 ObjectView。

验证

删除卡的"复活断肢看变红"在结构上不成立 —— 文件本就不可达,放回去不改变任何产物。故改用两侧都做的方式:一边测量引用面(上表),一边对检测手段本身做阳性对照,证明绿是"确实没有",而不是"探测器根本没看这块地方"。

阳性对照:临时新建一个 apps/console/src/__positive_control__.ts import 这两个已删模块,type-check 按预期变红,随后删除该临时文件、type-check 复绿:

src/__positive_control__.ts(4,38): error TS2307: Cannot find module './pages/system/SystemObjectViewPage' …
src/__positive_control__.ts(5,31): error TS2307: Cannot find module './pages/system/systemObjects' …
Exit status 2

这说明 tsc 的模块解析确实覆盖 pages/system/,因此下面的全绿是有效的"不存在引用"证据(该临时文件未进入任何提交,工作树已核验干净)。

三项全绿(均在共享 verify 锁下、--max-old-space-size=4096--maxWorkers=2):

pnpm --filter @object-ui/console type-check     → EXIT=0
pnpm exec vitest run apps/console --maxWorkers=2 → Test Files 27 passed (27)
                                                   Tests 245 passed (245)   EXIT=0
pnpm --filter @object-ui/console build           → EXIT=0

发布物影响:零(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 definitionsAll 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,cccdf84d736674075f不是 main 的祖先(仅存在于其他远端分支)。相应地,issue 说 cccdf84 删掉的五个薄壳中的 AuditLogPage.tsx 今天仍在 main 上 —— 但它是一份独立手写的只读审计页(直接 fetch REST,不经 ObjectView),与被删的两个文件零交集,已逐一核实。

结论不变:删除的依据是当前 origin/main 上实测的零引用 + 对象名脱节,而非那条历史归因;上述差异仅更正史实叙述。


Generated by Claude Code

…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
@vercel

vercel Bot commented Aug 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectui Ignored Ignored Aug 7, 2026 10:01pm

Request Review

@github-actions github-actions Bot added the apps label Aug 7, 2026
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Main entry (gzip) 28.1 KB 350 KB
Entry file index-C0qouk22.js
Status PASS

📦 Bundle Size Report

Package Size Gzipped
app-shell (index.js) 8.66KB 3.13KB
app-shell (runtime-config.js) 7.42KB 2.32KB
app-shell (types.js) 0.01KB 0.04KB
app-shell (urlParams.js) 7.57KB 2.97KB
auth (AuthContext.js) 0.31KB 0.24KB
auth (AuthGuard.js) 1.17KB 0.53KB
auth (AuthProvider.js) 22.10KB 4.37KB
auth (AuthShell.js) 3.49KB 1.40KB
auth (ForgotPasswordForm.js) 12.21KB 3.45KB
auth (LoginForm.js) 18.13KB 5.39KB
auth (PreviewBanner.js) 0.90KB 0.50KB
auth (RegisterForm.js) 6.64KB 2.21KB
auth (SocialSignInButtons.js) 9.60KB 3.89KB
auth (UserMenu.js) 3.40KB 1.22KB
auth (auth-gate-events.js) 1.29KB 0.66KB
auth (authStyles.js) 5.04KB 1.72KB
auth (createAuthClient.js) 35.76KB 9.11KB
auth (createAuthenticatedFetch.js) 4.37KB 1.69KB
auth (index.js) 2.35KB 1.07KB
auth (org-roles.js) 6.66KB 2.78KB
auth (phone-identifier.js) 1.11KB 0.66KB
auth (types.js) 0.59KB 0.35KB
auth (useAuth.js) 4.91KB 0.87KB
auth (useIsWorkspaceAdmin.js) 1.61KB 0.85KB
collaboration (CommentThread.js) 26.07KB 7.56KB
collaboration (LiveCursors.js) 3.17KB 1.27KB
collaboration (PresenceAvatars.js) 6.49KB 2.64KB
collaboration (PresenceProvider.js) 2.79KB 1.13KB
collaboration (index.js) 1.65KB 0.73KB
collaboration (useCollaborationTranslation.js) 6.05KB 2.52KB
collaboration (useCommentSearch.js) 1.98KB 0.88KB
collaboration (useConflictResolution.js) 7.75KB 1.86KB
collaboration (useMentionNotifications.js) 1.81KB 0.68KB
collaboration (usePresence.js) 6.33KB 1.84KB
collaboration (useRealtimeSubscription.js) 7.91KB 2.01KB
components (index.js) 480.72KB 105.64KB
core (index.js) 2.96KB 1.13KB
create-plugin (index.js) 9.08KB 2.92KB
data-objectstack (index.js) 137.51KB 35.11KB
fields (index.js) 230.87KB 56.83KB
i18n (LocalizationContext.js) 1.76KB 0.96KB
i18n (currency.js) 1.22KB 0.64KB
i18n (i18n.js) 4.32KB 1.77KB
i18n (index.js) 2.65KB 1.06KB
i18n (pickLocalized.js) 1.70KB 0.83KB
i18n (provider.js) 9.48KB 3.27KB
i18n (useObjectLabel.js) 26.14KB 6.07KB
i18n (useSafeTranslation.js) 4.52KB 1.96KB
layout (index.js) 38.53KB 10.71KB
mobile (MobileProvider.js) 0.92KB 0.49KB
mobile (ResponsiveContainer.js) 0.94KB 0.38KB
mobile (breakpoints.js) 1.51KB 0.70KB
mobile (createOfflineDataSource.js) 5.61KB 1.74KB
mobile (index.js) 1.50KB 0.62KB
mobile (offlineQueue.js) 3.91KB 1.35KB
mobile (pwa.js) 0.97KB 0.49KB
mobile (serviceWorker.js) 1.48KB 0.62KB
mobile (serviceWorkerSource.js) 3.41KB 1.48KB
mobile (useBreakpoint.js) 1.54KB 0.65KB
mobile (useGesture.js) 6.96KB 1.98KB
mobile (useOfflineSync.js) 1.99KB 0.72KB
mobile (usePullToRefresh.js) 2.53KB 0.85KB
mobile (useResponsive.js) 0.71KB 0.42KB
mobile (useResponsiveConfig.js) 1.36KB 0.63KB
mobile (useSpecGesture.js) 4.32KB 1.64KB
mobile (useTouchTarget.js) 1.01KB 0.54KB
permissions (MePermissionsProvider.js) 8.75KB 3.06KB
permissions (PermissionContext.js) 0.31KB 0.25KB
permissions (PermissionGuard.js) 0.89KB 0.45KB
permissions (PermissionProvider.js) 3.67KB 1.12KB
permissions (evaluator.js) 4.41KB 1.44KB
permissions (index.js) 0.91KB 0.41KB
permissions (store.js) 0.91KB 0.42KB
permissions (useFieldPermissions.js) 1.28KB 0.52KB
permissions (usePermissions.js) 1.55KB 0.71KB
plugin-ai (index.js) 15.71KB 3.79KB
plugin-calendar (index.js) 44.98KB 12.37KB
plugin-charts (index.js) 61.04KB 17.31KB
plugin-chatbot (index.js) 180.09KB 42.72KB
plugin-dashboard (index.js) 115.50KB 29.96KB
plugin-designer (index.js) 210.51KB 42.51KB
plugin-detail (index.js) 232.79KB 57.42KB
plugin-editor (index.js) 2.46KB 1.10KB
plugin-form (index.js) 112.10KB 27.10KB
plugin-gantt (index.js) 162.55KB 39.57KB
plugin-grid (index.js) 186.61KB 49.34KB
plugin-kanban (index.js) 48.30KB 13.28KB
plugin-list (index.js) 105.12KB 25.48KB
plugin-map (index.js) 16.81KB 5.24KB
plugin-markdown (index.js) 13.72KB 4.69KB
plugin-report (index.js) 40.58KB 10.58KB
plugin-timeline (index.js) 25.76KB 7.33KB
plugin-tree (index.js) 8.50KB 2.88KB
plugin-view (index.js) 84.03KB 20.55KB
providers (DataSourceProvider.js) 0.75KB 0.39KB
providers (MetadataProvider.js) 1.37KB 0.59KB
providers (ThemeProvider.js) 1.90KB 0.85KB
providers (UploadProvider.js) 11.71KB 3.53KB
providers (index.js) 0.44KB 0.22KB
providers (types.js) 0.01KB 0.04KB
react-runtime (index.js) 5.67KB 2.37KB
react (LazyPluginLoader.js) 3.77KB 1.33KB
react (SchemaRenderer.js) 19.28KB 6.38KB
react (data-invalidation.js) 5.05KB 2.08KB
react (index.js) 1.02KB 0.55KB
react (spec-input.js) 0.20KB 0.18KB
sdui-parser (codegen.js) 4.09KB 1.74KB
sdui-parser (index.js) 4.47KB 2.03KB
sdui-parser (parse.js) 10.04KB 2.82KB
sdui-parser (types.js) 0.29KB 0.24KB
sdui-parser (validate.js) 4.69KB 1.48KB
types (ai.js) 0.20KB 0.17KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 2.87KB 0.99KB
types (base.js) 0.20KB 0.18KB
types (blocks.js) 0.20KB 0.18KB
types (complex.js) 0.20KB 0.18KB
types (crud.js) 0.20KB 0.18KB
types (data-display.js) 0.20KB 0.18KB
types (data-protocol.js) 0.20KB 0.19KB
types (data.js) 0.20KB 0.18KB
types (designer.js) 1.87KB 0.85KB
types (disclosure.js) 0.20KB 0.18KB
types (error-code.js) 1.54KB 0.88KB
types (feedback.js) 0.20KB 0.18KB
types (field-types.js) 0.20KB 0.18KB
types (form.js) 0.20KB 0.18KB
types (http-retry.js) 4.32KB 2.02KB
types (index.js) 2.71KB 1.34KB
types (layout.js) 0.20KB 0.18KB
types (managed-by.js) 0.19KB 0.18KB
types (mobile.js) 2.59KB 1.31KB
types (navigation.js) 0.20KB 0.18KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (permissions.js) 0.20KB 0.18KB
types (plugin-scope.js) 0.20KB 0.18KB
types (record-components.js) 0.20KB 0.19KB
types (record-semantics.js) 1.28KB 0.67KB
types (registry.js) 0.20KB 0.18KB
types (reports.js) 0.20KB 0.18KB
types (spec-report.js) 5.05KB 1.93KB
types (system-fields.js) 3.33KB 1.54KB
types (theme.js) 0.20KB 0.18KB
types (ui-action.js) 3.40KB 1.71KB
types (views.js) 0.20KB 0.18KB
types (widget.js) 0.20KB 0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

@yinlianghui
yinlianghui marked this pull request as ready for review August 7, 2026 22:07
@yinlianghui
yinlianghui added this pull request to the merge queue Aug 7, 2026
Merged via the queue into main with commit b19f54f Aug 7, 2026
18 checks passed
@yinlianghui
yinlianghui deleted the claude/issue-3672-remove-orphan-system-pages branch August 7, 2026 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

console: SystemObjectViewPage.tsx + systemObjects.ts 自 2026-04 起全仓零引用,且其内嵌对象定义用的是已废弃/不存在的对象名

2 participants