[Bug]: Composite `ui screenshot` success output ignores `--quiet`

Open Beginner friendly
#914 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
csharp
Domain
cli

Research direction

Start in src/winapp-CLI/WinApp.Cli/Commands/UiScreenshotCommand.cs, reviewing the composite output around lines 372–441 and 506–510 alongside the single-window logging check. Reproduce a composite capture with winapp --quiet ui screenshot, then verify informational success output is suppressed while warnings, errors, and --json output remain unaffected.

Written by the indexing model from the issue text.

Description

bug
Describe the bug

When winapp ui screenshot falls back to composite (multi-window) capture, its human-readable success output is emitted unconditionally (gated only on !json), so it is printed even under --quiet. The single-window path is correctly gated on Information-level logging, so this is an asymmetry: quiet mode silences a single-window capture but not a composite one.

This is a pre-existing issue (the composite AnsiConsole.MarkupLine calls are not new), surfaced during review of #884. That PR gated the single-window success line on logger.IsEnabled(LogLevel.Information) but intentionally scoped itself to host-path reporting and left the composite branch as-is, which makes the gap more visible.

To Reproduce
  1. Have an app with an owned dialog/second window open (so capture goes composite).
  2. Run: winapp --quiet ui screenshot -a <app-with-owned-dialog> -o shot.png
  3. Observe stdout still contains success chatter, e.g. ⚠ N windows detected. Compositing into single image., ✓ HWND …, and ✓ Saved composite: ….
Expected behavior

Under --quiet (Warning-level logging), a successful composite capture should produce no informational success output on stdout — matching the single-window behavior. Warnings/errors and --json output should be unaffected.

Screenshots

N/A — textual output.

OS Version and details

N/A — behavior is platform-independent.


Suggested fix: Gate the composite informational lines (⚠ … windows detected, ✓ HWND …, ✓ Saved composite: …) on logger.IsEnabled(LogLevel.Information), consistent with the single-window path. See src/winapp-CLI/WinApp.Cli/Commands/UiScreenshotCommand.cs (composite output around L372–441 and L506–510).

Dominant language
C#
Stars
1.3k
Forks
80
Avg merge
2d 13h
Merged PRs (30d)
65

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/winappCli

All issues in microsoft/winappCli

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.