Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
… layout - Remove ObjectView breadcrumb (Opportunity > All Opportunities) - Remove ViewTabBar from ObjectView (view switching via config panel) - Remove Add Filter button from UserFilters component - Restructure ListView toolbar: UserFilters left, tool buttons right - Update tests to match new UI Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
- Remove VIEW_TYPE_ICONS, AVAILABLE_VIEW_TYPES constants (unused after ViewTabBar removal) - Remove unused imports: ComponentType, AvailableViewType, icon imports - Fix ViewSwitching test to verify tabs are no longer rendered - Fix ObjectView tests that relied on breadcrumb for live preview verification Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
|
@copilot ViewTabBar 还是需要显示,只是不需要拖动和新增功能 |
Per reviewer feedback, ViewTabBar should remain visible for view switching
but without design-mode features (drag-to-reorder, +add, context menu actions).
- config={{ reorderable: false }} disables drag
- No onAddView, onRenameView, onDuplicateView, etc. callbacks
- Restore VIEW_TYPE_ICONS and related imports
- Update tests to verify tabs render without design features
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Restored ViewTabBar as a read-only view switcher in |
There was a problem hiding this comment.
Pull request overview
This PR removes design-mode UI affordances from the main ObjectView content area (breadcrumb, view management controls, and the “Add filter” entry point) and reshapes the ListView toolbar into a split left/right layout to match the intended design/config-panel-driven workflow.
Changes:
- Remove the inline breadcrumb from Console
ObjectViewand simplifyViewTabBarto a read-only switcher. - Remove the “Add filter” button from
UserFiltersdropdown mode and update related tests. - Split the ListView toolbar into left (user filters) and right (tool buttons + add record) regions.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/console/src/components/ObjectView.tsx | Removes breadcrumb and strips ViewTabBar management handlers; sets tab bar to non-reorderable. |
| apps/console/src/tests/ObjectView.test.tsx | Updates test expectations to reflect breadcrumb removal and view tab changes. |
| apps/console/src/tests/ViewSwitching.test.tsx | Updates view tab rendering test wording for the simplified tab bar. |
| packages/plugin-list/src/UserFilters.tsx | Removes “Add filter” button from dropdown filters UI. |
| packages/plugin-list/src/ListView.tsx | Reworks toolbar layout into left/right regions and moves Add Record into right region. |
| packages/plugin-list/src/tests/UserFilters.test.tsx | Updates assertions for removed “Add filter” button. |
| packages/plugin-list/src/tests/ListView.test.tsx | Updates assertion to ensure “Add filter” button is not rendered. |
Comments suppressed due to low confidence (1)
apps/console/src/components/ObjectView.tsx:752
ViewTabBaris fed from the baseviewsarray, so any draft edits (e.g. label changes coming fromviewDraft/mergedViews) won't reflect in the tab labels during live preview. Consider using the merged view list (or merging the active draft into the tab items) so the tab bar reflects the same view state asPluginObjectView.
{/* View Tabs — read-only view switcher (design features like drag/add are in ViewConfigPanel) */}
{views.length > 1 && (
<div className="border-b px-3 sm:px-4 bg-background overflow-x-auto shrink-0">
<ViewTabBar
views={views.map((view: { id: string; label: string; type: string; filter?: any[]; sort?: any[] }) => ({
| it('renders view tabs without drag or add features', () => { | ||
| renderObjectView(); | ||
|
|
||
| // "All Tasks" appears in breadcrumb and tab, so use getAllByText | ||
| // ViewTabBar should be present for switching views | ||
| const allTasksElements = screen.getAllByText('All Tasks'); |
There was a problem hiding this comment.
This test description says "without drag or add features", but it currently only asserts that tab labels render. Either add assertions that the management affordances are absent (e.g. view-tab-add / drag handles) or rename the test to match what it's actually verifying.
| setShowViewConfigPanel(true); | ||
| } : undefined} | ||
| availableViewTypes={AVAILABLE_VIEW_TYPES} | ||
| config={{ reorderable: false }} |
There was a problem hiding this comment.
config={{ reorderable: false }} drops any other objectDef.viewTabBar settings (e.g. maxVisibleTabs, showIndicators, etc.) and leaves contextMenu enabled by default. Since no context-menu handlers are passed anymore, this can still wrap tabs in a context menu that opens with an empty menu. Consider merging the existing config while explicitly disabling design-mode affordances (e.g. contextMenu: false, inlineRename: false, showAddButton: false, reorderable: false).
| config={{ reorderable: false }} | |
| config={{ | |
| ...(objectDef as any).viewTabBar, | |
| contextMenu: false, | |
| inlineRename: false, | |
| showAddButton: false, | |
| reorderable: false, | |
| }} |
| // Breadcrumb should show object label and active view label (may appear in tabs too) | ||
| const allOppTexts = screen.getAllByText('All Opportunities'); | ||
| expect(allOppTexts.length).toBeGreaterThanOrEqual(2); // breadcrumb + tab | ||
| // Breadcrumb removed — "All Opportunities" should not appear in the header area |
There was a problem hiding this comment.
This test name/intent says the breadcrumb was removed, but the assertion only checks that the H1 still renders; it doesn't actually verify the breadcrumb is absent. Add an explicit negative assertion (e.g. only one occurrence of the active view label, or absence of a breadcrumb-specific element) so the test will fail if the breadcrumb UI regresses.
| // Breadcrumb removed — "All Opportunities" should not appear in the header area | |
| // Breadcrumb removed — "All Opportunities" should not appear in the header area | |
| expect(screen.queryByText('All Opportunities')).not.toBeInTheDocument(); |
| // The label change propagates via mergedViews (live preview) | ||
| await vi.waitFor(() => { | ||
| const breadcrumbItems = screen.getAllByText('Live Preview Test'); | ||
| expect(breadcrumbItems.length).toBeGreaterThanOrEqual(1); | ||
| expect(titleInput).toHaveValue('Live Preview Test'); | ||
| }); |
There was a problem hiding this comment.
The test title suggests it's validating mergedViews/live preview propagation, but the assertion only checks the input value changed (which doesn't exercise anything outside the config panel). To make this meaningful, assert a downstream effect of the draft label (e.g. the active tab label in ViewTabBar updates, or PluginObjectView receives the updated view label).
Removes design-mode UI elements from the main content area that duplicate AppHeader functionality or belong in the right-side config panel. Restructures the toolbar to an Airtable Interfaces-style split layout.
ObjectView (
apps/console/src/components/ObjectView.tsx)config={{ reorderable: false }}), the "+" add view button is removed, and context menu actions (rename, duplicate, delete, set default, share, pin, reorder, change type) are removed. These features are now accessible only via ViewConfigPanel (right sidebar).AVAILABLE_VIEW_TYPES,ChevronRight, etc.)UserFilters (
packages/plugin-list/src/UserFilters.tsx)+ Add filterbutton from DropdownFilters mode. Tab mode'sallowAddTabbutton is preserved (different feature).ListView toolbar (
packages/plugin-list/src/ListView.tsx)Tests
ObjectView.test.tsx,ViewSwitching.test.tsx,ListView.test.tsx,UserFilters.test.tsxto reflect the changesOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.