Skip to content

UI improvements of pages nav menu - #426

Open
freekh wants to merge 4 commits into
mainfrom
ui-improv-pages-nav-menu
Open

UI improvements of pages nav menu#426
freekh wants to merge 4 commits into
mainfrom
ui-improv-pages-nav-menu

Conversation

@freekh

@freekh freekh commented May 17, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@changeset-bot

changeset-bot Bot commented May 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b175d65

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@valbuild/ui Patch
@valbuild/server Patch
@valbuild/next Patch
@valbuild/react Patch
@valbuild/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refreshes the NavMenu UI: a redesigned sitemap row with route-aware "New page" forms, validation error badges across nav items and section headers, and supporting data wiring to derive per-row error counts from useAllValidationErrors.

Changes:

  • New NewPageForm (with single/multi/catch-all dynamic segment support) and a top-level "New page" entry in SitemapSection, replacing the inline AddRouteForm.
  • New ErrorBadge + errorAggregation helpers; useNavMenuData now attaches per-row errors (own count + first message) derived from validation errors.
  • Visual overhaul of SitemapItem/ExplorerItem (monospace, dynamic-segment pills, dropped file/folder icons, val extension stripping) and Storybook fixtures/stories for new flows.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/ui/spa/components/NavMenu/useNavMenuData.ts Attach per-row validation error summaries to sitemap/explorer items.
packages/ui/spa/components/NavMenu/types.ts Add NavItemErrors; mark ExplorerItem.hasError deprecated.
packages/ui/spa/components/NavMenu/SitemapSection.tsx Section-level error badge; collect routes for new top-level "New page" popover.
packages/ui/spa/components/NavMenu/SitemapItem.tsx Redesign row, render dynamic-segment pill, integrate NewPageForm/ErrorBadge.
packages/ui/spa/components/NavMenu/NewPageForm.tsx New shared form for creating pages, supports multi-route selection.
packages/ui/spa/components/NavMenu/ExplorerSection.tsx Add aggregated error badge to header.
packages/ui/spa/components/NavMenu/ExplorerItem.tsx Redesign row; replace error icon with count badge; strip .val.ts.
packages/ui/spa/components/NavMenu/ErrorBadge.tsx New shared error count badge with tooltip.
packages/ui/spa/components/NavMenu/errorAggregation.ts Recursive total error counting helpers.
packages/ui/spa/components/NavMenu/mockData.ts Add catch-all and multi-segment route fixtures; switch to new error shape.
packages/ui/spa/components/NavMenu/stories/SitemapSection.stories.tsx New stories for catch-all, multi-segment, and validation error cases.
packages/ui/spa/components/NavMenu/stories/NewPageForm.stories.tsx New stories covering the standalone form.
packages/ui/spa/components/NavMenu/index.ts Export new modules.
packages/ui/.storybook/preview.js Wrap stories in TooltipProvider for badge tooltips.
.changeset/six-laws-repair.md Patch changeset note.

Comment on lines +19 to +21
/** Optional element wrapping the badge inside the tooltip trigger, for
* cases where the badge sits inside a button row. */
asChild?: boolean;
Comment on lines +178 to +186
function walk(item: SitemapItem, parentPath: string) {
const displayUrl =
item.name === "/" || item.name === ""
? "/"
: `${parentPath}/${item.name}`;

if (item.sourcePath || item.children.length === 0) {
urls.push(displayUrl);
}
);
}
// Aggregate-only: descendants carry the errors.
return <span>{count === 1 ? "1 error below" : `${count} errors below`}</span>;
# Conflicts:
#	packages/ui/spa/components/NavMenu/SitemapItem.tsx
@freekh

freekh commented Jun 14, 2026

Copy link
Copy Markdown
Contributor Author

Some more things we want before this the nav menu updates have been improved enough:

  • we want to move the external pages to be a button
  • we want to make sure that it is possible to create new pages and external pages from where users selects pages
  • we want to show s.files / s.images directories as "Assets" - clicking the directories show the gallery

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants