# UnifiedWriter v5.29.0 List / Outline / Ruler Stability

## Purpose

v5.29.0 is a core-stability milestone after the v5.28.0 Selection / Toolbar / Format work.  It focuses on three areas that must be stable before table editing, DOCX Level 3, and high-fidelity page layout are expanded:

- list structure and list indent normalization
- model-driven document Outline navigation
- a Google Docs-style ruler foundation connected to Model-first paragraph/list indent operations

## Model-first principle

The ruler and Outline are UI surfaces only.  They never mutate rendered page DOM directly.  The rendered pages are disposable output from `DocumentModel -> LayoutEngine -> Renderer`, so every user action must route through the model operation path.

```text
Ruler drag / Outline click / List command
  -> UnifiedWriter action
  -> NativeEditorAdapter model operation
  -> render pages
  -> restore model selection
  -> update toolbar / Outline / ruler state
```

## Outline changes

The Outline is now generated from `NativeEditorAdapter.getOutlineModel()` rather than querying visible `h1/h2/h3` DOM nodes.  This is important because future pagination may split one logical heading across pages, and the visible DOM must not become the canonical source of document structure.

Implemented behavior:

- H1/H2/H3 blocks are read from DocumentModel.
- Outline rows carry the logical block id.
- Clicking an Outline row scrolls to the rendered block/fragment and restores the model selection.
- The current heading is highlighted based on the current model selection.
- Left pane provides refresh, expand all, and collapse all controls.

## Ruler foundation

The ruler is displayed above the editable print-layout page.  It shows page width, margins, and a draggable left-indent marker.

Implemented behavior:

- left margin and right margin visual bands are derived from page metrics
- marker position is derived from current paragraph/list indentation
- dragging or clicking the ruler calls `setParagraphIndentPx()`
- normal paragraphs receive `margin-left` block metadata
- list items receive item-level `data-unified-writer-list-indent` metadata

The current implementation intentionally limits the ruler to left indent.  First-line indent, hanging indent, right indent, tab stops, and margin dragging should be added after the paragraph layout model is further expanded.

## List changes

v5.29.0 keeps the existing flat list model:

```html
<ul>
  <li>level 0</li>
  <li data-unified-writer-list-indent="1">level 1</li>
</ul>
```

This is not a final semantic nested-list structure, but it keeps text offsets stable for SelectionController and Undo/Redo.  The CSS displays nested-looking bullets/numbering styles, while the model stores a deterministic item indent level.

Implemented behavior:

- adjacent list blocks of the same type are normalized after list conversion
- ruler drag can adjust selected list item levels
- item-level indentation remains compatible with Tab / Shift+Tab

## Remaining work

- true semantic nested-list model and DOCX numbering round-trip
- restart numbering / continue numbering commands
- first-line indent and hanging indent markers
- right indent and tab stop markers
- page margin drag support
- keyboard navigation within Outline
- deeper Outline collapse state persistence
