feat(core): add title order by (#12696)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Added support for ordering documents by their title.
  - Introduced a new "title" system property type with an associated icon and display name.

- **Improvements**
  - Enhanced system property types to allow more flexible filtering options.
  - Improved filter condition handling to show an unknown filter UI when filtering methods or values are unavailable.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
EYHN
2025-06-04 02:41:55 +00:00
parent 99198e246b
commit 160e4c2a38
6 changed files with 73 additions and 3 deletions
@@ -37,6 +37,16 @@ export const SystemFilterCondition = ({
const methods = type.filterMethod;
const Value = type.filterValue;
if (!methods || !Value) {
return (
<UnknownFilterCondition
isDraft={isDraft}
onDraftCompleted={onDraftCompleted}
filter={filter}
/>
);
}
return (
<Condition
filter={filter}
@@ -12,6 +12,7 @@ import {
MemberIcon,
TagIcon,
TemplateIcon,
TitleIcon,
} from '@blocksuite/icons/rc';
import type { GroupHeaderProps } from '../explorer/types';
@@ -55,6 +56,11 @@ import {
} from './template';
export const SystemPropertyTypes = {
title: {
icon: TitleIcon,
name: 'Title',
allowInOrderBy: true,
},
tags: {
icon: TagIcon,
name: 'Tags',
@@ -213,8 +219,8 @@ export const SystemPropertyTypes = {
allowInOrderBy?: boolean;
allowInGroupBy?: boolean;
filterMethod: { [key: string]: I18nString };
filterValue: React.FC<{
filterMethod?: { [key: string]: I18nString };
filterValue?: React.FC<{
filter: FilterParams;
isDraft?: boolean;
onDraftCompleted?: () => void;