Skip to content

Navigation: drop ViewModel, use Leaf/Node + RootIndex - #3784

Merged
Mpdreamz merged 3 commits into
cursor/0e6c827bfrom
refactor/nav-render-model-cleanup
Aug 6, 2026
Merged

Navigation: drop ViewModel, use Leaf/Node + RootIndex#3784
Mpdreamz merged 3 commits into
cursor/0e6c827bfrom
refactor/nav-render-model-cleanup

Conversation

@Mpdreamz

@Mpdreamz Mpdreamz commented Aug 6, 2026

Copy link
Copy Markdown
Member

Why

PR #3750 introduced both NavigationViewModel and NavigationRenderModel, which both read as Razor bind targets. After the projection, only NavigationRenderModel is the template model — the extra type adds an unnecessary hop and keeps presentational chrome (IndexLink) mixed into the tree kinds.

What

  • Delete NavigationViewModel; writers and tests call NavigationRenderModel.Create(...) directly
  • Rename render kinds to Leaf / Node to match domain vocabulary
  • Lift the synthetic root-index sidebar row out of the tree onto NavigationRenderModel.RootIndex
  • Include RootIndex in the content hash (navigation-tree-v2)

Opened against #3750 so we can discuss the shape on the feature branch.

Made with Cursor

Mpdreamz and others added 2 commits August 6, 2026 10:38
Remove NavigationViewModel so writers project straight into NavigationRenderModel, and lift the synthetic root-index row out of the tree as RootIndex.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@Mpdreamz
Mpdreamz requested a review from a team as a code owner August 6, 2026 08:40
@Mpdreamz Mpdreamz added the chore label Aug 6, 2026
@Mpdreamz
Mpdreamz requested a review from cotti August 6, 2026 08:40
NotBeNull() does not expose Subject; assert the URL on the property directly.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@Mpdreamz
Mpdreamz merged commit efaf740 into main Aug 6, 2026
24 checks passed
@Mpdreamz
Mpdreamz deleted the refactor/nav-render-model-cleanup branch August 6, 2026 09:11
Mpdreamz added a commit that referenced this pull request Aug 6, 2026
…odel

Resolve conflicts after PR #3784 (Navigation: drop ViewModel, use Leaf/Node + RootIndex).

The new rendering pipeline projects raw nav items into NavigationRenderNode records
before templates see them. Island listing nodes need a matching projection:

- Add IsIslandListing bool to NavigationRenderNode (hashed in ContentHash)
- NavigationRenderModel.CreateNode: detect IsIslandListing; set ShowToggle=false
  and NavigationItems=[] so the toggle and subtree are suppressed in the main nav
- _TocTreeNav.cshtml: for IsIslandListing nodes render a link chevron (<a href>)
  instead of the expand/collapse label; guard subtree on NavigationItems.Count > 0
- IsolatedBuildNavigationHtmlWriter / GlobalNavigationHtmlWriter: use separate
  ConcurrentDictionary<string,string> for island HTML (NavigationRenderCache is
  keyed by IRootNavigationItem object reference, not by string id)
- GlobalNavigationHtmlWriter: drop IDisposable + Dispose() (semaphore removed in #3784)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants