Overview

There is no way to assign or update a code component's folder locally when using the Canvas CLI. With no local representation of folder assignment, developers have no way to manage folder structure as part of their local workflow, and the workbench cannot categorize components correctly.

Proposed resolution

Store folder assignment in component.yml and sync it on pull and push. The folder field could be a string, applied to both the component library and the code section, or an object that allows setting the folder independently for each:

# Option A: string (same folder for both)
folder: Banners

# Option B: object (separate folders per context)
folder:
  library: Banners
  code: UI Components

npx canvas pull should write whichever form reflects the state in Drupal. npx canvas push should read the field and apply it when placing the component.

User interface changes

Issue fork canvas-3586988

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

lauriii created an issue. See original summary.

lauriii’s picture

Issue summary: View changes