Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ae56d67349
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // For main table — resolve the in-memory record set per scope. | ||
| $inMemoryRecords = match ($scope) { | ||
| 'page' => $this->getTableRecords(), | ||
| 'selection' => $this->getSelectedRecords(), |
There was a problem hiding this comment.
Use aggregate-aware records for selection summaries
When the footer is switched to selection, this path fetches selected rows via getSelectedRecords(), which uses the raw table query instead of buildTableQuery(). For aggregate columns such as Column::make('items_total')->sums('items', 'line_total')->summarizeSum(), the selected models therefore lack the items_sum_line_total attribute that HasSummary plucks, so selection totals render as empty/0 even though page/query scopes work.
Useful? React with 👍 / 👎.
|
|
||
| // Fast path: sub-rows were eager-loaded for the whole page in one query | ||
| // (see eagerLoadSubRows). Read from memory instead of querying per parent. | ||
| if ($record->relationLoaded($relation)) { |
There was a problem hiding this comment.
Apply sub-row filters before using loaded relations
If the table query or caller already eager-loads the sub-row relation, this fast path returns the loaded collection before the sub-row filter block below can run. In a subRowsFilterable() table backed by a query like Invoice::with('items'), active rows.subRowFilters are ignored for both the displayed children and the show-more count, because relationLoaded() short-circuits the filtered query path.
Useful? React with 👍 / 👎.
No description provided.