# UnifiedWriter dev-5.28.0 Selection / Toolbar / Format Stability

This milestone focuses on editing quality rather than broad new UI categories.
UnifiedWriter continues to treat the rendered page DOM as a display and hit-test
surface only; the canonical state remains the DocumentModel.

## Scope

- SelectionController stability for caret/selection driven formatting state.
- Toolbar active-state reporting for B/I/U, list type, paragraph style, font size,
  alignment and line spacing.
- Collapsed selection formatting: clicking Bold, Italic, Underline, text color,
  highlight color or font size with no range stores a Model typing state for the
  next inserted text instead of mutating the visible DOM.
- Inline format preservation during typing and single-character deletion.
- Undo/Redo snapshot restoration includes selection anchor and pending typing
  inline state.
- IME composition is guarded so Japanese/Chinese/Korean input is committed as a
  single model operation after compositionend.

## Design Notes

### Rendered DOM is not the source of truth

Toolbar commands must never patch the visible page directly. Each command updates
DocumentModel blocks/runs, then the renderer rebuilds the page and restores the
model selection.

### Inline run preservation

Before this milestone, some insertion/deletion paths converted a whole block to
plain text and rebuilt the HTML. That was safe but destroyed inline marks such as
font size, DOCX-imported color, bold runs, and highlights. v5.28.0 adds inline
character-state helpers so typing and deletion preserve surrounding run metadata.

### IME handling

During composition, UnifiedWriter does not re-render. The proxy textarea is owned
by the browser IME until the committed string arrives. After compositionend, the
committed text is inserted through the same Model-first operation path used by
normal typing.

## Remaining Work

- Full mixed-selection UI indication beyond active/off states.
- Non-text object selection such as images, tables, comments and page anchors.
- Complete preservation for all multi-block delete and join cases.
- Automated browser-level regression tests.
