Skip to content

導入: 右側 command rail をゲーム内 DOM overlay に統合する #1370

Closed
9 of 10 issues completed
Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: parent
goal_ref: "右側 command rail を廃止し、LoopPhase を正本にしたゲーム内 DOM overlay UI として title / preparation / running / result / pause の画面体験を統合する"
change_kind: mixed
parent_mode: delivery-rollup
closure_mode: child-complete

Summary

現在の battle-stage と command-rail の二列構成を、Canvas 戦闘領域の内側に重なる DOM overlay UI へ段階移行する parent tracker。

Goal

右側 command rail に常時表示されている情報と操作を、LoopPhase に従う title / preparation / running / result / pause の画面単位へ分解し、通常プレイでは単一の battle surface 内で完結する UI にする。

Desired Destination

Current Validated Scope

Decisions Fixed

Quality Decision Record

  • Status: N/A
  • Decision Date: 2026-07-07
  • Does this prove the parent goal complete?: N/A
  • Reason: delivery-rollup parent のため、quality-gate 判定ではなく child 完了で close 判定する
  • Evidence: N/A
  • Next Action: child issue を依存順に実装する

Parent Closure Rule

  • delivery-rollup: Child Issues がすべて close され、旧 command rail 削除後の E2E / build verification が PASS したら close する
  • quality-gate: N/A
  • routing-map: N/A
  • decision-log: N/A
  • 非 quality-gate parent の Quality Decision Record は N/A 扱いでよく、close 判定の必須材料にしない

Child Issues

Remaining Parent Gaps

Phase Handoff Contract

  • Desired Destination: battle-stage 内 DOM overlay UI へ段階移行。Canvas は world / visual cue のみを担い、interactive control は DOM overlay が正本
  • Current Validated Scope: src/main.ts / src/ui/HudController.ts / src/style.css / relevant tests / UI IA docs
  • Remaining Parent Gaps: child ごとに本文へ列挙
  • Current Objective: child issue の Outcome に従う
  • Bounded Current Context: Canvas に interactive control を焼き込まない。pause は productPause.isPaused 由来の interruption overlay として扱う
  • Normative References: docs/product/features/ui-information-architecture.md, docs/product/features/sortie.md, docs/product/game-design.md, docs/adr/0001-architecture-baseline.md
  • Allowed Paths: child issue ごとに限定
  • Required Skills: TypeScript / DOM UI / CSS overlay / Vitest / Playwright
  • Validation Commands: child issue ごとに単一コマンドで列挙
  • Stop Conditions: implementation template の 6 定型項目を継承
  • Open Questions: [Deferred] 実装: 戦闘中ステータス(HULL/HP)を戦闘描画画面(Canvas)に集約表示する #727 の最終処理、safe margin / collapse threshold の最終値
  • Next Action: docs 境界整理 child から着手する
  • Artifact Refs: src/main.ts, src/ui/HudController.ts, src/style.css, tests/hud-controller.test.ts, tests/main-loop.test.ts, tests/e2e/m3-loop-mvp.spec.ts
  • Handoff Prompt Draft: Issue contract を正本として専用 worktree で実装する
  • Linked PR: implementation child で作成する

Outcome

Child issue contract が anchor comment の指摘を反映し、右側 command rail 廃止までの blocker 順序、pause source-of-truth、preview evidence、#727 routing が parent tracker から追跡できる状態。

Product Spec Context

product_spec_id: UI-OVERLAY-PARENT-1370
requirement_id: REQ-1370
source_task_id: TASK-1370
source_of_truth: docs/product/features/ui-information-architecture.md
diff_rationale: "#1370 anchor review comment 4903849229 により、DOM overlay 統合 parent の blocker 順序、pause source-of-truth、preview evidence、#727 routing を明確化するため"
changed_requirement_id: UI-OVERLAY-PARENT-1370
affected_sections:
  - Desired Destination
  - Current Validated Scope
  - Child Issues
  - Remaining Parent Gaps
  - Acceptance Criteria
  - Verification Commands
product_spec_change_mode: parent_tracker_contract_sync

Acceptance Criteria

Verification Commands

# AC1
$ gh issue view 1370 --json body
# AC2
$ gh issue view 1370 --json body
# AC3
$ pnpm build
# AC4
$ rg -c "command-rail" src/main.ts
# AC5
$ gh issue view 727 --json body,comments
# AC6
$ gh pr checks

Runtime Verification Applicability

decision: not_applicable
reason: parent tracker refinement のため、runtime verification は implementation child で実施する。

Allowed Paths

  • docs/product/features/ui-information-architecture.md
  • docs/product/features/sortie.md
  • docs/product/game-logic.md
  • docs/product/game-design.md
  • src/main.ts
  • src/style.css
  • src/ui/HudController.ts
  • src/ui/index.ts
  • src/ui/productPause.ts
  • tests/main-loop.test.ts
  • tests/hud-controller.test.ts
  • tests/product-pause.test.ts
  • tests/e2e/m2-combat-mvp.spec.ts
  • tests/e2e/m3-loop-mvp.spec.ts
  • tests/e2e/hud-hull-overflow.spec.ts
  • tests/e2e/product-pause.spec.ts
  • tests/e2e/screenshots/

Notes

Sub-issues

Sub-issues

9 of 10 Issues completed
Loading 10 sub-issues

Activity

  1. added
    tracking
    state/in-progress
    on Jul 7, 2026
  2. squne121 commented on Jul 7, 2026

    @squne121
    OwnerAuthor

    判定

    REQUEST_CHANGES。方向性は妥当だが、#1370 は parent contract としてまだ硬さが足りません。
    「Canvas に操作 UI を焼かず、battle-stage 内 DOM overlay に集約する」という判断は、既存の UI IA と Web 標準の両方に合っています。ただし現状の #1370 は、依存状態が stale、pause の source-of-truth が曖昧、docs conflict が未解消、AC/VC が rg 中心で弱く、実装者が「右レールを battle-stage の上に移しただけ」の状態で通せてしまいます。

    このレビューでは、#1370、子 Issue #1372–#1377、#1282、#727、PR #1365、関連コメント、src/main.ts / HudController.ts / CSS / specs / E2E / deploy workflow を確認しました。新規に pnpm は実行していません。#1282 対応 PR #1365 については、PR コメント上で最終的に typecheck / lint / test / build が PASS と記録されています。

    P0: そのまま進めると破綻する点

    1. #1282 blocker 情報が stale

    #1370 本文は #1282 を「merge 後に UI child intake」として残しており、#1373 も「#1282 が未マージの場合は着手しない」としています。
    しかし #1282 は現在 closed / completed で、PR #1365 は merged 済みです。 PR #1365 は Weapon Power、Upgrade weapon、quoteUpgrade() authority、failure copy mapping、同期 hud.render() seam を入れたと説明しており、Closes #1282 です。

    修正必須: #1370 の Remaining Parent Gaps から #1282 blocker を削除し、#1373–#1377 の state/blocked / 着手条件を更新してください。残すなら「#1282 merge 後の現行 HudController shape を前提に intake 済み」と書き換えるべきです。

    2. 「LoopPhase を screen selection の正本」と「pause screen」が矛盾している

    #1370 は LoopPhase を screen selection の正本にし、独立 uiScreen state は導入しないと固定しています。
    しかし現行 LoopPhase は title_menu / load_menu / preparation / running / result / legacy debrief だけで、pause は含みません。 PhaseTransitionSystem にも pause transition はありません。 現行 pause は productPause.isPaused という runtime-local state で、handleTogglePause() が running 中だけ entry を許可しています。

    修正案: uiScreen を追加しない方針は維持してよいですが、screen selector は次の形に明文化すべきです。

    type BattleOverlaySurface =
      | 'title'
      | 'load'
      | 'preparation'
      | 'combat'
      | 'result'
      | 'pause'
    
    function deriveBattleOverlaySurface(
      loopPhase: LoopPhase,
      isPaused: boolean,
    ): BattleOverlaySurface

    つまり、LoopPhase は phase の正本、productPause.isPaused は interruption overlay の正本です。pause まで LoopPhase だけから導出すると、現行 state model と矛盾します。

    3. #1372 の 30秒 / 120秒 conflict は実在するので docs-only child を軽視できない

    #1372 は sortie.md と game-logic.md の timer authority を整理するとしています。 これは仮説ではなく実在する conflict です。sortie.md は 30 秒 timeout を正本とし、targetTicks = ceil(30_000 / fixedDeltaMs)、duration は elapsedTicks * fixedDeltaMs と定義しています。 一方、game-logic.md は timer 120 秒を victory/termination 要件としてまだ持っています。

    修正必須: #1372 は単なる前座ではなく、#1373 以降の blocker にしてください。UI は timer / result / duration を表示するため、SSOT conflict を残すと running HUD と result screen が仕様上不安定になります。

    4. 現行 HudController は “phase screen” ではなく “全パネル常時生成 + disabled 切替”

    createHudController() は Pilot feed / Progress / Sortie / Wingmates / Armory / Pilot updates / pause status / actions を全て一括生成しています。 render() は phase に応じて button disabled を切り替えていますが、構造上は action surface が常に DOM に存在します。 現行テストも running 中に Save / Load / Reset 等が「disabled で存在する」ことを確認しています。

    これは #1374 / #1375 の「title / preparation screen」「running combat HUD」と噛み合いません。右レールを battle-stage 内に移すだけなら AC を満たしたように見えますが、UI IA が求める phase-aware overlay にはなりません。

    修正必須: 子 Issue の AC を「disabled」から「visible / hidden / inert / focusable の明示検証」に引き上げてください。特に running 中は New Game / Save / Load / Reset が tab order に残らないことを Playwright と jsdom の両方で確認すべきです。

    P1: 高リスク設計指摘

    5. overlay の pointer-events 設計が弱い

    #1373 は overlay CSS に position / inset / pointer-events foundation を追加するとしていますが、AC は position: absolute 相当の確認に留まっています。 現行 CSS では .battle-stage に position: relative がなく、overlay root もありません。

    外部仕様上、pointer-events: none はポインターイベントを下層へ通せますが、子孫は別値で targetable にできます。また、pointer-events: none だけでは Tab focus から除外されません。([MDNウェブドキュメント]1)
    したがって CSS だけでは accessibility state を制御できません。

    追加すべき実装規約:

    .battle-stage {
      position: relative;
    }
    
    .battle-ui-layer {
      position: absolute;
      inset: 0;
      pointer-events: none;
      z-index: 2;
    }
    
    .battle-ui-layer [data-battle-interactive='true'] {
      pointer-events: auto;
    }

    加えて、inactive screen は hidden または inert で tab order / accessibility tree から外すべきです。MDN は inert が click / focus / tab order / accessibility tree から対象を除外すると説明しています。([MDNウェブドキュメント]2)

    6. pause overlay / result screen の dialog semantics が未規定

    #1376 は DOM dialog semantics / focus management を Required Skills に入れていますが、AC では focus trap、focus return、aria-modal、Escape behavior の合否条件が薄いです。

    WAI-ARIA APG の modal dialog pattern では、modal 表示中は外側 content が inert になり、Tab / Shift+Tab は dialog 内を循環し、Escape で閉じ、閉じた後は通常 invoking element に focus を戻します。role="dialog" と aria-modal="true" は、実際に外部 interaction をブロックして視覚的にも modal になっている場合だけ使うべきです。([W3C]3)

    修正案: pause overlay を本当に modal にするなら、#1376 AC に以下を追加してください。

    • pause entry 時、focus が Resume button へ移る。
    • Tab / Shift+Tab が pause overlay 内を循環する。
    • Escape で resume する。
    • resume 後、focus が canvas または Pause button に戻る。
    • aria-modal="true" を使う場合、外側 battle controls は実際に inert になる。
    • non-modal HUD overlay とする場合は aria-modal を使わず、role="status" / labelled region にする。

    7. accessible name regression を AC で捕まえるべき

    UI IA は Canvas を唯一の interactive control surface にしないと明記しています。 外部仕様でも、focusable interactive element は accessible name が必要で、可能なら可視テキストを優先すべきです。([W3C]4)

    #1374–#1376 の AC は「button が存在する」だけでなく、getByRole('button', { name: '...' }) で検証してください。特に aria-label を多用すると、可視ラベルと accessible name が drift します。

    8. Canvas result overlay は visual cue に留める必要がある

    現行 CanvasRenderer は sortie result に応じて Canvas 全面に色 overlay を描きます。 これは visual cue としては許容できますが、#1376 の result screen は DOM 側が authoritative surface であるべきです。

    MDN も Canvas は bitmap であり、semantic HTML のように accessibility tree に露出しないため、accessible UI を Canvas のみで構成すべきでないと説明しています。([MDNウェブドキュメント]5)
    したがって #1376 は「Canvas result fill は non-authoritative visual cue。Return to hangar / result details は DOM overlay が正本」と明記してください。

    9. #727 の扱いが弱い

    #727 は OWNER 判断で Deferred であり、再開条件が満たされるまで実装 PR を作らないと明記されています。 UI IA も #727 をそのまま resume せず、Canvas visual cues + DOM HUD player status integration へ rewrite または replace すると定義しています。

    #1370 は「本 parent 完了後に #727 を rewrite / close / supersede 判断」としていますが、これは後回しにしすぎです。少なくとも #1372 で #727 に routing comment を残す、または #1370 の child closure 条件に「#727 の最終 routing が記録済み」を入れるべきです。そうしないと、#1370 と #727 から相反する UI 実装 PR が発生します。

    P2: 品質を上げる改善

    10. Allowed Paths が monolith 化を誘発している

    #1373–#1376 はほぼ src/ui/HudController.ts に変更を集中させています。
    現行 HudController.ts は既に HUD rendering、copy mapping、button wiring、upgrade surface を抱えています。

    提案: child Issue の Allowed Paths に、新規 UI module を許可してください。

    • src/ui/battleOverlay.ts
    • src/ui/phaseScreens.ts
    • src/ui/combatHud.ts
    • tests/phase-screens.test.ts または既存 hud-controller.test.ts

    1 ファイルに overlay shell / phase screen / running HUD / result dialog / pause overlay を詰めると、後続改修で不可避に崩れます。

    11. legacy debrief phases の表示方針が未定義

    LoopPhase には debrief_pending_reward と debrief_reward_claimed がまだ残っています。 現行 HUD には legacy 用の Collect payout / Prepare next sortie もあります。 #1376 はそれらを通常 result UI から隠すとしていますが、legacy phase に入った場合の overlay fallback が曖昧です。

    追加 AC: legacy debrief phase は normal overlay で露出しない、または compatibility-only hidden/debug surface に隔離する、と明文化してください。

    12. UI IA の readability / viewport / evidence policy を子 Issue が引き継いでいない

    UI IA は 1920x1080 baseline、major HUD text 18 CSS px 以上、200% zoom で critical warning 可視、safe margin、viewport / zoom / DPR 検証を定義しています。 Evidence policy も commit SHA、run ID、page URL、artifact names/digests、retention、viewport、DPR、zoom、userAgent、timezone、screenshot/video を要求しています。

    #1375 / #1377 にこれを落とし込まないと、通常プレイ UI が battle-stage 内に収まっただけで、可読性 evidence は残りません。

    配布物・Web 実装調査を反映した要求

    Vite / GitHub Pages

    Vite の公式 docs は、GitHub Pages で repository path 配下に deploy する場合、base: '/<REPO>/' が必要と説明しています。([vitejs]6)
    この repo は vite.config.ts で VITE_BASE_PATH を検証し、末尾 slash を正規化しています。 deploy workflow も main では /${repo}/、PR preview では /${repo}/pr-${number}/ を注入し、dist 内 asset base path を grep で検証しています。

    #1370 最終 child に追加すべき AC:

    • PR preview URL で live assets が verified である。
    • dist/index.html に /loop-protocol/pr-<PR>/assets/ が入り、/assets/ 直指定がない。
    • VITE_LOOP_STORAGE_NAMESPACE=pr-<PR> が preview bundle に反映され、main save key と衝突しない。
    • evidence に commit SHA / GitHub Actions run ID / page URL / artifact names / retention が残る。

    Playwright screenshot / E2E

    Playwright の toHaveScreenshot() は初回に reference を生成し、以後比較しますが、rendering は OS / version / hardware / headless 等で変わるため、同じ環境で実行する必要があります。volatile 要素は style injection で隠す運用も公式に説明されています。([Playwright]7)

    #1377 の E2E は最低限これを確認すべきです。

    • .command-rail が存在しない。
    • getByRole('button', { name: 'New Game' }) 等の主要 control が .battle-stage 配下にある。
    • title → preparation → running → pause/resume → result → preparation が keyboard-only で通る。
    • running 中、Save / Load / Reset / New Game が visible でも focusable でもない。
    • overlay 非 interactive 領域をクリックしても canvas pointer input が壊れない。
    • screenshot は 1280x720 / 1366x768 / 1920x1080 で残す。DPR/zoom は完全自動化できない場合でも evidence metadata に残す。

    Issue 本文への具体的修正案

    #1370 parent に追加

    ## Blocking Contract Updates
    
    - #1282 / PR #1365 is merged; UI children must intake the post-#1282
      HudController/main.ts shape and must not reimplement upgrade purchase logic.
    - LoopPhase remains the canonical phase source. Pause overlay is derived from
      runtime-local productPause.isPaused; no independent uiScreen state is introduced.
    - battle-stage DOM overlay is the authoritative interactive surface.
      Canvas remains world / visual cue only.
    - #1372 must resolve the 30s sortie timer authority conflict before timer/result UI work.

    #1373 overlay shell AC 追加

    - ACx: `.battle-stage` is the containing block for `.battle-ui-layer`.
    - ACx: `.battle-ui-layer` uses `pointer-events: none`; interactive descendants opt into `pointer-events: auto`.
    - ACx: HudController mount target is inside `.battle-stage`, not sibling `.command-rail`.
    - ACx: canvas pointer input still works when overlay root is present.
    - ACx: inactive overlay regions are not tabbable.

    #1374 / #1375 phase screen AC 追加

    - ACx: inactive phase screens are hidden or inert and excluded from keyboard tab order.
    - ACx: visible controls are queried by role/name, not only data-action selectors.
    - ACx: running phase exposes only combat-critical HUD and allowed running actions.
    - ACx: New Game / Save / Load / Reset are not focusable during running.
    - ACx: no raw LoopPhase, raw telemetry, or internal enum copy appears in normal overlay text.

    #1376 result / pause AC 追加

    - ACx: result screen is the authoritative DOM result surface; Canvas result fill is visual-only.
    - ACx: pause overlay focus moves to Resume on open and returns on close.
    - ACx: Escape resumes from pause.
    - ACx: aria-modal is used only if outside interaction is actually blocked/inert.
    - ACx: Tab order is contained while modal pause is active.

    #1377 final verification AC 追加

    - ACx: Runtime DOM contains no `.command-rail`.
    - ACx: All normal-play controls are descendants of `.battle-stage`.
    - ACx: E2E verifies title -> preparation -> running -> pause/resume -> result -> preparation.
    - ACx: PR preview evidence includes page URL, commit SHA, run ID, artifact names/digest or availability reason, viewport, DPR, zoom, userAgent, timezone.
    - ACx: Vite base path and preview storage namespace are verified in dist.

    推奨順序

    1. 導入: 右側 command rail をゲーム内 DOM overlay に統合する #1370 / child Issue 本文更新: stale 実装: HUD に upgrade purchase surface と player-facing state を追加する #1282 blocker、pause source-of-truth、[Deferred] 実装: 戦闘中ステータス(HULL/HP)を戦闘描画画面(Canvas)に集約表示する #727 routing、AC/VC を修正。
    2. 実装: command rail 統合前に UI IA と sortie timer authority を整理する #1372 実装: 30s/120s conflict と UI IA phase mapping を確定。
    3. 実装: battle-stage 内 DOM overlay shell を追加する #1373: overlay shell だけ。command-rail はまだ削除しないが、Hud mount を battle-stage 内に移す。
    4. 実装: title と preparation を phase screen overlay に移す #1374: title/load/preparation の phase screen 化。inactive screen の focus exclusion をテスト。
    5. 実装: running 用 combat HUD を battle-stage 内 overlay に再配置する #1375: running combat HUD。DOM controls を最小化し、canvas pointer と keyboard を回帰確認。
    6. 実装: result screen と pause overlay を battle-stage 内に統合する #1376: result / pause。focus management と dialog semantics を先に固定。
    7. 実装: 旧 command rail を削除し overlay UI を E2E 検証する #1377: rail deletion、E2E、preview/provenance evidence、screenshot 更新。

    この順序なら、#1370 の方針は維持しつつ、「DOM overlay に移しただけ」「disabled な旧 rail が画面内に残っただけ」「pause が LoopPhase 契約を破る」といった失敗を防げます。

  3. squne121 commented on Jul 7, 2026

    @squne121
    OwnerAuthor

    Refinement Loop: Approved

    The issue has been approved and is ready for implementation.

  4. squne121 commented on Oct 2, 2026

    @squne121
    OwnerAuthor

    Backlog audit (2026-10-02): close as completed. Parent closure conditions are satisfied: child Issues #1372 through #1377 are all CLOSED / completed; the legacy competing route #727 is CLOSED / not_planned; and the final rail-removal child #1377 landed via merged PR #1998. #1377 records PASS for typecheck/lint/test/build and the remaining local E2E visual delta as pre-existing on clean main rather than introduced by the child. No residual parent-owned delivery scope was found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    state/in-progresstracking

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions