Remove `category` from `Component` config entities, add `ComponentSourceInterface::determineDefaultFolder()` instead
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3549726. --> Reported by: [wim leers](https://www.drupal.org/user/99777) Related to !246 >>> <h3 id="overview">Overview</h3> <p>As explained in detail in <a href="https://git.drupalcode.org/project/canvas/-/merge_requests/106#note_597908">this MR comment</a> on <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/canvas/-/work_items/3545716" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/canvas/-/work_items/3545716</a></span>, the use and importance of <code>category</code> has almost completely evaporated since its introduction in <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/experience_builder/issues/3459088" title="Status: Closed (fixed)">#3459088: Every XB `Component` config entity should have a `category` property</a></span>.</p> <p>It used to have an impact even on the UI, but first <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/canvas/-/work_items/3540576" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/canvas/-/work_items/3540576</a></span> and later <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/canvas/-/work_items/3545716" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/canvas/-/work_items/3545716</a></span> made it have zero (direct) effect.</p> <h3 id="proposed-resolution">Proposed resolution</h3> <p>We should:</p> <ol> <li>Delete <code>category</code> from the <code>Component</code> config entity.</li> <li>Delete <code>Component(Interface)::getCategory()</code></li> <li>Add <code>ComponentSourceInterface::determineDefaultFolder()</code></li> </ol> <p>because there's only 2 times <code>::getCategory()</code> is called:</p> <ol> <li><code>\Drupal\canvas\Entity\Component::postSave()</code>, to place the updated <code>Component</code> in the appropriate <code>Folder</code>, if any</li> <li><code>\Drupal\canvas\Entity\Component::preDelete()</code>, to remove the deleted <code>Component</code> from its <code>Folder</code>, if any.</li> </ol> <p>(That second call is AFAICT even wrong, because the user could've moved it to a different <code>Folder</code>!)</p> <p>So, really, only 1 actual usage. And it's happening whenever the <code>Component</code> is created or updated, i.e. when something in the source has changed. So &hellip; then it makes much more sense to have this information NOT be stored in <code>Component</code> config entities at all times, and just computed/retrieved by the <code>ComponentSource</code> plugin on the rare occassions that it is necessary.</p> <h3 id="ui-changes">User interface changes</h3> > Related issue: [Issue #3459088](https://www.drupal.org/node/3459088)
issue