Skip to content

Commit 53e1480

Browse files
Copilothotlong
andcommitted
Remove MetadataToggle button from RecordDetailView, DashboardView, PageView, 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>
1 parent 3c66604 commit 53e1480

File tree

5 files changed

+9
-12
lines changed

5 files changed

+9
-12
lines changed

ROADMAP.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,6 +1180,7 @@ The `FlowDesigner` is a canvas-based flow editor that bridges the gap between th
11801180
- [x] **P1: Spec-Aligned CRM I18n** — Fixed CRM internationalization not taking effect on the console. Root cause: CRM metadata used plain string labels instead of spec-aligned `I18nLabel` objects. Fix: (1) Updated CRM app/dashboard/navigation metadata to use `I18nLabel` objects (`{ key, defaultValue }`) per spec. (2) Updated `NavigationItem` and `NavigationArea` types to support I18nLabel. (3) Added `resolveLabel()` helper in NavigationRenderer. (4) Updated `resolveI18nLabel()` to accept `t()` function for translation. (5) Added `loadLanguage` callback in I18nProvider for API-based translation loading. (6) Added `/api/v1/i18n/:lang` endpoint to mock server. Console contains zero CRM-specific code.
11811181
- [x] **P0: Opportunity List View & ObjectDef Column Enrichment** — Fixed ObjectGrid not using objectDef field metadata for type-aware rendering when columns are `string[]` or `ListColumn[]` without full options. (1) Schema resolution always fetches full schema from DataSource for field type metadata. (2) String[] column path enriched with objectDef types, options (with colors), currency, precision for proper CurrencyCellRenderer, SelectCellRenderer (colored badges), PercentCellRenderer, DateCellRenderer. (3) ListColumn[] fieldMeta deep-merged with objectDef field properties (select options with colors, currency code, precision). (4) Opportunity view columns upgraded from bare `string[]` to `ListColumn[]` with explicit types, alignment, and summary aggregation. 9 new tests.
11821182
- [x] **P1: Actions Merge into Object Definitions** — Fixed action buttons never showing in Console/Studio because example object definitions lacked `actions` field. Added `mergeActionsIntoObjects()` helper (mirrors existing `mergeViewsIntoObjects` pattern) to root config and console shared config. Uses longest-prefix name matching with explicit `objectName` fallback. Created todo task actions (6: complete, start, clone, defer, set_reminder, assign) and kitchen-sink showcase actions (3: change_status, assign_owner, archive). All CRM/Todo/Kitchen Sink objects now serve `actions` in metadata. Fixes #840.
1183+
- [x] **P1: Unified Debug/Metadata Entry — Remove Redundant Metadata Button** — Removed the visible `<MetadataToggle>` button from RecordDetailView, DashboardView, PageView, and ReportView headers. End users no longer see a "</> Metadata" button that had no practical purpose. The MetadataInspector panel is now only accessible via `?__debug` URL parameter (auto-opens when debug mode is active). ObjectView retains its admin-only Design Tools menu entry for metadata inspection. This unifies the debug entry point and improves end-user UX by removing redundant UI elements.
11831184

11841185
### Ecosystem & Marketplace
11851186
- Plugin marketplace website with search, ratings, and install count

apps/console/src/components/DashboardView.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import {
2525
Plus,
2626
Trash2,
2727
} from 'lucide-react';
28-
import { MetadataToggle, MetadataPanel, useMetadataInspector } from './MetadataInspector';
28+
import { MetadataPanel, useMetadataInspector } from './MetadataInspector';
2929
import { SkeletonDashboard } from './skeletons';
3030
import { useMetadata } from '../context/MetadataProvider';
3131
import { resolveI18nLabel } from '../utils';
@@ -129,7 +129,7 @@ function extractDashboardConfig(schema: DashboardSchema): Record<string, any> {
129129

130130
export function DashboardView({ dataSource }: { dataSource?: any }) {
131131
const { dashboardName } = useParams<{ dashboardName: string }>();
132-
const { showDebug, toggleDebug } = useMetadataInspector();
132+
const { showDebug } = useMetadataInspector();
133133
const adapter = useAdapter();
134134
const { t } = useObjectTranslation();
135135
const [isLoading, setIsLoading] = useState(true);
@@ -416,7 +416,6 @@ export function DashboardView({ dataSource }: { dataSource?: any }) {
416416
<Pencil className="h-3.5 w-3.5" />
417417
Edit
418418
</button>
419-
<MetadataToggle open={showDebug} onToggle={toggleDebug} />
420419
</div>
421420
</div>
422421

apps/console/src/components/PageView.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { useParams, useSearchParams } from 'react-router-dom';
99
import { SchemaRenderer } from '@object-ui/react';
1010
import { Empty, EmptyTitle, EmptyDescription } from '@object-ui/components';
1111
import { FileText, Pencil } from 'lucide-react';
12-
import { MetadataToggle, MetadataPanel, useMetadataInspector } from './MetadataInspector';
12+
import { MetadataPanel, useMetadataInspector } from './MetadataInspector';
1313
import { useMetadata } from '../context/MetadataProvider';
1414
import { DesignDrawer } from './DesignDrawer';
1515
import type { PageSchema } from '@object-ui/types';
@@ -21,7 +21,7 @@ const PageCanvasEditor = lazy(() =>
2121
export function PageView() {
2222
const { pageName } = useParams<{ pageName: string }>();
2323
const [searchParams] = useSearchParams();
24-
const { showDebug, toggleDebug } = useMetadataInspector();
24+
const { showDebug } = useMetadataInspector();
2525
const [drawerOpen, setDrawerOpen] = useState(false);
2626

2727
// Find page definition from API-driven metadata
@@ -80,7 +80,6 @@ export function PageView() {
8080
<Pencil className="h-3.5 w-3.5" />
8181
Edit
8282
</button>
83-
<MetadataToggle open={showDebug} onToggle={toggleDebug} />
8483
</div>
8584
<SchemaRenderer
8685
schema={{

apps/console/src/components/RecordDetailView.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { Empty, EmptyTitle, EmptyDescription } from '@object-ui/components';
1313
import { PresenceAvatars, type PresenceUser } from '@object-ui/collaboration';
1414
import { useAuth } from '@object-ui/auth';
1515
import { Database, Users } from 'lucide-react';
16-
import { MetadataToggle, MetadataPanel, useMetadataInspector } from './MetadataInspector';
16+
import { MetadataPanel, useMetadataInspector } from './MetadataInspector';
1717
import { SkeletonDetail } from './skeletons';
1818
import type { DetailViewSchema, FeedItem } from '@object-ui/types';
1919

@@ -27,7 +27,7 @@ const FALLBACK_USER = { id: 'current-user', name: 'Demo User' };
2727

2828
export function RecordDetailView({ dataSource, objects, onEdit }: RecordDetailViewProps) {
2929
const { objectName, recordId } = useParams();
30-
const { showDebug, toggleDebug } = useMetadataInspector();
30+
const { showDebug } = useMetadataInspector();
3131
const { user } = useAuth();
3232
const [isLoading, setIsLoading] = useState(true);
3333
const [feedItems, setFeedItems] = useState<FeedItem[]>([]);
@@ -286,7 +286,6 @@ export function RecordDetailView({ dataSource, objects, onEdit }: RecordDetailVi
286286
<PresenceAvatars users={recordViewers} size="sm" maxVisible={4} showStatus />
287287
</div>
288288
)}
289-
<MetadataToggle open={showDebug} onToggle={toggleDebug} />
290289
</div>
291290

292291
<div className="flex-1 overflow-hidden flex flex-row">

apps/console/src/components/ReportView.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { useParams } from 'react-router-dom';
33
import { ReportViewer, ReportConfigPanel } from '@object-ui/plugin-report';
44
import { Empty, EmptyTitle, EmptyDescription } from '@object-ui/components';
55
import { Pencil, BarChart3, Loader2 } from 'lucide-react';
6-
import { MetadataToggle, MetadataPanel, useMetadataInspector } from './MetadataInspector';
6+
import { MetadataPanel, useMetadataInspector } from './MetadataInspector';
77
import { useMetadata } from '../context/MetadataProvider';
88
import { useAdapter } from '../context/AdapterProvider';
99
import type { DataSource } from '@object-ui/types';
@@ -22,7 +22,7 @@ const FALLBACK_FIELDS = [
2222

2323
export function ReportView({ dataSource }: { dataSource?: DataSource }) {
2424
const { reportName } = useParams<{ reportName: string }>();
25-
const { showDebug, toggleDebug } = useMetadataInspector();
25+
const { showDebug } = useMetadataInspector();
2626
const adapter = useAdapter();
2727
const [configPanelOpen, setConfigPanelOpen] = useState(false);
2828
// Version counter — incremented on save to refresh the stable config reference
@@ -358,7 +358,6 @@ export function ReportView({ dataSource }: { dataSource?: DataSource }) {
358358
<Pencil className="h-3.5 w-3.5" />
359359
Edit
360360
</button>
361-
<MetadataToggle open={showDebug} onToggle={toggleDebug} />
362361
</div>
363362
</div>
364363

0 commit comments

Comments
 (0)