docs: archive arena-size change and sync specs

Archive completed change and add arena-sizing main spec.
This commit is contained in:
2026-11-08 16:11:03 +01:00
parent a607a2441c
commit bf426d1e06
6 changed files with 41 additions and 0 deletions
@@ -0,0 +1,2 @@
schema: spec-driven
created: 2026-11-08
@@ -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.
@@ -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.
@@ -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
@@ -0,0 +1,11 @@
# Tasks
## 1. Output handling
- [x] 1.1 Store output mode dimensions in the output listener.
- [x] 1.2 Compute default logical window size as 80% of output divided by scale, with fallback.
## 2. Verification
- [x] 2.1 Build and run, verifying window is ~80% of screen.
- [x] 2.2 Resize window and verify grid updates.