Ship traffic faction highlight on selection
- Lenguaje dominante
- TypeScript
- Estrellas
- 0
- Forks
- 1
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
> **Skills:** TypeScript · React Three Fiber · subscribing to Zustand
> **Time:** ~3 hours
> **Good for:** R3F devs who want to extend the new ship-traffic system
> **Difficulty:** Intermediate
---
## Context
`components/galaxy/ShipTraffic.tsx` (shipped in v0.10) runs ~240 instanced ships across 5 hyperspace lanes during the Galactic Civil War era, in 3 buckets (cream civilian, alarm-red Imperial, accent-blue Rebel).
When the user selects a faction-aligned entity (e.g. "Imperial Star Destroyer" or "Princess Leia"), nothing changes about the ships. We could highlight the selection's faction.
## Goal
When an entity with a resolvable faction is selected:
- That faction's bucket renders at full opacity + brightened color
- Other faction buckets dim to ~0.4 opacity
- Civilian bucket stays unaffected (always neutral)
- Smooth 400ms transition via Motion or `useFrame` lerp
## Where to start
- `ShipTraffic.tsx` — currently each bucket has fixed opacity
- `lib/data/ship-classes.ts` — has `faction` per class. Map faction → ship class set.
- Resolve selected entity's faction: from `entity.affiliations[]` if present, OR from a hard-coded mapping (e.g. `person/4` Vader → "empire", `person/5` Leia → "rebel"). Document the heuristic.
## Acceptance criteria
- Pick Vader / select an Imperial ship → Imperial bucket bright, Rebel dim, civilian normal
- Pick Leia / select an X-wing → Rebel bright, Imperial dim
- Deselecting → all buckets return to baseline opacity
- Smooth transition, not a flicker
- Reduced motion → instant change
Guía de contribución
Evaluación
Este issue todavía no se ha evaluado.