Overview and feature map
Purpose and boundaries
CODE Editor is an embeddable surface for Olympus notes/comments, Markdown documents, HTML fragments, and modest source-editing tasks. It aims for reliable editing fundamentals without adopting a JavaScript editor framework. It is intentionally smaller than ACE or Monaco: language services, debugger integration, multiple cursors, and huge-file virtualization are outside this delivery.
The browser owns the caret, selection interaction, and native text input. A separate model owns content, commands, history, and serialization. This separation makes it possible to replace the rendering/input adapter later without replacing the entire document engine. Such a replacement would still be substantial work; it is not a configuration switch.
Three independent choices
| Choice | Controls | Examples |
|---|---|---|
| Storage format | Loaded/saved string | Markdown, HTML fragment, plain text |
| View mode | Editing experience | Source, Visual |
| Source language | Lexical decoration and source commands | Markdown, HTML, T-SQL, JavaScript, plain text |
For a note, choose Markdown storage, Visual mode, and a notes policy. For a technical Markdown document, choose Markdown storage, Source mode, and optional preview. For SQL, choose plain-text storage, Source mode, and T-SQL language. Selecting SQL coloring does not convert the storage format.
Switching Source/Visual views is not a format conversion or document reload. Unedited supported content retains original source information where possible. Editing a rich structure can canonicalize its serialization. Arbitrary Markdown or HTML does not have a universal byte-for-byte round-trip guarantee.
Feature map
| Area | Implemented | Boundary |
|---|---|---|
| Input | Native caret/selection, composition-aware input adapter | Real-device acceptance remains |
| State | Logical selections, bookmarks, undo/redo, revisions, dirty state | No collaboration or durable undo history |
| Source | Wrapping, line numbers, lexical colors, indentation, SQL/JS comments, find/replace | No IntelliSense, folding, multi-cursor or virtualization |
| Visual | Headings, paragraphs, emphasis, links, lists/tasks, quotes, code, thematic breaks | Supported schema rather than arbitrary editable HTML |
| Typing | Markdown-like input rules; Ctrl+B/I in Markdown source | Conservative Markdown subset |
| Tables | Rectangular pipe/HTML tables; row/column commands; alignment; TSV | No merged or nested tables |
| Images | References and host-backed imports from paste/drop/files | Host supplies storage and durable URLs |
| Preview | Native parser, preprocess/custom HTML hook, isolated CSS, scroll following, resize divider | Transformed/custom output uses proportional following |
| Policy | Presets, feature overrides, headings, list depth, embedded HTML rules | Product policy does not replace server authorization |
| WinForms | .NET 10 control, embedded assets, enums, events, search popup, NuGet | Windows and WebView2 Runtime required |
| Other hosts | Browser demo, ASP.NET sample, Photino bridge example | Photino and mobile are not fully validated |
Host responsibilities
The editor handles text interaction and document state. The application handles document identity, permissions, loading/saving, conflict resolution, autosave timing, dialogs, toolbar layout, asset ownership, and link navigation. There is no requirement for an IoC container or a specific application architecture.
The standalone sample provides a native toolbar; the reusable TextEditor does not. The control contains the editing surface, optional preview, and its Ctrl+F/Ctrl+H popup. A bare JavaScript host supplies its own search UI around the search APIs.
Display styling versus stored styling
DisplayFontFamily and DisplayFontSize affect the editing surface. Syntax coloring is also presentation. Neither writes font markup into source text.
Rich content fonts, colors, sizes, and underline apply to document runs. Clean Markdown has no standard representation for font family or size, so these require HTML storage or the allowed embedded HTML extension. Current content choices are curated; the control does not contain an arbitrary installed-font picker.
Suggested integration sequence
- Run a delivered example.
- Select format, view, language, and policy for one real scenario.
- Implement validated snapshot saving and error handling.
- Add the host toolbar using commands or typed methods.
- Add preview expansion and CSS where needed.
- Add image storage if file imports are enabled.
- Test actual documents, devices, deployment and clipboard sources.