Skip to content

Conversation

@NoOne7135
Copy link
Contributor

…view

@NoOne7135 NoOne7135 requested a review from Copilot November 28, 2025 15:16
Copilot finished reviewing on behalf of NoOne7135 November 28, 2025 15:19
Copy link
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

This PR adds a new tableRowReplace injection point that allows users to customize how each row in the list view table is rendered. This extends AdminForth's page injection system to support full row-level customization beyond the existing column-level components.

Key Changes

  • Added tableRowReplace to the list of allowed page injections in the config validator
  • Implemented custom row rendering in ResourceListTableVirtual.vue using Vue's dynamic component system
  • Added comprehensive documentation with usage examples and component contract specifications

Reviewed changes

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

File Description
adminforth/spa/src/views/ListView.vue Passes tableRowReplaceInjection prop to both table components with array handling logic
adminforth/spa/src/components/ResourceListTableVirtual.vue Implements custom row component rendering using dynamic <component> element
adminforth/modules/configValidator.ts Adds tableRowReplace to the allowed injection keys for list pages
adminforth/documentation/docs/tutorial/03-Customization/08-pageInjections.md Adds complete documentation section explaining the feature, configuration, and usage patterns

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

Comment on lines 179 to 181
:tableRowReplaceInjection="Array.isArray(coreStore.resourceOptions?.pageInjections?.list?.tableRowReplace)
? coreStore.resourceOptions.pageInjections.list.tableRowReplace[0]
: coreStore.resourceOptions?.pageInjections?.list?.tableRowReplace || null"
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

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

The tableRowReplaceInjection prop is passed to ResourceListTable but this component doesn't appear to use it. Unlike ResourceListTableVirtual which has custom row rendering logic, ResourceListTable still uses a standard <tr> element (line 86-87 in the base file). Either implement the tableRowReplace functionality in this component to match ResourceListTableVirtual, or remove this prop binding if the feature is only intended for virtual scrolling.

Suggested change
:tableRowReplaceInjection="Array.isArray(coreStore.resourceOptions?.pageInjections?.list?.tableRowReplace)
? coreStore.resourceOptions.pageInjections.list.tableRowReplace[0]
: coreStore.resourceOptions?.pageInjections?.list?.tableRowReplace || null"

Copilot uses AI. Check for mistakes.
Notes and tips:
- Requirements:
- Required <tr></tr> structure around </slot>
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

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

The documentation mentions "Required structure around " but uses incorrect syntax with </slot>. The correct syntax should be <slot /> as shown in the template example above. Update to: "Required <tr></tr> structure around <slot />"

Suggested change
- Required <tr></tr> structure around </slot>
- Required `<tr></tr>` structure around `<slot />`

Copilot uses AI. Check for mistakes.
@NoOne7135 NoOne7135 requested a review from ivictbor November 28, 2025 15:24
Copy link
Contributor

@ivictbor ivictbor left a comment

Choose a reason for hiding this comment

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

Lets make scalar type for this injection for now since there is no roadmap to make recursive wrap. For actions injection same.

- Slots
- Default slot: the table’s standard row content (cells) will be projected here. Your component can wrap or style it.
- Output
- Render a full `<tr></tr>` fragment. For simple decoration, render a single `<td :colspan="columnsCount">` and wrap `<slot />` inside your layout.
Copy link
Contributor

Choose a reason for hiding this comment

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

For simple decoration

->

For example to replace a set of cells with sincle full-width cell, render

<tr>
  <td :colspan="columnsCount">
     <slot />

? [coreStore.resourceOptions.pageInjections.list.tableBodyStart]
: []
"
:tableRowReplaceInjection="Array.isArray(coreStore.resourceOptions?.pageInjections?.list?.tableRowReplace)
Copy link
Contributor

Choose a reason for hiding this comment

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

@NoOne7135 Since we don't support array, the type of coreStore.resourceOptions?.pageInjections?.list?.tableRowReplace should not be array. Probably in future you plan to add recursive wrapping, but anyway now in config validation step if there is mroe then one element lets throw clear error that tableRowReplace has multiple components but supports only one

@devforth devforth deleted a comment from Copilot AI Dec 2, 2025
@devforth devforth deleted a comment from Copilot AI Dec 2, 2025
@devforth devforth deleted a comment from Copilot AI Dec 2, 2025
@SerVitasik SerVitasik merged commit 68c7bee into next Dec 2, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants