diff --git a/openspec/changes/arena-size/.openspec.yaml b/openspec/changes/arena-size/.openspec.yaml new file mode 100644 index 0000000..c0ad5ed --- /dev/null +++ b/openspec/changes/arena-size/.openspec.yaml @@ -0,0 +1,2 @@ +schema: spec-driven +created: 2026-11-08 diff --git a/openspec/changes/arena-size/design.md b/openspec/changes/arena-size/design.md new file mode 100644 index 0000000..cb5cdbf --- /dev/null +++ b/openspec/changes/arena-size/design.md @@ -0,0 +1,31 @@ +# Design + +## Context + +Output is already bound and a listener exists, but mode dimensions are ignored. See proposal.md. + +## Goals / Non-Goals + +**Goals:** +- Store output mode width/height. +- Compute default logical size = 0.8 * mode / scale. +- Keep grid resize/preserve behavior. + +**Non-Goals:** +- Fullscreen mode. +- Dynamic output hotplug handling beyond first output. + +## Decisions + +### D1: Output mode storage +- Store `output_width`, `output_height` from `wl_output.mode`. + +### D2: Default size computation +- After roundtrip, if output info available, set logical size; else fallback 1024x576. + +### D3: Fallback +- 1024x576 logical (~80% of 1280x720) when no output info. + +## Open Questions + +None. \ No newline at end of file diff --git a/openspec/changes/arena-size/proposal.md b/openspec/changes/arena-size/proposal.md new file mode 100644 index 0000000..36a755a --- /dev/null +++ b/openspec/changes/arena-size/proposal.md @@ -0,0 +1,27 @@ +# Proposal + +## Why + +The current default arena is 400×400 logical pixels (50×50 cells), too small for comfortable exploration. The arena should occupy about 80% of a FullHD screen, adapting to the actual output size and scale. + +## What Changes + +- Use `wl_output` mode dimensions to compute a default logical window size equal to 80% of the output, divided by the active scale. +- Keep the 8 px logical cell size; grid dimensions derive from the logical window size. +- Preserve resizable behavior and grid recalculation on resize. +- Provide a sensible fallback when output info is unavailable. + +## Capabilities + +### New Capabilities + +- `arena-sizing`: output-aware default arena size (~80% of screen) with fallback and resize handling. + +### Modified Capabilities + +None. + +## Impact + +- Affected code: `wlgol.c` (output mode handling, default size calculation, canvas/grid resize). +- No new dependencies. \ No newline at end of file diff --git a/openspec/changes/arena-size/specs/arena-sizing/spec.md b/openspec/changes/arena-size/specs/arena-sizing/spec.md new file mode 100644 index 0000000..30252e3 --- /dev/null +++ b/openspec/changes/arena-size/specs/arena-sizing/spec.md @@ -0,0 +1,42 @@ +# Spec Delta + +## Purpose + +Defines how the arena default size is derived from the output and how resizing affects the grid. + +## ADDED Requirements + +### Requirement: Default arena is about 80% of output +The system SHALL compute the default logical window size as 80% of the output mode dimensions divided by the active scale. + +#### Scenario: Output available +- **WHEN** output mode and scale are known at startup +- **THEN** the default logical window size is approximately 80% of the output + +### Requirement: Fallback when output unknown +The system SHALL use a fallback default size when output info is unavailable. + +#### Scenario: No output info +- **WHEN** output mode is not reported +- **THEN** a fallback logical size is used + +### Requirement: Cell size remains 8 logical pixels +The system SHALL keep an 8 logical pixel cell size. + +#### Scenario: Grid dimensions +- **WHEN** the logical window size is known +- **THEN** grid columns and rows are logical size divided by 8 + +### Requirement: Resizable window +The system SHALL allow the window to be resized by the user. + +#### Scenario: Resize +- **WHEN** the user resizes the window +- **THEN** the grid dimensions update accordingly + +### Requirement: Grid preserved on resize +The system SHALL preserve overlapping cells when the grid dimensions change. + +#### Scenario: Enlarge +- **WHEN** the window grows +- **THEN** existing cells within the old bounds remain \ No newline at end of file diff --git a/openspec/changes/arena-size/tasks.md b/openspec/changes/arena-size/tasks.md new file mode 100644 index 0000000..48575ae --- /dev/null +++ b/openspec/changes/arena-size/tasks.md @@ -0,0 +1,11 @@ +# Tasks + +## 1. Output handling + +- [ ] 1.1 Store output mode dimensions in the output listener. +- [ ] 1.2 Compute default logical window size as 80% of output divided by scale, with fallback. + +## 2. Verification + +- [ ] 2.1 Build and run, verifying window is ~80% of screen. +- [ ] 2.2 Resize window and verify grid updates. \ No newline at end of file