Skip to content

[Release] v0.4.0#3

Merged
NishargShah merged 39 commits into
masterfrom
canary
Jun 25, 2026
Merged

[Release] v0.4.0#3
NishargShah merged 39 commits into
masterfrom
canary

Conversation

@NishargShah

Copy link
Copy Markdown
Contributor

0.4.0 (2026-06-25)

🚀 Features

  • sanity-plugin-structure-tool:
    • Added support for custom actions via menuItems and collapsible sections via menuItemGroups in pane header menus.
    • Added dynamic callback support to menuItems and menuItemGroups with access to a prev parameter containing default items from Sanity Studio.
    • Added isVisible configuration option (boolean or callback) to dynamically hide/show list items.
    • Added support for separate parent and child display titles in the title option (using title: { parent: ..., child: ... }).
    • Added workspace and role filter evaluation to control visibility of list items per workspace/user role.
    • Completed JSDoc documentation comprehensively for all exported and internal functions, interfaces, and types.
  • docs:
    • Added examples and documentation for menuItems, menuItemGroups, isVisible, and the parent/child pane title configuration format.
  • studio:
    • Added example configurations for custom action menus, groups, parent/child titles, and visibility toggles in the reference studio.

Copilot AI review requested due to automatic review settings June 25, 2026 16:44
@vercel

vercel Bot commented Jun 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sanity-structure-tool Ready Ready Preview, Comment Jun 25, 2026 5:21pm
sanity-structure-tool-studio Ready Ready Preview, Comment Jun 25, 2026 5:21pm

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Release v0.4.0 primarily expands the sanity-plugin-structure-tool configuration surface (menu actions/groups, visibility gating, parent/child titles) and refactors the internal structure rendering pipeline to support these features, alongside documentation and version bumps across the monorepo.

Changes:

  • Add menuItems / menuItemGroups (with prev support), isVisible, and parent/child title support to list item definitions.
  • Refactor structure rendering: replace the old workspace-list-item expansion with a centralized renderListItems pipeline and per-item renderers.
  • Update docs, changelog, and package versions for the 0.4.0 release (plus workspace/tooling bumps).

Reviewed changes

Copilot reviewed 76 out of 77 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
pnpm-workspace.yaml Bump catalog dep and adjust pnpm workspace settings.
packages/sanity-plugin-structure-tool/src/utils/string/common.ts Add JSDoc for string utilities.
packages/sanity-plugin-structure-tool/src/types/lib.types.ts Add JSDoc for shared utility types.
packages/sanity-plugin-structure-tool/src/types/index.ts Adjust exported public types.
packages/sanity-plugin-structure-tool/src/structure/types/listItemDefinitions.types.ts New shared list-item definition types (children/id/title/workspaces/roles/etc.).
packages/sanity-plugin-structure-tool/src/structure/types/listItemCore.types.ts Remove old workspaces/roles core type definitions (moved/refactored).
packages/sanity-plugin-structure-tool/src/structure/types/listItem.types.ts Expand list item core config (menu items/groups, isVisible, title object, etc.).
packages/sanity-plugin-structure-tool/src/structure/types/common.types.ts Add shared types (common params, ListItemReturn, helpers for generic params).
packages/sanity-plugin-structure-tool/src/structure/templates/templates.types.ts Refine/export template parameter types and JSDoc.
packages/sanity-plugin-structure-tool/src/structure/templates/templates.ts Refactor templates resolver to use flattened list items.
packages/sanity-plugin-structure-tool/src/structure/structureToolPlugin/structureToolPlugin.types.ts Expand and document plugin parameter/type model.
packages/sanity-plugin-structure-tool/src/structure/structureToolPlugin/structureToolPlugin.ts Add JSDoc and internal generic defaults typing.
packages/sanity-plugin-structure-tool/src/structure/structure/structure.types.ts Simplify structure params typing and integrate plugin params type.
packages/sanity-plugin-structure-tool/src/structure/structure/structure.ts Refactor root structure resolver to use renderListItems.
packages/sanity-plugin-structure-tool/src/structure/renderListItems/renderListItems.types.ts New types for the centralized list-item render pipeline.
packages/sanity-plugin-structure-tool/src/structure/renderListItems/renderListItems.ts New centralized list-item rendering + access checks + renderer dispatch.
packages/sanity-plugin-structure-tool/src/structure/renderListItem/renderListItem.types.ts Remove old single-item renderer types (replaced by new pipeline).
packages/sanity-plugin-structure-tool/src/structure/renderListItem/renderListItem.ts Remove old single-item renderer implementation (replaced by new pipeline).
packages/sanity-plugin-structure-tool/src/structure/listItems/listItems.types.ts New shared “list item key” param typing for renderer functions.
packages/sanity-plugin-structure-tool/src/structure/listItems/getSingleton.ts New renderer for singleton items.
packages/sanity-plugin-structure-tool/src/structure/listItems/getRaw.ts New renderer for raw items.
packages/sanity-plugin-structure-tool/src/structure/listItems/getListing.ts New renderer for schemaType listings (menu items/groups support).
packages/sanity-plugin-structure-tool/src/structure/listItems/getFilters.ts New renderer for GROQ-filtered lists (menu items/groups support).
packages/sanity-plugin-structure-tool/src/structure/listItems/getDivider.ts New renderer for divider items.
packages/sanity-plugin-structure-tool/src/structure/listItems/getComponent.ts New renderer for component items (menu items/groups support).
packages/sanity-plugin-structure-tool/src/structure/listItems/getChildren.ts New renderer for nested children/folder items (recursive).
packages/sanity-plugin-structure-tool/src/structure/getWorkspaceListItem/getWorkspaceListItem.types.ts Remove old workspace list item expansion types (replaced by access helpers + new pipeline).
packages/sanity-plugin-structure-tool/src/structure/getWorkspaceListItem/getWorkspaceListItem.ts Remove old workspace list item expansion logic (replaced by new pipeline).
packages/sanity-plugin-structure-tool/src/structure/getComputedListItems/getComputedListItems.types.ts Remove old computed-list-items typing (replaced/moved).
packages/sanity-plugin-structure-tool/src/structure/getComputedListItems/getComputedListItems.ts Remove old computed-list-items implementation (replaced/moved).
packages/sanity-plugin-structure-tool/src/helpers/hasWorkspacesAccess.ts New workspace-based access evaluation helper.
packages/sanity-plugin-structure-tool/src/helpers/hasRolesAccess.ts New role-based access evaluation helper.
packages/sanity-plugin-structure-tool/src/helpers/getWorkspacesWithDefaults.ts Remove old helper (superseded by new access helper).
packages/sanity-plugin-structure-tool/src/helpers/getValidListItem.ts Add JSDoc for config-value resolution helper.
packages/sanity-plugin-structure-tool/src/helpers/getTitle.ts New helper for resolving parent/child titles.
packages/sanity-plugin-structure-tool/src/helpers/getRolesWithDefaults.ts Remove old helper (superseded by new access helper).
packages/sanity-plugin-structure-tool/src/helpers/getFlatListItems.ts Rename/refactor list-item flattening helper + JSDoc.
packages/sanity-plugin-structure-tool/src/helpers/getDisplayTitle.ts New helper for computed display titles (pluralization + schema fallback).
packages/sanity-plugin-structure-tool/src/helpers/getCurrentUserRoles.ts Tighten types and add JSDoc around current-user role extraction.
packages/sanity-plugin-structure-tool/src/helpers/getContextValues.ts Add JSDoc for context normalization helper.
packages/sanity-plugin-structure-tool/src/helpers/getComputedListItems.ts New computed-value resolver for list item config fields.
packages/sanity-plugin-structure-tool/src/helpers/generateId.ts New helper for consistent list-item ID generation.
packages/sanity-plugin-structure-tool/src/factories/helpers/singletonHelper.ts Update helper typings to new list item core/definitions + add JSDoc.
packages/sanity-plugin-structure-tool/src/factories/helpers/rawHelper.ts Update helper typings to new list item core/definitions + add JSDoc.
packages/sanity-plugin-structure-tool/src/factories/helpers/listingHelper.ts Update helper typings for new list item fields (menu items/groups, isVisible, etc.).
packages/sanity-plugin-structure-tool/src/factories/helpers/index.ts Add JSDoc and reflect expanded helper set.
packages/sanity-plugin-structure-tool/src/factories/helpers/filtersHelper.ts Update helper typings to new list item core/definitions + add JSDoc.
packages/sanity-plugin-structure-tool/src/factories/helpers/dividerHelper.ts Update divider helper typing model + add JSDoc.
packages/sanity-plugin-structure-tool/src/factories/helpers/componentHelper.ts Update component helper typing model (title object, menu items/groups, etc.).
packages/sanity-plugin-structure-tool/src/factories/helpers/childrenHelper.ts Update children helper typing model (nested lists + menu items/groups + isVisible).
packages/sanity-plugin-structure-tool/src/factories/defineListItems.ts Add JSDoc for list-items factory helper.
packages/sanity-plugin-structure-tool/src/factories/defineListItem.ts Add JSDoc for list-item factory helper.
packages/sanity-plugin-structure-tool/src/constants/export.ts Add JSDoc for exported constants.
packages/sanity-plugin-structure-tool/src/constants/constants.ts Expand constants (unique id seed) + add JSDoc.
packages/sanity-plugin-structure-tool/src/constants/common.ts Add JSDoc for action-name constants.
packages/sanity-plugin-structure-tool/src/actions/SingletonAction.ts Add richer JSDoc around singleton document action filtering.
packages/sanity-plugin-structure-tool/package.json Bump to 0.4.0, expand Sanity peer range, adjust inlined deps.
package.json Bump repo version + tooling versions (pnpm, lint-staged).
docs/package.json Bump docs package + dep versions.
docs/introduction/upcoming-features.md Update upcoming-features list for shipped items.
docs/guide/list-items.md Document new list item props (menu items/groups, isVisible).
docs/examples/title.md Document new parent/child title object format.
docs/examples/menu-items.md New docs example for menuItems.
docs/examples/menu-item-groups.md New docs example for menuItemGroups.
docs/examples/is-visible.md New docs example for isVisible.
docs/.vitepress/config.ts Update nav links for new docs pages; adjust plugin usage.
configs/typescript-config/package.json Bump to 0.4.0.
configs/tsdown-config/package.json Bump to 0.4.0.
configs/prettier-config/package.json Bump to 0.4.0.
configs/lint-staged-config/package.json Bump to 0.4.0.
configs/eslint-config/package.json Bump to 0.4.0.
CHANGELOG.md Add 0.4.0 release notes.
apps/studio/src/structure/listItems.ts Update reference studio examples to cover new capabilities.
apps/studio/sanity.cli.ts Adjust Sanity CLI Vite config (tsconfig paths).
apps/studio/package.json Bump studio + deps (Sanity v6, styled-components, etc.).
.agents/AGENTS.md Add guidance to keep docs and types synchronized + JSDoc expectations.

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

Comment thread packages/sanity-plugin-structure-tool/src/helpers/getDisplayTitle.ts Outdated
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.

2 participants