Skip to content

The Query Shapes sub-tab assigns a Grid.Row it never declares, so the captured-plans note and grid share a cell #3049

Closed

Description

@erikdarlingdata

The Activity tab's Query Shapes sub-tab grid in Darling/PerformanceMonitor.Darling.Viewer/ViewerServerTab.xaml declares 10 RowDefinitions and assigns Grid.Row="10".

row   7  DataGrid   PgKernelStatsGrid
row   8  TextBlock  (spacer)
row   9  TextBlock  PgCapturedPlansNote
row  10  DataGrid   PgCapturedPlansGrid   <-- no row 10 exists

Rows 0-9 are declared, so row 10 is out of range. WPF clamps an out-of-range Grid.Row to the last available row rather than throwing, which puts PgCapturedPlansGrid into row 9 together with PgCapturedPlansNote — the note and the grid occupying one cell.

It is the only grid in the file with a row beyond its declarations; every other layout grid in both the SQL Server and PostgreSQL trees is consistent. Two of that block's RowDefinition entries also carry a different indentation from their neighbours, which is the shape of later insertions that added panels without adding the matching rows.

Fix

Add the missing RowDefinition. The neighbouring pairs use Auto for a note and a star height for its grid, so the pattern is already established by the eight rows above it.

Verification this needs

Whatever the fix, it should come with a guard that a layout grid never assigns a Grid.Row at or beyond its own RowDefinition count — the defect is invisible at build time (the XAML compiles and BAML is produced) and only shows up as two controls sharing a cell on screen. A file-wide assertion over the XAML is cheap and would have caught this one.

Not verified

Read from the layout, not observed on screen. The clamping behaviour is WPF's documented handling of an out-of-range Grid.Row; nothing here was rendered, and Darling.Tests cannot execute on macOS. Somebody with a Windows build should confirm the visual overlap before treating the severity as settled — it is possible the note's own margins make the collision unobtrusive.

Provenance

Found while confirming #3048 by parsing the XAML to resolve which TabItem owns the PostgreSQL deadlock grid. Unrelated to that issue's cause and deliberately left out of its fix.

Activity

  1. added a commit that references this issue on Sep 6, 2026
    bbacf4c
  2. erikdarlingdata commented on Sep 6, 2026

    @erikdarlingdata
    OwnerAuthor

    Claude posting for Erik Darling

    Closed by #3056, merged to dev at a69c849932199173235855803f9013f619a2c01a. Closing by hand because a closing keyword does not fire against dev. That PR also closes #3050.

    The Query Shapes sub-tab now declares the row it assigns, so PgCapturedPlansGrid and PgCapturedPlansNote no longer share a cell.

    The guard this issue asked for is the durable half, and it was built past the reported shape. Three population floors — at least 100 files, 300 grids, 1,500 row assignments — each naming which stage stopped finding things, so a sweep that reads nothing fails loudly instead of reporting clean. Theory cases cover the exact defect here, the no-RowDefinitions implicit-row case, and Grid.RowSpan overrun, which this issue did not have and would have been easy to leave out.

    That matters because the defect is invisible at build time: the XAML compiles, BAML is produced, CI is green, and the only symptom is two controls in one cell on a screen nobody scripted. A file-wide assertion is the only thing that catches the next one.

    Not verified: nothing was rendered. The overlap was read from the layout and the fix from the row count; no Windows build put either on a screen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions