Skip to content

Conversation

@Ovgodd
Copy link
Collaborator

@Ovgodd Ovgodd commented Oct 30, 2025

Purpose

Improve mobile user experience by indicating when a document or a subdocument has children.

issue : 1314

image

Proposal

  • Display the number of sub-documents in mobile view only and only if they exist
  • Adjust the UI to accommodate the new child count information
  • Create a DocHeaderInfo component to encapsulate related logic and rendering

@Ovgodd Ovgodd requested a review from AntoLC October 30, 2025 10:02
@Ovgodd Ovgodd self-assigned this Oct 30, 2025
@Ovgodd Ovgodd added enhancement improve an existing feature frontend labels Oct 30, 2025
@Ovgodd Ovgodd force-pushed the feat/1314-show-sub-docs-count branch from e79dba5 to 050189f Compare October 30, 2025 10:03
@Ovgodd Ovgodd marked this pull request as ready for review October 30, 2025 10:03
@github-actions
Copy link

github-actions bot commented Oct 30, 2025

Size Change: +211 B (+0.01%)

Total Size: 3.68 MB

Filename Size Change
apps/impress/out/_next/static/7a8dff1b/_buildManifest.js 0 B -884 B (removed) 🏆
apps/impress/out/_next/static/d9508a32/_buildManifest.js 884 B +884 B (new file) 🆕

compressed-size-action

Comment on lines 31 to 46
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;

Copy link
Collaborator

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 ?

Copy link
Collaborator Author

@Ovgodd Ovgodd Nov 10, 2025

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 ?

@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.

@Ovgodd Ovgodd force-pushed the feat/1314-show-sub-docs-count branch from 050189f to e6bbbf3 Compare November 10, 2025 12:39
@Ovgodd Ovgodd requested a review from AntoLC November 10, 2025 13:31
@AntoLC AntoLC linked an issue Nov 10, 2025 that may be closed by this pull request
@Ovgodd Ovgodd force-pushed the feat/1314-show-sub-docs-count branch from 0e17f4f to 45dba48 Compare November 12, 2025 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement improve an existing feature frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show on mobile when a document has sub docs

3 participants