Skip to content

Commit fdc511c

Browse files
committed
Complete Monaco styled editor migration
1 parent 637f946 commit fdc511c

35 files changed

Lines changed: 438 additions & 1430 deletions

AGENTS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ Rule format:
9494
- TPS authoring completeness must be checked against the upstream `managedcode/TPS` README, not only the currently shipped editor menus, so new editor support stays aligned with the full spec for emotions, delivery, pauses, speed, pronunciation, and related cues.
9595
- Editor TPS command surfaces must expose the full currently supported TPS authoring set consistently across top toolbar menus, floating-toolbar menus, and Monaco assistance; do not ship partial or differently grouped command taxonomies between those surfaces.
9696
- The editor must support multiple authoring views: `Raw` is the canonical TPS source editor with tags, and `Editor` is the WYSIWYG-style styled-text editor that hides raw Markdown/TPS syntax while preserving text styling for non-technical authors. Do not label the styled authoring tab as `Rendered`; it is still an editor, and card or storyboard concepts must be separate modes when explicitly requested.
97+
- The styled `Editor` authoring view must be a full Monaco-backed editing surface with cursor, selection, keyboard editing, find behavior, and undo/redo parity with `Raw`; rendered styling should be applied through Monaco decorations or equivalent editor-native layers, not by replacing the editor with a static preview or separate non-editable DOM.
98+
- Styled `Editor` TPS hover tooltips must be compact, readable, and viewport-safe; they should explain what the hovered cue/header element means and how it affects authoring without giant clipped Monaco popovers.
99+
- Styled `Editor` header metadata must not dominate the authoring surface or expose vague labels such as `Header metadata`; speaker, WPM, emotion, timing, and archetype parts need clear semantic labels and should stay visually subordinate to the actual script text.
100+
- Styled `Editor` Monaco performance must avoid redundant hidden overlay rendering and unnecessary full-document decoration work while typing; optimize the editor-native decoration path before adding more DOM layers or broad scans.
97101
- TPS cue semantics must be visually represented across both the editor and live reader surfaces: emotions, delivery, voice, pace, energy, pauses or breath marks, pronunciation, phonetics, stress, staccato, legato, emphasis, highlight, aside, rhetorical, building, sarcasm, loud, soft, whisper, and related cues need visible affordances that help the user read intent without inspecting raw TPS tags.
98102
- TPS word and emotion treatments should use tasteful word-level CSS effects such as gradients, shadows, underline textures, and constrained animation when they make the cue more legible and interesting; do not limit cue rendering to flat color changes, but never let effects reduce readability or cause word overlap.
99103
- TPS emotion cue colors must be meaningfully distinguishable from each other and should be grounded in color/emotion theory where possible; do not ship a set of near-identical pastel tints that users cannot tell apart while reading.

src/PrompterOne.Shared/Contracts/UiTestIds.Editor.cs

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -133,17 +133,15 @@ public static class Editor
133133
public const string PauseTwoSeconds = "editor-pause-two-seconds";
134134
public const string Profile = "editor-profile";
135135
public const string Redo = "editor-redo";
136-
public const string RenderedEmpty = "editor-rendered-empty";
137-
public const string RenderedFallbackText = "editor-rendered-fallback-text";
138-
public const string RenderedStrip = "editor-rendered-strip";
139136
public const string WorkspaceEditorTab = "editor-workspace-editor-tab";
140-
public const string RenderedView = "editor-rendered-view";
141137
public const string SourceHighlight = "editor-source-highlight";
142138
public const string SourceInput = "editor-source-input";
143139
public const string SourceGutter = "editor-source-gutter";
144140
public const string SourceMinimap = "editor-source-minimap";
145141
public const string SourceScrollHost = "editor-source-scroll-host";
146142
public const string SourceStage = "editor-source-stage";
143+
public const string StyledAuthoringMode = "styled-text";
144+
public const string LegacyRenderedView = "editor-rendered-view";
147145
public const string Toolbar = "editor-toolbar";
148146
public const string ToolbarScrollNext = "editor-toolbar-scroll-next";
149147
public const string ToolbarScrollPrevious = "editor-toolbar-scroll-previous";
@@ -196,31 +194,6 @@ public static class Editor
196194

197195
public static string LocalHistoryRestore(int index) => $"editor-local-history-restore-{index}";
198196

199-
public static string RenderedBlock(int segmentIndex, int blockIndex) => $"editor-rendered-block-{segmentIndex}-{blockIndex}";
200-
201-
public static string RenderedBlockDragHandle(int segmentIndex, int blockIndex) => $"editor-rendered-block-drag-handle-{segmentIndex}-{blockIndex}";
202-
203-
public static string RenderedBlockCues(int segmentIndex, int blockIndex) => $"editor-rendered-block-cues-{segmentIndex}-{blockIndex}";
204-
205-
public static string RenderedBlockAttachment(int segmentIndex, int blockIndex, int attachmentIndex) =>
206-
$"editor-rendered-block-attachment-{segmentIndex}-{blockIndex}-{attachmentIndex}";
207-
208-
public static string RenderedBlockAttachmentInput(int segmentIndex, int blockIndex) =>
209-
$"editor-rendered-block-attachment-input-{segmentIndex}-{blockIndex}";
210-
211-
public static string RenderedBlockAttachments(int segmentIndex, int blockIndex) =>
212-
$"editor-rendered-block-attachments-{segmentIndex}-{blockIndex}";
213-
214-
public static string RenderedBlockMoveDown(int segmentIndex, int blockIndex) => $"editor-rendered-block-move-down-{segmentIndex}-{blockIndex}";
215-
216-
public static string RenderedBlockMoveUp(int segmentIndex, int blockIndex) => $"editor-rendered-block-move-up-{segmentIndex}-{blockIndex}";
217-
218-
public static string RenderedBlockText(int segmentIndex, int blockIndex) => $"editor-rendered-block-text-{segmentIndex}-{blockIndex}";
219-
220-
public static string RenderedSegmentCues(int segmentIndex) => $"editor-rendered-segment-cues-{segmentIndex}";
221-
222-
public static string RenderedSegment(int segmentIndex) => $"editor-rendered-segment-{segmentIndex}";
223-
224197
public static string SplitResultItem(int index) => $"editor-split-result-item-{index}";
225198

226199
public static string SegmentNavigation(int segmentIndex) => $"editor-structure-segment-{segmentIndex}";

src/PrompterOne.Shared/Editor/Components/EditorRenderedTextView.razor

Lines changed: 0 additions & 107 deletions
This file was deleted.

src/PrompterOne.Shared/Editor/Components/EditorRenderedTextView.razor.css

Lines changed: 0 additions & 217 deletions
This file was deleted.

src/PrompterOne.Shared/Editor/Components/EditorSourcePanel.razor

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
@inject EditorInterop SemanticInterop
88
@inject EditorMonacoInterop MonacoInterop
99

10-
<div class="ed-main" data-test="@UiTestIds.Editor.MainPanel">
10+
<div class="@MainPanelCss"
11+
data-authoring-mode="@AuthoringModeAttribute"
12+
data-test="@UiTestIds.Editor.MainPanel">
1113
<div class="ed-toolbar"
1214
@ref="_toolbarRef"
1315
data-test="@UiTestIds.Editor.Toolbar">

0 commit comments

Comments
 (0)