Skip to content

Remove redundant Metadata button from end-user views#955

Merged
hotlong merged 2 commits intomainfrom
copilot/remove-metadata-button
Mar 2, 2026
Merged

Remove redundant Metadata button from end-user views#955
hotlong merged 2 commits intomainfrom
copilot/remove-metadata-button

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 2, 2026

RecordDetailView, DashboardView, PageView, and ReportView all expose a </> Metadata toggle button in the header that serves no purpose for end users and duplicates the existing ?__debug / Ctrl+Shift+D debug panel. ObjectView already gates this behind an admin-only Design Tools menu.

Changes

  • Remove <MetadataToggle> button from RecordDetailView, DashboardView, PageView, ReportView headers
  • Retain <MetadataPanel> — still auto-opens when ?__debug URL param is present, preserving developer access
  • Clean up imports — drop unused MetadataToggle and toggleDebug references from all four views

The MetadataToggle component and useMetadataInspector().toggleDebug remain exported for ObjectView's Design Tools menu, which is unchanged.

Original prompt

This section details on the original issue you should resolve

<issue_title>统一 debug/metadata 入口,移除多余的 Metadata 按钮,提升终端用户体验</issue_title>
<issue_description>### 背景
目前 RecordDetailView、DashboardView、PageView、ReportView 等多个界面右上角都有明显 "</> Metadata" 按钮,对普通用户没有实际用途,且与 ObjectView/Design Tools 的调试入口功能重叠,容易引起困惑。

已有独立的调试模式(DebugPanel),支持 ?__debug 参数和 Ctrl+Shift+D 激活,功能更强大,且 ObjectView 已经把 metadata inspector 限制为 admin 可见,放在 Design Tools 菜单下。

截图:
RecordDetailView 界面存在 Metadata 按钮,无实际用途

问题

  • Metadata inspector 和 DebugPanel 功能重复
  • 终端用户界面冗余,按钮无实际意义
  • ObjectView 做了权限限制,其他视图未统一

建议优化方案

  1. RecordDetailView / DashboardView / PageView / ReportView 彻底移除 <MetadataToggle> 按钮,不再在头部显式展示
  2. MetadataInspector 只在 ?__debug 模式下自动开启/可见,或者仅 admin 通过菜单入口访问
  3. 保留 ObjectView Admin 的 design tools 菜单中的 debug/metadata inspector 入口(已实现)
  4. 更新文档,说明终端用户场景下不显示调试入口
  5. 检查 Roadmap 和相关文档,避免调试功能泄漏到用户主流程

参考文件

  • apps/console/src/components/RecordDetailView.tsx
  • apps/console/src/components/DashboardView.tsx
  • apps/console/src/components/PageView.tsx
  • apps/console/src/components/ReportView.tsx
  • packages/components/src/debug/DebugPanel.tsx

建议先 quick win,PR 直接移除按钮。后续可考虑进一步统一 metadata inspector 与 debug panel。

优化后能明显提升终端用户体验,并避免误触。
</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 2, 2026

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

Project Deployment Actions Updated (UTC)
objectui Ready Ready Preview, Comment Mar 2, 2026 7:28am
objectui-demo Ready Ready Preview, Comment Mar 2, 2026 7:28am
objectui-storybook Ready Ready Preview, Comment Mar 2, 2026 7:28am

Request Review

…geView, ReportView

Removed the visible </> Metadata button from end-user view headers.
The MetadataInspector panel now only opens via ?__debug URL parameter.
ObjectView retains its admin Design Tools menu entry for metadata inspection.

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove redundant Metadata button for improved user experience Remove redundant Metadata button from end-user views Mar 2, 2026
@hotlong hotlong marked this pull request as ready for review March 2, 2026 07:18
Copilot AI review requested due to automatic review settings March 2, 2026 07:18
@hotlong hotlong merged commit 35350b3 into main Mar 2, 2026
4 of 5 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes the end-user-facing </> Metadata header toggle from several Console views to avoid duplicating the existing debug entry points (?__debug and Ctrl+Shift+D), while keeping the metadata inspector panel available for developer/debug workflows.

Changes:

  • Removed <MetadataToggle> from the headers of RecordDetailView, DashboardView, PageView, and ReportView.
  • Kept <MetadataPanel> wired to showDebug so it still opens when debug mode is active (e.g., via ?__debug).
  • Cleaned up related imports/usages (MetadataToggle, toggleDebug) in the affected views and documented the change in ROADMAP.md.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
apps/console/src/components/ReportView.tsx Removes header metadata toggle; retains metadata panel controlled by showDebug.
apps/console/src/components/RecordDetailView.tsx Removes header metadata toggle; retains metadata panel controlled by showDebug.
apps/console/src/components/PageView.tsx Removes header metadata toggle; keeps debug-driven metadata panel and existing edit button behavior.
apps/console/src/components/DashboardView.tsx Removes header metadata toggle; retains metadata panel controlled by showDebug.
ROADMAP.md Adds a completed roadmap entry documenting the unified debug/metadata entry change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

统一 debug/metadata 入口,移除多余的 Metadata 按钮,提升终端用户体验

3 participants