Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .specify/feature.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"feature_directory": "specs/002-cube-render-layer"
"feature_directory": "specs/004-full-ui-options"
}
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- SPECKIT START -->
For additional context about technologies to be used, project structure,
shell commands, and other important information, read the current plan
at specs/002-cube-render-layer/plan.md
at specs/004-full-ui-options/plan.md
<!-- SPECKIT END -->

## プロジェクト制約
Expand Down
6 changes: 6 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ export default [
},
},
prettierConfig,
{
files: ['tests/**/*.ts'],
rules: {
'@typescript-eslint/no-non-null-assertion': 'off',
},
},
{
ignores: ['dist/', 'node_modules/', 'coverage/'],
},
Expand Down
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Visual Cube Editor 3</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" />
</head>
<body>
<div id="app"></div>
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"main": "index.js",
"type": "module",
"scripts": {
"dev": "vite",
"test": "vitest run",
"test:watch": "vitest",
"test:coverage": "vitest run --coverage",
Expand Down
36 changes: 36 additions & 0 deletions specs/004-full-ui-options/checklists/requirements.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Specification Quality Checklist: Ver.2 相当フル UI オプション

**Purpose**: Validate specification completeness and quality before proceeding to planning
**Created**: 2026-05-03
**Feature**: [spec.md](../spec.md)

## Content Quality

- [x] No implementation details (languages, frameworks, APIs)
- [x] Focused on user value and business needs
- [x] Written for non-technical stakeholders
- [x] All mandatory sections completed

## Requirement Completeness

- [x] No [NEEDS CLARIFICATION] markers remain
- [x] Requirements are testable and unambiguous
- [x] Success criteria are measurable
- [x] Success criteria are technology-agnostic (no implementation details)
- [x] All acceptance scenarios are defined
- [x] Edge cases are identified
- [x] Scope is clearly bounded
- [x] Dependencies and assumptions identified

## Feature Readiness

- [x] All functional requirements have clear acceptance criteria
- [x] User scenarios cover primary flows
- [x] Feature meets measurable outcomes defined in Success Criteria
- [x] No implementation details leak into specification

## Notes

- FR-015〜FR-017 はやや技術的な記述だが、既存アーキテクチャとの整合性を保つために必要な制約として記載
- アロー定義 UI は Ver.2 の完全実装より簡略化(テキスト入力のみ)—前提条件に明記済み
- 全項目パス済み:`/speckit-plan` に進める状態
94 changes: 94 additions & 0 deletions specs/004-full-ui-options/contracts/render-options-api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
/**
* 拡張 RenderOptions 公開 API 契約
* ファイル: src/render/types.ts の拡張として実装される
*
* このファイルはコントラクト定義のみ(実装なし)。
*/

// ---------------------------------------------------------------------------
// 既存定義(変更なし)
// ---------------------------------------------------------------------------

export declare const ViewAxis: {
readonly X: 'x'
readonly Y: 'y'
readonly Z: 'z'
}
export type ViewAxis = (typeof ViewAxis)[keyof typeof ViewAxis]

export type ColorScheme = Readonly<Record<0 | 1 | 2 | 3 | 4 | 5, string>>

// ---------------------------------------------------------------------------
// 拡張 RenderOptions
// ---------------------------------------------------------------------------

/**
* 描画オプション(全フィールド省略可能)
* 004-full-ui-options で新規フィールドを追加
*/
export interface RenderOptions {
// ---- 既存フィールド ----
readonly colorScheme?: Partial<ColorScheme>
readonly backgroundColor?: string
readonly width?: number
readonly height?: number
readonly viewportRotations?: ReadonlyArray<readonly [ViewAxis, number]>

// ---- 新規フィールド(004) ----
/**
* 表示モード。'plan' で上面投影図を表示する。
* 省略または他の値の場合は通常の3D表示。
*/
readonly view?: string

/**
* ステージマスク(sr-visualizer Masking 列挙体の文字列値)。
* 例: 'oll', 'f2l', 'll'
* 省略または空文字の場合はマスクなし。
*/
readonly mask?: string

/**
* マスク向き調整アルゴリズム(例: 'y', "x'", 'z2')。
* mask が指定されている場合のみ有効。
*/
readonly maskAlg?: string

/**
* キューブ輪郭色。'#rrggbb' 形式。
* デフォルト: '#000000'(黒)
*/
readonly cubeColor?: string

/**
* マスク適用ステッカーの色。'#rrggbb' 形式。
* デフォルト: '#404040'
*/
readonly maskColor?: string

/**
* キューブ輪郭の不透明度(0〜100)。
* sr-visualizer は 0〜100 の整数を受け取る。
* デフォルト: 100(完全不透明)
*/
readonly cubeOpacity?: number

/**
* ステッカーの不透明度(0〜100)。
* デフォルト: 100(完全不透明)
*/
readonly stickerOpacity?: number

/**
* 投影距離(1〜100)。大きいほど正射影に近くなる。
* デフォルト: 5
*/
readonly dist?: number

/**
* アロー定義文字列(sr-visualizer のアロー書式)。
* 例: "UFR-UFR,UFL-UBL" (複数はカンマ区切り)
* 省略または空文字の場合はアロー非表示。
*/
readonly arrows?: string
}
93 changes: 93 additions & 0 deletions specs/004-full-ui-options/contracts/render-options-store-api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/**
* useRenderOptionsStore 公開 API 契約
* ファイル: src/stores/renderOptions.ts として実装される
*
* このファイルはコントラクト定義のみ(実装なし)。
*/

import type { RenderOptions, ViewAxis, ColorScheme } from './render-options-api.js'

// ---------------------------------------------------------------------------
// useRenderOptionsStore — Pinia setup ストア
// ---------------------------------------------------------------------------

/**
* useRenderOptionsStore() の戻り値型(概念定義)。
* 実装は defineStore('renderOptions', () => { ... }) で行う。
*/
export interface RenderOptionsStore {
// ---- ステート ----

/** 画像サイズ(幅・高さ共通)。1〜1000。デフォルト: 128 */
imageSize: number

/** 表示モード。デフォルト: 'normal' */
view: 'normal' | 'plan'

/** ステージマスク値('' = なし)。デフォルト: '' */
mask: string

/** マスク向き調整('' = なし)。デフォルト: '' */
maskAlg: string

/** 6面カラースキーム。デフォルト: WCA 標準色 */
colorScheme: Record<0 | 1 | 2 | 3 | 4 | 5, string>

/** 背景色。デフォルト: '#ffffff' */
backgroundColor: string

/** キューブ輪郭色。デフォルト: '#000000' */
cubeColor: string

/** マスク色。デフォルト: '#404040' */
maskColor: string

/** キューブ不透明度(0〜100)。デフォルト: 100 */
cubeOpacity: number

/** ステッカー不透明度(0〜100)。デフォルト: 100 */
stickerOpacity: number

/** 投影距離(1〜100)。デフォルト: 5 */
dist: number

/** ビューポート回転リスト(3スロット)。デフォルト: y/45, x/-34, z/0 */
viewportRotations: [ViewAxis, number][]

/** アロー定義文字列('' = なし)。デフォルト: '' */
arrows: string

// ---- computed ----

/**
* 全ステートを RenderOptions に変換した computed プロパティ。
* CubeDisplay が renderSVG() に渡す際に使用する。
*/
readonly renderOptions: RenderOptions

// ---- アクション ----

/**
* カラースキームを WCA 標準色にリセットする。
* U=白, D=黄, F=赤, B=橙, R=青, L=緑
*/
resetColorScheme(): void

/**
* X 軸回転相当で面の色を1ステップ循環する。
* U←B, B←D, D←F, F←U
*/
rotateX(): void

/**
* Y 軸回転相当で面の色を1ステップ循環する。
* F←R, R←B, B←L, L←F
*/
rotateY(): void

/**
* Z 軸回転相当で面の色を1ステップ循環する。
* U←L, L←D, D←R, R←U
*/
rotateZ(): void
}
Loading
Loading