Repository navigation
Ariadne: background: on a window or group (media M2, stacked on #931) - #932
Merged
Merged
Conversation
added 2 commits
October 30, 2026 22:24
An image: whose src (or bound value, or computed expression) is a URI now
loads that picture: http(s) through the host's network policy, with
auth: NAME sending the host's credential on the http verbs' terms; file://
relative to the document. The media cache (media.h) fetches, decodes,
downscales and fits off the frame on the app's background pool (a step per
drain in a browser build without threads), shares one fetch between boxes,
evicts idle pictures and retries failures. Widgets draw a placeholder of
their box until the picture arrives and a darker one on failure, with the
reason in the tooltip and at an optional status: key.
- cvc::decode_image: PNG/JPEG/GIF/BMP via stb, WebP via libwebp (now linked
directly, optional), TIFF/AVIF/HEIC via ImageMagick with the coder named
from the magic bytes; size caps checked before decoding.
- fit: contain|cover|fill and shape: circle, made by the core so every
backend draws the raster unchanged; size: [w, h] is a box.
- FTXUI half-blocks honour alpha (a transparent half keeps the terminal's
background); Backend::drop_image frees an evicted picture (ImGui deletes
its texture).
- host_get + net_host_access: a host-side GET on the verbs' terms.
- ari/arigl snapshot (and ari test) wait for the pictures a frame drew.
- Tests: ariadne_media_test (decode, fit, cache, widget over a local server
with a credential and a token scan), ari_media_test (the ari binary),
ari_run_media_images_{ftxui,tvision} (tmux), cvcgl_imgui_media.
A window, overlay or group may take background: {src|bind, auth, fit,
opacity, terminal, banner_rows, status} (or a bare URL): a picture by URI
through the media cache, or a published image name, drawn behind the
content. The core brackets the content with the new Backend::begin_backdrop
/ end_backdrop; each backend fits the picture to the area the content takes.
- ImGui: the content goes on a draw-list channel above the picture, which is
drawn (cover/contain/fill UVs, opacity as tint alpha) once the area is
known: a window's inner rect, a group's rect, full width unless size: says
otherwise and at least size:'s height.
- FTXUI and tvision: terminal: behind draws dimmed half-blocks under the
content and turns each cell the content wrote text into readable (the
picture's colour as background, dimmed to <= 40%, the terminal's own
foreground); terminal: banner draws the picture as a row above the
content, in Kitty/Sixel/iTerm pixels once its width is known; none draws
nothing. No background in mono.
- Tests: loader, core bracketing (ariadne_media_test), FTXUI behind/banner
layout, ImGui split/merge and the authored height (cvcgl_imgui_media), and
the tmux test now checks a window background on both terminal backends.
transfix
added a commit
to cy-pca/nicotina
that referenced
this pull request
Oct 31, 2026
Where the host has background: (transfix/libcvc#932), the profile card has the account's card_image_url behind it and the window its profile_bg_url, dimmed as the web app dims them (opacity 0.3 and 0.25). A host without background: ignores the key. Terminals show neither for now (terminal: none): #932's half-blocks behind coloured text take the text's colour to the row's end, reported to that work. Video URLs keep none, by the same rule as the avatar. The Details window lists the page picture; the stub serves one.
X11 headers define None, so x11_macro_headers_test failed to compile widget.h. The YAML value stays terminal: none.
added 6 commits
October 31, 2026 00:02
…a reply names image.url holds in every host that loads a picture by URI, so a document for older hosts gates its pictures on (has? "image.url") and keeps its own placeholder elsewhere (an older host prints an unknown URI as text). A picture whose URL a reply puts in state was drawn as its loading placeholder by ari snapshot / arigl --terminal snapshot: no frame had asked for it while the request was out, so the settle loop never waited for it. AppRuntime::settle_and_render settles, draws, and while that frame drew a picture still loading, settles and draws again (within the same 10 s). Test: AriMedia.SnapshotWaitsForAPictureWhoseUrlComesFromAReply.
… the image.background token A text: with color: wraps its row in a colour decorator, which recoloured the backdrop's half-blocks after the text (solid bars in the text's colour). BackdropText now gives a cell that is still the backdrop's own (its character and background) the picture's foreground back. Test: MediaBackground.ColouredTextDoesNotPaintTheBackdropBesideIt. image.background holds where background: draws.
transfix
added a commit
to cy-pca/nicotina
that referenced
this pull request
Oct 31, 2026
…ances tabs); no Runway (#12) The profile laid out as the TX.WTF web app's: the banner, the card (avatar, full handle, badges, description, counts, groups, Refresh and Sign out) and Posts, Replies and Balances tabs, in 76x19 so it fits 80x24 in FTXUI and tvision. The confusing Runway row is gone. The account's avatar and header image show where the host has pictures by URL (image.url, transfix/libcvc#931), and its card and page pictures where it has background: (transfix/libcvc#932, ImGui only for now); placeholders elsewhere. Video avatars keep their placeholder, by the web app's rule. Tests: the stub's profile pictures, emblems, presence and user timeline; local txwtf posts and a reply; tabs, paging, no Runway and the 80x24 fit in tmux in both backends.
added 5 commits
October 31, 2026 00:51
…image-url # Conflicts: # src/cvc/ariadne/loader.cpp
…image-url # Conflicts: # src/cvc/ariadne/app_runtime.cpp
…ded wasm (on #914) With #914's cvc::net::start, the image cache in a browser build without threads starts a picture's http(s) request (host_get_start: the policy and auth: on host_get's terms, prepared and completed around cvc::net::start; else the http handler's resolve_async) and decodes the reply when the browser hands it over, between frames. host_get_start is host_get, blocking, where the transport does not start requests.
… clang-format encode() removed its temporary file while the ifstream reading it was still open. Windows refuses to delete an open file, so every MediaDecode/MediaCache/MediaWidget case that encodes a picture threw from std::filesystem::remove there (8 cases in recipe/windows, the same in the three package-windows builds). The stream now closes first. Also the changed lines clang-format 18 reformats: ari_media_test.cpp, the two hosts' snapshot settle calls and two include blocks the master merge touched.
The three MediaBackground cases shared temp/ariadne_media_test_backdrop, and each removed it when done. ctest runs the cases as separate processes at the same time, so one case removed (or rewrote) bg.png while another was still loading it; that picture never reached ready and the case timed out at 5 s. Seen on recipe/ubuntu Debug and Release and on macOS Debug once the stack above added cases and changed which ones run together. The directory now carries the running test's name.
…dne-media-background
#931's changes are already here from its branch, so this keeps this tree and makes the squash an ancestor, so the branch merges into master.
transfix
enabled auto-merge (squash)
November 2, 2026 05:44
transfix
added a commit
that referenced
this pull request
Nov 2, 2026
#932's changes are already here from its branch, so this keeps this tree and makes the squash an ancestor, so the branch merges into master.
transfix
added a commit
that referenced
this pull request
Nov 2, 2026
…932) (#933) Media M3: cvc://components/card.ari, a generic card (avatar, title, subtitle, timestamp, body, a media slot and an actions row) built from the built-in widgets, so it draws in every backend; `slots:` for units; optional imports ({uri, optional: true}) and `fallback: true` units, so a document can use the card where the host has it and its own unit where it does not.
transfix
added a commit
that referenced
this pull request
Nov 2, 2026
#932 took docs/ARIADNE.md §5.12 for backgrounds; the phone section is now §5.13. #932's ImGui backdrop took a group's authored px as device px, so on a phone (UI size 1.25 at pixel ratio 3) a `size: [auto, 120]` background came out a quarter of its height. It now goes through ui_px like every other px a document authors, and cvcgl_imgui_ui_size checks the area at the phone's scale and at 1 x 1.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Media M2 from the design (#929). Stacked on #931: this branch contains #931's commit (b2e1323), so its diff shows both until #931 merges. Review only def77d8. It targets master so the full CI runs.
Reference: docs/ARIADNE.md §5.12.
Core.
background:is parsed on window/overlay/group (a bare URL is short forsrc:). The picture loads through Ariadne: image: shows a picture by URL (media M1) #931's cache at its own shape. The content is bracketed by the newBackend::begin_backdrop(Backdrop)/end_backdrop(), which nest like grids. While the picture loads, or when it failed, the backdrop has no image, and the content is drawn as without one.ImGui. The content goes on channel 1 of an
ImDrawListSplitter. The picture is drawn on channel 0 once the area is known:InnerRect;size:says otherwise and at leastsize:'s height;fitsets the UVs andopacitythe tint alpha.Draw-list splitting nests, so tables inside still work.
FTXUI and tvision.
behinddraws half-blocks dimmed byopacity. A pass after the content turns each text cell readable: the picture's colour as background, at most 40%, and the terminal's own foreground unless the document coloured the text.bannerdraws a picture row above the content, in Kitty/Sixel/iTerm pixels from the second frame (once the row's width is known), else half-blocks.nonedraws nothing, and mono draws no background.behindis always half-blocks. This is documented.Tests
ariadne_media_test+3: the loader (map, URL, clamping, a warning on a non-container), core bracketing (empty image while loading, then one shared picture for both backdrops at source size), and the FTXUI layout (2 banner rows, picture cells beside the text inbehind).cvcgl_imgui_media+5: a window and group backdrop with their fit and opacity, the group's authored 120 px height, and the draw list merged back.ari_run_media_images_{ftxui,tvision}: the tmux document now has a window background, and the test checks picture cells beside its text on both backends.Verified locally (GCC 13, Release): ctest
Ariadne|Ari|ari_|Media|cvcgl_imgui|cvcgl_ari, 632/632 (1 skipped as on master). clang-format 18 is clean. Not checked visually in a real GL window (no X server here).Since opening: master merged in (#900, #914).
BackdropTerminal::Nonewas renamed toOff, because X11 definesNone. A colouredtext:no longer paints the backdrop cells beside it (MediaBackground.ColouredTextDoesNotPaintTheBackdropBesideIt). New tokenimage.background.