Local tasks for scopes should be dynamically generated
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3585041. -->
Reported by: [mglaman](https://www.drupal.org/user/2416470)
Related to !124
>>>
<p>[Tracker]<br>
<strong>Update Summary: </strong>[One-line status update for stakeholders]<br>
<strong>Check-in Date: </strong>MM/DD/YYYY<br>
<strong>Blocked by: </strong>[#XXXXXX] (New issues on new lines)<br>
<strong>Additional Collaborators: </strong> @username1, @username2<br>
<em>Metadata is used by the <a href="https://www.drupalstarforge.ai/" title="AI Tracker">AI Tracker.</a> Docs and additional fields <a href="https://www.drupalstarforge.ai/ai-dashboard/docs" title="AI Issue Tracker Documentation">here</a>.</em><br>
[/Tracker]</p>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>The local tasks are hardcoded for the scope plugins, but can be broken if a scope plugin is programmatically removed.</p>
<pre># Scope settings sub-tabs<br>ai_context.settings.scope.global:<br> route_name: ai_context.settings.scope.global<br> title: 'Global'<br> parent_id: ai_context.settings.scope_tab<br> weight: 0<br><br>ai_context.settings.scope.use_case:<br> route_name: ai_context.settings.scope.use_case<br> title: 'Use Case'<br> parent_id: ai_context.settings.scope_tab<br> weight: 10<br><br>ai_context.settings.scope.language:<br> route_name: ai_context.settings.scope.language<br> title: 'Language'<br> parent_id: ai_context.settings.scope_tab<br> weight: 20<br><br>ai_context.settings.scope.tag:<br> route_name: ai_context.settings.scope.tag<br> title: 'Tags'<br> parent_id: ai_context.settings.scope_tab<br> weight: 30<br><br>ai_context.settings.scope.site_section:<br> route_name: ai_context.settings.scope.site_section<br> title: 'Site Sections'<br> parent_id: ai_context.settings.scope_tab<br> weight: 40<br><br>ai_context.settings.scope.target_entity:<br> route_name: ai_context.settings.scope.target_entity<br> title: 'Target Entities'<br> parent_id: ai_context.settings.scope_tab<br> weight: 50</pre><h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Provide them dynamically</p>
<h3 id="summary-remaining-tasks">Target date or deadline</h3>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<h3 id="summary-ai-usage">AI usage (if applicable)</h3>
<p>[ ] AI Assisted Issue<br>
This issue was generated with AI assistance, but was reviewed and refined by the creator.</p>
<p>[ ] AI Assisted Code<br>
This code was mainly generated by a human, with AI autocompleting or parts AI generated, but under full human supervision.</p>
<p>[x] AI Generated Code<br>
This code was mainly generated by an AI with human guidance, and reviewed, tested, and refined by a human.</p>
<p>[ ] Vibe Coded<br>
This code was generated by an AI and has only been functionally tested.</p>
issue