Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…sity keys to all locales Add 4 new i18n keys (enableHideFields, enableGroup, enableColor, enableDensity) to all non-English locale files: de, pt, ru, es, ja, ko, fr, ar, zh. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…oup, Color, Density, Export) - Add showHideFields, showGroup, showColor, showDensity, allowExport to ListViewSchema and NamedListView types - Add Zod schema fields for new toolbar control properties - Wrap Hide Fields, Group, Color, Density buttons with schema conditions in ListView - Fix Export button to check allowExport !== false - Propagate new props through Console ObjectView fullSchema and PluginObjectView renderListView - Add toggle switches in ViewConfigPanel for all new controls - Fix hasExport logic bug (was always true due to undefined !== false) - Add i18n translations for new toggle labels in all locales Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
…st expectations - Add tests for Hide Fields, Group, Color, Density conditional rendering - Add test for Export button hidden when allowExport=false with exportOptions - Add tests for new ViewConfigPanel toggles (showHideFields, showGroup, showColor, showDensity) - Add test for hasExport fix (false when allowExport undefined and no exportOptions) - Fix existing allowExport test expectations to match corrected hasExport logic Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
|
@copilot 清单上有很多问题要解决所有的问题 |
Add translated 'striped' and 'bordered' i18n keys to zh, ja, ko, de, fr, es, pt, ru, and ar locale files to match the en.ts baseline. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…(Issue #719) - Add inlineEdit, wrapHeaders, clickIntoRecordDetails, addRecordViaForm, addDeleteRecordsInline, collapseAllByDefault, fieldTextColor, prefixField, showDescription to NamedListView, ListViewSchema, and Zod schema - Propagate all missing props through Console ObjectView fullSchema - Propagate all missing props through PluginObjectView renderListView schema - Forward striped/bordered/wrapHeaders from ListView to child viewComponentSchema - Add striped/bordered toggles to ViewConfigPanel Appearance section - Add i18n keys for striped/bordered in all 10 locales - Add tests for schema prop forwarding and new toggles - 847 tests pass, 0 failures Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
All 22 items from the issue checklist have been resolved in commits Toolbar visibility (Bugs 1-3, 7): Hide Fields, Group, Color, Density buttons now conditionally rendered via Full data flow (Bug 4-5, Items 14-22): All props now propagated end-to-end through 3 layers:
New panel controls: Added Types: 847 tests pass. |
There was a problem hiding this comment.
Pull request overview
This pull request completes the end-to-end data flow for ListView toolbar control visibility and all 22 view-config properties from the ViewConfigPanel. It resolves a comprehensive checklist of 22 items that were preventing proper synchronization between the right-side panel configuration and the ListView rendering.
Changes:
- Added type definitions for 13 new properties across NamedListView, ListViewSchema, and Zod schemas (showHideFields, showGroup, showColor, showDensity, allowExport, inlineEdit, wrapHeaders, clickIntoRecordDetails, addRecordViaForm, addDeleteRecordsInline, collapseAllByDefault, fieldTextColor, prefixField, showDescription)
- Fixed conditional rendering of 5 toolbar buttons (Hide Fields, Group, Color, Density, Export) in ListView
- Fixed hasExport logic bug (was always true when undefined) and Export button visibility
- Completed 3-layer data flow propagation: ViewConfigPanel → Console ObjectView → PluginObjectView → ListView
- Added child view schema forwarding for striped, bordered, wrapHeaders, and inlineEdit properties
- Added i18n keys across all 10 locales for new UI toggles
- Added comprehensive test coverage (15 new tests) for toolbar visibility and schema forwarding
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/types/src/objectql.ts | Added 13 new properties to NamedListView and ListViewSchema interfaces with documentation |
| packages/types/src/zod/objectql.zod.ts | Added Zod schema validation for all 13 new properties |
| packages/plugin-list/src/ListView.tsx | Wrapped Hide Fields/Group/Color/Density buttons in conditional rendering; fixed Export button logic; added striped/bordered/wrapHeaders/inlineEdit forwarding to child view schemas |
| packages/plugin-view/src/ObjectView.tsx | Added propagation of all 22 properties to renderListView schema (fixes Bug 4 from issue) |
| apps/console/src/components/ObjectView.tsx | Added propagation of all 22 properties to fullSchema; exportOptions clearing when allowExport is false |
| apps/console/src/components/ViewConfigPanel.tsx | Added 6 new toggle switches; fixed hasExport logic from always-true bug |
| packages/i18n/src/locales/*.ts (10 files) | Added enableHideFields, enableGroup, enableColor, enableDensity, striped, bordered keys across all locales |
| packages/plugin-list/src/tests/ListView.test.tsx | Added 15 new tests for toolbar visibility and schema forwarding |
| apps/console/src/tests/ViewConfigPanel.test.tsx | Added tests for new toggles and hasExport logic fix; updated allowExport test expectations |
| ROADMAP.md | Documented all fixes with checkmarks and cross-references to Issue #719 |
| showHideFields: activeView?.showHideFields ?? (schema as any).showHideFields, | ||
| showGroup: activeView?.showGroup ?? (schema as any).showGroup, | ||
| showColor: activeView?.showColor ?? (schema as any).showColor, | ||
| showDensity: activeView?.showDensity ?? (schema as any).showDensity, | ||
| allowExport: activeView?.allowExport ?? (schema as any).allowExport, | ||
| // Propagate display properties | ||
| striped: activeView?.striped ?? (schema as any).striped, | ||
| bordered: activeView?.bordered ?? (schema as any).bordered, | ||
| color: activeView?.color ?? (schema as any).color, | ||
| // Propagate view-config properties (Bug 4 / items 14-22) | ||
| inlineEdit: activeView?.inlineEdit ?? (schema as any).inlineEdit, | ||
| wrapHeaders: activeView?.wrapHeaders ?? (schema as any).wrapHeaders, | ||
| clickIntoRecordDetails: activeView?.clickIntoRecordDetails ?? (schema as any).clickIntoRecordDetails, | ||
| addRecordViaForm: activeView?.addRecordViaForm ?? (schema as any).addRecordViaForm, | ||
| addDeleteRecordsInline: activeView?.addDeleteRecordsInline ?? (schema as any).addDeleteRecordsInline, | ||
| collapseAllByDefault: activeView?.collapseAllByDefault ?? (schema as any).collapseAllByDefault, | ||
| fieldTextColor: activeView?.fieldTextColor ?? (schema as any).fieldTextColor, | ||
| prefixField: activeView?.prefixField ?? (schema as any).prefixField, | ||
| showDescription: activeView?.showDescription ?? (schema as any).showDescription, |
There was a problem hiding this comment.
Multiple type assertions using (schema as any) indicate that ObjectViewSchema is missing the new properties (showHideFields, showGroup, showColor, showDensity, allowExport, striped, bordered, inlineEdit, wrapHeaders, clickIntoRecordDetails, addRecordViaForm, addDeleteRecordsInline, collapseAllByDefault, fieldTextColor, prefixField, showDescription). These properties should be added to the ObjectViewSchema interface in packages/types/src/objectql.ts to maintain type safety and avoid runtime errors if these properties are accessed incorrectly.
Resolves all 22 items from the right-side panel issue checklist. Of the 10 toolbar buttons in ListView, only Search/Filter/Sort were conditionally rendered via schema props. The remaining 4 (Hide Fields, Group, Color, Density) rendered unconditionally, Export had a broken toggle due to field name mismatch, and
hasExportwas alwaystruebecauseundefined !== false. Additionally, 9 ViewConfigPanel properties (items 14–22) were not propagated through the 3-layer data flow, and ListView did not forwardstriped/bordered/wrapHeadersto child view schemas.Type definitions
showHideFields,showGroup,showColor,showDensity,allowExporttoNamedListView,ListViewSchema, and Zod schemainlineEdit,wrapHeaders,clickIntoRecordDetails,addRecordViaForm,addDeleteRecordsInline,collapseAllByDefault,fieldTextColor,prefixField,showDescriptiontoNamedListView,ListViewSchema, and Zod schemaListView conditional rendering
schema.showX !== false &&schema.exportOptions && schema.allowExport !== falseProp propagation (3-layer fix)
ObjectView.tsx— all 22 view-config props added tofullSchema;exportOptionscleared whenallowExport === falseObjectView.tsx— all 22 props added torenderListViewschema (fixes Bug 4: missinginlineEdit,wrapHeaders,clickIntoRecordDetails,addRecordViaForm,addDeleteRecordsInline,collapseAllByDefault,fieldTextColor,prefixField,showDescription)showHideFields,showGroup,showColor,showDensity,striped,bordered);hasExportfixed fromdraft.allowExport !== false→draft.allowExport === true || draft.exportOptions != nullListView child view forwarding (Bug 5)
stripedandborderedforwarded to all child view schemas viabasePropswrapHeadersforwarded to grid child view schemainlineEditmapped to grideditableprop (already existed, now propagated end-to-end)i18n
enableHideFields,enableGroup,enableColor,enableDensity,striped,borderedkeys across all 10 localesTests
allowExporttests that relied on the buggy always-true behaviorOriginal prompt
This section details on the original issue you should resolve
<issue_title>列表右侧面板问题汇总</issue_title>
<issue_description>
让我先深入排查每一个控件和属性的完整数据流。现在我已经完整阅读了四个核心文件的最新代码,下面给出深度排查的完整清单:
深度排查完整清单
📊 整体数据流路径
逐控件排查结果
showSearch✅fullSchema.showSearch✅ L307renderListView schema.showSearch✅ L817schema.showSearch !== false✅ L1033showFilters✅fullSchema.showFilters✅ L309renderListView schema.showFilters✅ L818schema.showFilters !== false✅ L874showSort✅fullSchema.showSort✅ L308renderListView schema.showSort✅ L819schema.showSort !== false✅ L924rowHeight值fullSchema.densityMode✅ L301schema.densityMode✅ L813密度值通过
useDensityMode消费allowExport开关 ✅exportOptionsschema.exportOptions &&L986 控制schema.sharing?.enabledL1018 控制fullSchema.striped✅ L310schema.striped✅ L821fullSchema.bordered✅ L311schema.bordered✅ L822rowHeight选择器 ✅fullSchema.rowHeight✅ L300schema.rowHeight✅ L812useDensityMode(resolvedDensity)✅ L342-354fullSchema.densityMode✅ L301schema.densityMode✅ L813useDensityMode(resolvedDensity)✅ L342-354editRecordsInline✅fullSchema.inlineEdit✅ L302schema.inlineEdit != null ? editableL622clickIntoRecordDetails✅addRecordViaForm✅wrapHeaders✅showDescription✅fullSchema.appearance.showDescription✅ L303-305collapseAllByDefault✅fieldTextColor✅prefixField✅addDeleteRecordsInline✅🔴 关键 Bug 汇总(必须修复)
Bug 1: Hide Fields / Group / Color 按钮始终无条件显示
位置:
ListView.tsxL816-971原因: 这 3 个 toolbar 按钮没有任何条件判断,永远渲染
修复: 需要新增 schema 属性(如
showHideFields、showGroup、showColor)并在 ListView 中条件渲染,或统一用一个toolbarControls配置Bug 2: Export 开关断裂
位置: ViewConfigPanel 写入
allowExport: boolean,但 ListView 检查的是schema.exportOptions对象原因: 两端用了不同的字段名/类型,Console 也没有将
allowExport转换为exportOptions修复: Console
fullSchema需要exportOptions: viewDef.allowExport ? { formats: ['csv', 'json'] } : undefinedBug 3: Density/行高按钮无法隐藏
位置:
ListView.tsxL973-983原因: 密度按钮无条件渲染(且永远显示在 toolbar)
修复: 需��新增
showDensityschema 属性Bug 4: PluginObjectView
renderListView缺少多个属性位置:
PluginObjectView.tsxL802-829 的renderContent()缺少传递:
inlineEdit、appearance(showDescription)、wrapHeaders、clickIntoRecordDetails、addRecordViaForm、collapseAllByDefault、fieldTextColor、prefixField、addDeleteRecordsInline修复: 补齐所有属性到 renderListView schema
Bug 5: ListView 不消费大量已传递属性
**...
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.