UnifiedWriter Regression Tests
Target: dev-5.66.6. Open parameters.html and verify the following Model-first editing behaviours.
v5.56.0 focus: v5.47-v5.56 productization plus DOCM/VBA macro foundation: selection/IME/Undo/Clipboard diagnostics, DOCX compatibility diagnostics, layout/print/PDF preflight, Host API v1.1, i18n audit, and regression/product readiness polish.
1. Menu / Toolbar polish
| Case | Expected result |
| Compact menu density | Top menus and nested submenus open with compact row height; Japanese labels do not create excessive right-side blank space. |
| Shortcut alignment | Shortcut keys such as Ctrl+O, Ctrl+S, and Ctrl+P remain right aligned and never touch the label text. |
| Submenu arrows | Submenu arrows are shown only when children exist and stay aligned on the right edge. |
| Toolbar overflow | The toolbar stays one compact row and horizontally scrolls on narrow frames instead of wrapping into a tall toolbar. |
| Menu name | Japanese Format menu is shown as 書式, not 表示形式. |
2. Command availability / contextual toolbars
| Case | Expected result |
| No object selected | Image-only and table-only commands are disabled or hidden as appropriate. |
| Select image | Image contextual toolbar appears; table contextual tools remain hidden/disabled. |
| Select table cell/range | Table contextual toolbar appears; image contextual tools remain hidden/disabled. |
| Mixed selection state | Toolbar buttons that represent mixed selection state show the mixed indicator instead of incorrect active state. |
| Status bar | Status bar shows the current selection mode: text/table/image/comment. |
3. Core editing stability
| Case | Expected result |
| IME input | Japanese IME composition does not cause intermediate page re-rendering; confirmed text becomes one natural undo unit. |
| Undo / Redo | Text, table, image and comment operations restore both document content and selection mode. |
| Clipboard | Text, table range, and selected image copy/cut/paste routes do not conflict. |
| Context menu | Right-click inside the document never shows the browser-native context menu; UnifiedWriter menu is shown for text/link/table/image. |
4. Stage 1 practical editing
| Case | Expected result |
| Table | Insert, select, edit, merge/split, style, copy/paste, resize and normalize table grid without breaking DocumentModel. |
| Image | Insert image through Host OpenFile callback; select, resize, set wrap/caption/margin, and delete with Undo support. |
| Review | Add/edit/reply/resolve/reopen comments; history and footnote panels remain synchronized with metadata. |
| Page chrome | Header/footer/page number/footnote chrome renders from metadata and is not saved as transient DOM handles. |
5. DOCX / UWPSX / Host integration
| Case | Expected result |
| DOCX import/export | Headings, paragraphs, inline formatting, lists, tables, images, links, comments, footnotes and header/footer basics round-trip through diagnostics-visible paths. |
| Preserved OOXML | Unsupported parts are represented in diagnostics/preserved metadata instead of silently discarded. |
| UWPSX reopen | Save/reopen preserves document metadata, quality diagnostics, Host API policy and round-trip policy. |
| Host API | getDocument(), setDocument(), exportBlob(), validate(), and Host callback flow remain storage-provider independent. |
6. Print / PDF / Layout
| Case | Expected result |
| Print | Only document pages are printed, never Host/Demo chrome, menus, side panes or parameter panels. |
| PDF | PDF export uses rendered pages and preserves Japanese text, images and simple tables as closely as current renderer allows. |
| Layout | Print Layout / Normal Layout switching keeps editor selection usable and does not restore contenteditable as document truth. |
v5.52.0 productization checks
- Tools > 編集安定性診断 opens without errors.
- Tools > DOCX互換性診断 shows Import/Export/Round-trip readiness.
- Tools > レイアウト / 印刷 / PDF事前確認 shows page/table/image readiness.
- Tools > Host API契約 displays JSON contract v1.1.
- Tools > 多言語監査 reports EN/JA/ZH key coverage.
7. DOCM / VBA / Script Engine
| Case | Expected result |
| DOCM import | Importing a .docm preserves vbaProject.bin in UWPSX macro metadata and imports the document body through the DOCX path. |
| Macro diagnostics | Tools > マクロ診断 reports preserved VBA, supported document APIs and unsupported OS-level APIs. |
| VBA viewer | 開発 > VBAコードビューア displays extracted/best-effort module hints without executing macros. |
| VBA to JS | 開発 > VBA→JS変換 generates browser-safe UnifiedWriter JavaScript macro skeletons for supported document-editing statements. |
| Script Engine | Tools > UnifiedWriterスクリプトエンジン keeps execution disabled by default and blocks FileSystemObject, Shell, DLL, ActiveX, COM and Win32 APIs. |
| DOCM export | Export > DOCM writes a macro-enabled OOXML package and restores preserved macro parts when available. |
v5.63.0 focus: v5.57-v5.63 consolidation: editing stability, Track Changes/Suggesting foundation, DOCX/DOCM round-trip preserve, DrawingML/Shape placeholder diagnostics, Layout/Print/PDF preflight, macro object model, Host/i18n/regression polish.
- Tools > v5.63 productization finish opens and summarizes stage checks.
- Tools > Review tools > Suggesting mode toggles without corrupting text/table/image selection.
- Tools > Compatibility tools > DOCX/DOCM Round-trip shows preserve policy.
- Tools > Compatibility tools > DrawingML / shapes placeholders lists unsupported object preservation targets.
- Tools > Compatibility tools > Macro Object Model confirms browser-safe API scope and OS-level exclusions.
8. v5.65.0 Control policy / OneEditor integration
| Case | Expected result |
| Policy wording | Docs and Control contract describe OneEditor / OneViewer File-menu delegation as a profile-specific integration, not a universal Host rule. |
| Workbench File menu | WorkbenchControl can still show a package File menu and route items to writer.file.* commands. |
| EditorControl view mode | createEditorControl({ mode:"view", readOnly:true }) exposes only view-safe commands and file capabilities. |
| Command guard | control.exec("writer.format.bold") is rejected in view/readOnly mode, while writer.file.openPackage, export, print and properties remain allowed. |
| OneEditor demo | demo/oneeditor-integration.html displays Command/Menu/Toolbar/File Capability JSON and does not rely on Workbench File menu chrome. |
9. v5.66.0 UnifiedControl Framework
| Case | Expected result |
| RequireJS peer dependency | Demo/Host config provides both UnifiedControl and UnifiedWriter aliases. UnifiedControl is not copied into the UnifiedWriter ZIP. |
| EditorControl class | UnifiedWriter.EditorControl is exported and instances returned by createEditorControl() inherit UnifiedControl.Control. |
| WorkbenchControl class | UnifiedWriter.WorkbenchControl is exported and instances returned by createWorkbenchControl() expose the standard Control API. |
| Command contribution | getCommandContributions('menu') and getCommandContributions('toolbar') return descriptors that reference command IDs and do not require Host DOM access. |
| View mode guard | view/readOnly mode still rejects mutation commands through exec(). |