Skip to content

Architecture review (#157): #145 follow-ups, #146–#155 - #159

Merged
239573049 merged 10 commits into
mainfrom
arch/1.2-batch-1
Nov 17, 2026
Merged

239573049 merged 10 commits into
mainfrom
arch/1.2-batch-1

Conversation

@239573049

@239573049 239573049 commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

One commit per issue (#150 and #151 share one). Merge with rebase so each commit keeps its Closes #N.

Commit Issue What
docs(AGENTS) #155 design/ stays a local working area (untracked since 4092a67), and AGENTS.md now says so; no hard-coded Avalonia version
fix(Special, Blocks) #147 Special drops Markdown and Highlighting, Blocks drops Highlighting; internal CodeTokenHighlighter; PackageReferenceTests
test(Mobile) #152 Keep the shared type names; MobileClassNameTests; alias pattern in AGENTS.md
feat(Audio, Video, Pdf) #149 BackendChanged on all three; VideoPlayer, MediaPlayer and PdfViewer follow late backends; UseArc*Native/Browser() entries; shared ArcNativeLibrary; PDFium starts outside the lock
feat(Fonts, Themes, Terminal) #150, #151 UseArcFonts(), package-id constants, PackageEntryTests and PackageRegistrationTests; Terminal is standalone (ADR 0052) with Geist Mono first
build #146 PublicApiAnalyzers on every packable library; PublicAPI.Shipped.txt = 1.1.1, PublicAPI.Unshipped.txt = added since
docs(AGENTS) #154 Drawn controls take colors from tokens or brushes; the gallery API tables mark templated vs drawn (ArcGallery#12)
feat(Core) #148 ArcColor and ArcFormatting.Bytes; DuplicateHelperTests allow-lists that only shrink
test(InlineEdit) #145 follow-up Wait for the rendered scene before hit testing (flaky under load since the split)
refactor #153 TreeSelect, Table, RichTextEditor and RichTextEditorSurface split into partial files by concern

Local checks

  • TKCode.Arc.slnx builds in Debug and Release with no RS0016/RS0017 errors; Video.Native also builds for net11.0-ios.
  • Test runs:
    • the full TKCode.Arc.Tests (2481) and Blocks.Tests (5679), run together;
    • Integration (62), the Extras Pdf/Video/Terminal tests, and the Core Audio and ArcColor tests;
    • the Gallery docs and demo tests, against this branch.

🤖 Generated with Claude Code

239573049 and others added 5 commits November 17, 2026 10:48
…pository (#155)

design/ has been untracked since 4092a67 on purpose, but AGENTS.md called it the source of truth without saying
that a fresh clone does not have it. The version of Avalonia is no longer written into the prose.

Closes #155

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e for a few components (#147)

- TKCode.Arc gets an internal code-coloring contract (CodeTokens.CodeTokenHighlighter): CodeBlock's roles from the
  installed provider in CodeBlock's colors, in the shape of StreamMark's highlighter. The four Special components that
  show code (AskYourData, CodeSuggestion, DesignToCode, InstallSnippet) use it instead of MarkdownHighlightPlugin.
- TKCode.Arc.Special no longer references TKCode.Arc.Markdown or TKCode.Arc.Highlighting, and TKCode.Arc.Blocks no
  longer references TKCode.Arc.Highlighting; UseArcSpecial() / UseArcBlocks() no longer enable UseArcHighlighting()
  (CHANGELOG: call it to keep colored code).
- PackageReferenceTests pins every package's project and package references.

Closes #147

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ges (#152)

Decision: keep the names. The Mobile types live in their own namespace and xmlns (arcm), renaming them would be a
breaking change, and XAML has no clash. MobileClassNameTests pins the shared names (Button, ButtonVariant, Checkbox,
Dialog, RadioCard, RadioCardOption, RadioCards, Switch, Toast); AGENTS.md says new Mobile types do not reuse desktop
names and shows the C# alias pattern.

Closes #152

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ne native-library helper (#149)

- ArcAudio and ArcPdf get BackendChanged (like ArcVideo); all three raise it once per change.
- VideoPlayer and MediaPlayer replace their player when the process backend changes; PdfViewer and the attached
  Pdf.Source reopen a source that failed with BackendUnavailable. A browser's UseAsync finishing late is no longer lost.
- UseArcAudioNative/Browser, UseArcVideoNative/Browser and UseArcPdfNative/Browser enable the backends from UseArc(...)
  and list them in ArcRuntime.Packages; the static Use()/UseAsync() stay.
- src/Shared/ArcNativeLibrary.cs (linked source) replaces three copies of the RID, file-name and runtimes lookup.
- ArcPdfNative.Use() waits for PDFium's start outside its lock.

Not done, on purpose: IsAudible / IsReal keep their names (a rename would deprecate a member every backend and app
uses, for naming only), and backends are not disposed at exit (releasing the miniaudio engine or PDFium while a player
or document may still be alive risks a use-after-free, and the process is exiting anyway).

Closes #149

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
….); Terminal is a standalone library (#150, #151)

#151:
- UseArcFonts() / UseArcPixelFonts() register the Arc fonts from UseArc(...); WithArcFonts() stays, and calling both
  is harmless (each collection is added once per font manager). TKCode.Arc.Fonts references Foundation for this.
- Corners and Pixel pass a named PackageId constant instead of a string literal.
- PackageEntryTests: every package has a UseArcXxx(this ArcBuilder) entry (the exceptions are listed with their
  reason) and no package id is a string literal; PackageRegistrationTests checks ArcRuntime.Packages.

#150 (decision, ADR 0052): TKCode.Arc.Terminal stays a standalone terminal library on Avalonia alone, with its
TKCode.Terminal.* namespaces and no token, theme or UseArc entry; its colors come from the terminal core's palette,
which the host sets. AGENTS.md lists the exception. TerminalView's default font now starts with Geist Mono.

Closes #150
Closes #151

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@239573049 239573049 changed the title Architecture review, batch 1: design notes (#155), Special and Blocks dependencies (#147) Architecture review, batch 1: #155, #147, #152, #149, #150, #151 Nov 17, 2026
239573049 and others added 2 commits November 17, 2026 11:29
- build/Arc.Repository.targets adds Microsoft.CodeAnalysis.PublicApiAnalyzers to every packable library (ArcPublicApi):
  RS0016 (public member not listed) and RS0017 (listed but gone) are errors; the analyzer's design rules are off.
- PublicAPI.Shipped.txt holds the surface of the released 1.1.1 packages; PublicAPI.Unshipped.txt what was added since
  (Terminal #139-#143, the backend events and UseArc entries of #149/#151). Source-generated members (tokens, language
  resources, Lucide kinds) are listed too.
- AGENTS.md: how to add members, the stable release moves Unshipped into Shipped, and block parts are internal by
  default. Decision: no separate stability tier for Blocks and Special; making existing types internal is #160 (2.0).

Closes #146

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…gallery marks templated vs drawn (#154)

The gallery side (ArcGallery docs/arc-1.2) adds a Customization line to every API table, worked out from the control's
type: drawn (it or an Arc base overrides Render) or templated.

Closes #154

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
239573049 and others added 3 commits November 17, 2026 11:42
…new copies (#148)

- ArcColor (Lerp in sRGB, LerpOklab, WithOpacity) and ArcFormatting.Bytes in Core; ActivityTime.FormatBytes uses it.
- DuplicateHelperTests: color blending, byte formatters, formatting-helper files and spring-helper files outside Core
  are pinned to allow-lists (35, 7, 28 and 4 files today). A new copy fails, and a file that lost its copy must leave the
  list, so the lists only shrink. Existing copies move over when their component is next touched (their rounding and
  color spaces differ, so a blanket swap would change pixels).
- AGENTS.md lists the Core helpers to use (also ListKeyboardNavigator, DragTracker/DragRecognizer, Springs).

Closes #148

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…actions

Hit testing reads the rendered scene, which a loaded runner can publish a frame or two after the one ForceRenderTimerTick
the test gave it; since the split of #145 this test ran in a smaller assembly and failed now and then on CI. It now ticks
until the scene has the save button (10 s bound).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…urface by concern (#153)

Members move into partial files; nothing else changes (the 275 tests of these components pass unchanged, and the
public API files are untouched).

- TreeSelect 2107 -> 800 lines (+ Data, Selection, Field, Search, Rows, Popup, Input), by its #regions.
- Table 1973 -> 761 (+ Data, Layout, Items, Sorting, Selection, Keyboard), by its #regions.
- RichTextEditorSurface 2781 -> 368 (+ TableGrips, Layout, Render, Input), by its section banners; the caret, IME client and
  automation peer get their own files.
- RichTextEditor 2380 -> 935 (+ Input, Clipboard, Surface, Menus); its event args, clipboard fragment and command get
  their own files.
- AGENTS.md: about 1200 lines per file, split when you next work on a file.

Closes #153

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant