Skip to content

v0.18.2 — README + docs homepage workshop

Choose a tag to compare

@Vusys Vusys released this 30 May 23:47
· 88 commits to master since this release
68361c0

Docs-only patch release. No src/ changes — README and docs/index.md were workshopped so the headline preview is more honest about what the package does. All v0.18.0/v0.18.1 application behavior is preserved.

What changed (#160)

  • Running example switches from Category/products to BudgetItem/cost so each declared aggregate maps to a natural business question (`cost_total` = total spend, `item_count` = line items, `avg_cost` = avg line cost, `biggest_item` = max, `recurring_total` = filtered SUM). "Average product count per category" felt forced; "average cost per line item" doesn't.

  • Hand-drawn ASCII tree comment replaced with a real BudgetItem::toAsciiTreeForest(new AsciiOptions(label: ...)) call. The rendered ASCII below the call is what the exporter would actually print — readers see the API surface they'd use, not a fiction.

  • Demo tree grows from 2 to 3 levels (Engineering → People → Salaries/Bonuses, Engineering → Tools → SaaS/Hardware, Operations → Office). The update mutation now cascades through two ancestor levels (Bonuses → People → Engineering); the move re-parents a whole 3-node subtree atomically. The tree renders before AND after so the move's effect on both old and new ancestors is visually obvious.

  • Inlined node lookups as BudgetItem::query()->where('name', '=', '...')->first() at each call site, instead of conjuring undefined \$bonuses / \$tools / etc. The snippet now stands alone without imagined prior context.

  • getSubtreeSize() example replaced with getDescendantCount(). The previous example was confusing: getSubtreeSize() returns the lft/rgt slot count (rgt - lft + 1 = 2N), not the node count, so a 2-node tree returned 4. Swapped for the descendant count most readers actually want, with a comment that spells out the +1-for-self adjustment.

  • Docs link cleanup: dropped the dead vs. kalnoy/nestedset entry (docs/reference/comparison.md doesn't exist), added the Glossary page from v0.18.1, added a new Internals line linking to Architecture Overview.

  • docs/index.md ns-tree interactive widget now uses the same budget tree as the code snippet that follows it ({cost=NNN} annotations roll up automatically). The interactive widget, the prose, and the code snippet are now one consistent dataset — three lenses on the same tree.