Repository navigation
ariadne: persist table column widths (tree.<id>.columns); fix the row-split 16 px first-walk pin - #727
Merged
Conversation
FtxuiBackend now draws images in real pixels where the terminal can: - Kitty: each image is sent once, out of band, after the frame that first draws it (a=T, U=1, f=24, q=2, chunked base64), and shown through Unicode placeholder cells (U+10EEEE + row/column diacritics, fg = image id). A window or menu over an image hides exactly the cells it covers, and FTXUI's full repaint redraws the placeholders. An image is re-sent only when its pixels change and deleted once no frame draws it; images wider or taller than 297 cells go as tiles. - Sixel: a bitmap is re-sent after each draw, inside synchronized-output marks, clipped to the cells nothing covers (the node draws a half-block underlay; a pass after the frame finds the cells still showing it). Fixed 6x7x6 palette (fewer where XTSMGRAPHICS says so), ordered dither. run() probes the terminal before FTXUI takes the tty (a kitty query, CSI 16 t and DA1 on /dev/tty in raw mode), merges FTXUI's DA1 capabilities for Sixel, and reads the cell size in pixels from TIOCGWINSZ every frame. Options::cell_px_w/h stays the layout unit; the real cell size only sets the raster. Options::ImageColor gains Kitty and Sixel; Auto picks Kitty, else Sixel (when the cell size is known), else half-blocks. Hosted mode (tvision) keeps half-blocks. The encoders and the probe-reply parser are pure functions in term_graphics.h, unit-tested in ariadne_term_graphics_test. take_graphics() returns the bytes run() writes after a frame, so the backend paths are tested headless too. cvcGL's TerminalScene renders at the cells' real pixels when a pixel mode is on (FtxuiBackend::image_raster) and maps drags with the frame's own pixels per cell. ari and ariadne_terminal take --graphics; ari also takes --image NAME=FILE (new example terminal_images.ari), and snapshot --cell-size. The .ari schema now allows an image widget's scalar size.
… the first walk A resizable table (a resizable grid that is not a row split) now keeps its column widths in tree.<id>.columns, the column counterpart of a row split's tree.<id>.tracks. The backend seam is the same shape: Backend::seed_grid_columns (before begin_grid, applied once) and grid_columns (after end_grid); the core seeds and writes back beside the row-split code. Widths are px for every column; 0 means "not set". - FTXUI: a persisted width fixes its column once (px_to_cols), and the table reports the columns it holds at a size (authored px as written, seeded or dragged) and 0 for a stretch column. - ImGui: the persisted widths become TableSetupColumn's init values, which ImGui applies when it creates the table, so a drag wins: a fixed column takes its width, a stretch column its weight (stretch proportions survive another table width). Widths come back from imgui_internal (Columns[i].WidthGiven) before EndTable, once the layout is locked. Row-split fix: the FTXUI backend measured a naturally laid-out pane from its box, which on the first walk had never been laid out (one cell, so 16 px). That was persisted, and the next load pinned the pane at one row. A natural pane now reports 0, so it stays natural; dragged and authored panes persist as before. Tests: ariadne_runtime_test (the core key, and only resizable tables use it), ariadne_ftxui_test (the row-split regression, drag -> persist -> seed), and the new cvcgl_imgui_table_columns (a bare ImGui context: authored widths, a seeded fixed width and 3:1 stretch weights, round trip).
…-table-columns # Conflicts: # docs/ARIADNE.md # src/ari/main.cpp # src/cvc/CMakeLists.txt # src/cvc/tests/CMakeLists.txt
transfix
added a commit
that referenced
this pull request
Oct 20, 2026
…aches libcvcGL cvcgl_imgui_table_columns (#727) segfaulted on package-windows once #725 put a real imgui into the Windows CI build. The test creates its ImGui context in the test executable and drives ImGuiBackend, which runs inside cvcGL.dll. The cvcpkg Windows imgui is a static library, so the exe and the DLL each carry a copy of imgui with its own current context, and the backend found none. (ImGuiOverlay creates its context inside libcvcGL, so overlay hosts never hit this; a shared imgui, as on Linux, has one copy.) ImGuiBackend::setImGuiContext(ctx) makes ctx current in libcvcGL's copy; the test hands its context over after CreateContext and clears it before destroying it, which it now does by pointer (with a shared imgui clearing libcvcGL's current context clears the test's too).
This was referenced Oct 20, 2026
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.
This PR includes #724's commit (Kitty/Sixel,
1a599395b) underneath its own (3e750c1fb), so CI runs against master. Review the top commit only. Once #724 merges, I'll rebase onto master and its commit will drop out.A resizable table now persists its column widths to
tree.<id>.columns, the column counterpart of a row split'stree.<id>.tracks. This also fixes the FTXUI row-split bug where the first walk pinned a natural pane at 16 px.What changes
inc/cvc/ariadne/backend.h): newseed_grid_columns(widths)(beforebegin_grid, applied once by the backend, so a live drag wins) andgrid_columns()(afterend_grid). Both are non-pure no-ops by default.ariadne.cpp, beside the row-split code): forresizable && !is_row_split(), it seeds fromtree.<id>.columnsand writes the reported widths back. The write is skipped when nothing changed. Tables that are not resizable, and row splits, never use the key.0means "not set" (the column keeps its authored track).px_to_cols).0.TableSetupColumn's init width/weight. ImGui applies those only when it creates the table, so the seed is apply-once.imgui_internal:GetCurrentTable()->Columns[i].WidthGiven, the valueTableSetupColumntakes back. They are read beforeEndTable, and only onceIsLayoutLocked.0and stays natural. Authored and dragged panes persist as before, and a report with nothing set writes nothing.Tests
ariadne_runtime_test:ResizableTableColumnsSeedAndPersist: seed, write-back, no tracks.OnlyAResizableTablePersistsColumns: tables that are not resizable and row splits ignore the key.ariadne_ftxui_test:ANaturalPaneIsNotPinnedByTheFirstWalk: the regression. The first walk persists80,0, and a reload shows all three lines of the natural pane.DraggedTableColumnsPersistAndSeedTheNextLoad: the table starts at80,80,0, a drag persists112,48,0, and a fresh load from that state lays out the same columns and reports them unchanged.cvcgl_imgui_table_columns, run on a bare ImGui context (no window, no GL):ctest -R 'ariadne|Ariadne|cvcgl_terminal_scene|cvcgl_imgui_table_columns': 409/409.