Repository navigation
Ariadne tvision: a reopened window fits what it shows then - #930
Merged
Merged
Conversation
A window that closed and opened again in the same run came back at its first size on the tvision desktop, so rows it gained while closed were cut off (nicotina's sign-in form after signing out lost its "Signed out." row). FTXUI and ImGui fit it again. Cause: the host reports every window's bounds on each walk, and FtxuiBackend::set_window_geometry took the size as the window's own (Win.sized). That record outlives the window, so the reopen's hosted_windows() handed the host the old size, which it took as authored and never refit; the size was also persisted to tree.<id>.geometry. - set_window_geometry takes user_sized: the place is always kept, the size only when the user chose it, and only that size persists. HostedWindow::user_sized tells the host on a reopen. - The tvision host marks a window user-sized only from tvision's own user paths (dragView: the frame's corner and Ctrl-F5; zoom), not from "the size differs from the last fit", which also fired when tvision scaled the windows on a terminal resize. Until then it sizes the window on every walk from the document's size or the content, and not mid-drag (sfDragging). - Ctrl-F5 is bound to cmResize, as ARIADNE.md already listed among tvision's keys. - A window's smallest size is the host's fit floor (16 x 4), not tvision's 16 x 6, so a refit or a drag no longer leaves a small window two rows taller than its content. Tests: AriadneFtxuiHosted.AReopenedWindowFitsWhatItShowsThen and AWindowTheUserResizedKeepsItsSizeWhenItOpensAgain; ari_run_reopen_refit_ftxui / _tvision run src/ari/tests/reopen_refit.ari in a tmux pane: its windows gain rows while closed and must show them, and on tvision a window resized with Ctrl-F5 comes back at that size. Both fail on the old behaviour. ARIADNE.md §5.8 / §5.9 say how a reopened window is sized.
This was referenced Oct 31, 2026
transfix
added a commit
to cy-pca/nicotina
that referenced
this pull request
Oct 31, 2026
) * Sign-in windows fit what they show; no status row without a message transfix/libcvc#930 (merged 6d84dc7d) makes the tvision host refit a window that closes and opens again, so the workaround for it goes: the sign-in, two-step and starting windows lose their fixed 496 px width, and the status line takes a row only when the controller has a message. The profile keeps its 76 columns, which is its layout, not the workaround. tests/run.sh's tvision sign-out step ("Signed out." in the reopened sign-in form) is the check that the refit works without the workaround. * tests: a host with open-url adds In browser to each card and the post transfix/libcvc#916 (merged 19:31 UTC) gives ari open-url, so the documents show their In browser button: on each feed card after Open, and on the post window in place of its URL. run.sh's expectations were written for a host without it and failed six steps on libcvc master: the card's counts row, the post's URL, and Load more, which Tab now reaches ten stops later. run.sh asks the host (`ari check`, as for image.url and media.player) and expects either layout. --------- Co-authored-by: tfx <[email protected]>
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.
On the tvision desktop, a window that closed and opened again in the same run came back at its first size and never refit, so rows it had gained while closed were cut off. nicotina hit it: after signing out, the sign-in window came back without its "Signed out." row (cy-pca/nicotina works around it with a fixed width and an always-present status row). First openings fit, and FTXUI and ImGui fit a reopened window too.
Cause (verified)
The tvision host reports every window's bounds on each walk (
set_window_geometry), andFtxuiBackendrecorded that size as the window's own (Win.sized). The record outlives the window, so on the reopenhosted_windows()handed the host the old size. The host took it as an authored size and turned fitting off. The same size was also persisted totree.<id>.geometry, so a seed from it would have done the same.Fix
FtxuiBackend::set_window_geometry(id, x, y, w, h, user_sized): the place is always kept. The size is kept only when the user chose it, and only that size persists, so a fitting window persistsx,y,0,0.HostedWindow::user_sizedtells the host on a reopen that the size is the user's.dragView(the frame's corner, or Ctrl-F5 then Shift and the arrows) andzoom. The old test, "the size differs from the last fit", also fired when tvision scaled every window on a terminal resize (TWindow'sgfGrowRel), which turned fitting off for good.sfDragging; tvision's drag loop runs the sync between moves). An authored size the user hasn't changed is re-applied too, so percent sizes follow the terminal, as in the FTXUI loop.cmResize. ARIADNE.md already listed it among tvision's keys, but the host's status line never bound it.locate(a refit, a drag, the desktop scaling) left a window with 1–2 rows of content two rows taller than that content.The other backends were checked for consistency, not changed. ImGui gives a window with no size
AlwaysAutoResizeand ignores a persisted size for it. FTXUI's loop fits it every frame from its per-window record, which only a seed or a host marks sized. Cross-run persistence: none exists (§5.9: geometry "holds for the run and across a reload, but not across runs"). A reload of the same document keeps the backend's records, so a size the user chose holds through it. A new document still lays its windows out afresh.Tests
AriadneFtxuiHosted.AReopenedWindowFitsWhatItShowsThen: a fitting window and a width-authored, auto-height one (nicotina's shape) close, gain a row, and reopen. Both are reported fitting, with the new content size, at their old place.AriadneFtxuiHosted.AWindowTheUserResizedKeepsItsSizeWhenItOpensAgain.ari_run_reopen_refit_ftxui/ari_run_reopen_refit_tvision(tmux, Linux, next to the JSON-feed ones from ci: tmux from cvcpkg on the Linux lanes, so the ari tmux tests run #901):src/ari/tests/reopen_refit_test.shdrivessrc/ari/tests/reopen_refit.ariwith its keys.osigns out andisigns back in, and the reopened windows must show the rows they gained while closed. On tvision it then resizes "Sign in" with Ctrl-F5 / Shift-arrows, signs out and in, and the window must come back at that size.sized = trueinset_window_geometry). The tmux test passes with gawk and with mawk.ariadne_ftxui_test76/76;ctest -R ari_run_4/4.docs/ARIADNE.md§5.8 and §5.9 say how a reopened window is sized and what counts as the user's size on tvision; the tvision keys line spells out Ctrl-F5.