> 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_23/session_06_battlefield_camp_layer.md).

# Session 06: Battlefield Camp Layer

**Session ID**: `phase23-session06-battlefield-camp-layer` **Package**: apps/web **Status**: Not Started **Estimated Tasks**: \~22 **Estimated Duration**: 2-4 hours

***

## Objective

Render prioritized Legion camps on the battlefield as accessible, honest, reduced-motion-safe UI below hero tokens.

***

## Scope

### In Scope (MVP)

* Create `apps/web/src/components/battlefield/CampLayer.tsx`.
* Integrate `CampLayer` into `apps/web/src/components/battlefield/Battlefield.tsx` while keeping the battlefield file thin.
* Render camps as native buttons with tier, HP, issue count, sector label, and stable sector-cell placement.
* Connect click and keyboard activation to Quest Board inspection and Banish callbacks from Session 05.
* Add `apps/web/tests/Battlefield.test.tsx` coverage for camp rendering, callbacks, ordering, Champion Mode, and reduced motion.

### Out of Scope

* Dispatch Scouts ceremony.
* Golden Age behavior.
* Live combat playback.
* New art assets.
* Required new audio.
* Later effects layers.

***

## Detailed Requirements

* Camps are readable at a glance:
  * Camp size and label communicate tier: camp, fort, or citadel.
  * HP is the aggregate issue weight from Session 01.
  * The HP chip is visible in normal and reduced-motion modes.
  * Camp markers sit below hero tokens so heroes remain foreground actors.
  * Large repositories must show a handful of major fronts, not hundreds of sprites.
  * Small repositories must still produce a readable board without inventing issues.
* `CampLayer` props should be explicit so the component remains easy to test:

  ```ts
  interface CampLayerProps {
    camps: readonly RankedLegionCamp[];
    reduceMotion: boolean;
    onInspectCamp: (campId: string, issueIds: readonly string[]) => void;
    onBanishCamp: (campId: string, issueIds: readonly string[]) => void;
  }
  ```
* Render each camp as a native `button`.
* Use an accessible name with tier, HP, issue count, and sector label.
* Position by stable sector cell, not random runtime order.
* Keep camps below hero tokens and above the board backdrop.
* Use one z-index band for camps so effects in later phases can stack above them without rewriting this layer.
* Include a compact HP chip and issue-count chip.
* Entrenched camps render as quieter acknowledged debt: muted color or opacity, smaller emphasis, or a sector-edge placement. They remain keyboard accessible and inspectable, but they should not read as fresh shouting threats.
* Visual v1 is CSS-only. Use a simple tent-cluster or fortified silhouette, existing palette tokens, and tier-scaled size.
* Do not add new art.
* A normal-motion camp may flicker or breathe subtly, but it must never be the only way to read severity, HP, or issue count.
* In reduced-motion mode, remove flicker, pulse, travel, and looping motion.
* Reduced-motion camps use static markers, numeric HP chips, issue-count chips, and tier by size or label.
* Camps join heroes in the keyboard tab order.
* The existing empty-terrain clear selection affordance stays below camps.
* Camp labels and chips must not obscure hero tokens or hero labels at common desktop and mobile board sizes.
* Add `data-testid` hooks for camp count, individual camps, HP, tier, Golden Age, and reduced-motion behavior. Golden Age-specific hooks may be completed in Session 07 if that state owns the DOM.
* Board-internal order for this phase:
  1. board art, grid, vignette, and empty-terrain clear-selection surface
  2. camp layer
  3. hero token layer
  4. alert pulse ring owned by the current projection focus
* Later effects layers must be able to slot above camps without moving the camp API or changing how camps inspect into Quest Board issues.
* Champion Mode presentation:
  * One or two active heroes should not be surrounded by dozens of camps.
  * Render only the highest-priority camps for the visible roster size from Session 02.
  * Use singular copy for one-hero play: `your champion` style language, not army language.
  * For one or two heroes, visual richness should favor the hero and the nearest few camps rather than filling the whole board.
* Camp copy should frame visible fronts, sectors, and current camp issue counts. Do not show a demoralizing total-remaining-debt counter across the whole repository.

***

## Required Tests

* `apps/web/tests/Battlefield.test.tsx`
  * camp layer renders accessible camp buttons
  * camp count respects Champion Mode limits
  * camps sit below hero tokens
  * camps do not remove empty-terrain clearing
  * camp click opens or filters Quest Board state
  * keyboard activation reaches the same inspection path
  * reduced-motion marker removes motion-only treatment
  * HP and issue-count chips render in normal and reduced-motion modes
  * tier is readable without motion
  * entrenched camps render as muted or edge-placed while remaining inspectable
  * camp labels and chips avoid hero token and label occlusion at common desktop and mobile board sizes

***

## Prerequisites

* [ ] Session 02 ranking selectors are implemented.
* [ ] Session 03 projection camps are available.
* [ ] Session 05 Quest Board callbacks are available.

***

## Deliverables

1. `apps/web/src/components/battlefield/CampLayer.tsx`.
2. Battlefield integration in `Battlefield.tsx`.
3. Battlefield tests covering camp rendering, callbacks, ordering, Champion Mode, and reduced motion.

***

## Dependencies / Notes

* Depends on Session 02 ranking selectors, Session 03 projection camps, and Session 05 Quest Board callbacks.
* Dispatch Scouts ceremony, Golden Age behavior, live combat playback, new art assets, dynamic audio, and later effects layers are out of scope.

***

## Success Criteria

* [ ] Camps are readable at a glance, keyboard accessible, and inspect into the real camp issue set.
* [ ] Camp markers do not obscure hero tokens or labels at common desktop and mobile board sizes.
* [ ] Entrenched camps are de-emphasized without becoming fake boss, reward, or progress state.
* [ ] Reduced-motion mode has complete static equivalents with no motion-only meaning.
* [ ] Battlefield code does not absorb reconciliation, ranking, or Quest Board business logic.


---

# 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_23/session_06_battlefield_camp_layer.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.
