Flight log grows with window and can be copied or saved - #31
Merged
Conversation
The flight log was pinned to a 104–150px box, so making the Fido window taller only opened a gap above it — and the narration it holds could only be read, never taken anywhere. The log panel now takes whatever vertical slack the window has beyond what the upper section needs: the window's height minus the upper stack's desired height, the log's own label row, and the countdown bar. Every input is a desired size or the window's own height, so the panel lands in one further layout pass instead of feeding back on itself. While the window is still auto-sizing to its content there is no slack by definition, and taking any would start a fight the two can't finish (the window trails the panel by a pass), so the panel stays content-sized until the user resizes — which is when Avalonia drops SizeToContent anyway. Too short a window behaves exactly as before: the panel holds its content-sized box and the upper section scrolls. Two icon buttons on the Flight log rule lift the narration out: copy puts the whole log on the clipboard as plain text, and save writes it to a text file picked through the storage provider (suggesting a dated name). Both are disabled until there's a line to hand over, cancelling the picker is silent, and everything else — a missing clipboard, a failed write — is reported in the log itself. The copy-path button's style is now shared as `iconaction`, with a dimmed :disabled state for the empty-log case. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019pNcGRSKiKZiZZWp7zDP7V
Two CLI startup tests were coin tosses, and the extra layout work the flight-log sizing does was enough to flip them: Ubuntu CI failed on `Unknown_tool_id_warns_with_known_ids_and_never_auto_opens` and `Branch_plus_tool_auto_opens_once_for_a_single_location_and_closes`, both of which also fail on main when the timing lands that way. The cause is one race with two faces. The Opened handler starts the CLI branch's scan fire-and-forget, and the harness shows the window and pumps the dispatcher before the test body runs — so that scan can complete first. When it does, it has already consumed the run's one-shots: the test's own `RunDiscoveryAsync` then clears the log the unknown-tool warning was just written into, and the auto-open's close has already fired before the body subscribes to `Closed`. The window now keeps the startup scan as an internal `StartupScan` task and the tests await it rather than starting a competing scan, so exactly one scan runs whatever the timing. For the close, `Harness.WithWindow` takes a `beforeShow` hook, letting that test watch for the close from before the window is shown. No production behaviour changes — the scan is the same fire-and-forget launch, now with a handle on it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019pNcGRSKiKZiZZWp7zDP7V
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.
Summary
The flight log panel now dynamically grows to fill available vertical space when the window is resized, and users can copy the entire log to the clipboard or save it to a text file via new action buttons.
Key Changes
Dynamic flight log height: The log panel absorbs spare vertical space beyond what the upper section and countdown bar need, growing when the window is enlarged and falling back to its compact 104–150px box when space is constrained. The upper section scrolls if needed, but the log always remains visible.
Copy and save actions: Two new icon buttons on the Flight log rule header allow users to:
fido-flight-log-YYYYMMDD-HHMMSS.txt)UI updates:
copypathbutton style toiconactionto accommodate both copy-path and copy/save-log buttonsx:Nameattributes to key layout elements (RootGrid,MainScroller,UpperStack,LogRegion,LogPanel) to enable dynamic sizingViewModel enhancements:
HasLogproperty to gate the copy/save actionsLogTextproperty that returns the entire log as plain text (one line per entry, without color codes)HasLogDialog service extension: Added
PickFlightLogPathAsyncmethod toIDialogServicefor platform-specific file save dialogs, with implementations in bothAvaloniaDialogServiceandFakeDialogServiceComprehensive test coverage: New
FlightLogTestsclass with 6 end-to-end tests covering copy/save functionality, empty log handling, window resizing behavior, and layout constraintsImplementation Details
UpdateFlightLogHeightmethod runs on every layout pass to recalculate available space, but only applies changes whenSizeToContentisManual(user has resized the window) to avoid layout thrashing during auto-sizinghttps://claude.ai/code/session_019pNcGRSKiKZiZZWp7zDP7V