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

View File

@@ -81,6 +81,10 @@ export class DocsService extends Service {
return this.store.watchTrashDocIds();
}
allDocTitle$() {
return this.store.watchAllDocTitle();
}
constructor(
private readonly store: DocsStore,
private readonly docPropertiesStore: DocPropertiesStore,

View File

@@ -142,6 +142,25 @@ export class DocsStore extends Store {
);
}
watchAllDocTitle() {
return yjsGetPath(
this.workspaceService.workspace.rootYDoc.getMap('meta'),
'pages'
).pipe(
switchMap(pages => yjsObservePath(pages, '*.title')),
map(pages => {
if (pages instanceof YArray) {
return pages.map(v => ({
id: v.get('id') as string,
title: (v.get('title') ?? '') as string,
}));
} else {
return [];
}
})
);
}
watchNonTrashDocIds() {
return yjsGetPath(
this.workspaceService.workspace.rootYDoc.getMap('meta'),