---
phase: 06.3
plan: "08"
subsystem: rendering
tags: [client, nameplate, d45, e2e, unit]
requires:
  - phase: "06.3-02"
    provides: "Exported NAMETAG_OFFSET_Y used by nameplate diagnostics"
provides:
  - "D-45 Plan A nameplate offset retuned from 16 to 1"
  - "Unit and Playwright expectations updated with legacy source citation"
affects: [phase-06.3, D-45, Nameplate, cli-08-uat]
tech-stack:
  added: []
  patterns: ["Nameplate visual expectations cite extracted Draw.dnd.json rather than mirroring implementation blindly"]
key-files:
  created: []
  modified:
    - apps/client/src/render/Nameplate.ts
    - apps/client/src/__test__/nameplate.test.ts
    - apps/client/test/e2e/cli-08-nameplate-offset.e2e.test.ts
key-decisions:
  - "Kept the existing follow() formula and changed only NAMETAG_OFFSET_Y from 16 to 1."
patterns-established:
  - "Use NAMETAG_OFFSET_Y export for code-level consumers, but e2e derives the expected value independently."
requirements-completed:
  - REQ-CLI-04
  - REQ-CLI-08
duration: 12 min
completed: 2026-05-14
---

# Phase 06.3 Plan 08: D-45 Plan A Nameplate Offset Summary

**Nameplate placement now uses `NAMETAG_OFFSET_Y = 1` with unit and e2e assertions tied to the legacy Draw.dnd.json source**

## Performance

- **Duration:** 12 min
- **Started:** 2026-05-14T09:11:00Z
- **Completed:** 2026-05-14T09:23:00Z
- **Tasks:** 3
- **Files modified:** 3

## Accomplishments

- Changed `NAMETAG_OFFSET_Y` from `16` to `1`.
- Updated `nameplate.test.ts` expected Y values to `spriteY - spriteHeight - 1`.
- Updated `cli-08-nameplate-offset.e2e.test.ts` to cite `Draw.dnd.json` and use an independent `NAMETAG_OFFSET_Y = 1` expectation with ±2 px tolerance.

## Task Commits

1. **Task 1/2/3: D-45 Plan A offset and tests** - `6b91c86` (`fix(06.3-08)`)

## Files Created/Modified

- `apps/client/src/render/Nameplate.ts` - Retuned exported `NAMETAG_OFFSET_Y` to 1 and documented the Phaser descender-padding root cause.
- `apps/client/src/__test__/nameplate.test.ts` - Updated unit expectations and source comments.
- `apps/client/test/e2e/cli-08-nameplate-offset.e2e.test.ts` - Updated Playwright expected position derivation and canonical source comments.

## Decisions Made

- Preserved the formula shape `textY = spriteY - spriteHeight - NAMETAG_OFFSET_Y`; only the constant changed.
- Used `spriteTop - 1` in the e2e test rather than double-subtracting sprite height, because `spriteTop` is already `spriteY - spriteHeight`.

## Deviations from Plan

### Auto-fixed Issues

**1. [Rule 1 - Bug] Corrected the e2e expectedY formula while applying the plan snippet**
- **Found during:** Task 2.
- **Issue:** The plan snippet said `expectedY = spriteTop - spriteHeight - NAMETAG_OFFSET_Y`, but `spriteTop` already subtracts `spriteHeight`.
- **Fix:** Used `expectedY = spriteTop - NAMETAG_OFFSET_Y`, equivalent to `spriteY - spriteHeight - 1`.
- **Files modified:** `apps/client/test/e2e/cli-08-nameplate-offset.e2e.test.ts`
- **Verification:** Playwright listed the nameplate-offset test and client unit suite passed.
- **Committed in:** `6b91c86`

---

**Total deviations:** 1 auto-fixed (1 formula bug in plan snippet).
**Impact on plan:** The implemented assertion matches the unchanged production formula and the canonical source comment.

## Issues Encountered

- `pnpm e2e --list` is not a root script in this repo on Windows; equivalent `pnpm --filter @rebno/client exec playwright test --list` successfully listed `cli-08-nameplate-offset.e2e.test.ts`.

## Verification

- `pnpm --filter @rebno/client test --run -- --reporter=verbose` - PASS, 26 test files passed, 190 tests passed, 4 todo.
- `pnpm --filter @rebno/client exec playwright test --list | Select-String "nameplate-offset"` - PASS, listed the nameplate-offset e2e test.

## User Setup Required

None - no external service configuration required.

## Next Phase Readiness

Ready for staging visual UAT and downstream D-45 Plan B/C work.

---
*Phase: 06.3*
*Completed: 2026-05-14*
