Skip to content

t27os: shell layout state model - resizable left, right and bottom panels, overlay, Zen, persistence #14047

Closed

Description

@gHashTag

ISSUE: shell layout state model. MILESTONE: Zen shell, step 1 of the skeleton. GOAL: one pure model of the three auxiliary panels (left navigation, right T27L log, bottom CLI) that the window later draws and hit-tests from. This issue does not touch the window spec, so it runs in parallel with the browser work.

Owner order 2026-11-16: one calm Zen interface in the style of the home (matte glass, no permanent button borders). The left and right panels open independently and mirror each other; the bottom panel spans the centre column; all three are resizable by dragging a splitter and from the keyboard; sizes and open state persist between launches; the centre never disappears; on a narrow window the side panels open over the content instead of squeezing it; Zen mode hides the auxiliary panels and a second toggle restores the previous layout.

What exists: the window layout spec already computes win_regions_v2, splitter_rects and region_at_v2 (PR 14029), but the side widths are fixed constants and there is no state, no clamp by the centre width, no overlay mode, no Zen and no persistence. The window does not call v2 yet.

INPUT: the window layout spec on master. OUTPUT: the functions below with tests. Drawing, animation, the T27L content and the CLI are separate issues and land after this one.

Boundary

  • specs/t27os/win_layout.t27

User Scenarios

  • Given a 1280 x 800 window with both side panels open, when the left splitter is dragged right by 500 points, then the left width stops at its maximum and the centre keeps at least its minimum width.
  • Given a window narrower than the sum of the open panels and the centre minimum, when the regions are computed, then the side panels are marked overlay and the centre rect keeps the full width between the window edges.
  • Given a focused splitter, when an arrow key is pressed, then the size moves by one step, and Enter collapses the panel or restores its last size.
  • Given any layout, when Zen is toggled on and then off, then the open flags and sizes equal the ones before the first toggle.
  • Given a saved layout line, when it is decoded and encoded again, then the line is byte-identical; a malformed line decodes to the default layout.

Requirements

  • FR-001: a ShellLayout state MUST hold the left width, the right width, the bottom height, three open flags and the Zen flag with its saved flags.
  • FR-002: one clamp function MUST keep each size inside its minimum and maximum and keep the centre at least CENTER_MIN_W wide and CENTER_MIN_H high.
  • FR-003: the regions function MUST take the state and return the left, centre, right and bottom rects plus an overlay flag for each side panel; in overlay mode the centre rect MUST NOT shrink.
  • FR-004: the right panel MUST mirror the left: same minimum, maximum, default and splitter hit width, taken from the same constants.
  • FR-005: a drag function and a key function MUST return the next state for each of the three splitters; Enter MUST collapse and restore.
  • FR-006: the Zen toggle MUST be its own inverse on every state.
  • FR-007: the state MUST encode to and decode from one ASCII line; decoding a malformed line MUST return the default state.
  • FR-008: the existing win_regions, win_regions_v2 and their tests MUST stay unchanged.

Success Criteria

  • The spec tests of the window layout spec pass: exit 0.
  • 0 vacuous passes in the test report.
  • At least 8 new tests, one per requirement.
  • 0 changed lines in the window spec.

Activity

  1. gHashTag commented on Nov 17, 2026

    @gHashTag
    CollaboratorAuthor

    Spec created: specs/t27os/layout_state.t27 (typecheck OK, 3 tests pass).

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions