# EditorControl View Mode Policy (v5.64.2)

v5.64.2 removes `ViewerControl` as a separate official Control variant.

## Final model

```text
OneEditor
  -> UnifiedWriter.createEditorControl({ mode: 'edit' })

OneViewer
  -> UnifiedWriter.createEditorControl({ mode: 'view' })

WorkbenchControl
  -> wraps EditorControl and passes mode: 'edit' or mode: 'view'
```

## Why ViewerControl is unnecessary

UnifiedWriter's body Control already owns the DocumentModel, layout, selection, outline, search, print target generation, export capabilities and file-specific command registry. Maintaining a second ViewerControl would duplicate the same body surface and create extra integration contracts.

A view/read-only mode on EditorControl is enough for OneViewer:

- mutation commands are omitted or disabled;
- Insert / Format / Review editing contributions are not exposed;
- read-only File commands such as open package, export, print and properties remain available;
- View / Search / Outline / Comments display can remain available;
- Host still owns File/Help UI and delegates to `writer.file.*` as needed.

## Command filtering

`getCommandRegistry({ mode: 'view' })` returns only read-only/view-safe commands. Examples:

```text
writer.file.openPackage
writer.file.export
writer.file.printContent
writer.file.properties
writer.edit.findReplace
writer.view.printLayout
writer.view.normalLayout
writer.view.outline
```

`getMenuContributions({ mode: 'view' })` and `getToolbarContributions({ mode: 'view' })` are similarly filtered.

## Compatibility

`createViewerControl()` is kept only as a transition alias for older integrations. It should internally call `createEditorControl({ mode: 'view' })` and should not be described as a separate official Control variant in new documentation.

## v5.66.0 class implementation note

The view/readOnly policy is now implemented on the public `EditorControl` class in `scripts/controls/editor_control.js`, which inherits `UnifiedControl.Control`.  `createViewerControl()` remains only a compatibility alias.  OneViewer and other viewer Hosts should call `createEditorControl({ mode:'view', readOnly:true })`.
