Repository navigation
fix(plugin-grid): a grouped list on a phone draws group headers and cards instead of the desktop table - #27078
Merged
Merged
Conversation
… phone Below the card breakpoint the grouped branch kept the desktop table. The card body moves into one renderer (buildMobileCardRenderer) that the plain card view and a new grouped card view both draw with; the grouped view draws each band, its rows as cards and its footer. Claude-Session: https://claude.ai/code/session_01JQwxbYnetNoLwkb9ksXxde Co-authored-by: Claude <noreply@anthropic.com>
…s and cards The re-homed pin asserted the grouped table under 768px, which is the behaviour this card replaces; it now asserts the bands, their cards and no table, keeping the ungrouped control. Claude-Session: https://claude.ai/code/session_01JQwxbYnetNoLwkb9ksXxde Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
席位核对ACCEPT · 席位意见:手机上的分组列表现在逐组画出组头、卡片和组尾,与普通列表的卡片视图同一个渲染器;桌面分组表格不变。
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Requested by Warren · project thread
Fixes #26896
Clause-②: no
Metadata-protocol: none
维护者速读
ObjectGrid的渲染分支,桌面分组表格与普通卡片不变;回滚即 revert 本 PR。ObjectGrid.tsx里新的isGrouped && useCardView分支与buildMobileCardRenderer;groupedMobileCards-26896.test.tsx;groupingNeedsHeaderQuery-10881.test.tsx改写的那条旧断言。pnpm --dir ui exec vitest run packages/plugin-grid/src/__tests__/groupedMobileCards-26896.test.tsx,预期 4 个测试全绿。What changes
ObjectGridlifts the mobile card body out of the plain card branch into one renderer,buildMobileCardRenderer(), which returns the per-row card function. The plain card view (ungrouped, under 768px) draws through it unchanged: same scroller, same card markup.isGrouped && useCardView) now drawsgroupBandsOf(pagedGroups)as a vertical list instead of the grouped table: each band'sGroupRow(toggle, label, count, aggregations), then that band's rows as cards, then its footer (a server-grouped group's pager or loading line). Collapse, counts, the whole-group pager (groupedPager) and server group paging keep working because they are the same bands the table draws.Tests
groupedMobileCards-26896.test.tsx(4 tests): at 390px a client-grouped view draws one band per group with that group's rows as cards under it and notable; collapsing a band removes its cards and keeps the band; the same on the server-grouped path (header query + per-group pages). CONTROL: at 1280px the same view still draws the one grouped table and no card.groupingNeedsHeaderQuery-10881.test.tsx: its re-homed pin asserted that a grouped grid under 768px draws the table, which is exactly the behaviour this card replaces. It now asserts the five bands, their cards and no table; its ungrouped control is unchanged.isGrouped && useCardViewreplaced byisGrouped && false(viascripts/ablation-replace.mjs, anchor hit 1 → 0, restored blob equal to HEAD,git diff HEADempty), the new file goes 3 failed / 1 passed: the three phone tests red, the desktop control green.Acceptance notes
Verification
Gates derived by
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack, run on the final head8cfdb16a: 35 derived plus 5 extra (plugin-grid type-check, eslint on the touched files,check:changeset-fixed,check:new-line-citations, the touched test files), all 40 exit 0, exits captured before any pipe;--ranreconciles 35 derived / 35 run / 0 NOT-MEASURED. Details in the os-dev report on the card. The wholepackages/plugin-grid/suite ran once before the test update (253/254 files; the one red was the stale pin rewritten above) and the touched files were re-run on the final head.Generated by Claude Code