Repository navigation
feat(display): show the number of subpages at sections - #1824
Merged
Merged
Conversation
6 tasks done
perber
added a commit
that referenced
this pull request
Nov 15, 2026
…1825) "wide stays aligned next to the expanded TOC side panel" failed in CI on #1823 (3.7px) and #1824 (25px) without touching the viewer. The TOC pane and the subheader's reserved padding animate their width over 200ms, and the spec measured once right after the panel became visible, so content and header rows could be caught mid-animation. measureViewer now waits until no CSS transition is running.
Each section of the Display settings page saved its patch with its own
copy of the saving flag, the store call and the success/error toasts.
useDisplaySettingSave holds that once; a section passes its two messages
and gets { saving, save }. No behaviour change.
New instance-wide display setting showSubpageCount (default off), part of #1779. When an admin turns it on under Settings > Display, section rows in the tree and sub-sections in the section overview show how many direct children they have. The count comes from the client tree, which is already filtered for the viewer, so nothing is counted server side; anonymous visitors get the setting through /api/config like the other display settings. The visible number is aria-hidden, screen readers get "12 subpages". The setting is a new field in pagedisplay.Settings/Patch and in toc-display.json (a missing field means off) and is changed through PUT /api/admin/settings/display; no new route.
Merge the per-field read tests (no file, old files, content width, subpage count) into one table comparing the whole Settings value, and the per-field reload tests into one table. No case dropped; coverage stays at 98.1%.
perber
force-pushed
the
feat/subpage-count
branch
from
November 15, 2026 18:57
982162d to
b19ad77
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issue
Part of #1779 (step 3 of 3; step 1 was #1813, step 2 #1821, the shared display update route #1823). Closes #1779.
What changed
Admins can turn on Settings → Display → Subpage count (default off). Sections then show how many direct subpages they have: in the tree after the title, and in the overview of an empty section at every sub-section. The setting is instance-wide and also applies to anonymous visitors with public access.
children.length), so it only counts what the viewer already sees; nothing is counted server side. An empty section shows0.aria-hidden; screen readers get the plural text ("12 subpages"),_one/_otherin all 5 locales.internal/pagedisplaychanges. NewshowSubpageCountfield inSettings/Patch/toc-display.json(missing means off), set through the existingPUT /api/admin/settings/display, delivered via/api/config. No new route.components/SubpageCount.tsxused byTreeNodeandEmptySectionChildrenList; new checkbox section on the Display page. The tree link is now flex withmin-w-0, so a long title truncates before the number.refactor(settings)commit first: the per-section saving state and toasts inDisplaySettings.tsxmove into oneuseDisplaySettingSavehook (no behaviour change), so the third setting doesn't copy them again.How I tested it
/api/configwith and without public access).0, direct children only, store updates on move and toggle), EmptySectionChildrenList, plural resolution in every locale.settings-subpage-count.spec.ts: admin enables it, tree and overview show the count with the right accessible name; anonymous visitor on a public wiki sees it too.make test,make lint,make verify,make verify-commits,make ui-check.Checklist
if featurebranches in shared code (rule 1)Behavior-Change:trailer (commit style) (not added: default off, nothing changes until an admin enables it)🤖 Generated with Claude Code