Fix page create name, sidebar items ordering and name popover placeholder

This commit is contained in:
Hakan Shehu
2024-10-16 09:35:29 +02:00
parent dca335f2a9
commit d8cc99efdf
3 changed files with 7 additions and 1 deletions

View File

@@ -45,6 +45,7 @@ export class PageCreateMutationHandler
type: NodeTypes.Page,
parentId: input.parentId,
index: index,
name: input.name,
},
},
input.userId,

View File

@@ -13,6 +13,7 @@ import { mapNode } from '@/lib/nodes';
import { LocalNode } from '@/types/nodes';
import { MutationChange } from '@/operations/mutations';
import { isEqual } from 'lodash';
import { compareString } from '@/lib/utils';
export class SidebarSpaceListQueryHandler
implements QueryHandler<SidebarSpaceListQueryInput>
@@ -101,7 +102,10 @@ export class SidebarSpaceListQueryHandler
continue;
}
const children = nodes.filter((n) => n.parentId === node.id);
const children = nodes
.filter((n) => n.parentId === node.id)
.sort((a, b) => compareString(a.index, b.index));
spaces.push(this.buildSpaceNode(node, children));
}

View File

@@ -54,6 +54,7 @@ export const BreadcrumbItemPopover = ({
</AvatarPopover>
<SmartTextInput
value={node.name}
placeholder="Unnamed"
onChange={(newName) => {
if (isPending) return;
if (newName === node.name) return;