mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-22 20:41:50 +08:00
feat(core): add default group and order (#12526)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added default sorting and grouping by "Last Updated" for document views. - Introduced clearer group headers for documents grouped by creation or update date, displaying relative dates or appropriate fallback text. - **Improvements** - Enhanced date grouping headers with capitalized, user-friendly text and improved handling of missing dates. - Added a new localization for "Never updated" to improve clarity in document groupings. - Initialized document update timestamps at creation to improve date accuracy. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -19,6 +19,8 @@ const AllDocs = () => {
|
||||
displayProperties: ['createdAt', 'updatedAt', 'tags'],
|
||||
view: 'masonry',
|
||||
showDragHandle: false,
|
||||
groupBy: undefined,
|
||||
orderBy: undefined,
|
||||
})
|
||||
);
|
||||
const collectionRulesService = useService(CollectionRulesService);
|
||||
@@ -43,8 +45,8 @@ const AllDocs = () => {
|
||||
},
|
||||
],
|
||||
orderBy: {
|
||||
type: 'property',
|
||||
key: 'createdAt',
|
||||
type: 'system',
|
||||
key: 'updatedAt',
|
||||
desc: true,
|
||||
},
|
||||
})
|
||||
|
||||
@@ -36,6 +36,8 @@ const CollectionDocs = ({ collection }: { collection: Collection }) => {
|
||||
displayProperties: ['createdAt', 'updatedAt', 'tags'],
|
||||
view: 'masonry',
|
||||
showDragHandle: false,
|
||||
groupBy: undefined,
|
||||
orderBy: undefined,
|
||||
})
|
||||
);
|
||||
const groups = useLiveData(explorerContextValue.groups$);
|
||||
|
||||
@@ -20,6 +20,8 @@ const TagDocs = ({ tag }: { tag: Tag }) => {
|
||||
displayProperties: ['createdAt', 'updatedAt', 'tags'],
|
||||
view: 'masonry',
|
||||
showDragHandle: false,
|
||||
groupBy: undefined,
|
||||
orderBy: undefined,
|
||||
})
|
||||
);
|
||||
const collectionRulesService = useService(CollectionRulesService);
|
||||
@@ -50,8 +52,8 @@ const TagDocs = ({ tag }: { tag: Tag }) => {
|
||||
},
|
||||
],
|
||||
orderBy: {
|
||||
type: 'property',
|
||||
key: 'createdAt',
|
||||
type: 'system',
|
||||
key: 'updatedAt',
|
||||
desc: true,
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user