Skip to content

Flight log grows with window and can be copied or saved - #31

Merged
seankearon merged 2 commits into
mainfrom
claude/log-area-expand-export-oubezb
Aug 6, 2026
Merged

Flight log grows with window and can be copied or saved#31
seankearon merged 2 commits into
mainfrom
claude/log-area-expand-export-oubezb

Conversation

@seankearon

Copy link
Copy Markdown
Owner

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:

    • Copy the entire flight log (all lines, not just visible ones) to the clipboard as plain text
    • Save the log to a user-selected text file with a suggested dated filename (fido-flight-log-YYYYMMDD-HHMMSS.txt)
    • Both actions are disabled when the log is empty and confirm themselves with a narration line in the log
  • UI updates:

    • Renamed the generic copypath button style to iconaction to accommodate both copy-path and copy/save-log buttons
    • Added x:Name attributes to key layout elements (RootGrid, MainScroller, UpperStack, LogRegion, LogPanel) to enable dynamic sizing
    • Restructured the Flight log header grid to include the new action buttons
  • ViewModel enhancements:

    • Added HasLog property to gate the copy/save actions
    • Added LogText property that returns the entire log as plain text (one line per entry, without color codes)
    • Log collection change events now trigger property notifications for HasLog
  • Dialog service extension: Added PickFlightLogPathAsync method to IDialogService for platform-specific file save dialogs, with implementations in both AvaloniaDialogService and FakeDialogService

  • Comprehensive test coverage: New FlightLogTests class with 6 end-to-end tests covering copy/save functionality, empty log handling, window resizing behavior, and layout constraints

Implementation Details

  • The UpdateFlightLogHeight method runs on every layout pass to recalculate available space, but only applies changes when SizeToContent is Manual (user has resized the window) to avoid layout thrashing during auto-sizing
  • Sub-pixel drift is ignored to prevent unnecessary layout passes
  • File save operations are best-effort with error reporting in the log itself
  • The flight log text is extracted as plain text without color codes, making it suitable for clipboard and file operations

https://claude.ai/code/session_019pNcGRSKiKZiZZWp7zDP7V

claude added 2 commits August 6, 2026 12:28
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
@seankearon
seankearon merged commit 799ad77 into main Aug 6, 2026
2 checks passed
@seankearon
seankearon deleted the claude/log-area-expand-export-oubezb branch August 6, 2026 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants