Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…ADMAP update - Update ObjectGrid.tsx: state type, cellClassName, cycleRowHeight, icons for all 5 rowHeight values (compact/short/medium/tall/extra_tall) - Add 14 unit tests for row height initialization, cycle, label, toggle visibility - Update ROADMAP.md to reflect ObjectGrid rendering support and new test count Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
…mprove test assertions Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
|
@copilot 仔细审查,要完成任务中列出的所有开发 |
…update - ViewConfigPanel: 18 new tests for toggle interactions (collapseAllByDefault, showDescription, clickIntoRecordDetails, addDeleteRecordsInline), conditional rendering (sharing visibility, navigation width/openNewTab), all 5 rowHeight clicks, boundary values (empty actions, long labels, special chars), pageSizeOptions, densityMode/ARIA live enums - view-config-schema: 8 new tests for accessibility field ordering, emptyState compound field, switch field defaults, comprehensive visibleWhen predicates - ROADMAP: add Phase 5 spec alignment completion section Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
…SizeOptions boundary test Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
All issue tasks completed in commits 4f072c8–636fcd6: Task 1 — ObjectGrid rowHeight: Extended from 3 to all 5 spec values (compact/short/medium/tall/extra_tall) — state type, cellClassName, cycleRowHeight, icon mapping. Zod schema already had 5 values ✅. Task 2 — Section field Spec coverage: Verified all Appearance/UserActions/Sharing/Accessibility fields have UI controls, defaults, ordering, and conditional visibility. Added 19 ViewConfigPanel interaction tests covering toggle behaviors, conditional rendering (sharing visibility, navigation width/openNewTab), all 5 rowHeight clicks, boundary values (empty actions, long labels, special chars, invalid pageSizeOptions). Task 3 — Test coverage: Added 41 total new tests: 14 ObjectGrid rowHeight, 19 ViewConfigPanel interactions, 8 schema spec alignment (accessibility ordering, emptyState, switch defaults, visibleWhen predicates). Full suite: 213 console tests, 186 plugin-grid tests, all passing. Task 5 — ROADMAP: Updated with Phase 5 spec alignment completion section. |
There was a problem hiding this comment.
Pull request overview
This PR completes the ConfigPanel UI Spec alignment by extending ObjectGrid to support all 5 rowHeight enum values (previously hardcoded to only 3) and adding comprehensive test coverage for ViewConfigPanel field interactions, conditional rendering, and boundary cases.
Changes:
- Extended ObjectGrid rowHeight support from 3 values (compact/medium/tall) to all 5 spec-defined values (compact/short/medium/tall/extra_tall) with full rendering support including state management, cell styling, cycle toggle logic, and icon mapping
- Added 19 new ViewConfigPanel interaction tests covering toggle interactions, conditional rendering (sharing visibility, navigation width/openNewTab, addRecord sub-editor), all 5 rowHeight button clicks, boundary values (empty actions, long labels, special chars, invalid pageSizeOptions), and enum cycling (densityMode, ARIA live)
- Added 8 new schema-level spec alignment tests verifying field ordering, compound field structure, switch field defaults, and comprehensive visibleWhen predicates
- Added 14 new ObjectGrid rowHeight tests validating initialization, full 5-step cycle, label display, and toggle visibility for all enum values
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/plugin-grid/src/ObjectGrid.tsx | Extended rowHeightMode state type to include all 5 values, updated cellClassName mapping with styles for short/extra_tall, modified cycleRowHeight to cycle through all 5 values, added Rows2 icon import, implemented icon mapping via object lookup |
| packages/plugin-grid/src/tests/row-height.test.tsx | New test file with 14 comprehensive tests covering all 5 rowHeight enum values: toggle visibility, initialization, full cycle sequence, label display, and default behavior |
| apps/console/src/tests/ViewConfigPanel.test.tsx | Added 19 interaction tests for spec alignment: toggle interactions (collapseAllByDefault, showDescription, clickIntoRecordDetails, addDeleteRecordsInline), conditional rendering (sharing, navigation, addRecord), rowHeight buttons, boundary cases, enum cycling |
| apps/console/src/tests/view-config-schema.test.tsx | Added 8 schema-level tests: accessibility field ordering, emptyState compound field structure, switch field default conventions, comprehensive visibleWhen predicates for sharing and navigation |
| ROADMAP.md | Updated Phase 4 test counts and added Phase 5 section documenting spec alignment completion with all changes |
Comments suppressed due to low confidence (3)
ROADMAP.md:390
- The count "18 new ViewConfigPanel interaction tests" is incorrect. There are actually 19 new tests added in this PR (lines 2439-2772 of ViewConfigPanel.test.tsx): 4 toggle tests, 4 conditional rendering tests, 1 all-rowHeight test, 2 empty actions tests, 3 boundary tests, 2 pageSizeOptions tests, 1 densityMode test, 1 addRecord conditional test, and 1 ARIA live test.
- [x] 18 new ViewConfigPanel interaction tests: collapseAllByDefault, showDescription, clickIntoRecordDetails, addDeleteRecordsInline toggles; sharing visibility conditional hide; navigation width/openNewTab conditional rendering; all 5 rowHeight button clicks; boundary tests (empty actions, long labels, special chars); pageSizeOptions input; densityMode/ARIA live enums; addRecord conditional sub-editor; sharing visibility select
ROADMAP.md:388
- The issue reference is incorrect. The PR description states this PR "Fixes #762", but the ROADMAP references "Issue #745". These should match to ensure proper issue tracking and documentation consistency.
**Phase 5 — Spec Alignment Completion (Issue #745):**
packages/plugin-grid/src/tests/row-height.test.tsx:160
- The test name "should default to 'medium' when rowHeight is defined but empty" doesn't match the test implementation. The test passes
rowHeight: 'medium'explicitly, which is not testing a default or fallback scenario. The comment mentions that "when schema.rowHeight is undefined, no toggle is shown" which is already tested in the "Row height toggle visibility" describe block. Consider either removing this redundant test or modifying it to test an actual edge case, such as passing an invalid rowHeight value to verify fallback behavior.
describe('Row height default', () => {
it('should default to "medium" when rowHeight is defined but empty', async () => {
// When rowHeight is present (truthy or not), toggle shows.
// When schema.rowHeight is undefined, no toggle is shown — default 'medium' is internal.
renderGrid({ rowHeight: 'medium' });
await waitFor(() => {
expect(screen.getByText('Name')).toBeInTheDocument();
});
expect(screen.getByTitle('Row height: medium')).toBeInTheDocument();
});
});
Completes all development tasks from the ConfigPanel UI Spec alignment issue. ObjectGrid hardcoded only 3 of 5 spec rowHeight values (
compact/medium/tall), and test coverage for section field interactions, conditional rendering, and boundary values was incomplete.Changes
1. ObjectGrid rowHeight — full 5-enum rendering (
ObjectGrid.tsx)rowHeightModestate,cellClassNamestyles,cycleRowHeighttoggle, and icon mapping to cover all 5 valuesshort:py-1 leading-normal(between compact and medium)extra_tall:py-3.5 leading-relaxed(beyond tall){ compact: Rows4, short: Rows3, medium: Rows2, tall: AlignJustify, extra_tall: AlignJustify }Rows2icon import for medium modeZod schema (
objectql.zod.ts) already had the correct 5-valuez.enum— no changes needed there.2. Section field Spec coverage verification & interaction tests (
ViewConfigPanel.test.tsx)collapseAllByDefault,showDescription,clickIntoRecordDetails,addDeleteRecordsInline— all verified to triggeronViewUpdatesharing.enabledis false/undefined; navigation width hidden when mode ispage; navigation openNewTab hidden when mode isdraweronViewUpdatecallcompact/comfortable/spacious), all ARIA live values (polite/assertive/off), sharing visibility select changeaddRecordViaFormis false3. Schema-level spec alignment tests (
view-config-schema.test.tsx)ariaLabel<ariaDescribedBy<ariaLive)collapseAllByDefaultexplicitTrue,showDescription/inlineEditdefaultOn)visibleWhenpredicates for sharing visibility, navigation width, and navigation openNewTab4. ObjectGrid rowHeight tests (
row-height.test.tsx)5. ROADMAP update
Test Results
Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.