fix(core): fix all docs group header (#12334)

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

- **New Features**
  - Improved document grouping logic in the explorer view, allowing for more dynamic and responsive updates when changing grouping criteria.

- **Bug Fixes**
  - Prevented unnecessary synchronization operations in local workspace environments, ensuring sync only occurs for applicable workspace types.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
EYHN
2025-05-20 06:55:56 +00:00
parent 6f9361caee
commit 151f499154
2 changed files with 6 additions and 4 deletions

View File

@@ -101,6 +101,7 @@ export const DocsExplorer = ({
const contextValue = useContext(DocExplorerContext);
const docsService = useService(DocsService);
const groupBy = useLiveData(contextValue.groupBy$);
const groups = useLiveData(contextValue.groups$);
const view = useLiveData(contextValue.view$);
const selectMode = useLiveData(contextValue.selectMode$);
@@ -113,8 +114,8 @@ export const DocsExplorer = ({
const items = groups.map((group: any) => {
return {
id: group.key,
Component: groups.length > 1 ? GroupHeader : undefined,
height: groups.length > 1 ? 24 : 0,
Component: groupBy ? GroupHeader : undefined,
height: groupBy ? 24 : 0,
className: styles.groupHeader,
items: group.items.map((docId: string) => {
return {
@@ -133,7 +134,7 @@ export const DocsExplorer = ({
} satisfies MasonryGroup;
});
return items;
}, [groups, view]);
}, [groupBy, groups, view]);
const handleCloseFloatingToolbar = useCallback(() => {
contextValue.selectMode$?.next(false);

View File

@@ -136,7 +136,8 @@ export class DocCreatedByUpdatedBySyncService extends Service {
workspaceRootDocSynced &&
isOwnerOrAdmin &&
missingCreatedBy &&
!markedSynced
!markedSynced &&
this.workspaceService.workspace.flavour !== 'local'
)
),
false