-
Notifications
You must be signed in to change notification settings - Fork 456
✨(frontend) improve mobile UX by showing subdocs count #1540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
e79dba5 to
050189f
Compare
src/frontend/apps/impress/src/features/docs/doc-header/components/DocHeaderInfo.tsx
Outdated
Show resolved
Hide resolved
|
Size Change: +211 B (+0.01%) Total Size: 3.68 MB
|
src/frontend/apps/impress/src/features/docs/doc-header/components/DocHeaderInfo.tsx
Outdated
Show resolved
Hide resolved
| const { data: childrenPage } = useDocChildren( | ||
| { docId: doc.id, page_size: 1 }, | ||
| { enabled: true }, | ||
| ); | ||
| const countFromTreeContext = | ||
| treeContext?.root?.id === doc.id | ||
| ? treeContext?.treeData?.nodes?.length | ||
| : undefined; | ||
|
|
||
| const childrenCount = | ||
| countFromTreeContext ?? | ||
| childrenPage?.count ?? | ||
| doc.numchild ?? | ||
| tree?.children?.length ?? | ||
| 0; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need all that ? Why is doc.numchild not enough ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need all that ? Why is
doc.numchildnot enough ?
@AntoLC I used TreeContext’s count because numchild displayed 0 on the root document, and hides the badge; with countFromTreeContext the root shows the correct visible child count,
wdyt ? I didn't find another way
and I remove useDocChildren here (it worked without it) and simplify childrenCount.
src/frontend/apps/impress/src/features/docs/doc-header/components/DocHeaderInfo.tsx
Show resolved
Hide resolved
src/frontend/apps/impress/src/features/docs/doc-header/components/DocHeaderInfo.tsx
Outdated
Show resolved
Hide resolved
050189f to
e6bbbf3
Compare
helps users notice root documents have children in mobile view Signed-off-by: Cyril <[email protected]>
ensures numchild count is displayed correctly on mobile interface Signed-off-by: Cyril <[email protected]>
0e17f4f to
45dba48
Compare
Purpose
Improve mobile user experience by indicating when a document or a subdocument has children.
issue : 1314
Proposal