# Patch Series Feature Documentation

This document describes each patch in the series, its user-facing impact, and
all configuration options.

---

## 01. Configurable Gap Between Tiled Windows

Adds a configurable pixel gap between tiled windows. When set to a value
greater than 0, windows are visually separated by empty space instead of
touching at their borders.

**Config option:**

| Key | Type | Default | Range |
|-----|------|---------|-------|
| `theme.gap` | integer | `0` | 0–1000 |

**Example:**

```toml
[theme]
gap = 10
```

---

## 02. Position and Size Animations for Tiled Windows

Adds smooth animations when tiled windows change position or size (e.g. when
a window is opened, closed, or resized). Window transitions interpolate from
old to new geometry over a configurable duration.

**Config option:**

| Key | Type | Default | Range |
|-----|------|---------|-------|
| `theme.animation-duration` | integer (ms) | `0` | 0–5000 |

Set to `0` to disable animations.

**Example:**

```toml
[theme]
animation-duration = 200
```

---

## 03. Window Border Frames When Gaps Are Enabled

When gaps are enabled (`gap > 0`), each tiled window gets an individual border
frame drawn around it, rather than sharing borders with adjacent windows. This
gives each window a distinct visual boundary within the gap space.

**Config option:**

Uses the existing `theme.border-width` setting. Borders are drawn per-window
when `gap > 0`.

| Key | Type | Default |
|-----|------|---------|
| `theme.border-width` | integer | `4` |

---

## 04. Sequential Animation Mode for Tiled Windows

Adds a sequential animation mode where position and size changes animate in
two phases rather than simultaneously. When a window shrinks, it resizes first
then moves; when it grows, it moves first then resizes. This prevents windows
from overlapping during animations.

**Config option:**

| Key | Type | Default | Values |
|-----|------|---------|--------|
| `theme.animation-mode` | string | `"concurrent"` | `"concurrent"`, `"sequential"` |

**Example:**

```toml
[theme]
animation-mode = "sequential"
animation-duration = 200
```

---

## 05. Cursor Follows Focus

When enabled, the mouse cursor warps to the center of the focused window on
keyboard-driven focus changes. This is useful with multi-monitor setups or
large screens where the cursor may be far from the focused window.

**Config option:**

| Key | Type | Default |
|-----|------|---------|
| `cursor-follows-focus` | boolean | `false` |

**Example:**

```toml
cursor-follows-focus = true
```

---

## 06. Toggle Focus Between Floating and Tiled Layers

Adds an action to toggle keyboard focus between the floating and tiled window
layers. Useful for quickly switching attention between a floating terminal and
tiled editor, for example.

**Config action:**

| Action | Description |
|--------|-------------|
| `toggle-float-focus` | Toggles focus between floating and tiled windows |

**Example:**

```toml
[shortcuts]
alt-space = "toggle-float-focus"
```

---

## 07. Open/Close Animations for Tiled Windows

Adds spawn and despawn animations for tiled windows. When a window is opened
or closed, it can slide in from a screen edge or grow/shrink from center.

**Config option:**

| Key | Type | Default | Values |
|-----|------|---------|--------|
| `theme.spawn-animation` | string | `"none"` | `"none"`, `"slide-left"`, `"slide-right"`, `"slide-top"`, `"slide-bottom"`, `"grow"` |

Requires `animation-duration > 0` to be visible.

**Example:**

```toml
[theme]
spawn-animation = "grow"
animation-duration = 200
```

---

## 08. Directional Focus Navigation for Floating Windows

Extends the existing directional focus commands (`focus-left`, `focus-right`,
`focus-up`, `focus-down`) to work with floating windows. When focus is on a
floating window, left/down moves to the previous float in stacking order and
right/up moves to the next. Navigation wraps around at the ends.

**No new config options.** Uses existing directional focus key bindings.

---

## 09. Configurable Animation Easing Curves

Adds configurable easing curves for all animations. Choose from preset curves
or define a custom cubic bezier curve (same syntax as CSS `cubic-bezier()`).

**Config option:**

| Key | Type | Default | Values |
|-----|------|---------|--------|
| `theme.animation-curve` | string or array | `"ease-out"` | `"linear"`, `"ease-in"`, `"ease-out"`, `"ease-in-out"`, `[x1, y1, x2, y2]` |

For custom bezier curves, specify an array of 4 floats representing the two
control points, matching CSS `cubic-bezier(x1, y1, x2, y2)`.

**Examples:**

```toml
[theme]
animation-curve = "ease-in-out"
```

```toml
[theme]
# CSS "ease" equivalent
animation-curve = [0.25, 0.1, 0.25, 1.0]
```

---

## 10. Rounded Corners for Window Frames

Adds rounded corners to window frames. All frame elements (borders, title bar,
content) are clipped to a rounded rectangle using anti-aliased SDF clipping in
the fragment shaders. Works for both tiled and floating windows. Best paired
with gaps for clean visuals.

**Config option:**

| Key | Type | Default | Range |
|-----|------|---------|-------|
| `theme.corner-radius` | integer (px) | `0` | 0–100 |

Set to `0` for square corners.

**Example:**

```toml
[theme]
gap = 10
corner-radius = 8
```
