-
Notifications
You must be signed in to change notification settings - Fork 3
Optimize object detail page with Power Apps-inspired tabbed layout #1200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
6825fc9
Add tabbed layout for object detail page
Claude b10d608
Improve widget styling with cleaner Power Apps-inspired layout
Claude 6f8c952
Update tests to support new tabbed layout
Claude 05d7e5c
fix: address all PR review comments - use SchemaRenderer, semantic HT…
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
137 changes: 137 additions & 0 deletions
137
apps/console/src/components/schema/ObjectDetailTabsWidget.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,137 @@ | ||
| /** | ||
| * Object Detail Tabs Widget | ||
| * | ||
| * Self-contained, schema-driven tabbed widget for the object detail page. | ||
| * Organizes object configuration into logical tabs similar to Power Apps: | ||
| * - Details: Object properties and basic information | ||
| * - Fields: Field designer for managing object fields | ||
| * - Relationships: Relationships and unique keys | ||
| * - Data: Data preview and experience placeholders | ||
| * | ||
| * Schema: { type: 'object-detail-tabs', objectName: 'account' } | ||
| * | ||
| * @module components/schema/ObjectDetailTabsWidget | ||
| */ | ||
|
|
||
| import { useState } from 'react'; | ||
| import { Tabs, TabsList, TabsTrigger, TabsContent } from '@object-ui/components'; | ||
| import { Settings2, Columns, Link2, Table } from 'lucide-react'; | ||
| import type { SchemaNode } from '@object-ui/core'; | ||
| import { | ||
| ObjectPropertiesWidget, | ||
| ObjectRelationshipsWidget, | ||
| ObjectKeysWidget, | ||
| ObjectDataExperienceWidget, | ||
| ObjectDataPreviewWidget, | ||
| } from './objectDetailWidgets'; | ||
| import { ObjectFieldDesignerWidget } from './ObjectFieldDesignerWidget'; | ||
|
|
||
| /** Schema props for object detail tabs widget. */ | ||
| interface ObjectDetailTabsSchema extends SchemaNode { | ||
| objectName: string; | ||
| } | ||
|
|
||
| export function ObjectDetailTabsWidget({ schema }: { schema: ObjectDetailTabsSchema }) { | ||
| const objectName = schema.objectName; | ||
| const [activeTab, setActiveTab] = useState('details'); | ||
|
|
||
| // Create schema objects for each widget | ||
| const detailsSchema: SchemaNode & { objectName: string } = { | ||
| type: 'object-properties', | ||
| id: `${objectName}-properties`, | ||
| objectName, | ||
| }; | ||
|
|
||
| const fieldsSchema: SchemaNode & { objectName: string } = { | ||
| type: 'object-field-designer', | ||
| id: `${objectName}-field-designer`, | ||
| objectName, | ||
| }; | ||
|
|
||
| const relationshipsSchema: SchemaNode & { objectName: string } = { | ||
| type: 'object-relationships', | ||
| id: `${objectName}-relationships`, | ||
| objectName, | ||
| }; | ||
|
|
||
| const keysSchema: SchemaNode & { objectName: string } = { | ||
| type: 'object-keys', | ||
| id: `${objectName}-keys`, | ||
| objectName, | ||
| }; | ||
|
|
||
| const dataExperienceSchema: SchemaNode & { objectName: string } = { | ||
| type: 'object-data-experience', | ||
| id: `${objectName}-data-experience`, | ||
| objectName, | ||
| }; | ||
|
|
||
| const dataPreviewSchema: SchemaNode & { objectName: string } = { | ||
| type: 'object-data-preview', | ||
| id: `${objectName}-data-preview`, | ||
| objectName, | ||
| }; | ||
|
|
||
| return ( | ||
| <div className="w-full" data-testid="object-detail-tabs"> | ||
| <Tabs value={activeTab} onValueChange={setActiveTab} className="w-full"> | ||
| <TabsList className="w-full justify-start border-b rounded-none bg-transparent p-0 h-auto"> | ||
| <TabsTrigger | ||
| value="details" | ||
| className="relative rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent data-[state=active]:shadow-none" | ||
| > | ||
| <Settings2 className="h-4 w-4 mr-2" /> | ||
| Details | ||
| </TabsTrigger> | ||
| <TabsTrigger | ||
| value="fields" | ||
| className="relative rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent data-[state=active]:shadow-none" | ||
| > | ||
| <Columns className="h-4 w-4 mr-2" /> | ||
| Fields | ||
| </TabsTrigger> | ||
| <TabsTrigger | ||
| value="relationships" | ||
| className="relative rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent data-[state=active]:shadow-none" | ||
| > | ||
| <Link2 className="h-4 w-4 mr-2" /> | ||
| Relationships | ||
| </TabsTrigger> | ||
| <TabsTrigger | ||
| value="data" | ||
| className="relative rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent data-[state=active]:shadow-none" | ||
| > | ||
| <Table className="h-4 w-4 mr-2" /> | ||
| Data | ||
| </TabsTrigger> | ||
| </TabsList> | ||
|
|
||
| <TabsContent value="details" className="mt-6"> | ||
| <div className="space-y-6"> | ||
| <ObjectPropertiesWidget schema={detailsSchema} /> | ||
| </div> | ||
| </TabsContent> | ||
|
|
||
| <TabsContent value="fields" className="mt-6"> | ||
| <div className="space-y-6"> | ||
| <ObjectFieldDesignerWidget schema={fieldsSchema} /> | ||
| </div> | ||
| </TabsContent> | ||
|
|
||
| <TabsContent value="relationships" className="mt-6"> | ||
| <div className="space-y-6"> | ||
| <ObjectRelationshipsWidget schema={relationshipsSchema} /> | ||
| <ObjectKeysWidget schema={keysSchema} /> | ||
| </div> | ||
| </TabsContent> | ||
|
|
||
| <TabsContent value="data" className="mt-6"> | ||
| <div className="space-y-6"> | ||
| <ObjectDataPreviewWidget schema={dataPreviewSchema} /> | ||
| <ObjectDataExperienceWidget schema={dataExperienceSchema} /> | ||
| </div> | ||
| </TabsContent> | ||
| </Tabs> | ||
| </div> | ||
| ); | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ObjectDetailTabsWidgetcomposes object detail sections by importing and rendering the widget components directly. This bypassesSchemaRendererfeatures (expression evaluation, per-node error boundary, debug attributes/ARIA extraction) and prevents swapping/overriding implementations viaComponentRegistry. Consider rendering the per-tab child nodes via<SchemaRenderer schema={...} />instead of direct component imports, and keep only SchemaNodes in this widget.