LearnNewsExamplesServices
Frontmatter
id12218
titleOpt-in load-on-folder-expand for the shared portal TreeList
stateClosed
labels
enhancementaiperformance
assigneesneo-gpt
createdAtMay 30, 2026, 7:27 PM
updatedAtJun 1, 2026, 6:37 AM
githubUrlhttps://github.com/neomjs/neo/issues/12218
authorneo-opus-ada
commentsCount0
parentIssue12204
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[x] 12217 Refactor tickets index emitter → chunked-by-folder + path de-duplication
blocking[x] 12219 Make tickets controller deep-link + default-route lazy-aware
closedAtJun 1, 2026, 6:37 AM

Opt-in load-on-folder-expand for the shared portal TreeList

Closed v13.0.0/archive-v13-0-0-chunk-15 enhancementaiperformance
neo-opus-ada
neo-opus-ada commented on May 30, 2026, 7:27 PM

Context

Part of epic #12207 (Track B; #11372 Phase 2). V-B-A confirmed Neo Store has no fetch-children-on-expand (autoInitRecords/initialChunkSize/streaming are in-memory/instantiation features); the tree loads the whole index up front.

The Fix

Add an opt-in lazyChildLoad config to the shared src/app/content/TreeList.mjs / src/tree/List.mjs: on first folder expand, the base tree awaits onFolderItemClick() before toggling the folder. Neo.app.content.TreeList uses that hook to fetch a node chunk once and store.add() its children; the flat parentId shape slots straight into createItemLevel recursion with no structural change. Per-node isChildrenLoaded / isChildrenLoading guards. Default OFF so blog, release, and medium trees keep full-load behavior.

Acceptance Criteria

  • Expanding a lazy-enabled folder fetches and appends only that chunk children.
  • Behavior is unchanged where lazyChildLoad is off.
  • Accordion tree overrides preserve click ordering when the base folder hook is async.

Contract Ledger

Target Surface Source of Authority Proposed Behavior Fallback / Edge Case Docs Evidence
src/tree/List.mjs onFolderItemClick(record, item, data) Shared tree interaction pipeline Await the folder hook before toggling VDOM/open state so subclasses can prepare children lazily. Hook default is a no-op; returning false cancels the folder toggle. JSDoc on hook and async click path. Focused tree unit coverage.
src/tree/Accordion.mjs onItemClick() override Accordion selection/event semantics Await the base tree click pipeline, then apply Accordion selection/event behavior without rewriting record.collapsed. Base hook rejection propagates to awaited callers; base tree remains the collapsed-state owner. JSDoc return contract. New Accordion regression spec.
src/app/content/TreeList.mjs lazy configs Portal content-tree specialization lazyChildLoad, lazyChildUrlPrefix, and lazyChildUrlField opt in to one-shot child-chunk fetch on first expand. Disabled by default; missing URL or already loaded/loading records skip fetch. Config JSDoc and method summaries. App content TreeList lazy-load spec.
apps/portal/model/Ticket.mjs chunk metadata fields Portal ticket JSON chunk emitter contract Preserve childCount, childrenUrl, contentDir, and filePrefix on ticket tree records. Existing full-index records without chunk metadata remain valid. Model field declarations. Portal ticket tree fixture coverage through TreeList tests.
apps/portal/view/news/tickets/MainContainer.mjs treeConfig Tickets tab is the first lazy-load consumer Opt only the tickets tree into lazy loading and point chunk URLs at portal data resources. Other portal content tabs retain current eager loading until separately opted in. Config surface in MainContainer. Build/lazy TreeList verification in PR.

Related

Epic #12207; #11372 Phase 2. Depends on the chunked emitter (sub 12); unblocks the lazy-aware controller (sub 14).

tobiu referenced in commit e0abc90 - "feat(portal): lazily load content tree children (#12218) (#12279) on Jun 1, 2026, 6:37 AM
tobiu closed this issue on Jun 1, 2026, 6:37 AM