• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

orion-ecs / keen-eye / 20898732154

11 Jan 2026 05:02PM UTC coverage: 85.226% (-0.2%) from 85.407%
20898732154

push

github

tyevco
feat(testbridge): Add IWindowController for window state queries

Implements issue #828 - adds window state inspection to TestBridge API.

Changes:
- Add IWindowController interface with methods for querying window state
- Add WindowStateSnapshot record for complete window state
- Add WindowControllerImpl in-process implementation
- Add WindowCommandHandler for IPC server
- Add RemoteWindowController for IPC client
- Add WindowTools MCP tools for external tooling
- Add unit tests for WindowController and command handler

MCP Tools Added:
- window_is_available - Check if window queries are available
- window_get_state - Get complete window state
- window_get_size - Get window dimensions
- window_get_title - Get window title
- window_is_closing - Check if window is closing
- window_is_focused - Check if window has focus
- window_get_aspect_ratio - Get aspect ratio

Closes #828

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

9596 of 13642 branches covered (70.34%)

Branch coverage included in aggregate %.

232 of 262 new or added lines in 10 files covered. (88.55%)

388 existing lines in 5 files now uncovered.

166204 of 192634 relevant lines covered (86.28%)

0.98 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

4.35
/src/KeenEyes.TestBridge.Client/RemoteWindowController.cs
1
using KeenEyes.TestBridge.Ipc.Protocol;
2
using KeenEyes.TestBridge.Window;
3

4
namespace KeenEyes.TestBridge.Client;
5

6
/// <summary>
7
/// Remote implementation of <see cref="IWindowController"/> that communicates over IPC.
8
/// </summary>
9
internal sealed class RemoteWindowController(TestBridgeClient client) : IWindowController
1✔
10
{
11
    /// <inheritdoc />
NEW
12
    public bool IsAvailable => client.SendRequestAsync<bool>("window.isAvailable", null, CancellationToken.None)
×
NEW
13
        .GetAwaiter().GetResult();
×
14

15
    /// <inheritdoc />
16
    public async Task<WindowStateSnapshot> GetStateAsync()
17
    {
NEW
18
        var result = await client.SendRequestAsync<WindowStateSnapshot>("window.getState", null, CancellationToken.None);
×
NEW
19
        return result ?? throw new InvalidOperationException("Failed to get window state");
×
NEW
20
    }
×
21

22
    /// <inheritdoc />
23
    public async Task<(int Width, int Height)> GetSizeAsync()
24
    {
NEW
25
        var result = await client.SendRequestAsync<WindowSizeResult>("window.getSize", null, CancellationToken.None);
×
NEW
26
        if (result == null)
×
27
        {
NEW
28
            return (0, 0);
×
29
        }
30

NEW
31
        return (result.Width, result.Height);
×
NEW
32
    }
×
33

34
    /// <inheritdoc />
35
    public async Task<string> GetTitleAsync()
36
    {
NEW
37
        var result = await client.SendRequestAsync<string>("window.getTitle", null, CancellationToken.None);
×
NEW
38
        return result ?? string.Empty;
×
NEW
39
    }
×
40

41
    /// <inheritdoc />
42
    public async Task<bool> IsClosingAsync()
43
    {
NEW
44
        return await client.SendRequestAsync<bool>("window.isClosing", null, CancellationToken.None);
×
NEW
45
    }
×
46

47
    /// <inheritdoc />
48
    public async Task<bool> IsFocusedAsync()
49
    {
NEW
50
        return await client.SendRequestAsync<bool>("window.isFocused", null, CancellationToken.None);
×
NEW
51
    }
×
52

53
    /// <inheritdoc />
54
    public async Task<float> GetAspectRatioAsync()
55
    {
NEW
56
        return await client.SendRequestAsync<float>("window.getAspectRatio", null, CancellationToken.None);
×
NEW
57
    }
×
58
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc