-
Notifications
You must be signed in to change notification settings - Fork 294
fix: eliminate layout shifts on public wiki page load #595
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| {% macro render_wiki_tree(nodes, level=0, current_route='') %} | ||
| {% macro render_wiki_tree(nodes, level=0, current_route='', expanded_nodes=set()) %} | ||
| {% if nodes %} | ||
| <ul class="wiki-tree list-none m-0 px-0 py-0.5 space-y-0.5"> | ||
| {% for node in nodes %} | ||
|
|
@@ -54,8 +54,9 @@ | |
| <div id="{{ node.name }}-children" | ||
| class="wiki-children overflow-hidden mt-0.5 ml-[14px] pl-2 border-l border-[var(--outline-gray-2)]" | ||
| x-show="isExpanded('{{ node.name }}')" | ||
| x-collapse> | ||
| {{ render_wiki_tree(node.children, level + 1, current_route) }} | ||
| x-collapse | ||
| {% if node.name not in expanded_nodes %}x-cloak{% endif %}> | ||
| {{ render_wiki_tree(node.children, level + 1, current_route, expanded_nodes) }} | ||
|
Comment on lines
54
to
+59
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Potential flash for ancestor nodes on first visit. The logic correctly uses server-computed
Between steps 2 and 3, ancestor nodes might briefly collapse before re-expanding. The Consider initializing 🤖 Prompt for AI Agents |
||
| </div> | ||
| {% endif %} | ||
| </li> | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.