Skip to content

[GreenDonut] Re-add Page<T>.Items#9420

Merged
tobias-tengler merged 2 commits intomainfrom
tte/readd-items-to-page
Mar 23, 2026
Merged

[GreenDonut] Re-add Page<T>.Items#9420
tobias-tengler merged 2 commits intomainfrom
tte/readd-items-to-page

Conversation

@tobias-tengler
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings March 23, 2026 05:58
@github-actions github-actions Bot added 📚 documentation This issue is about working on our documentation. 🌶️ green donut labels Mar 23, 2026
@tobias-tengler tobias-tengler changed the title [GreenDonut] Re-add items to Page<T> [GreenDonut] Re-add Items to Page<T> Mar 23, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Reintroduces an Items collection on Page<T> in GreenDonut and wires it through page implementations and EF paging helpers to avoid re-materializing items from entries. Also updates the v16 migration guide headings and removes a migration note about ToBatchPageAsync’s valueSelector.

Changes:

  • Add Page<T>.Items with optional constructor-provided backing store and fallback derivation from Entries.
  • Thread the optional items parameter through ValueCursorPage, ElementCursorPage, and EF ToPageAsync/CreateValueCursorPage.
  • Documentation formatting updates in the HotChocolate v16 migration guide (including removal of a ToBatchPageAsync note).

Reviewed changes

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

Show a summary per file
File Description
website/src/docs/hotchocolate/v16/migrating/migrate-from-15-to-16.md Adjusts migration guide headings/sections; removes a ToBatchPageAsync migration note.
src/GreenDonut/src/GreenDonut.Data.Primitives/Page.cs Re-adds Items to Page<T> with lazy derivation and new ctor parameter.
src/GreenDonut/src/GreenDonut.Data.Primitives/ValueCursorPage.cs Pass-through support for optional precomputed items.
src/GreenDonut/src/GreenDonut.Data.Primitives/ElementCursorPage.cs Pass-through support for optional precomputed items.
src/GreenDonut/src/GreenDonut.Data.EntityFramework/Extensions/PagingQueryableExtensions.cs Captures immutable items once and passes through to avoid re-derivation when Items is accessed.
Comments suppressed due to low confidence (1)

src/GreenDonut/src/GreenDonut.Data.Primitives/Page.cs:111

  • Page<T>.Items has been reintroduced, but there are existing PageTests covering cursor behavior and empty pages without any assertions around the new Items property. Adding a couple of tests that Items matches the original input (for Page.Create(...)) and is correctly derived from Entries would help prevent regressions.
    public ImmutableArray<T> Items => _items ??= CreateItemsFromEntries(Entries);

    /// <summary>
    /// Gets the number of items in this page.
    /// </summary>
    public int Count => Entries.Length;

    /// <summary>
    /// Gets the item at the specified index.
    /// </summary>
    /// <param name="index">
    /// The zero-based index of the item.
    /// </param>
    public T this[int index] => Entries[index].Item;

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/GreenDonut/src/GreenDonut.Data.Primitives/Page.cs
Comment thread src/GreenDonut/src/GreenDonut.Data.Primitives/Page.cs
Comment thread src/GreenDonut/src/GreenDonut.Data.Primitives/Page.cs
Comment thread src/GreenDonut/src/GreenDonut.Data.Primitives/Page.cs
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (299c245) to head (0c117b9).

Additional details and impacted files
@@     Coverage Diff      @@
##   main   #9420   +/-   ##
============================
============================

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tobias-tengler tobias-tengler force-pushed the tte/readd-items-to-page branch from 76f30de to 8288515 Compare March 23, 2026 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📚 documentation This issue is about working on our documentation. 🌶️ green donut

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants