Initial Commit
This commit is contained in:
64
openspec/changes/enterprise-gaming-r3f-ui/proposal.md
Normal file
64
openspec/changes/enterprise-gaming-r3f-ui/proposal.md
Normal file
@@ -0,0 +1,64 @@
|
||||
# OpenSpec Change: enterprise-gaming-r3f-ui
|
||||
|
||||
- **Change ID**: enterprise-gaming-r3f-ui
|
||||
- **Package**: `@suaveplan/r3f-ui`
|
||||
- **Category**: gaming/gameplay
|
||||
- **Target path**: `gaming/gameplay/r3f-ui`
|
||||
- **Status**: PROPOSED
|
||||
- **Date**: 2026-04-24
|
||||
|
||||
---
|
||||
|
||||
## Summary
|
||||
|
||||
Deliver `@suaveplan/r3f-ui` on the genesis branch from scratch at enterprise quality. The package provides HTML/React UI components embedded into 3D space via React Three Fiber: `Billboard3D` always-facing panel with configurable lock-axis, `WorldLabel` text label anchored to a 3D point with screen-edge clamping, `HealthBar3D` segmented progress bar above an entity, `InteractionPrompt` contextual action tooltip with keyboard hint, `Tooltip3D` hover-triggered tooltip, and `RadialMenu` circular context menu. All components use `@react-three/drei`'s `<Html>` for crisp GPU-independent rendering. Genesis adds 100% coverage and Storybook stories.
|
||||
|
||||
---
|
||||
|
||||
## Available workspace deps
|
||||
|
||||
`@suaveplan/error`, `@suaveplan/types`, react, `@react-three/fiber`, `@react-three/drei`, three.
|
||||
|
||||
---
|
||||
|
||||
## Public API surface
|
||||
|
||||
```ts
|
||||
function Billboard3D(props: Billboard3DProps): JSX.Element
|
||||
// position, lockX, lockY, lockZ, children
|
||||
|
||||
function WorldLabel(props: WorldLabelProps): JSX.Element
|
||||
// position, text, clampToEdge, style
|
||||
|
||||
function HealthBar3D(props: HealthBar3DProps): JSX.Element
|
||||
// value, max, segments, width, height, colors
|
||||
|
||||
function InteractionPrompt(props: InteractionPromptProps): JSX.Element
|
||||
// label, keyHint, visible, position
|
||||
|
||||
function Tooltip3D(props: Tooltip3DProps): JSX.Element
|
||||
// content, triggerRef, offset
|
||||
|
||||
function RadialMenu(props: RadialMenuProps): JSX.Element
|
||||
// items: RadialMenuItem[], onSelect, open, position
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## File layout
|
||||
|
||||
```text
|
||||
gaming/gameplay/r3f-ui/
|
||||
package.json / tsconfig.json / vitest.config.ts
|
||||
src/
|
||||
index.ts / error-codes.ts
|
||||
types/common.ts + md
|
||||
components/
|
||||
Billboard3D/ (tsx + md + test + stories + index)
|
||||
WorldLabel/ (tsx + md + test + stories + index)
|
||||
HealthBar3D/ (tsx + md + test + stories + index)
|
||||
InteractionPrompt/ (tsx + md + test + stories + index)
|
||||
Tooltip3D/ (tsx + md + test + stories + index)
|
||||
RadialMenu/ (tsx + md + test + stories + index)
|
||||
tests/integration.test.ts
|
||||
```
|
||||
36
openspec/changes/enterprise-gaming-r3f-ui/tasks.md
Normal file
36
openspec/changes/enterprise-gaming-r3f-ui/tasks.md
Normal file
@@ -0,0 +1,36 @@
|
||||
# Tasks: enterprise-gaming-r3f-ui
|
||||
|
||||
## 0. Pre-flight (non-negotiable)
|
||||
|
||||
- [ ] 0.1 Confirm clean working tree (`git status` reports nothing) and no in-flight worktrees with uncommitted work (`git worktree list` then `git status` in each)
|
||||
- [ ] 0.2 If any worktrees exist under `.claude/worktrees/`, account for each one: still-active agent, work-pending-merge, or stale-and-prune. Stale worktrees MUST be removed (`git worktree remove`) before opening a new one — code that has been lost twice on main is the failure mode this guards against.
|
||||
- [ ] 0.3 Confirm the package set in `MANIFEST.md` matches `find packages -maxdepth 3 -name package.json` count. Drift here means a prior change archived without regenerating the manifest.
|
||||
|
||||
## Phase 1 — Scaffold
|
||||
|
||||
- [ ] Create `gaming/gameplay/r3f-ui/` (`@suaveplan/r3f-ui`, `0.1.0`, `sideEffects: false`)
|
||||
|
||||
## Phase 2 — Types + error codes
|
||||
|
||||
- [ ] `src/types/common.ts` + `common.md`
|
||||
- [ ] `src/error-codes.ts`
|
||||
|
||||
## Phase 3 — Components
|
||||
|
||||
- [ ] `Billboard3D` — always-facing panel, lock-axis config, drei Html wrapper
|
||||
- [ ] `WorldLabel` — 3D-anchored text with screen-edge clamping
|
||||
- [ ] `HealthBar3D` — segmented progress bar above entity
|
||||
- [ ] `InteractionPrompt` — contextual action tooltip with keyboard hint
|
||||
- [ ] `Tooltip3D` — hover-triggered tooltip
|
||||
- [ ] `RadialMenu` — circular context menu with item icons
|
||||
- [ ] Tests + Storybook stories for each
|
||||
|
||||
## Phase 4 — Integration tests
|
||||
|
||||
- [ ] `tests/integration.test.ts` — visibility, position tracking, radial selection
|
||||
|
||||
## Phase 5 — Pre-publish gate
|
||||
|
||||
- [ ] `bunx turbo lint typecheck test --filter=@suaveplan/r3f-ui` green
|
||||
- [ ] 100% coverage
|
||||
- [ ] Publish: `bun scripts/publish.ts --package @suaveplan/r3f-ui`
|
||||
Reference in New Issue
Block a user