> For the complete documentation index, see [llms.txt](https://faction-os.gitbook.io/faction-os-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://faction-os.gitbook.io/faction-os-docs/.spec_system/archive/phases/phase_21/session_03_orchestration_command_center_expansion.md).

# Session 03: Orchestration Command Center Expansion

**Session ID**: `phase21-session03-orchestration-command-center-expansion` **Package**: apps/web **Status**: Complete **Estimated Tasks**: \~18-25 **Estimated Duration**: 2-4 hours

***

## Objective

Make the primary Orchestration open path expose the actual Command Center workbench.

***

## Scope

### In Scope (MVP)

* Change the primary Orchestration open label from details language to a working-surface label such as `Open Command Center` or `Open full Orchestration`.
* Route the primary open action through the shared expanded bottom-rail state.
* Ensure expanded Orchestration shows the existing `OrchestrationTabs` and `CommandCenterPanes` implementation.
* Prove Campaigns, File/Git, Attention, Executors, Federation, and Metrics are reachable in expanded mode.
* Keep `OrchestrationDetailPortal` only as a secondary inspector if retained.
* Update Orchestration tests that currently treat details popup behavior as the primary path.

### Out of Scope

* Backend orchestration execution changes.
* New Command Center workbenches.
* Duplicating `OrchestrationPanel` or `OrchestrationShell`.

***

## Prerequisites

* [x] Sessions 01 and 02 completed.
* [x] Current Orchestration local state and hydration effects reviewed.
* [x] Existing Orchestration panel tests identified for update.

***

## Deliverables

1. Primary Orchestration open path that opens the expanded Command Center.
2. Updated Orchestration tests for Campaigns visibility, tab preservation, and no duplicate hydration.
3. Secondary details inspector behavior retained, renamed, or demoted without being the main user path.

***

## Folded Source Details

The source investigation found that the real Command Center is already inside the bottom rail, while the current popup is only a details/status inspector. This session owns making the primary Orchestration open action expose the actual workbench.

Code evidence to preserve:

* `apps/web/src/components/orchestration/OrchestrationShell.tsx:2162` places the real command-center content inside a `mobile-scroll-region h-0 min-h-0 flex-1` scroller.
* `apps/web/src/components/orchestration/OrchestrationTabs.tsx:216` renders the Command Center tablist.
* `apps/web/src/components/orchestration/OrchestrationTabs.tsx:252` renders the active tab panel, including where the `Campaigns` tab lives.
* `apps/web/src/components/orchestration/OrchestrationHeader.tsx:60` currently defines the popup trigger as `Open Orchestration details`, which is not the right primary label.
* `apps/web/src/components/orchestration/OrchestrationShell.tsx:2282` opens `OrchestrationDetailPortal`, which receives queue/template/lineage/guarded state views but not the full `OrchestrationTabs` workbench.
* `apps/web/src/components/orchestration/OrchestrationShell.tsx:357` keeps `detailsOpen` local, line 358 keeps `terminalDrawerOpen` local, and lines 359-360 keep selected Attention/Campaign ids local.
* `apps/web/src/store/useGameStore.ts:385-386` stores `commandCenter.activeTab` and `commandCenter.selectedDetail` globally, with setters at lines 2366 and 2375.
* `apps/web/tests/OrchestrationPanel.test.tsx:2334` currently proves the details popup renders state summary, not full launcher semantics.

Implementation details to preserve:

* Rename the primary open action to a working-surface label such as `Open Command Center` or `Open full Orchestration`.
* Route the primary header/open action through the shared bottom-rail expansion state instead of local details-popup state.
* The expanded surface must include `OrchestrationTabs` and `CommandCenterPanes`, including `Campaigns`, `File/Git`, `Attention`, `Executors`, `Federation`, and `Metrics`.
* Keep `OrchestrationDetailPortal` only as a secondary state inspector if it still has product value.
* Never implement this by rendering a second `<OrchestrationPanel />` or a second `OrchestrationShell`; that would duplicate hydration, diagnostics, lineage roster fetches, filters, selected ids, terminal drawer state, and local result state.

End-to-end delivery bar for this session:

* The user outcome is that the natural Orchestration open action answers "where do I use Campaigns?" by showing the real Command Center workbench.
* The visible result must include the Campaigns tab and the other existing workbench tabs in the focused surface.
* Recovery and state preservation must be proven by close/reopen tests, no duplicate hydration tests, and local selected row/drawer-state checks.

***

## Success Criteria

* [x] Expanded Orchestration includes `data-testid="command-center-tab-campaigns"`.
* [x] Changing tabs in expanded mode updates `commandCenter.activeTab`.
* [x] Close and reopen preserves the intended tab plus local selected campaign/attention state.
* [x] Expansion does not trigger duplicate command-center hydration, diagnostics, or lineage fetches.
* [x] The visible user path answers where Campaigns is operated.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://faction-os.gitbook.io/faction-os-docs/.spec_system/archive/phases/phase_21/session_03_orchestration_command_center_expansion.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
