feat(spec,lint): allow dropdown userFilters on object list views (#2679)#2683
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 2 package(s): 94 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
Airtable-style quick-filter chips (`userFilters`, `element: 'dropdown'`)
were blanket-suppressed on object list views ("views" mode) — omitted
from `ObjectListViewSchema`, errored by the `validate` list-view-mode
rule, and dropped at render. That over-corrected against ADR-0047 TL;DR
#5 (data mode is meant to expose quick filters).
Narrow the rule: an object list view MAY carry a `dropdown` (value-chip)
userFilters; only the `tabs` preset style stays page-only, because the
saved-view ViewTabBar already owns the tab-bar role (need presets on an
object → use `listViews`).
- spec: new `ObjectUserFiltersSchema` (element narrowed to dropdown/
toggle, tabs/showAllRecords omitted); `ObjectListViewSchema` extends
`userFilters` back in with it.
- lint: `validate-list-view-mode` flags `quickFilters` always, but
`userFilters` only when `element: 'tabs'` / carrying `tabs`.
- app-showcase: dropdown userFilters (status + health) on the default
`showcase_project` list view.
- docs: ADR-0047 amendment note + regenerated view reference.
Companion objectui runtime change: objectstack-ai/objectui#2338.
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.
Closes #2679
问题
Airtable 风格的快捷筛选胶囊(
userFilters,element: 'dropdown')此前只能用在页面列表(InterfaceListPage,"filters" 模式)。对象的默认列表视图("views" 模式)被三层护栏禁止携带userFilters:ObjectListViewSchema编译期剥离、validate-list-view-mode预解析报错、objectui 运行时强制undefined。这与 ADR-0047 TL;DR #5(data 模式本应暴露快捷筛选)相悖,phase-4 一刀切属于过度收敛。方案(ADR-0047 修订)
放开
element: 'dropdown'(及历史遗留toggle),但保留element: 'tabs'为页面专属——对象视图的已保存视图切换器 ViewTabBar 已占据 tab 栏角色,tabs会造成双 tab 栏冲突;需要预设时用listViews。ObjectUserFiltersSchema(element 限dropdown/toggle,去掉tabs/showAllRecords);ObjectListViewSchema改为ListViewSchema.omit({ userFilters }).extend({ userFilters: ObjectUserFiltersSchema.optional() })。validate-list-view-mode中quickFilters仍全禁;userFilters仅在element: 'tabs'/ 携带tabs时报错,hint 指向listViews/ 页面列表。showcase_project默认列表加 dropdownuserFilters(status + health)示例。测试
packages/specobject-list-view.test.ts(6 passed)、packages/lintvalidate-list-view-mode.test.ts(8 passed)。配套 objectui 运行时改动:objectstack-ai/objectui#2338。