Skip to content

align FilterList API with ObjectTable: objectType required, objectSet optional#2982

Draft
KuberSethi wants to merge 1 commit intomainfrom
ksethi/filter-list-objectset-api-followup
Draft

align FilterList API with ObjectTable: objectType required, objectSet optional#2982
KuberSethi wants to merge 1 commit intomainfrom
ksethi/filter-list-objectset-api-followup

Conversation

@KuberSethi
Copy link
Copy Markdown
Contributor

FilterList required objectSet as the sole data-source prop, diverging from ObjectTable's pattern

• add objectType as the primary required prop for metadata resolution, make objectSet optional for scoping aggregation queries
• conditionally pass objectSet to useOsdkAggregation so aggregations fall back to the full type when no objectSet is provided
• update stories, example app, and tests to use the new API

… optional

add objectType as the primary required prop and make objectSet optional,
matching the pattern used by ObjectTable. aggregation queries scope to the
objectSet when provided, otherwise run against the full type.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

size-limit report 📦

Path Size Change
@osdk/api 432 B 0%
@osdk/client 24.11 kB 0%
@osdk/oauth 6.52 kB 0%
@osdk/react 513 B 0%
@osdk/react/experimental 50.07 kB 0%
@osdk/react/experimental/admin 2.43 kB 0%
@osdk/react-components 10 B 0%
@osdk/react-components/experimental 481.58 kB 0%
@osdk/react-components/primitives 40.46 kB 0%
@osdk/widget.client-react 10.56 kB 0%

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: Why do we remove objectSet from all stories if it's now supported?

});
const aggregationArgs = useMemo(
() =>
objectSet != null
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Can we remove the ternary condition since the hook is handling empty objectSet anyway?

@@ -867,7 +851,6 @@ export const WithCheckbox: Story = {
function CombinedWithObjectTableStory(
Copy link
Copy Markdown
Contributor

@ziyunp ziyunp Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add filtered objectSet example

Suggested change
function CombinedWithObjectTableStory(
function CombinedWithObjectTableStory(
args: Partial<EmployeeFilterListProps>,
) {
const client = useOsdkClient();
const employeeObjectSet = client(Employee).where({
jobProfile: "Marketing Manager",
});
const [filterClause, setFilterClause] = useState<
WhereClause<Employee> | undefined
>(undefined);
const handleFilterRemoved = useCallback((filterKey: string) => {
// eslint-disable-next-line no-console
console.log("Removed filter:", filterKey);
}, []);
return (
<div style={COMBINED_LAYOUT_STYLE}>
<div style={SIDEBAR_FIXED_STYLE}>
<FilterList
objectType={Employee}
objectSet={employeeObjectSet}
filterDefinitions={sharedFilterDefinitions}
onFilterRemoved={handleFilterRemoved}
filterClause={filterClause}
onFilterClauseChanged={setFilterClause}
{...args}
/>
</div>
<div style={FLEX_FILL_STYLE}>
<ObjectTable
objectType={Employee}
filter={filterClause}
objectSet={employeeObjectSet}
/>
</div>
</div>
);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants