Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…cales Add navigationWidthHint, openNewTabHint, and their parent keys (navigationMode, navigationWidth, openNewTab) to ar, de, es, fr, ja, ko, pt, and ru locale files. Hint values are kept in English as they are developer-facing. Parent keys include localized translations. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…description spec alignment, helpText hints - Add `description` field to NamedListView interface (protocol alignment) - Add `disabledWhen` predicate to ConfigField type for conditional disabling - Implement `disabledWhen` evaluation in ConfigFieldRenderer for all control types - Add `expandedSections` prop to ConfigPanelRenderer for external section collapse control - Add `helpText` to navigation-dependent fields (width/openNewTab) for UX context - Add `disabledWhen` to grid-only fields (striped/bordered/wrapHeaders/resizable) - Add i18n keys for navigation hint text (all 11 locales) - Add 24 new tests covering expandedSections, disabledWhen, and helpText Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
…lish locales Replaced English placeholder strings with proper translations for: de, fr, es, pt, ja, ko, ru, ar Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
@copilot 仔细审查确认是否已经完成了任务中的所有要求 |
…ding custom The helpText property was defined on ConfigField type and set on navigation-dependent fields but never actually rendered. Refactored ConfigFieldRenderer to use break-based switch + post-render helpText wrapper. Added 3 new tests for helpText rendering. Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
经过仔细审查,确认 6 个问题全部已完成。在本次审查中还发现并修复了一个遗漏: 逐项确认:
283 个测试全部通过(新增 27 个测试)。 |
There was a problem hiding this comment.
Pull request overview
This PR enhances the ConfigPanel system with protocol alignment, conditional field disabling, external collapse control, and user-facing hints for navigation-dependent fields. It addresses 4 of 6 issues raised in #804, focusing on spec alignment and UX improvements.
Changes:
- Added
descriptionfield toNamedListViewprotocol interface for spec alignment - Implemented
disabledWhenpredicate onConfigFieldto conditionally disable fields based on draft state - Added
expandedSectionsprop toConfigPanelRendererfor programmatic section expansion control - Refactored
ConfigFieldRendererto supporthelpTextrendering for all field types and unifieddisabledWhenevaluation - Added contextual hints for navigation-dependent fields with translations across all 10 locales
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 optional description field to NamedListView interface for protocol spec alignment |
| packages/i18n/src/locales/*.ts | Added navigationWidthHint and openNewTabHint translation keys across all 10 locale files |
| packages/components/src/types/config-panel.ts | Added disabledWhen predicate to ConfigField interface for conditional field disabling |
| packages/components/src/custom/config-panel-renderer.tsx | Added expandedSections prop for external section collapse control with proper precedence over local state |
| packages/components/src/custom/config-field-renderer.tsx | Refactored switch cases to break pattern, implemented universal disabledWhen evaluation and helpText rendering wrapper |
| packages/components/src/tests/config-panel-renderer.test.tsx | Added 5 new tests covering expandedSections override and disabledWhen evaluation |
| packages/components/src/tests/config-field-renderer.test.tsx | Added 3 new tests verifying helpText rendering for standard and custom field types |
| apps/console/src/utils/view-config-schema.tsx | Applied disabledWhen predicates to grid-only fields, added helpText to navigation fields, updated buildSwitchField signature, corrected description field comment |
| apps/console/src/tests/view-config-schema.test.tsx | Added 19 new tests covering grid-only disabledWhen predicates, helpText validation, and description spec alignment |
| ROADMAP.md | Updated Phase 5 documentation with new features and test counts |
| navigationWidthHint: 'Available for drawer, modal, and split navigation modes', | ||
| openNewTab: 'Open in new tab', | ||
| openNewTabHint: 'Available for page and new window navigation modes', |
There was a problem hiding this comment.
The PR description mentions "all 11 locales" but the codebase actually has 10 built-in locales (en, zh, ja, ko, de, fr, es, pt, ru, ar). All 10 locales have been correctly updated with the new translation keys navigationWidthHint and openNewTabHint.
Addresses several ViewConfigPanel/ConfigPanelRenderer detail issues: missing
disabledstate for view-type-dependent fields, no external collapse control,descriptionnot in protocol spec, and no UX hints on conditionally-visible navigation fields.Protocol alignment
description?: stringtoNamedListViewinterface — was annotated as "UI extension", now spec-aligneddisabledWhenpredicate onConfigFielddisabledWhen?: (draft) => booleanonConfigFieldtypeConfigFieldRendereraseffectiveDisabledfor all control types (input, switch, checkbox, select, slider, color, icon-group, field-picker)striped,bordered,wrapHeaders,resizable) now disabled whentype !== 'grid'expandedSectionsprop onConfigPanelRendererexpandedSections?: string[]prop overrides local collapsed state for listed section keysNavigation-dependent field hints
helpTextadded to_navigationWidthand_navigationOpenNewTabfieldsnavigationWidthHint/openNewTabHinttranslated across all 11 localesConfigFieldRendererrendershelpTextas a<p>element below the field control for all field types includingcustomTests
expandedSectionsoverride (3),disabledWhenevaluation (2), grid-only predicates (16), helpText validation (2), description spec alignment (1), helpText rendering in ConfigFieldRenderer (3)Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.