Skip to content

Sidebar fields get moved into tabs structure #50

@tommyflint-pers

Description

@tommyflint-pers

Plugin version

0.10.0

Payload version

3.64.0

Auth.js version

5.0.0.beta

Describe the bug

When defining fields with admin.position: 'sidebar' on a user collection, they get merged into the "General" tab instead of staying at the root level.

Current behavior:
In index.ts , restFields (user-defined fields that don't match existing field names) are pushed into the first tab:

(collection.fields[1] as TabsField).tabs[0].fields.push(...restFields);

This breaks sidebar positioning since Payload requires sidebar fields to be at the collection's root level.

Expected behavior:
Fields with admin.position: 'sidebar' should remain at the root level of collection.fields.

To Reproduce

  1. Create a user collection with a sidebar field:
const Users: CollectionConfig = {
  slug: "users",
  fields: [
    {
      name: "status",
      type: "select",
      options: ["active", "inactive"],
      admin: { position: "sidebar" },
    },
  ],
};
  1. Add authjsPlugin to your Payload config
  2. Field appears in the "General" tab instead of the sidebar

Additional context / Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions