0
Fork 0
mirror of https://github.com/Droid-VM/DroidVM.git synced 2026-11-17 06:58:15 +00:00
DroidVM/scripts/ci
HuJK 7f23d5de83 vm: Markdown notes, on their own page and rendered where the VM is shown
A VM accumulates things worth writing down -- what it is for, how to log in,
what not to touch -- and a config field is the only place they stay attached to
the VM rather than to whoever set it up. So VMConfig grows "notes", which rides
along in a package like every other field: the notes are about the VM, not about
the phone it happens to be on.

They are edited on a page of their own. A row at the end of the editor's Basic
section carries the first line and an Edit button, because prose in a row-sized
text box is unusable the moment it is longer than a sentence. That page has
three modes -- source, rendered, both -- in the title bar rather than under it,
since a row of its own would cost the editor a line of text for a control that
is three buttons wide.

In "both", the split follows the screen's short axis: upright one pane above the
other, on its side one beside the other, so each pane keeps the longest lines it
can. It is taken from the container's own measurements rather than the display's,
which keeps it right in split-screen, in freeform, and when the keyboard takes
half the screen. The panes are sized in pixels, not weights, and that is not a
detail: a weighted LinearLayout measures its weighted children once with an
unbounded spec along the weight axis, and Compose throws outright when a
horizontally scrollable element -- which is what this renderer makes of a table
or a code block -- is measured against an infinite width. Upright that never
happens; turning the phone took the screen down every time until the weights
went.

The rendered notes appear as a card on the VM's own page and on the vmpkg import
screen, the latter being where someone handed a package finds out what they were
handed, before importing it.

Rendering is Compose, because the renderer is. It is confined to one file with
one entry point, so the editor's preview and the read-only cards cannot drift
apart -- they are the same call. Two things there are deliberate: the palette is
read off the hosting Android theme, so a card of notes sits on the same surface
colour as the card beside it instead of arriving in Compose purple; and the
heading ladder is retuned for a phone, since the library starts h1 at
displayLarge -- 57sp, right for a document on its own page and absurd in a card,
where an h1 would take a line and a half on its own.

The renderer itself is vendored rather than pulled as an artifact. Its published
builds use a newer Kotlin than AGP's built-in Kotlin plugin provides, and a
compiler refuses to read metadata from a newer one, which pinned us to 0.38.1 --
the last release built with Kotlin 2.2 -- and would have kept us there until AGP
moved. As source it compiles with whatever Kotlin the build has, so the version
becomes a choice: this takes 0.45.0, the current release, and it needs no change
to compile under 2.2.10. What is taken is the renderer and its Material 3
bindings, commonMain only -- not the Coil loaders, the Material 2 bindings, the
syntax-highlighting module, or the js/wasm/native source sets. 60 files,
Apache-2.0, under app/src/main/vendor in a root of their own so that "not ours,
and under its own licence" is structural rather than a convention, with no SPDX
header of ours added to them. One file is changed and marked in place:
MarkdownLogger declares `internal expect fun platformLog` upstream with an
`actual` per platform, which needs the Kotlin Multiplatform plugin, so the
androidMain implementation is inlined instead. The root is registered with
kotlin.srcDir, not java.srcDir -- the latter compiles nothing here and leaves
every reference unresolved, which is a confusing way to find out.

Kotlin needs no plugin: AGP 9 compiles it out of the box and already owns the
"kotlin" extension, so asking for the Kotlin plugin fails outright. Only the
Compose compiler plugin is applied, pinned to the Kotlin AGP carries. What stays
an artifact is what the renderer depends on -- the org.jetbrains markdown parser,
kotlinx collections-immutable, coroutines and Compose -- all still subject to
the metadata rule, and all currently built with an older Kotlin than ours.

Signed-off-by: HuJK <gh@hujk.org>
History 2026-09-03 21:43:51 +08:00
..
arity_allow.txt ci: three source checks, and a build that can unit-test a class that logs 2026-09-01 20:28:18 +08:00
ascii_allow.txt vm: Markdown notes, on their own page and rendered where the VM is shown 2026-09-03 21:43:51 +08:00
check_arity.py ci: three source checks, and a build that can unit-test a class that logs 2026-09-01 20:28:18 +08:00
check_ascii.py ci: add non-ASCII and translation-completeness PR checks 2026-07-05 22:20:49 +08:00
check_string_concat.py ci: three source checks, and a build that can unit-test a class that logs 2026-09-01 20:28:18 +08:00
check_translations.py ci: add non-ASCII and translation-completeness PR checks 2026-07-05 22:20:49 +08:00
check_vector_icons.py ci: three source checks, and a build that can unit-test a class that logs 2026-09-01 20:28:18 +08:00